SPB Git

Repository Public

batches.md 408.0 KB 13,131 lines markdown

1---2title: Batches3url: https://platform.claude.com/docs/en/api/beta/messages/batches4---56# Batches78## Create a Message Batch910**POST** `/v1/messages/batches`1112Send a batch of Message creation requests.1314The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.1516Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)1718### Headers1920- `"anthropic-beta": optional array of AnthropicBeta`2122  Optional header to specify the beta version(s) you want to use.2324  - `string`2526  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`2728    - `"message-batches-2024-09-24"`2930    - `"prompt-caching-2024-07-31"`3132    - `"computer-use-2024-10-22"`3334    - `"computer-use-2025-01-24"`3536    - `"pdfs-2024-09-25"`3738    - `"token-counting-2024-11-01"`3940    - `"token-efficient-tools-2025-02-19"`4142    - `"output-128k-2025-02-19"`4344    - `"files-api-2025-04-14"`4546    - `"mcp-client-2025-04-04"`4748    - `"mcp-client-2025-11-20"`4950    - `"dev-full-thinking-2025-05-14"`5152    - `"interleaved-thinking-2025-05-14"`5354    - `"code-execution-2025-05-22"`5556    - `"extended-cache-ttl-2025-04-11"`5758    - `"context-1m-2025-08-07"`5960    - `"context-management-2025-06-27"`6162    - `"model-context-window-exceeded-2025-08-26"`6364    - `"skills-2025-10-02"`6566    - `"fast-mode-2026-02-01"`6768    - `"output-300k-2026-03-24"`6970    - `"user-profiles-2026-03-24"`7172    - `"user-profiles-2026-08-18"`7374    - `"user-profiles-2026-09-04"`7576    - `"advisor-tool-2026-03-01"`7778    - `"managed-agents-2026-04-01"`7980    - `"cache-diagnosis-2026-04-07"`8182    - `"dreaming-2026-04-21"`8384    - `"thinking-token-count-2026-05-13"`8586    - `"server-side-fallback-2026-06-01"`8788    - `"server-side-fallback-2026-07-01"`8990    - `"fallback-credit-2026-06-01"`9192    - `"fallback-credit-2026-07-01"`9394    - `"agent-memory-2026-07-22"`9596    - `"mid-conversation-tool-changes-2026-07-01"`9798    - `"compact-2026-01-12"`99100    - `"computer-use-2025-11-24"`101102    - `"mcp-tunnels-2026-06-22"`103104    - `"structured-outputs-2025-11-13"`105106    - `"task-budgets-2026-03-13"`107108    - `"thinking-display-updates-2026-08-18"`109110    - `"ce-user-management-2026-07-13"`111112    - `"mid-conversation-output-config-2026-07-01"`113114    - `"thinking-binding-controls-2026-08-01"`115116    - `"mid-conversation-system-clear-at-2026-08-21"`117118    - `"compact-2026-09-04"`119120- `"anthropic-user-profile-id": optional string`121122  The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.123124- `"anthropic-workspace-id": optional string`125126### Body parameters127128- `requests: array of object`129130  List of requests for prompt completion. Each is an individual request to create a Message.131132  maxItems: 100000, minItems: 1133134  - `custom_id: string`135136    Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.137138    Must be unique for each request within the Message Batch.139140    maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,64}$141142  - `params: object`143144    Messages API creation parameters for the individual request.145146    See the [Messages API reference](https://platform.claude.com/docs/en/api/messages) for full documentation on available parameters.147148    - `max_tokens: number`149150      The maximum number of tokens to generate before stopping.151152      Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.153154      Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.155156      Different models have different maximum values for this parameter.  See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.157158      minimum: 0159160    - `messages: array of BetaMessageParam`161162      Input messages.163164      Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.165166      Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.167168      If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.169170      Example with a single `user` message:171172      ```json173      [{"role": "user", "content": "Hello, Claude"}]174      ```175176      Example with multiple conversational turns:177178      ```json179      [180        {"role": "user", "content": "Hello there."},181        {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},182        {"role": "user", "content": "Can you explain LLMs in plain English?"},183      ]184      ```185186      Example with a partially-filled response from Claude:187188      ```json189      [190        {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},191        {"role": "assistant", "content": "The best answer is ("},192      ]193      ```194195      Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:196197      ```json198      {"role": "user", "content": "Hello, Claude"}199      ```200201      ```json202      {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}203      ```204205      See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).206207      Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.208209      There is a limit of 100,000 messages in a single request.210211      - `content: string or array of BetaContentBlockParam`212213        - `string`214215        - `array of BetaContentBlockParam`216217          - `BetaTextBlockParam object`218219            - `type: "text"`220221            - `text: string`222223              minLength: 1224225            - `cache_control: optional BetaCacheControlEphemeral or null`226227              Create a cache control breakpoint at this content block.228229              - `type: "ephemeral"`230231              - `ttl: optional "5m" or "1h"`232233                The time-to-live for the cache control breakpoint.234235                This may be one the following values:236237                - `5m`: 5 minutes238                - `1h`: 1 hour239240                Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.241242                - `"5m"`243244                - `"1h"`245246            - `citations: optional array of BetaTextCitationParam or null`247248              - `BetaCitationCharLocationParam object`249250                - `type: "char_location"`251252                - `cited_text: string`253254                - `document_index: number`255256                  minimum: 0257258                - `document_title: string or null`259260                  maxLength: 500, minLength: 1261262                - `end_char_index: number`263264                - `start_char_index: number`265266                  minimum: 0267268              - `BetaCitationPageLocationParam object`269270                - `type: "page_location"`271272                - `cited_text: string`273274                - `document_index: number`275276                  minimum: 0277278                - `document_title: string or null`279280                  maxLength: 500, minLength: 1281282                - `end_page_number: number`283284                - `start_page_number: number`285286                  minimum: 1287288              - `BetaCitationContentBlockLocationParam object`289290                - `type: "content_block_location"`291292                - `cited_text: string`293294                  The full text of the cited block range, concatenated.295296                  Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.297298                - `document_index: number`299300                  minimum: 0301302                - `document_title: string or null`303304                  maxLength: 500, minLength: 1305306                - `end_block_index: number`307308                  Exclusive 0-based end index of the cited block range in the source's `content` array.309310                  Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.311312                - `start_block_index: number`313314                  0-based index of the first cited block in the source's `content` array.315316                  minimum: 0317318              - `BetaCitationWebSearchResultLocationParam object`319320                - `type: "web_search_result_location"`321322                - `cited_text: string`323324                - `encrypted_index: string`325326                - `title: string or null`327328                  maxLength: 512, minLength: 1329330                - `url: string`331332                  minLength: 1333334              - `BetaCitationSearchResultLocationParam object`335336                - `type: "search_result_location"`337338                - `cited_text: string`339340                  The full text of the cited block range, concatenated.341342                  Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.343344                - `end_block_index: number`345346                  Exclusive 0-based end index of the cited block range in the source's `content` array.347348                  Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.349350                - `search_result_index: number`351352                  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.353354                  Counted separately from `document_index`; server-side web search results are not included in this count.355356                  minimum: 0357358                - `source: string`359360                - `start_block_index: number`361362                  0-based index of the first cited block in the source's `content` array.363364                  minimum: 0365366                - `title: string or null`367368          - `BetaImageBlockParam object`369370            - `type: "image"`371372            - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`373374              - `BetaBase64ImageSource object`375376                - `type: "base64"`377378                - `data: string`379380                  format: byte381382                - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`383384                  - `"image/jpeg"`385386                  - `"image/png"`387388                  - `"image/gif"`389390                  - `"image/webp"`391392              - `BetaURLImageSource object`393394                - `type: "url"`395396                - `url: string`397398              - `BetaFileImageSource object`399400                - `type: "file"`401402                - `file_id: string`403404            - `cache_control: optional BetaCacheControlEphemeral or null`405406              Create a cache control breakpoint at this content block.407408            - `transformations: optional BetaImageTransformationsParam or null`409410              Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.411412              - `oversized_image: optional "downsize" or "error"`413414                What the server does when this image exceeds the model's maximum image size. `"downsize"` (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. `"error"` instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.415416                - `"downsize"`417418                - `"error"`419420          - `BetaRequestDocumentBlock object`421422            - `type: "document"`423424            - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`425426              - `BetaBase64PDFSource object`427428                - `type: "base64"`429430                - `data: string`431432                  format: byte433434                - `media_type: "application/pdf"`435436              - `BetaPlainTextSource object`437438                - `type: "text"`439440                - `data: string`441442                - `media_type: "text/plain"`443444              - `BetaContentBlockSource object`445446                - `type: "content"`447448                - `content: string or array of BetaContentBlockSourceContent`449450                  - `string`451452                  - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`453454                    - `BetaTextBlockParam object`455456                    - `BetaImageBlockParam object`457458              - `BetaURLPDFSource object`459460                - `type: "url"`461462                - `url: string`463464              - `BetaFileDocumentSource object`465466                - `type: "file"`467468                - `file_id: string`469470            - `cache_control: optional BetaCacheControlEphemeral or null`471472              Create a cache control breakpoint at this content block.473474            - `citations: optional BetaCitationsConfigParam or null`475476              - `enabled: optional boolean`477478            - `context: optional string or null`479480              minLength: 1481482            - `title: optional string or null`483484              maxLength: 500, minLength: 1485486          - `BetaSearchResultBlockParam object`487488            - `type: "search_result"`489490            - `content: array of BetaTextBlockParam`491492              - `type: "text"`493494              - `text: string`495496                minLength: 1497498              - `cache_control: optional BetaCacheControlEphemeral or null`499500                Create a cache control breakpoint at this content block.501502              - `citations: optional array of BetaTextCitationParam or null`503504            - `source: string`505506            - `title: string`507508            - `cache_control: optional BetaCacheControlEphemeral or null`509510              Create a cache control breakpoint at this content block.511512            - `citations: optional BetaCitationsConfigParam`513514          - `BetaThinkingBlockParam object`515516            - `type: "thinking"`517518            - `signature: string`519520              The `signature` value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.521522              Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.523524            - `thinking: string`525526              The `thinking` text of this block as returned by the API.527528          - `BetaRedactedThinkingBlockParam object`529530            - `type: "redacted_thinking"`531532            - `data: string`533534              The `data` value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.535536          - `BetaToolUseBlockParam object`537538            - `type: "tool_use"`539540            - `id: string`541542              pattern: ^[a-zA-Z0-9_-]+$543544            - `input: map[unknown]`545546            - `name: string`547548              maxLength: 200, minLength: 1549550            - `cache_control: optional BetaCacheControlEphemeral or null`551552              Create a cache control breakpoint at this content block.553554            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`555556              - `BetaDirectCaller object`557558                Tool invocation directly from the model.559560                - `type: "direct"`561562              - `BetaServerToolCaller object`563564                Tool invocation generated by a server-side tool.565566                - `type: "code_execution_20250825"`567568                - `tool_id: string`569570                  pattern: ^srvtoolu_[a-zA-Z0-9_]+$571572              - `BetaServerToolCaller20260120 object`573574                - `type: "code_execution_20260120"`575576                - `tool_id: string`577578                  pattern: ^srvtoolu_[a-zA-Z0-9_]+$579580            - `toolset_name: optional string or null`581582              For a toolset member tool_use, the toolset family this member belongs to.583584              maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$585586          - `BetaToolResultBlockParam object`587588            - `type: "tool_result"`589590            - `tool_use_id: string`591592              pattern: ^[a-zA-Z0-9_-]+$593594            - `cache_control: optional BetaCacheControlEphemeral or null`595596              Create a cache control breakpoint at this content block.597598            - `content: optional string or array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 3 more`599600              - `string`601602              - `array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 3 more`603604                - `BetaTextBlockParam object`605606                - `BetaImageBlockParam object`607608                - `BetaSearchResultBlockParam object`609610                - `BetaRequestDocumentBlock object`611612                - `BetaToolReferenceBlockParam object`613614                  Tool reference block that can be included in tool_result content.615616                  - `type: "tool_reference"`617618                  - `tool_name: string`619620                    maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$621622                  - `cache_control: optional BetaCacheControlEphemeral or null`623624                    Create a cache control breakpoint at this content block.625626                - `BetaBrowserStateBlockParam object`627628                  The caller's browser state after a browser toolset member call —629                  the full inventory of open tabs, which tab is active, and any side630                  effects (tabs opened, download state changes) the call produced.631632                  At most one per `tool_result`, only on a non-error result answering a633                  browser toolset member `tool_use`. The server renders the634                  model-visible text from it; the model never sees the raw fields.635636                  - `type: "browser_state"`637638                  - `tabs: array of BetaBrowserStateTabEntry`639640                    All tabs open in the browser after this call — the full inventory, not a delta. May be empty. Whenever non-empty, exactly one entry carries `active: true`.641642                    maxItems: 100643644                    - `tab_id: string`645646                      The caller-assigned identifier for this tab, unique within the inventory.647648                      maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$649650                    - `title: string`651652                      The title of the page the tab is showing. May be empty.653654                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$655656                    - `url: string`657658                      The URL of the page the tab is showing. May be empty.659660                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$661662                    - `active: optional boolean`663664                      Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.665666                  - `cache_control: optional BetaCacheControlEphemeral or null`667668                    Create a cache control breakpoint at this content block.669670                  - `state_changes: optional array of BetaBrowserStateChange or null`671672                    Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.673674                    maxItems: 200, minItems: 1675676                    - `BetaBrowserStateChangeTabOpened object`677678                      A tab this call's execution opened that remains open at its end —679                      the creation delta of the `tabs` inventory, not an event log.680681                      Carries only the `tab_id`; the tab's `title` and `url` live on its682                      `tabs` entry, which must include the same `tab_id`. A tab opened683                      during a failed call gets no deferred `tab_opened`; it simply appears684                      in the next result's `tabs` inventory.685686                      - `type: "tab_opened"`687688                      - `tab_id: string`689690                        The `tab_id` of the opened tab, present in `tabs`.691692                        maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$693694                    - `BetaBrowserStateChangeDownloadStarted object`695696                      A file download that started during this call.697698                      - `type: "download_started"`699700                      - `download_id: string`701702                        The caller-assigned identifier for this download, stable across the state changes reporting it.703704                        maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$705706                      - `url: string`707708                        The final post-redirect URL the download was served from.709710                        maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$711712                    - `BetaBrowserStateChangeDownloadCompleted object`713714                      A file download that finished during this call, reported with the715                      same `download_id` as its `download_started` — or without a prior716                      `download_started`, when the download finished during the call that717                      started it (at most one state change per `download_id` per result).718719                      - `type: "download_completed"`720721                      - `download_id: string`722723                        The caller-assigned identifier for this download, stable across the state changes reporting it.724725                        maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$726727                      - `url: string`728729                        The final post-redirect URL the download was served from.730731                        maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$732733                      - `path: optional string or null`734735                        Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.736737                        pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096738739                      - `size_bytes: optional number or null`740741                        The completed download's size.742743                        minimum: 0744745                    - `BetaBrowserStateChangeDownloadFailed object`746747                      A file download that failed — or was cancelled — during this call.748749                      - `type: "download_failed"`750751                      - `download_id: string`752753                        The caller-assigned identifier for this download, stable across the state changes reporting it.754755                        maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$756757                      - `url: string`758759                        The final post-redirect URL the download was served from.760761                        maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$762763                      - `error: optional string or null`764765                        The failure or cancellation detail, when known.766767                        pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096768769            - `is_error: optional boolean`770771            - `toolset_name: optional string or null`772773              For a toolset member tool_result, the toolset family of the paired tool_use.774775              maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$776777          - `BetaServerToolUseBlockParam object`778779            - `type: "server_tool_use"`780781            - `id: string`782783              pattern: ^srvtoolu_[a-zA-Z0-9_]+$784785            - `input: map[unknown]`786787            - `name: "advisor" or "web_search" or "web_fetch" or 5 more`788789              - `"advisor"`790791              - `"web_search"`792793              - `"web_fetch"`794795              - `"code_execution"`796797              - `"bash_code_execution"`798799              - `"text_editor_code_execution"`800801              - `"tool_search_tool_regex"`802803              - `"tool_search_tool_bm25"`804805            - `cache_control: optional BetaCacheControlEphemeral or null`806807              Create a cache control breakpoint at this content block.808809            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`810811              - `BetaDirectCaller object`812813                Tool invocation directly from the model.814815              - `BetaServerToolCaller object`816817                Tool invocation generated by a server-side tool.818819              - `BetaServerToolCaller20260120 object`820821          - `BetaWebSearchToolResultBlockParam object`822823            - `type: "web_search_tool_result"`824825            - `content: BetaWebSearchToolResultBlockParamContent`826827              - `ResultBlock = array of BetaWebSearchResultBlockParam`828829                - `type: "web_search_result"`830831                - `encrypted_content: string`832833                - `title: string`834835                - `url: string`836837                - `page_age: optional string or null`838839              - `BetaWebSearchToolRequestError object`840841                - `type: "web_search_tool_result_error"`842843                - `error_code: BetaWebSearchToolResultErrorCode`844845                  - `"invalid_tool_input"`846847                  - `"unavailable"`848849                  - `"max_uses_exceeded"`850851                  - `"too_many_requests"`852853                  - `"query_too_long"`854855                  - `"request_too_large"`856857            - `tool_use_id: string`858859              pattern: ^srvtoolu_[a-zA-Z0-9_]+$860861            - `cache_control: optional BetaCacheControlEphemeral or null`862863              Create a cache control breakpoint at this content block.864865            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`866867              - `BetaDirectCaller object`868869                Tool invocation directly from the model.870871              - `BetaServerToolCaller object`872873                Tool invocation generated by a server-side tool.874875              - `BetaServerToolCaller20260120 object`876877          - `BetaWebFetchToolResultBlockParam object`878879            - `type: "web_fetch_tool_result"`880881            - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`882883              - `BetaWebFetchToolResultErrorBlockParam object`884885                - `type: "web_fetch_tool_result_error"`886887                - `error_code: BetaWebFetchToolResultErrorCode`888889                  - `"invalid_tool_input"`890891                  - `"url_too_long"`892893                  - `"url_not_allowed"`894895                  - `"url_not_in_prior_context"`896897                  - `"url_not_accessible"`898899                  - `"unsupported_content_type"`900901                  - `"too_many_requests"`902903                  - `"max_uses_exceeded"`904905                  - `"unavailable"`906907                  - `"content_too_large"`908909              - `BetaWebFetchBlockParam object`910911                - `type: "web_fetch_result"`912913                - `content: BetaRequestDocumentBlock`914915                - `url: string`916917                  Fetched content URL918919                - `retrieved_at: optional string or null`920921                  ISO 8601 timestamp when the content was retrieved922923            - `tool_use_id: string`924925              pattern: ^srvtoolu_[a-zA-Z0-9_]+$926927            - `cache_control: optional BetaCacheControlEphemeral or null`928929              Create a cache control breakpoint at this content block.930931            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`932933              - `BetaDirectCaller object`934935                Tool invocation directly from the model.936937              - `BetaServerToolCaller object`938939                Tool invocation generated by a server-side tool.940941              - `BetaServerToolCaller20260120 object`942943          - `BetaAdvisorToolResultBlockParam object`944945            - `type: "advisor_tool_result"`946947            - `content: BetaAdvisorToolResultErrorParam or BetaAdvisorResultBlockParam or BetaAdvisorRedactedResultBlockParam`948949              - `BetaAdvisorToolResultErrorParam object`950951                - `type: "advisor_tool_result_error"`952953                - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`954955                  - `"max_uses_exceeded"`956957                  - `"prompt_too_long"`958959                  - `"too_many_requests"`960961                  - `"overloaded"`962963                  - `"unavailable"`964965                  - `"execution_time_exceeded"`966967                  - `"model_not_found"`968969              - `BetaAdvisorResultBlockParam object`970971                - `type: "advisor_result"`972973                - `text: string`974975                - `stop_reason: optional string or null`976977              - `BetaAdvisorRedactedResultBlockParam object`978979                - `type: "advisor_redacted_result"`980981                - `encrypted_content: string`982983                  Opaque blob produced by a prior response; must be round-tripped verbatim.984985                - `stop_reason: optional string or null`986987            - `tool_use_id: string`988989              pattern: ^srvtoolu_[a-zA-Z0-9_]+$990991            - `cache_control: optional BetaCacheControlEphemeral or null`992993              Create a cache control breakpoint at this content block.994995          - `BetaCodeExecutionToolResultBlockParam object`996997            - `type: "code_execution_tool_result"`998999            - `content: BetaCodeExecutionToolResultBlockParamContent`10001001              - `BetaCodeExecutionToolResultErrorParam object`10021003                - `type: "code_execution_tool_result_error"`10041005                - `error_code: BetaCodeExecutionToolResultErrorCode`10061007                  - `"invalid_tool_input"`10081009                  - `"unavailable"`10101011                  - `"too_many_requests"`10121013                  - `"execution_time_exceeded"`10141015              - `BetaCodeExecutionResultBlockParam object`10161017                - `type: "code_execution_result"`10181019                - `content: array of BetaCodeExecutionOutputBlockParam`10201021                  - `type: "code_execution_output"`10221023                  - `file_id: string`10241025                - `return_code: number`10261027                - `stderr: string`10281029                - `stdout: string`10301031              - `BetaEncryptedCodeExecutionResultBlockParam object`10321033                Code execution result with encrypted stdout for PFC + web_search results.10341035                - `type: "encrypted_code_execution_result"`10361037                - `content: array of BetaCodeExecutionOutputBlockParam`10381039                  - `type: "code_execution_output"`10401041                  - `file_id: string`10421043                - `encrypted_stdout: string`10441045                - `return_code: number`10461047                - `stderr: string`10481049            - `tool_use_id: string`10501051              pattern: ^srvtoolu_[a-zA-Z0-9_]+$10521053            - `cache_control: optional BetaCacheControlEphemeral or null`10541055              Create a cache control breakpoint at this content block.10561057          - `BetaBashCodeExecutionToolResultBlockParam object`10581059            - `type: "bash_code_execution_tool_result"`10601061            - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`10621063              - `BetaBashCodeExecutionToolResultErrorParam object`10641065                - `type: "bash_code_execution_tool_result_error"`10661067                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`10681069                  - `"invalid_tool_input"`10701071                  - `"unavailable"`10721073                  - `"too_many_requests"`10741075                  - `"execution_time_exceeded"`10761077                  - `"output_file_too_large"`10781079              - `BetaBashCodeExecutionResultBlockParam object`10801081                - `type: "bash_code_execution_result"`10821083                - `content: array of BetaBashCodeExecutionOutputBlockParam`10841085                  - `type: "bash_code_execution_output"`10861087                  - `file_id: string`10881089                - `return_code: number`10901091                - `stderr: string`10921093                - `stdout: string`10941095            - `tool_use_id: string`10961097              pattern: ^srvtoolu_[a-zA-Z0-9_]+$10981099            - `cache_control: optional BetaCacheControlEphemeral or null`11001101              Create a cache control breakpoint at this content block.11021103          - `BetaTextEditorCodeExecutionToolResultBlockParam object`11041105            - `type: "text_editor_code_execution_tool_result"`11061107            - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`11081109              - `BetaTextEditorCodeExecutionToolResultErrorParam object`11101111                - `type: "text_editor_code_execution_tool_result_error"`11121113                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`11141115                  - `"invalid_tool_input"`11161117                  - `"unavailable"`11181119                  - `"too_many_requests"`11201121                  - `"execution_time_exceeded"`11221123                  - `"file_not_found"`11241125                - `error_message: optional string or null`11261127              - `BetaTextEditorCodeExecutionViewResultBlockParam object`11281129                - `type: "text_editor_code_execution_view_result"`11301131                - `content: string`11321133                - `file_type: "text" or "image" or "pdf"`11341135                  - `"text"`11361137                  - `"image"`11381139                  - `"pdf"`11401141                - `num_lines: optional number or null`11421143                - `start_line: optional number or null`11441145                - `total_lines: optional number or null`11461147              - `BetaTextEditorCodeExecutionCreateResultBlockParam object`11481149                - `type: "text_editor_code_execution_create_result"`11501151                - `is_file_update: boolean`11521153              - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`11541155                - `type: "text_editor_code_execution_str_replace_result"`11561157                - `lines: optional array of string or null`11581159                - `new_lines: optional number or null`11601161                - `new_start: optional number or null`11621163                - `old_lines: optional number or null`11641165                - `old_start: optional number or null`11661167            - `tool_use_id: string`11681169              pattern: ^srvtoolu_[a-zA-Z0-9_]+$11701171            - `cache_control: optional BetaCacheControlEphemeral or null`11721173              Create a cache control breakpoint at this content block.11741175          - `BetaToolSearchToolResultBlockParam object`11761177            - `type: "tool_search_tool_result"`11781179            - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`11801181              - `BetaToolSearchToolResultErrorParam object`11821183                - `type: "tool_search_tool_result_error"`11841185                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`11861187                  - `"invalid_tool_input"`11881189                  - `"unavailable"`11901191                  - `"too_many_requests"`11921193                  - `"execution_time_exceeded"`11941195                - `error_message: optional string or null`11961197              - `BetaToolSearchToolSearchResultBlockParam object`11981199                - `type: "tool_search_tool_search_result"`12001201                - `tool_references: array of BetaToolReferenceBlockParam`12021203                  - `type: "tool_reference"`12041205                  - `tool_name: string`12061207                    maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$12081209                  - `cache_control: optional BetaCacheControlEphemeral or null`12101211                    Create a cache control breakpoint at this content block.12121213            - `tool_use_id: string`12141215              pattern: ^srvtoolu_[a-zA-Z0-9_]+$12161217            - `cache_control: optional BetaCacheControlEphemeral or null`12181219              Create a cache control breakpoint at this content block.12201221          - `BetaMCPToolUseBlockParam object`12221223            - `type: "mcp_tool_use"`12241225            - `id: string`12261227              pattern: ^[a-zA-Z0-9_-]+$12281229            - `input: map[unknown]`12301231            - `name: string`12321233            - `server_name: string`12341235              The name of the MCP server12361237            - `cache_control: optional BetaCacheControlEphemeral or null`12381239              Create a cache control breakpoint at this content block.12401241          - `BetaRequestMCPToolResultBlockParam object`12421243            - `type: "mcp_tool_result"`12441245            - `tool_use_id: string`12461247              pattern: ^[a-zA-Z0-9_-]+$12481249            - `cache_control: optional BetaCacheControlEphemeral or null`12501251              Create a cache control breakpoint at this content block.12521253            - `content: optional string or array of BetaTextBlockParam`12541255              - `string`12561257              - `BetaMCPToolResultBlockParamContent = array of BetaTextBlockParam`12581259                - `type: "text"`12601261                - `text: string`12621263                  minLength: 112641265                - `cache_control: optional BetaCacheControlEphemeral or null`12661267                  Create a cache control breakpoint at this content block.12681269                - `citations: optional array of BetaTextCitationParam or null`12701271            - `is_error: optional boolean`12721273          - `BetaContainerUploadBlockParam object`12741275            A content block that represents a file to be uploaded to the container1276            Files uploaded via this block will be available in the container's input directory.12771278            - `type: "container_upload"`12791280            - `file_id: string`12811282            - `cache_control: optional BetaCacheControlEphemeral or null`12831284              Create a cache control breakpoint at this content block.12851286          - `BetaCompactionBlockParam object`12871288            A compaction block containing summary of previous context.12891290            Users should round-trip these blocks from responses to subsequent requests1291            to maintain context across compaction boundaries.12921293            When content is None, the block represents a failed compaction. The server1294            treats these as no-ops. Empty string content is not allowed.12951296            - `type: "compaction"`12971298            - `cache_control: optional BetaCacheControlEphemeral or null`12991300              Create a cache control breakpoint at this content block.13011302            - `content: optional string or null`13031304              Summary of previously compacted content, or null if compaction failed13051306            - `encrypted_content: optional string or null`13071308              Opaque metadata from prior compaction, to be round-tripped verbatim13091310            - `signature: optional string or null`13111312              The block's signature as returned, to be sent back verbatim13131314          - `BetaRequestToolAdditionBlock object`13151316            Mid-conversation directive to surface a declared tool.13171318            `tool` references a tool (or MCP toolset) by name from the request's1319            `tools`; it is offered to the model from this point in the1320            conversation onward.13211322            - `type: "tool_addition"`13231324            - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`13251326              - `BetaToolChangeToolReference object`13271328                Reference to a single tool the caller declared directly in1329                `tools[]`. Does not accept the composed `{server}_{name}` form the1330                server assigns to MCP-resolved tools — use `mcp_tool_reference` or1331                `mcp_toolset_reference` for those.13321333                - `type: "tool_reference"`13341335                - `name: string`13361337                  pattern: ^[a-zA-Z0-9_-]{1,128}$13381339              - `BetaToolChangeMCPToolReference object`13401341                Reference to a single MCP tool by its server and remote name; the1342                same `server_name`/`name` pair `mcp_tool_use` carries.13431344                - `type: "mcp_tool_reference"`13451346                - `name: string`13471348                - `server_name: string`13491350              - `BetaToolChangeMCPToolsetReference object`13511352                Reference to every tool in the named MCP server's toolset.13531354                - `type: "mcp_toolset_reference"`13551356                - `server_name: string`13571358            - `cache_control: optional BetaCacheControlEphemeral or null`13591360              Create a cache control breakpoint at this content block.13611362          - `BetaRequestToolRemovalBlock object`13631364            Mid-conversation directive to withdraw a tool.13651366            `tool` references a tool (or MCP toolset) by name from the request's1367            `tools`; it is no longer offered to the model from this point in the1368            conversation onward.13691370            - `type: "tool_removal"`13711372            - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`13731374              - `BetaToolChangeToolReference object`13751376                Reference to a single tool the caller declared directly in1377                `tools[]`. Does not accept the composed `{server}_{name}` form the1378                server assigns to MCP-resolved tools — use `mcp_tool_reference` or1379                `mcp_toolset_reference` for those.13801381              - `BetaToolChangeMCPToolReference object`13821383                Reference to a single MCP tool by its server and remote name; the1384                same `server_name`/`name` pair `mcp_tool_use` carries.13851386              - `BetaToolChangeMCPToolsetReference object`13871388                Reference to every tool in the named MCP server's toolset.13891390            - `cache_control: optional BetaCacheControlEphemeral or null`13911392              Create a cache control breakpoint at this content block.13931394          - `BetaFallbackBlockParam object`13951396            A `fallback` block echoed back from a prior response.13971398            Accepted in `messages[].content` and not rendered into the prompt; not1399            validated against the request's `fallbacks` chain or top-level `model`.14001401            Echo the assistant turn back verbatim, including this block in its1402            original position. The block marks the boundary between content produced1403            before and after a fallback hop, and the server relies on that boundary1404            to validate the turn: when thinking runs flank the boundary, omitting1405            the block merges them into one span the server cannot validate (the1406            request is rejected), and moving it into the middle of a single run is1407            likewise rejected; between non-thinking blocks the block's placement has1408            no validation effect.14091410            - `type: "fallback"`14111412            - `from: BetaFallbackInfoParam`14131414              Identifies one hop of a fallback transition.14151416              - `model: Model`14171418                The model that will complete your prompt.14191420                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.14211422                - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`14231424                  The model that will complete your prompt.14251426                  See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.14271428                  - `"claude-fable-5-1"`14291430                    Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows14311432                  - `"claude-mythos-5-1"`14331434                    Our most capable model for cybersecurity and biology research, available through trusted access programs14351436                  - `"claude-sonnet-5"`14371438                    High-performance model for coding and agents14391440                  - `"claude-fable-5"`14411442                    Next generation of intelligence for the hardest knowledge work and coding problems14431444                  - `"claude-mythos-5"`14451446                    Most capable model for cybersecurity and biology research14471448                  - `"claude-opus-5"`14491450                    Powerful intelligence for long-running agents and coding14511452                  - `"claude-opus-4-8"`14531454                    Powerful intelligence for long-running agents and coding14551456                  - `"claude-opus-4-7"`14571458                    Powerful intelligence for long-running agents and coding14591460                  - `"claude-mythos-preview"`14611462                    New class of intelligence, strongest in coding and cybersecurity14631464                  - `"claude-opus-4-6"`14651466                    Powerful intelligence for long-running agents and coding14671468                  - `"claude-sonnet-4-6"`14691470                    Best combination of speed and intelligence14711472                  - `"claude-haiku-4-5"`14731474                    Fastest model with near-frontier intelligence14751476                  - `"claude-haiku-4-5-20251001"`14771478                    Fastest model with near-frontier intelligence14791480                  - `"claude-opus-4-5"`14811482                    Powerful intelligence for long-running agents and coding14831484                  - `"claude-opus-4-5-20251101"`14851486                    Powerful intelligence for long-running agents and coding14871488                  - `"claude-sonnet-4-5"`14891490                    High-performance model for agents and coding14911492                  - `"claude-sonnet-4-5-20250929"`14931494                    High-performance model for agents and coding14951496                - `string`14971498            - `to: BetaFallbackInfoParam`14991500              Identifies one hop of a fallback transition.15011502            - `trigger: optional unknown`15031504              The response block's `trigger`, echoed verbatim. Accepted and ignored by the server; any object or `null` is allowed.15051506      - `role: "user" or "assistant" or "system"`15071508        - `"user"`15091510        - `"assistant"`15111512        - `"system"`15131514      - `clear_at: optional "next_user_message" or "never" or null`15151516        How long this system message's text stays in front of the model. `"never"` (the default) renders it on every request that includes it. `"next_user_message"` renders it only for the user turn it follows: once a later `role: "user"` message exists in `messages` the message stays in the array (send it unchanged) but is no longer shown to the model. Only permitted on `role: "system"` messages.15171518        - `"next_user_message"`15191520        - `"never"`15211522      - `output_config: optional BetaSystemMessageOutputConfig or null`15231524        Per-message output configuration on a role:"system" input message.15251526        Fields here apply per-turn; `format` remains top-level only. An1527        empty `{}` is accepted on a message that carries content; a message1528        with neither content nor output_config fields is rejected.15291530        - `effort: optional "low" or "medium" or "high" or 2 more or null`15311532          All possible effort levels.15331534          - `"low"`15351536          - `"medium"`15371538          - `"high"`15391540          - `"xhigh"`15411542          - `"max"`15431544    - `model: Model`15451546      The model that will complete your prompt.15471548      See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.15491550    - `cache_control: optional BetaCacheControlEphemeral or null`15511552      Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.15531554    - `compaction: optional BetaCompactionConfig or null`15551556      Compact the whole conversation and return a signed `compaction` block,1557      alone, that a later request sends back first in `messages`, in place of1558      the messages it summarizes. There is no trigger and no pause flag: sending1559      the parameter compacts, and nothing is sampled after the block.15601561      The summarization prompt is the server's own unless `instructions` are1562      given, which then replace it for this request; a value that is empty or1563      only whitespace counts as absent.15641565      - `type: "summarize"`15661567      - `instructions: optional string or null`15681569        Replaces the server's default summarization prompt for this request. An empty or whitespace-only value counts as absent.15701571        maxLength: 1638415721573    - `container: optional BetaContainerParams or string or null`15741575      Container identifier for reuse across requests.15761577      - `BetaContainerParams object`15781579        Container parameters with skills to be loaded.15801581        - `id: optional string or null`15821583          Container id15841585        - `skills: optional array of BetaSkillParams or null`15861587          List of skills to load in the container15881589          maxItems: 2015901591          - `type: "anthropic" or "custom"`15921593            Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)15941595            - `"anthropic"`15961597            - `"custom"`15981599          - `skill_id: string`16001601            Skill ID16021603            maxLength: 64, minLength: 116041605          - `version: optional string`16061607            Skill version or 'latest' for most recent version16081609            maxLength: 64, minLength: 116101611      - `string`16121613    - `context_management: optional BetaContextManagementConfig or null`16141615      Context management configuration.16161617      This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.16181619      - `edits: optional array of BetaClearToolUses20250919Edit or BetaClearThinking20251015Edit or BetaCompact20260112Edit`16201621        List of context management edits to apply16221623        minItems: 016241625        - `BetaClearToolUses20250919Edit object`16261627          - `type: "clear_tool_uses_20250919"`16281629          - `clear_at_least: optional BetaInputTokensClearAtLeast or null`16301631            Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.16321633            - `type: "input_tokens"`16341635            - `value: number`16361637              minimum: 016381639          - `clear_tool_inputs: optional boolean or array of string or null`16401641            Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)16421643            - `boolean`16441645            - `array of string`16461647          - `exclude_tools: optional array of string or null`16481649            Tool names whose uses are preserved from clearing16501651          - `keep: optional BetaToolUsesKeep`16521653            Number of tool uses to retain in the conversation16541655            - `type: "tool_uses"`16561657            - `value: number`16581659              minimum: 016601661          - `trigger: optional BetaInputTokensTrigger or BetaToolUsesTrigger`16621663            Condition that triggers the context management strategy16641665            - `BetaInputTokensTrigger object`16661667              - `type: "input_tokens"`16681669              - `value: number`16701671                minimum: 116721673            - `BetaToolUsesTrigger object`16741675              - `type: "tool_uses"`16761677              - `value: number`16781679                minimum: 116801681        - `BetaClearThinking20251015Edit object`16821683          - `type: "clear_thinking_20251015"`16841685          - `keep: optional BetaThinkingTurns or BetaAllThinkingTurns or "all"`16861687            Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.16881689            - `BetaThinkingTurns object`16901691              - `type: "thinking_turns"`16921693              - `value: number`16941695                minimum: 116961697            - `BetaAllThinkingTurns object`16981699              - `type: "all"`17001701            - `"all"`17021703        - `BetaCompact20260112Edit object`17041705          Automatically compact older context when reaching the configured trigger threshold.17061707          - `type: "compact_20260112"`17081709          - `instructions: optional string or null`17101711            Additional instructions for summarization.17121713          - `pause_after_compaction: optional boolean`17141715            Whether to pause after compaction and return the compaction block to the user.17161717          - `trigger: optional BetaInputTokensTrigger or null`17181719            When to trigger compaction. Defaults to 150000 input tokens.17201721    - `diagnostics: optional BetaDiagnosticsParam or null`17221723      Request-level diagnostics. Currently carries the previous response1724      id for prompt-cache divergence reporting.17251726      - `previous_message_id: optional string or null`17271728        The `id` (`msg_...`) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns `diagnostics.cache_miss_reason` when the prompt-cache prefix could not be reused. Pass `null` on the first turn to opt in without a prior message to compare.17291730        maxLength: 25617311732    - `fallback_credit_token: optional string or BetaFallbackCreditTokenParam or null`17331734      The `fallback_credit_token` from a prior refusal's `stop_details`.17351736      When a preceding request was refused and returned a `fallback_credit_token`,1737      pass that code here on the retry to have the retry's cache-creation tokens1738      for the prefix that was warm on the refused model billed at the cache-read1739      rate. Must be redeemed by the same organization and workspace, with the same1740      request body (optionally extended by one appended `assistant` message whose1741      content is the partial text — with any trailing whitespace stripped from1742      the final text block — and paired server-tool blocks streamed before the1743      refusal; the appended-assistant form is not available for requests with1744      `output_format` set or forced `tool_choice`), on an eligible fallback1745      model, on the same platform,1746      and within 5 minutes of the refusal; a mismatch is a 400. A token minted1747      mid-server-tool-loop whose partial content was continuable may only be1748      redeemed with the appended-assistant form — if an exact-body retry is1749      rejected with a 400 saying the token must be redeemed by continuing the1750      partial response, retry with the appended-assistant form instead.17511752      When the appended-assistant form is used on a model that otherwise disallows1753      assistant-turn prefill, this token also authorizes that one prefill.17541755      - `string`17561757      - `BetaFallbackCreditTokenParam object`17581759        Object form of `fallback_credit_token`: the token plus a redemption1760        mode.17611762        Requires `anthropic-beta: fallback-credit-2026-07-01`; without that1763        header the field accepts the bare string only. The bare string and the1764        mode-less object are equivalent (both select `strict`), so wrapping1765        an existing token changes nothing by itself.17661767        - `token: string`17681769          The opaque `fallback_credit_token` from a prior refusal's `stop_details` — the same string the bare-string form carries.17701771          maxLength: 2048, minLength: 117721773        - `mode: optional "strict" or "best_effort"`17741775          How a failing token affects the retry. `strict` (the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served. `best_effort`: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response's `usage.fallback_credit`. Two failures stay hard in both modes: a malformed token, and combining `fallback_credit_token` with `fallbacks`.17761777          - `"strict"`17781779          - `"best_effort"`17801781    - `fallbacks: optional BetaFallbacksParam or null`17821783      Opt-in server-side retry on one or more substitute models when the requested model declines for policy reasons. Tried in order: if the first entry also declines, the second is tried, and so on. The string "default" requests the requested model's server-defined default fallback configuration.17841785      - `array of BetaFallbackParam`17861787        - `model: Model`17881789          The model that will complete your prompt.17901791          See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.17921793        - `max_tokens: optional number or null`17941795        - `output_config: optional BetaOutputConfig or null`17961797          - `effort: optional "low" or "medium" or "high" or 2 more or null`17981799            All possible effort levels.18001801            - `"low"`18021803            - `"medium"`18041805            - `"high"`18061807            - `"xhigh"`18081809            - `"max"`18101811          - `format: optional BetaJSONOutputFormat or null`18121813            A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)18141815            - `type: "json_schema"`18161817            - `schema: map[unknown]`18181819              The JSON schema of the format18201821          - `task_budget: optional BetaTokenTaskBudget or null`18221823            User-configurable total token budget across contexts.18241825            - `type: "tokens"`18261827              The budget type. Currently only 'tokens' is supported.18281829            - `total: number`18301831              Total token budget across all contexts in the session.18321833              minimum: 102418341835            - `remaining: optional number or null`18361837              Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.18381839              minimum: 018401841        - `speed: optional "standard" or "fast" or null`18421843          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.18441845          - `"standard"`18461847          - `"fast"`18481849        - `thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive or null`18501851          - `BetaThinkingConfigEnabled object`18521853            - `type: "enabled"`18541855            - `budget_tokens: number`18561857              Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.18581859              Must be ≥1024 and less than `max_tokens`.18601861              See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.18621863              minimum: 102418641865            - `block_binding: optional BetaThinkingBlockBinding or null`18661867              Controls for block binding: what happens when a thinking block this1868              request sends back fails the conversation check. Every field is optional;1869              an empty object means every default.18701871              - `prefix_mismatch_behavior: optional BetaThinkingPrefixMismatchBehavior or null`18721873                What happens when a thinking block in `messages` fails the conversation1874                check: it was created in a different conversation, or the messages before1875                it have changed since. `"error"` (the default) fails the request with a1876                400 error. `"drop_block"` removes the failing blocks and the request1877                proceeds; the model no longer sees the dropped reasoning.18781879                - `"error"`18801881                - `"drop_block"`18821883            - `display: optional "summarized" or "omitted" or "updates" or null`18841885              Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.18861887              - `"summarized"`18881889              - `"omitted"`18901891              - `"updates"`18921893          - `BetaThinkingConfigDisabled object`18941895            - `type: "disabled"`18961897          - `BetaThinkingConfigAdaptive object`18981899            - `type: "adaptive"`19001901            - `block_binding: optional BetaThinkingBlockBinding or null`19021903              Controls for block binding: what happens when a thinking block this1904              request sends back fails the conversation check. Every field is optional;1905              an empty object means every default.19061907            - `display: optional "summarized" or "omitted" or "updates" or null`19081909              Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.19101911              - `"summarized"`19121913              - `"omitted"`19141915              - `"updates"`19161917      - `Default = "default"`19181919    - `inference_geo: optional string or null`19201921      Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.19221923    - `mcp_servers: optional array of BetaRequestMCPServerURLDefinition`19241925      MCP servers to be utilized in this request19261927      maxItems: 2019281929      - `type: "url"`19301931      - `name: string`19321933      - `url: string`19341935      - `authorization_token: optional string or null`19361937      - `tool_configuration: optional BetaRequestMCPServerToolConfiguration or null`19381939        - `allowed_tools: optional array of string or null`19401941        - `enabled: optional boolean or null`19421943    - `metadata: optional BetaMetadata`19441945      An object describing metadata about the request.19461947      - `user_id: optional string or null`19481949        An external identifier for the user who is associated with the request.19501951        This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.19521953        maxLength: 51219541955    - `output_config: optional BetaOutputConfig`19561957      Configuration options for the model's output, such as the output format.19581959    - `service_tier: optional "auto" or "standard_only"`19601961      Determines whether to use priority capacity (if available) or standard capacity for this request.19621963      Anthropic offers different levels of service for your API requests. See [service-tiers](https://platform.claude.com/docs/en/api/service-tiers) for details.19641965      - `"auto"`19661967      - `"standard_only"`19681969    - `speed: optional "standard" or "fast" or null`19701971      Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.19721973      - `"standard"`19741975      - `"fast"`19761977    - `stop_sequences: optional array of string`19781979      Custom text sequences that will cause the model to stop generating.19801981      Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.19821983      If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.19841985    - `stream: optional boolean`19861987      Whether to incrementally stream the response using server-sent events.19881989      See [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming) for details.19901991    - `system: optional string or array of BetaTextBlockParam`19921993      System prompt.19941995      A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role).19961997      - `string`19981999      - `array of BetaTextBlockParam`20002001        - `type: "text"`20022003        - `text: string`20042005          minLength: 120062007        - `cache_control: optional BetaCacheControlEphemeral or null`20082009          Create a cache control breakpoint at this content block.20102011        - `citations: optional array of BetaTextCitationParam or null`20122013    - `thinking: optional BetaThinkingConfigParam`20142015      Configuration for enabling Claude's extended thinking.20162017      When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.20182019      See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.20202021      - `BetaThinkingConfigEnabled object`20222023      - `BetaThinkingConfigDisabled object`20242025      - `BetaThinkingConfigAdaptive object`20262027    - `tool_choice: optional BetaToolChoice`20282029      How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.20302031      - `BetaToolChoiceAuto object`20322033        The model will automatically decide whether to use tools.20342035        - `type: "auto"`20362037        - `disable_parallel_tool_use: optional boolean`20382039          Whether to disable parallel tool use.20402041          Defaults to `false`. If set to `true`, the model will output at most one tool use.20422043      - `BetaToolChoiceAny object`20442045        The model will use any available tools.20462047        - `type: "any"`20482049        - `disable_parallel_tool_use: optional boolean`20502051          Whether to disable parallel tool use.20522053          Defaults to `false`. If set to `true`, the model will output exactly one tool use.20542055      - `BetaToolChoiceTool object`20562057        The model will use the specified tool with `tool_choice.name`.20582059        - `type: "tool"`20602061        - `name: string`20622063          The name of the tool to use.20642065        - `disable_parallel_tool_use: optional boolean`20662067          Whether to disable parallel tool use.20682069          Defaults to `false`. If set to `true`, the model will output exactly one tool use.20702071      - `BetaToolChoiceNone object`20722073        The model will not be allowed to use tools.20742075        - `type: "none"`20762077    - `tools: optional array of BetaToolUnion`20782079      Definitions of tools that the model may use.20802081      If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.20822083      There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)).20842085      Each tool definition includes:20862087      * `name`: Name of the tool.2088      * `description`: Optional, but strongly-recommended description of the tool.2089      * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.20902091      For example, if you defined `tools` as:20922093      ```json2094      [2095        {2096          "name": "get_stock_price",2097          "description": "Get the current stock price for a given ticker symbol.",2098          "input_schema": {2099            "type": "object",2100            "properties": {2101              "ticker": {2102                "type": "string",2103                "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."2104              }2105            },2106            "required": ["ticker"]2107          }2108        }2109      ]2110      ```21112112      And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:21132114      ```json2115      [2116        {2117          "type": "tool_use",2118          "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",2119          "name": "get_stock_price",2120          "input": { "ticker": "^GSPC" }2121        }2122      ]2123      ```21242125      You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:21262127      ```json2128      [2129        {2130          "type": "tool_result",2131          "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",2132          "content": "259.75 USD"2133        }2134      ]2135      ```21362137      Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.21382139      See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.21402141      - `BetaTool object`21422143        - `type: optional "custom" or null`21442145        - `input_schema: object`21462147          [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.21482149          This defines the shape of the `input` that your tool accepts and that the model will produce.21502151          - `type: "object"`21522153          - `properties: optional map[unknown] or null`21542155          - `required: optional array of string or null`21562157        - `name: string`21582159          Name of the tool.21602161          This is how the tool will be called by the model and in `tool_use` blocks.21622163          maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$21642165        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`21662167          - `"direct"`21682169          - `"code_execution_20250825"`21702171          - `"code_execution_20260120"`21722173          - `"code_execution_20260521"`21742175        - `cache_control: optional BetaCacheControlEphemeral or null`21762177          Create a cache control breakpoint at this content block.21782179        - `defer_loading: optional boolean`21802181          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.21822183        - `description: optional string`21842185          Description of what this tool does.21862187          Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.21882189        - `eager_input_streaming: optional boolean or null`21902191          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.21922193        - `input_examples: optional array of map[unknown]`21942195        - `strict: optional boolean`21962197          When true, guarantees schema validation on tool names and inputs21982199      - `BetaToolBash20241022 object`22002201        - `type: "bash_20241022"`22022203        - `name: "bash"`22042205          Name of the tool.22062207          This is how the tool will be called by the model and in `tool_use` blocks.22082209        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`22102211          - `"direct"`22122213          - `"code_execution_20250825"`22142215          - `"code_execution_20260120"`22162217          - `"code_execution_20260521"`22182219        - `cache_control: optional BetaCacheControlEphemeral or null`22202221          Create a cache control breakpoint at this content block.22222223        - `defer_loading: optional boolean`22242225          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.22262227        - `input_examples: optional array of map[unknown]`22282229        - `strict: optional boolean`22302231          When true, guarantees schema validation on tool names and inputs22322233      - `BetaToolBash20250124 object`22342235        - `type: "bash_20250124"`22362237        - `name: "bash"`22382239          Name of the tool.22402241          This is how the tool will be called by the model and in `tool_use` blocks.22422243        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`22442245          - `"direct"`22462247          - `"code_execution_20250825"`22482249          - `"code_execution_20260120"`22502251          - `"code_execution_20260521"`22522253        - `cache_control: optional BetaCacheControlEphemeral or null`22542255          Create a cache control breakpoint at this content block.22562257        - `defer_loading: optional boolean`22582259          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.22602261        - `input_examples: optional array of map[unknown]`22622263        - `strict: optional boolean`22642265          When true, guarantees schema validation on tool names and inputs22662267      - `BetaCodeExecutionTool20250522 object`22682269        - `type: "code_execution_20250522"`22702271        - `name: "code_execution"`22722273          Name of the tool.22742275          This is how the tool will be called by the model and in `tool_use` blocks.22762277        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`22782279          - `"direct"`22802281          - `"code_execution_20250825"`22822283          - `"code_execution_20260120"`22842285          - `"code_execution_20260521"`22862287        - `cache_control: optional BetaCacheControlEphemeral or null`22882289          Create a cache control breakpoint at this content block.22902291        - `defer_loading: optional boolean`22922293          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.22942295        - `strict: optional boolean`22962297          When true, guarantees schema validation on tool names and inputs22982299      - `BetaCodeExecutionTool20250825 object`23002301        - `type: "code_execution_20250825"`23022303        - `name: "code_execution"`23042305          Name of the tool.23062307          This is how the tool will be called by the model and in `tool_use` blocks.23082309        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23102311          - `"direct"`23122313          - `"code_execution_20250825"`23142315          - `"code_execution_20260120"`23162317          - `"code_execution_20260521"`23182319        - `cache_control: optional BetaCacheControlEphemeral or null`23202321          Create a cache control breakpoint at this content block.23222323        - `defer_loading: optional boolean`23242325          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.23262327        - `strict: optional boolean`23282329          When true, guarantees schema validation on tool names and inputs23302331      - `BetaCodeExecutionTool20260120 object`23322333        Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).23342335        - `type: "code_execution_20260120"`23362337        - `name: "code_execution"`23382339          Name of the tool.23402341          This is how the tool will be called by the model and in `tool_use` blocks.23422343        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23442345          - `"direct"`23462347          - `"code_execution_20250825"`23482349          - `"code_execution_20260120"`23502351          - `"code_execution_20260521"`23522353        - `cache_control: optional BetaCacheControlEphemeral or null`23542355          Create a cache control breakpoint at this content block.23562357        - `defer_loading: optional boolean`23582359          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.23602361        - `strict: optional boolean`23622363          When true, guarantees schema validation on tool names and inputs23642365      - `BetaCodeExecutionTool20260521 object`23662367        Code execution tool with REPL state persistence.23682369        - `type: "code_execution_20260521"`23702371        - `name: "code_execution"`23722373          Name of the tool.23742375          This is how the tool will be called by the model and in `tool_use` blocks.23762377        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23782379          - `"direct"`23802381          - `"code_execution_20250825"`23822383          - `"code_execution_20260120"`23842385          - `"code_execution_20260521"`23862387        - `cache_control: optional BetaCacheControlEphemeral or null`23882389          Create a cache control breakpoint at this content block.23902391        - `defer_loading: optional boolean`23922393          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.23942395        - `strict: optional boolean`23962397          When true, guarantees schema validation on tool names and inputs23982399      - `BetaBrowserToolset20260801 object`24002401        The browser toolset: a single `tools[]` entry (carrying no2402        `name`) that declares the browser tool family. The model is served2403        the family's tool with any members disabled via `configs` removed2404        from its schema.24052406        - `type: "browser_toolset_20260801"`24072408        - `cache_control: optional BetaCacheControlEphemeral or null`24092410          Create a cache control breakpoint at this content block.24112412        - `configs: optional BetaBrowserToolsetConfigs or null`24132414          Per-member configuration for `browser_toolset_20260801`: one2415          optional field per member tool, keyed by the member name — the same2416          name the member's `tool_use` blocks carry. Every member is an2417          accepted key, and a member's defaults apply wherever its key is2418          absent. Unknown keys are rejected: the field set is this toolset2419          version's complete member set.24202421          - `type: optional BetaBrowserTypeConfig or null`24222423            `type`'s config overrides.24242425            - `defer_loading: optional boolean or null`24262427              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.24282429            - `enabled: optional boolean or null`24302431              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.24322433          - `close_tab: optional BetaBrowserCloseTabConfig or null`24342435            `close_tab`'s config overrides.24362437            - `defer_loading: optional boolean or null`24382439              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.24402441            - `enabled: optional boolean or null`24422443              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.24442445          - `double_click: optional BetaBrowserDoubleClickConfig or null`24462447            `double_click`'s config overrides.24482449            - `defer_loading: optional boolean or null`24502451              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.24522453            - `enabled: optional boolean or null`24542455              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.24562457          - `file_upload: optional BetaBrowserFileUploadConfig or null`24582459            `file_upload`'s config overrides.24602461            - `defer_loading: optional boolean or null`24622463              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.24642465            - `enabled: optional boolean or null`24662467              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.24682469          - `find: optional BetaBrowserFindConfig or null`24702471            `find`'s config overrides.24722473            - `defer_loading: optional boolean or null`24742475              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.24762477            - `enabled: optional boolean or null`24782479              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.24802481          - `form_input: optional BetaBrowserFormInputConfig or null`24822483            `form_input`'s config overrides.24842485            - `defer_loading: optional boolean or null`24862487              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.24882489            - `enabled: optional boolean or null`24902491              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.24922493          - `get_page_text: optional BetaBrowserGetPageTextConfig or null`24942495            `get_page_text`'s config overrides.24962497            - `defer_loading: optional boolean or null`24982499              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25002501            - `enabled: optional boolean or null`25022503              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.25042505          - `hold_key: optional BetaBrowserHoldKeyConfig or null`25062507            `hold_key`'s config overrides.25082509            - `defer_loading: optional boolean or null`25102511              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25122513            - `enabled: optional boolean or null`25142515              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.25162517          - `hover: optional BetaBrowserHoverConfig or null`25182519            `hover`'s config overrides.25202521            - `defer_loading: optional boolean or null`25222523              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25242525            - `enabled: optional boolean or null`25262527              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.25282529          - `javascript_exec: optional BetaBrowserJavascriptExecConfig or null`25302531            `javascript_exec`'s config overrides.25322533            - `defer_loading: optional boolean or null`25342535              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25362537            - `enabled: optional boolean or null`25382539              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.25402541          - `key: optional BetaBrowserKeyConfig or null`25422543            `key`'s config overrides.25442545            - `defer_loading: optional boolean or null`25462547              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25482549            - `enabled: optional boolean or null`25502551              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.25522553          - `left_click: optional BetaBrowserLeftClickConfig or null`25542555            `left_click`'s config overrides.25562557            - `defer_loading: optional boolean or null`25582559              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25602561            - `enabled: optional boolean or null`25622563              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.25642565          - `left_click_drag: optional BetaBrowserLeftClickDragConfig or null`25662567            `left_click_drag`'s config overrides.25682569            - `defer_loading: optional boolean or null`25702571              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25722573            - `enabled: optional boolean or null`25742575              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.25762577          - `left_mouse_down: optional BetaBrowserLeftMouseDownConfig or null`25782579            `left_mouse_down`'s config overrides.25802581            - `defer_loading: optional boolean or null`25822583              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25842585            - `enabled: optional boolean or null`25862587              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.25882589          - `left_mouse_up: optional BetaBrowserLeftMouseUpConfig or null`25902591            `left_mouse_up`'s config overrides.25922593            - `defer_loading: optional boolean or null`25942595              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.25962597            - `enabled: optional boolean or null`25982599              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.26002601          - `list_tabs: optional BetaBrowserListTabsConfig or null`26022603            `list_tabs`'s config overrides.26042605            - `defer_loading: optional boolean or null`26062607              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.26082609            - `enabled: optional boolean or null`26102611              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.26122613          - `middle_click: optional BetaBrowserMiddleClickConfig or null`26142615            `middle_click`'s config overrides.26162617            - `defer_loading: optional boolean or null`26182619              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.26202621            - `enabled: optional boolean or null`26222623              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.26242625          - `mouse_move: optional BetaBrowserMouseMoveConfig or null`26262627            `mouse_move`'s config overrides.26282629            - `defer_loading: optional boolean or null`26302631              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.26322633            - `enabled: optional boolean or null`26342635              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.26362637          - `navigate: optional BetaBrowserNavigateConfig or null`26382639            `navigate`'s config overrides.26402641            - `defer_loading: optional boolean or null`26422643              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.26442645            - `enabled: optional boolean or null`26462647              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.26482649          - `new_tab: optional BetaBrowserNewTabConfig or null`26502651            `new_tab`'s config overrides.26522653            - `defer_loading: optional boolean or null`26542655              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.26562657            - `enabled: optional boolean or null`26582659              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.26602661          - `read_console: optional BetaBrowserReadConsoleConfig or null`26622663            `read_console`'s config overrides.26642665            - `defer_loading: optional boolean or null`26662667              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.26682669            - `enabled: optional boolean or null`26702671              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.26722673          - `read_network: optional BetaBrowserReadNetworkConfig or null`26742675            `read_network`'s config overrides.26762677            - `defer_loading: optional boolean or null`26782679              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.26802681            - `enabled: optional boolean or null`26822683              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.26842685          - `read_page: optional BetaBrowserReadPageConfig or null`26862687            `read_page`'s config overrides.26882689            - `defer_loading: optional boolean or null`26902691              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.26922693            - `enabled: optional boolean or null`26942695              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.26962697          - `right_click: optional BetaBrowserRightClickConfig or null`26982699            `right_click`'s config overrides.27002701            - `defer_loading: optional boolean or null`27022703              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.27042705            - `enabled: optional boolean or null`27062707              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.27082709          - `screenshot: optional BetaBrowserScreenshotConfig or null`27102711            `screenshot`'s config overrides.27122713            - `defer_loading: optional boolean or null`27142715              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.27162717            - `enabled: optional boolean or null`27182719              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.27202721          - `scroll: optional BetaBrowserScrollConfig or null`27222723            `scroll`'s config overrides.27242725            - `defer_loading: optional boolean or null`27262727              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.27282729            - `enabled: optional boolean or null`27302731              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.27322733          - `scroll_to: optional BetaBrowserScrollToConfig or null`27342735            `scroll_to`'s config overrides.27362737            - `defer_loading: optional boolean or null`27382739              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.27402741            - `enabled: optional boolean or null`27422743              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.27442745          - `switch_tab: optional BetaBrowserSwitchTabConfig or null`27462747            `switch_tab`'s config overrides.27482749            - `defer_loading: optional boolean or null`27502751              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.27522753            - `enabled: optional boolean or null`27542755              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.27562757          - `triple_click: optional BetaBrowserTripleClickConfig or null`27582759            `triple_click`'s config overrides.27602761            - `defer_loading: optional boolean or null`27622763              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.27642765            - `enabled: optional boolean or null`27662767              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.27682769          - `wait: optional BetaBrowserWaitConfig or null`27702771            `wait`'s config overrides.27722773            - `defer_loading: optional boolean or null`27742775              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.27762777            - `enabled: optional boolean or null`27782779              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.27802781          - `zoom: optional BetaBrowserZoomConfig or null`27822783            `zoom`'s config overrides.27842785            - `defer_loading: optional boolean or null`27862787              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.27882789            - `enabled: optional boolean or null`27902791              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.27922793      - `BetaToolComputerUse20241022 object`27942795        - `type: "computer_20241022"`27962797        - `display_height_px: number`27982799          The height of the display in pixels.28002801          minimum: 128022803        - `display_width_px: number`28042805          The width of the display in pixels.28062807          minimum: 128082809        - `name: "computer"`28102811          Name of the tool.28122813          This is how the tool will be called by the model and in `tool_use` blocks.28142815        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`28162817          - `"direct"`28182819          - `"code_execution_20250825"`28202821          - `"code_execution_20260120"`28222823          - `"code_execution_20260521"`28242825        - `cache_control: optional BetaCacheControlEphemeral or null`28262827          Create a cache control breakpoint at this content block.28282829        - `defer_loading: optional boolean`28302831          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.28322833        - `display_number: optional number or null`28342835          The X11 display number (e.g. 0, 1) for the display.28362837          minimum: 028382839        - `input_examples: optional array of map[unknown]`28402841        - `strict: optional boolean`28422843          When true, guarantees schema validation on tool names and inputs28442845      - `BetaMemoryTool20250818 object`28462847        - `type: "memory_20250818"`28482849        - `name: "memory"`28502851          Name of the tool.28522853          This is how the tool will be called by the model and in `tool_use` blocks.28542855        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`28562857          - `"direct"`28582859          - `"code_execution_20250825"`28602861          - `"code_execution_20260120"`28622863          - `"code_execution_20260521"`28642865        - `cache_control: optional BetaCacheControlEphemeral or null`28662867          Create a cache control breakpoint at this content block.28682869        - `defer_loading: optional boolean`28702871          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.28722873        - `input_examples: optional array of map[unknown]`28742875        - `strict: optional boolean`28762877          When true, guarantees schema validation on tool names and inputs28782879      - `BetaToolComputerUse20250124 object`28802881        - `type: "computer_20250124"`28822883        - `display_height_px: number`28842885          The height of the display in pixels.28862887          minimum: 128882889        - `display_width_px: number`28902891          The width of the display in pixels.28922893          minimum: 128942895        - `name: "computer"`28962897          Name of the tool.28982899          This is how the tool will be called by the model and in `tool_use` blocks.29002901        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`29022903          - `"direct"`29042905          - `"code_execution_20250825"`29062907          - `"code_execution_20260120"`29082909          - `"code_execution_20260521"`29102911        - `cache_control: optional BetaCacheControlEphemeral or null`29122913          Create a cache control breakpoint at this content block.29142915        - `defer_loading: optional boolean`29162917          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.29182919        - `display_number: optional number or null`29202921          The X11 display number (e.g. 0, 1) for the display.29222923          minimum: 029242925        - `input_examples: optional array of map[unknown]`29262927        - `strict: optional boolean`29282929          When true, guarantees schema validation on tool names and inputs29302931      - `BetaToolTextEditor20241022 object`29322933        - `type: "text_editor_20241022"`29342935        - `name: "str_replace_editor"`29362937          Name of the tool.29382939          This is how the tool will be called by the model and in `tool_use` blocks.29402941        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`29422943          - `"direct"`29442945          - `"code_execution_20250825"`29462947          - `"code_execution_20260120"`29482949          - `"code_execution_20260521"`29502951        - `cache_control: optional BetaCacheControlEphemeral or null`29522953          Create a cache control breakpoint at this content block.29542955        - `defer_loading: optional boolean`29562957          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.29582959        - `input_examples: optional array of map[unknown]`29602961        - `strict: optional boolean`29622963          When true, guarantees schema validation on tool names and inputs29642965      - `BetaToolComputerUse20251124 object`29662967        - `type: "computer_20251124"`29682969        - `display_height_px: number`29702971          The height of the display in pixels.29722973          minimum: 129742975        - `display_width_px: number`29762977          The width of the display in pixels.29782979          minimum: 129802981        - `name: "computer"`29822983          Name of the tool.29842985          This is how the tool will be called by the model and in `tool_use` blocks.29862987        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`29882989          - `"direct"`29902991          - `"code_execution_20250825"`29922993          - `"code_execution_20260120"`29942995          - `"code_execution_20260521"`29962997        - `cache_control: optional BetaCacheControlEphemeral or null`29982999          Create a cache control breakpoint at this content block.30003001        - `defer_loading: optional boolean`30023003          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.30043005        - `display_number: optional number or null`30063007          The X11 display number (e.g. 0, 1) for the display.30083009          minimum: 030103011        - `enable_zoom: optional boolean`30123013          Whether to enable an action to take a zoomed-in screenshot of the screen.30143015        - `input_examples: optional array of map[unknown]`30163017        - `strict: optional boolean`30183019          When true, guarantees schema validation on tool names and inputs30203021      - `BetaComputerToolset20260801 object`30223023        The computer toolset: a single `tools[]` entry (carrying no3024        `name`) that declares the computer tool family. The model is3025        served the family's tool with any members disabled via `configs`3026        removed from its schema. Every member is enabled by default, zoom3027        included. The single-tool options `display_number` and3028        `enable_zoom` are not fields of a toolset entry — it carries only3029        `type`, `configs`, and `cache_control`; zoom is controlled3030        via `configs.zoom.enabled`.30313032        - `type: "computer_toolset_20260801"`30333034        - `cache_control: optional BetaCacheControlEphemeral or null`30353036          Create a cache control breakpoint at this content block.30373038        - `configs: optional BetaComputerToolsetConfigs or null`30393040          Per-member configuration for `computer_toolset_20260801`: one3041          optional field per member tool, keyed by the member name — the same3042          name the member's `tool_use` blocks carry. Every member is an3043          accepted key, and a member's defaults apply wherever its key is3044          absent. Unknown keys are rejected: the field set is this toolset3045          version's complete member set.30463047          - `type: optional BetaComputerTypeConfig or null`30483049            `type`'s config overrides.30503051            - `defer_loading: optional boolean or null`30523053              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.30543055            - `enabled: optional boolean or null`30563057              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.30583059          - `cursor_position: optional BetaComputerCursorPositionConfig or null`30603061            `cursor_position`'s config overrides.30623063            - `defer_loading: optional boolean or null`30643065              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.30663067            - `enabled: optional boolean or null`30683069              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.30703071          - `double_click: optional BetaComputerDoubleClickConfig or null`30723073            `double_click`'s config overrides.30743075            - `defer_loading: optional boolean or null`30763077              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.30783079            - `enabled: optional boolean or null`30803081              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.30823083          - `hold_key: optional BetaComputerHoldKeyConfig or null`30843085            `hold_key`'s config overrides.30863087            - `defer_loading: optional boolean or null`30883089              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.30903091            - `enabled: optional boolean or null`30923093              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.30943095          - `key: optional BetaComputerKeyConfig or null`30963097            `key`'s config overrides.30983099            - `defer_loading: optional boolean or null`31003101              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31023103            - `enabled: optional boolean or null`31043105              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.31063107          - `left_click: optional BetaComputerLeftClickConfig or null`31083109            `left_click`'s config overrides.31103111            - `defer_loading: optional boolean or null`31123113              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31143115            - `enabled: optional boolean or null`31163117              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.31183119          - `left_click_drag: optional BetaComputerLeftClickDragConfig or null`31203121            `left_click_drag`'s config overrides.31223123            - `defer_loading: optional boolean or null`31243125              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31263127            - `enabled: optional boolean or null`31283129              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.31303131          - `left_mouse_down: optional BetaComputerLeftMouseDownConfig or null`31323133            `left_mouse_down`'s config overrides.31343135            - `defer_loading: optional boolean or null`31363137              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31383139            - `enabled: optional boolean or null`31403141              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.31423143          - `left_mouse_up: optional BetaComputerLeftMouseUpConfig or null`31443145            `left_mouse_up`'s config overrides.31463147            - `defer_loading: optional boolean or null`31483149              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31503151            - `enabled: optional boolean or null`31523153              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.31543155          - `middle_click: optional BetaComputerMiddleClickConfig or null`31563157            `middle_click`'s config overrides.31583159            - `defer_loading: optional boolean or null`31603161              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31623163            - `enabled: optional boolean or null`31643165              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.31663167          - `mouse_move: optional BetaComputerMouseMoveConfig or null`31683169            `mouse_move`'s config overrides.31703171            - `defer_loading: optional boolean or null`31723173              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31743175            - `enabled: optional boolean or null`31763177              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.31783179          - `right_click: optional BetaComputerRightClickConfig or null`31803181            `right_click`'s config overrides.31823183            - `defer_loading: optional boolean or null`31843185              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31863187            - `enabled: optional boolean or null`31883189              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.31903191          - `screenshot: optional BetaComputerScreenshotConfig or null`31923193            `screenshot`'s config overrides.31943195            - `defer_loading: optional boolean or null`31963197              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.31983199            - `enabled: optional boolean or null`32003201              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.32023203          - `scroll: optional BetaComputerScrollConfig or null`32043205            `scroll`'s config overrides.32063207            - `defer_loading: optional boolean or null`32083209              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.32103211            - `enabled: optional boolean or null`32123213              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.32143215          - `triple_click: optional BetaComputerTripleClickConfig or null`32163217            `triple_click`'s config overrides.32183219            - `defer_loading: optional boolean or null`32203221              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.32223223            - `enabled: optional boolean or null`32243225              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.32263227          - `wait: optional BetaComputerWaitConfig or null`32283229            `wait`'s config overrides.32303231            - `defer_loading: optional boolean or null`32323233              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.32343235            - `enabled: optional boolean or null`32363237              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.32383239          - `zoom: optional BetaComputerZoomConfig or null`32403241            `zoom`'s config overrides.32423243            - `defer_loading: optional boolean or null`32443245              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.32463247            - `enabled: optional boolean or null`32483249              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.32503251      - `BetaToolTextEditor20250124 object`32523253        - `type: "text_editor_20250124"`32543255        - `name: "str_replace_editor"`32563257          Name of the tool.32583259          This is how the tool will be called by the model and in `tool_use` blocks.32603261        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`32623263          - `"direct"`32643265          - `"code_execution_20250825"`32663267          - `"code_execution_20260120"`32683269          - `"code_execution_20260521"`32703271        - `cache_control: optional BetaCacheControlEphemeral or null`32723273          Create a cache control breakpoint at this content block.32743275        - `defer_loading: optional boolean`32763277          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.32783279        - `input_examples: optional array of map[unknown]`32803281        - `strict: optional boolean`32823283          When true, guarantees schema validation on tool names and inputs32843285      - `BetaToolTextEditor20250429 object`32863287        - `type: "text_editor_20250429"`32883289        - `name: "str_replace_based_edit_tool"`32903291          Name of the tool.32923293          This is how the tool will be called by the model and in `tool_use` blocks.32943295        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`32963297          - `"direct"`32983299          - `"code_execution_20250825"`33003301          - `"code_execution_20260120"`33023303          - `"code_execution_20260521"`33043305        - `cache_control: optional BetaCacheControlEphemeral or null`33063307          Create a cache control breakpoint at this content block.33083309        - `defer_loading: optional boolean`33103311          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.33123313        - `input_examples: optional array of map[unknown]`33143315        - `strict: optional boolean`33163317          When true, guarantees schema validation on tool names and inputs33183319      - `BetaToolTextEditor20250728 object`33203321        - `type: "text_editor_20250728"`33223323        - `name: "str_replace_based_edit_tool"`33243325          Name of the tool.33263327          This is how the tool will be called by the model and in `tool_use` blocks.33283329        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`33303331          - `"direct"`33323333          - `"code_execution_20250825"`33343335          - `"code_execution_20260120"`33363337          - `"code_execution_20260521"`33383339        - `cache_control: optional BetaCacheControlEphemeral or null`33403341          Create a cache control breakpoint at this content block.33423343        - `defer_loading: optional boolean`33443345          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.33463347        - `input_examples: optional array of map[unknown]`33483349        - `max_characters: optional number or null`33503351          Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.33523353          minimum: 133543355        - `strict: optional boolean`33563357          When true, guarantees schema validation on tool names and inputs33583359      - `BetaWebSearchTool20250305 object`33603361        - `type: "web_search_20250305"`33623363        - `name: "web_search"`33643365          Name of the tool.33663367          This is how the tool will be called by the model and in `tool_use` blocks.33683369        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`33703371          - `"direct"`33723373          - `"code_execution_20250825"`33743375          - `"code_execution_20260120"`33763377          - `"code_execution_20260521"`33783379        - `allowed_domains: optional array of string or null`33803381          If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.33823383        - `blocked_domains: optional array of string or null`33843385          If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.33863387        - `cache_control: optional BetaCacheControlEphemeral or null`33883389          Create a cache control breakpoint at this content block.33903391        - `defer_loading: optional boolean`33923393          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.33943395        - `max_uses: optional number or null`33963397          Maximum number of times the tool can be used in the API request.33983399          exclusiveMinimum: 034003401        - `strict: optional boolean`34023403          When true, guarantees schema validation on tool names and inputs34043405        - `user_location: optional BetaUserLocation or null`34063407          Parameters for the user's location. Used to provide more relevant search results.34083409          - `type: "approximate"`34103411          - `city: optional string or null`34123413            The city of the user.34143415            maxLength: 255, minLength: 134163417          - `country: optional string or null`34183419            The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.34203421            maxLength: 2, minLength: 234223423          - `region: optional string or null`34243425            The region of the user.34263427            maxLength: 255, minLength: 134283429          - `timezone: optional string or null`34303431            The [IANA timezone](https://nodatime.org/TimeZones) of the user.34323433            maxLength: 255, minLength: 134343435      - `BetaWebFetchTool20250910 object`34363437        - `type: "web_fetch_20250910"`34383439        - `name: "web_fetch"`34403441          Name of the tool.34423443          This is how the tool will be called by the model and in `tool_use` blocks.34443445        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`34463447          - `"direct"`34483449          - `"code_execution_20250825"`34503451          - `"code_execution_20260120"`34523453          - `"code_execution_20260521"`34543455        - `allowed_domains: optional array of string or null`34563457          List of domains to allow fetching from34583459        - `blocked_domains: optional array of string or null`34603461          List of domains to block fetching from34623463        - `cache_control: optional BetaCacheControlEphemeral or null`34643465          Create a cache control breakpoint at this content block.34663467        - `citations: optional BetaCitationsConfigParam or null`34683469          Citations configuration for fetched documents. Citations are disabled by default.34703471        - `defer_loading: optional boolean`34723473          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.34743475        - `max_content_tokens: optional number or null`34763477          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.34783479          exclusiveMinimum: 034803481        - `max_uses: optional number or null`34823483          Maximum number of times the tool can be used in the API request.34843485          exclusiveMinimum: 034863487        - `strict: optional boolean`34883489          When true, guarantees schema validation on tool names and inputs34903491        - `url_sources: optional BetaWebFetchURLSources or null`34923493          Which sources contribute to the set of URLs web fetch may fetch.34943495          Each key is a tagged variant: `user_input` is `all` or `none`; the3496          two tool filters are `all`, `none`, `only` (only the named tools'3497          results) or `except` (every result but the named tools'). A named tool3498          must be declared in this request's `tools[]`.34993500          - `client_tool_results: optional BetaWebFetchURLSourceAll or BetaWebFetchURLSourceNone or BetaWebFetchURLSourceOnly or BetaWebFetchURLSourceExcept`35013502            Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].35033504            - `BetaWebFetchURLSourceAll object`35053506              The `url_sources` variant under which a source contributes in3507              full: every result of the tool filter's source, or all user input.35083509              - `type: "all"`35103511            - `BetaWebFetchURLSourceNone object`35123513              The `url_sources` variant under which a source contributes nothing:3514              no result of the tool filter's source, or no user input.35153516              - `type: "none"`35173518            - `BetaWebFetchURLSourceOnly object`35193520              The tool filter variant under which only the named tools' results3521              contribute.35223523              - `type: "only"`35243525              - `tools: array of BetaWebFetchURLSourceToolReference`35263527                - `type: "tool_reference"`35283529                - `name: string`35303531            - `BetaWebFetchURLSourceExcept object`35323533              The tool filter variant under which every result but the named3534              tools' contributes.35353536              - `type: "except"`35373538              - `tools: array of BetaWebFetchURLSourceToolReference`35393540                - `type: "tool_reference"`35413542                - `name: string`35433544          - `server_tool_results: optional BetaWebFetchURLSourceAll or BetaWebFetchURLSourceNone or BetaWebFetchURLSourceOnly or BetaWebFetchURLSourceExcept`35453546            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.35473548            - `BetaWebFetchURLSourceAll object`35493550              The `url_sources` variant under which a source contributes in3551              full: every result of the tool filter's source, or all user input.35523553            - `BetaWebFetchURLSourceNone object`35543555              The `url_sources` variant under which a source contributes nothing:3556              no result of the tool filter's source, or no user input.35573558            - `BetaWebFetchURLSourceOnly object`35593560              The tool filter variant under which only the named tools' results3561              contribute.35623563            - `BetaWebFetchURLSourceExcept object`35643565              The tool filter variant under which every result but the named3566              tools' contributes.35673568          - `user_input: optional BetaWebFetchURLSourceAll or BetaWebFetchURLSourceNone`35693570            Whether URLs in user messages are fetchable: "all" or "none".35713572            - `BetaWebFetchURLSourceAll object`35733574              The `url_sources` variant under which a source contributes in3575              full: every result of the tool filter's source, or all user input.35763577            - `BetaWebFetchURLSourceNone object`35783579              The `url_sources` variant under which a source contributes nothing:3580              no result of the tool filter's source, or no user input.35813582      - `BetaWebSearchTool20260209 object`35833584        - `type: "web_search_20260209"`35853586        - `name: "web_search"`35873588          Name of the tool.35893590          This is how the tool will be called by the model and in `tool_use` blocks.35913592        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`35933594          - `"direct"`35953596          - `"code_execution_20250825"`35973598          - `"code_execution_20260120"`35993600          - `"code_execution_20260521"`36013602        - `allowed_domains: optional array of string or null`36033604          If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.36053606        - `blocked_domains: optional array of string or null`36073608          If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.36093610        - `cache_control: optional BetaCacheControlEphemeral or null`36113612          Create a cache control breakpoint at this content block.36133614        - `defer_loading: optional boolean`36153616          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.36173618        - `max_uses: optional number or null`36193620          Maximum number of times the tool can be used in the API request.36213622          exclusiveMinimum: 036233624        - `strict: optional boolean`36253626          When true, guarantees schema validation on tool names and inputs36273628        - `user_location: optional BetaUserLocation or null`36293630          Parameters for the user's location. Used to provide more relevant search results.36313632      - `BetaWebFetchTool20260209 object`36333634        - `type: "web_fetch_20260209"`36353636        - `name: "web_fetch"`36373638          Name of the tool.36393640          This is how the tool will be called by the model and in `tool_use` blocks.36413642        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`36433644          - `"direct"`36453646          - `"code_execution_20250825"`36473648          - `"code_execution_20260120"`36493650          - `"code_execution_20260521"`36513652        - `allowed_domains: optional array of string or null`36533654          List of domains to allow fetching from36553656        - `blocked_domains: optional array of string or null`36573658          List of domains to block fetching from36593660        - `cache_control: optional BetaCacheControlEphemeral or null`36613662          Create a cache control breakpoint at this content block.36633664        - `citations: optional BetaCitationsConfigParam or null`36653666          Citations configuration for fetched documents. Citations are disabled by default.36673668        - `defer_loading: optional boolean`36693670          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.36713672        - `max_content_tokens: optional number or null`36733674          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.36753676          exclusiveMinimum: 036773678        - `max_uses: optional number or null`36793680          Maximum number of times the tool can be used in the API request.36813682          exclusiveMinimum: 036833684        - `strict: optional boolean`36853686          When true, guarantees schema validation on tool names and inputs36873688        - `url_sources: optional BetaWebFetchURLSources or null`36893690          Which sources contribute to the set of URLs web fetch may fetch.36913692          Each key is a tagged variant: `user_input` is `all` or `none`; the3693          two tool filters are `all`, `none`, `only` (only the named tools'3694          results) or `except` (every result but the named tools'). A named tool3695          must be declared in this request's `tools[]`.36963697      - `BetaWebFetchTool20260309 object`36983699        Web fetch tool with use_cache parameter for bypassing cached content.37003701        - `type: "web_fetch_20260309"`37023703        - `name: "web_fetch"`37043705          Name of the tool.37063707          This is how the tool will be called by the model and in `tool_use` blocks.37083709        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`37103711          - `"direct"`37123713          - `"code_execution_20250825"`37143715          - `"code_execution_20260120"`37163717          - `"code_execution_20260521"`37183719        - `allowed_domains: optional array of string or null`37203721          List of domains to allow fetching from37223723        - `blocked_domains: optional array of string or null`37243725          List of domains to block fetching from37263727        - `cache_control: optional BetaCacheControlEphemeral or null`37283729          Create a cache control breakpoint at this content block.37303731        - `citations: optional BetaCitationsConfigParam or null`37323733          Citations configuration for fetched documents. Citations are disabled by default.37343735        - `defer_loading: optional boolean`37363737          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.37383739        - `max_content_tokens: optional number or null`37403741          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.37423743          exclusiveMinimum: 037443745        - `max_uses: optional number or null`37463747          Maximum number of times the tool can be used in the API request.37483749          exclusiveMinimum: 037503751        - `strict: optional boolean`37523753          When true, guarantees schema validation on tool names and inputs37543755        - `url_sources: optional BetaWebFetchURLSources or null`37563757          Which sources contribute to the set of URLs web fetch may fetch.37583759          Each key is a tagged variant: `user_input` is `all` or `none`; the3760          two tool filters are `all`, `none`, `only` (only the named tools'3761          results) or `except` (every result but the named tools'). A named tool3762          must be declared in this request's `tools[]`.37633764        - `use_cache: optional boolean`37653766          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.37673768      - `BetaWebSearchTool20260318 object`37693770        - `type: "web_search_20260318"`37713772        - `name: "web_search"`37733774          Name of the tool.37753776          This is how the tool will be called by the model and in `tool_use` blocks.37773778        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`37793780          - `"direct"`37813782          - `"code_execution_20250825"`37833784          - `"code_execution_20260120"`37853786          - `"code_execution_20260521"`37873788        - `allowed_domains: optional array of string or null`37893790          If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.37913792        - `blocked_domains: optional array of string or null`37933794          If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.37953796        - `cache_control: optional BetaCacheControlEphemeral or null`37973798          Create a cache control breakpoint at this content block.37993800        - `defer_loading: optional boolean`38013802          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.38033804        - `max_uses: optional number or null`38053806          Maximum number of times the tool can be used in the API request.38073808          exclusiveMinimum: 038093810        - `response_inclusion: optional "full" or "excluded"`38113812          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. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.38133814          - `"full"`38153816          - `"excluded"`38173818        - `strict: optional boolean`38193820          When true, guarantees schema validation on tool names and inputs38213822        - `user_location: optional BetaUserLocation or null`38233824          Parameters for the user's location. Used to provide more relevant search results.38253826      - `BetaWebFetchTool20260318 object`38273828        - `type: "web_fetch_20260318"`38293830        - `name: "web_fetch"`38313832          Name of the tool.38333834          This is how the tool will be called by the model and in `tool_use` blocks.38353836        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`38373838          - `"direct"`38393840          - `"code_execution_20250825"`38413842          - `"code_execution_20260120"`38433844          - `"code_execution_20260521"`38453846        - `allowed_domains: optional array of string or null`38473848          List of domains to allow fetching from38493850        - `blocked_domains: optional array of string or null`38513852          List of domains to block fetching from38533854        - `cache_control: optional BetaCacheControlEphemeral or null`38553856          Create a cache control breakpoint at this content block.38573858        - `citations: optional BetaCitationsConfigParam or null`38593860          Citations configuration for fetched documents. Citations are disabled by default.38613862        - `defer_loading: optional boolean`38633864          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.38653866        - `max_content_tokens: optional number or null`38673868          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.38693870          exclusiveMinimum: 038713872        - `max_uses: optional number or null`38733874          Maximum number of times the tool can be used in the API request.38753876          exclusiveMinimum: 038773878        - `response_inclusion: optional "full" or "excluded"`38793880          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. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.38813882          - `"full"`38833884          - `"excluded"`38853886        - `strict: optional boolean`38873888          When true, guarantees schema validation on tool names and inputs38893890        - `url_sources: optional BetaWebFetchURLSources or null`38913892          Which sources contribute to the set of URLs web fetch may fetch.38933894          Each key is a tagged variant: `user_input` is `all` or `none`; the3895          two tool filters are `all`, `none`, `only` (only the named tools'3896          results) or `except` (every result but the named tools'). A named tool3897          must be declared in this request's `tools[]`.38983899        - `use_cache: optional boolean`39003901          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.39023903      - `BetaAdvisorTool20260301 object`39043905        - `type: "advisor_20260301"`39063907        - `model: Model`39083909          The model that will complete your prompt.39103911          See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.39123913        - `name: "advisor"`39143915          Name of the tool.39163917          This is how the tool will be called by the model and in `tool_use` blocks.39183919        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`39203921          - `"direct"`39223923          - `"code_execution_20250825"`39243925          - `"code_execution_20260120"`39263927          - `"code_execution_20260521"`39283929        - `cache_control: optional BetaCacheControlEphemeral or null`39303931          Create a cache control breakpoint at this content block.39323933        - `caching: optional BetaCacheControlEphemeral or null`39343935          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.39363937        - `defer_loading: optional boolean`39383939          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.39403941        - `max_tokens: optional number or null`39423943          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 server also emits a remaining-tokens budget block in the advisor's prompt so the advisor self-shapes toward the cap. When omitted, the advisor model's default output cap applies and no budget block is emitted.39443945          minimum: 102439463947        - `max_uses: optional number or null`39483949          Maximum number of times the tool can be used in the API request.39503951          exclusiveMinimum: 039523953        - `strict: optional boolean`39543955          When true, guarantees schema validation on tool names and inputs39563957      - `BetaToolSearchToolBm25_20251119 object`39583959        - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`39603961          - `"tool_search_tool_bm25_20251119"`39623963          - `"tool_search_tool_bm25"`39643965        - `name: "tool_search_tool_bm25"`39663967          Name of the tool.39683969          This is how the tool will be called by the model and in `tool_use` blocks.39703971        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`39723973          - `"direct"`39743975          - `"code_execution_20250825"`39763977          - `"code_execution_20260120"`39783979          - `"code_execution_20260521"`39803981        - `cache_control: optional BetaCacheControlEphemeral or null`39823983          Create a cache control breakpoint at this content block.39843985        - `defer_loading: optional boolean`39863987          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.39883989        - `strict: optional boolean`39903991          When true, guarantees schema validation on tool names and inputs39923993      - `BetaToolSearchToolRegex20251119 object`39943995        - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`39963997          - `"tool_search_tool_regex_20251119"`39983999          - `"tool_search_tool_regex"`40004001        - `name: "tool_search_tool_regex"`40024003          Name of the tool.40044005          This is how the tool will be called by the model and in `tool_use` blocks.40064007        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`40084009          - `"direct"`40104011          - `"code_execution_20250825"`40124013          - `"code_execution_20260120"`40144015          - `"code_execution_20260521"`40164017        - `cache_control: optional BetaCacheControlEphemeral or null`40184019          Create a cache control breakpoint at this content block.40204021        - `defer_loading: optional boolean`40224023          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.40244025        - `strict: optional boolean`40264027          When true, guarantees schema validation on tool names and inputs40284029      - `BetaMCPToolset object`40304031        Configuration for a group of tools from an MCP server.40324033        Allows configuring enabled status and defer_loading for all tools4034        from an MCP server, with optional per-tool overrides.40354036        - `type: "mcp_toolset"`40374038        - `mcp_server_name: string`40394040          Name of the MCP server to configure tools for40414042          maxLength: 255, minLength: 140434044        - `cache_control: optional BetaCacheControlEphemeral or null`40454046          Create a cache control breakpoint at this content block.40474048        - `configs: optional map[BetaMCPToolConfig] or null`40494050          Configuration overrides for specific tools, keyed by tool name40514052          - `defer_loading: optional boolean`40534054          - `enabled: optional boolean`40554056        - `default_config: optional BetaMCPToolDefaultConfig`40574058          Default configuration applied to all tools from this server40594060          - `defer_loading: optional boolean`40614062          - `enabled: optional boolean`40634064    - `output_format: optional BetaJSONOutputFormat or null`40654066      **Deprecated**40674068      Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)40694070      A schema to specify Claude's output format in responses. This parameter will be removed in a future release.40714072    - `temperature: optional number`40734074      **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.40754076      Amount of randomness injected into the response.40774078      Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.40794080      Note that even with `temperature` of `0.0`, the results will not be fully deterministic.40814082      maximum: 1, minimum: 040834084    - `top_k: optional number`40854086      **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.40874088      Only sample from the top K options for each subsequent token.40894090      Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).40914092      Recommended for advanced use cases only.40934094      minimum: 040954096    - `top_p: optional number`40974098      **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.40994100      Use nucleus sampling.41014102      In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`.41034104      Recommended for advanced use cases only.41054106      maximum: 1, minimum: 041074108### Returns41094110- `BetaMessageBatch object`41114112  - `type: "message_batch"`41134114    Object type.41154116    For Message Batches, this is always `"message_batch"`.41174118    default: message_batch41194120  - `id: string`41214122    Unique object identifier.41234124    The format and length of IDs may change over time.41254126  - `archived_at: string or null`41274128    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.41294130    format: date-time41314132  - `cancel_initiated_at: string or null`41334134    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.41354136    format: date-time41374138  - `created_at: string`41394140    RFC 3339 datetime string representing the time at which the Message Batch was created.41414142    format: date-time41434144  - `ended_at: string or null`41454146    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.41474148    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.41494150    format: date-time41514152  - `expires_at: string`41534154    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.41554156    format: date-time41574158  - `processing_status: "in_progress" or "canceling" or "ended"`41594160    Processing status of the Message Batch.41614162    - `"in_progress"`41634164    - `"canceling"`41654166    - `"ended"`41674168  - `request_counts: BetaMessageBatchRequestCounts`41694170    Tallies requests within the Message Batch, categorized by their status.41714172    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.41734174    - `canceled: number`41754176      Number of requests in the Message Batch that have been canceled.41774178      This is zero until processing of the entire Message Batch has ended.41794180      default: 041814182    - `errored: number`41834184      Number of requests in the Message Batch that encountered an error.41854186      This is zero until processing of the entire Message Batch has ended.41874188      default: 041894190    - `expired: number`41914192      Number of requests in the Message Batch that have expired.41934194      This is zero until processing of the entire Message Batch has ended.41954196      default: 041974198    - `processing: number`41994200      Number of requests in the Message Batch that are processing.42014202      default: 042034204    - `succeeded: number`42054206      Number of requests in the Message Batch that have completed successfully.42074208      This is zero until processing of the entire Message Batch has ended.42094210      default: 042114212  - `results_url: string or null`42134214    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.42154216    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.42174218### Example42194220```bash4221curl https://api.anthropic.com/v1/messages/batches \4222    -H 'Content-Type: application/json' \4223    -H 'anthropic-version: 2023-06-01' \4224    -H 'anthropic-beta: message-batches-2024-09-24' \4225    -H "X-Api-Key: $ANTHROPIC_API_KEY" \4226    -d '{4227          "requests": [4228            {4229              "custom_id": "my-custom-id-1",4230              "params": {4231                "max_tokens": 1024,4232                "messages": [4233                  {4234                    "content": "Hello, world",4235                    "role": "user"4236                  }4237                ],4238                "model": "claude-opus-5"4239              }4240            }4241          ]4242        }'4243```42444245#### Response (200)42464247```json4248{4249  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",4250  "archived_at": "2024-08-20T18:37:24.100435Z",4251  "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",4252  "created_at": "2024-08-20T18:37:24.100435Z",4253  "ended_at": "2024-08-20T18:37:24.100435Z",4254  "expires_at": "2024-08-20T18:37:24.100435Z",4255  "processing_status": "in_progress",4256  "request_counts": {4257    "canceled": 10,4258    "errored": 30,4259    "expired": 10,4260    "processing": 100,4261    "succeeded": 504262  },4263  "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",4264  "type": "message_batch"4265}4266```42674268## Retrieve a Message Batch42694270**GET** `/v1/messages/batches/{message_batch_id}`42714272This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.42734274Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)42754276### Path parameters42774278- `message_batch_id: string`42794280  ID of the Message Batch.42814282### Headers42834284- `"anthropic-beta": optional array of AnthropicBeta`42854286  Optional header to specify the beta version(s) you want to use.42874288  - `string`42894290  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`42914292    - `"message-batches-2024-09-24"`42934294    - `"prompt-caching-2024-07-31"`42954296    - `"computer-use-2024-10-22"`42974298    - `"computer-use-2025-01-24"`42994300    - `"pdfs-2024-09-25"`43014302    - `"token-counting-2024-11-01"`43034304    - `"token-efficient-tools-2025-02-19"`43054306    - `"output-128k-2025-02-19"`43074308    - `"files-api-2025-04-14"`43094310    - `"mcp-client-2025-04-04"`43114312    - `"mcp-client-2025-11-20"`43134314    - `"dev-full-thinking-2025-05-14"`43154316    - `"interleaved-thinking-2025-05-14"`43174318    - `"code-execution-2025-05-22"`43194320    - `"extended-cache-ttl-2025-04-11"`43214322    - `"context-1m-2025-08-07"`43234324    - `"context-management-2025-06-27"`43254326    - `"model-context-window-exceeded-2025-08-26"`43274328    - `"skills-2025-10-02"`43294330    - `"fast-mode-2026-02-01"`43314332    - `"output-300k-2026-03-24"`43334334    - `"user-profiles-2026-03-24"`43354336    - `"user-profiles-2026-08-18"`43374338    - `"user-profiles-2026-09-04"`43394340    - `"advisor-tool-2026-03-01"`43414342    - `"managed-agents-2026-04-01"`43434344    - `"cache-diagnosis-2026-04-07"`43454346    - `"dreaming-2026-04-21"`43474348    - `"thinking-token-count-2026-05-13"`43494350    - `"server-side-fallback-2026-06-01"`43514352    - `"server-side-fallback-2026-07-01"`43534354    - `"fallback-credit-2026-06-01"`43554356    - `"fallback-credit-2026-07-01"`43574358    - `"agent-memory-2026-07-22"`43594360    - `"mid-conversation-tool-changes-2026-07-01"`43614362    - `"compact-2026-01-12"`43634364    - `"computer-use-2025-11-24"`43654366    - `"mcp-tunnels-2026-06-22"`43674368    - `"structured-outputs-2025-11-13"`43694370    - `"task-budgets-2026-03-13"`43714372    - `"thinking-display-updates-2026-08-18"`43734374    - `"ce-user-management-2026-07-13"`43754376    - `"mid-conversation-output-config-2026-07-01"`43774378    - `"thinking-binding-controls-2026-08-01"`43794380    - `"mid-conversation-system-clear-at-2026-08-21"`43814382    - `"compact-2026-09-04"`43834384- `"anthropic-workspace-id": optional string`43854386### Returns43874388- `BetaMessageBatch object`43894390  - `type: "message_batch"`43914392    Object type.43934394    For Message Batches, this is always `"message_batch"`.43954396    default: message_batch43974398  - `id: string`43994400    Unique object identifier.44014402    The format and length of IDs may change over time.44034404  - `archived_at: string or null`44054406    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.44074408    format: date-time44094410  - `cancel_initiated_at: string or null`44114412    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.44134414    format: date-time44154416  - `created_at: string`44174418    RFC 3339 datetime string representing the time at which the Message Batch was created.44194420    format: date-time44214422  - `ended_at: string or null`44234424    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.44254426    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.44274428    format: date-time44294430  - `expires_at: string`44314432    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.44334434    format: date-time44354436  - `processing_status: "in_progress" or "canceling" or "ended"`44374438    Processing status of the Message Batch.44394440    - `"in_progress"`44414442    - `"canceling"`44434444    - `"ended"`44454446  - `request_counts: BetaMessageBatchRequestCounts`44474448    Tallies requests within the Message Batch, categorized by their status.44494450    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.44514452    - `canceled: number`44534454      Number of requests in the Message Batch that have been canceled.44554456      This is zero until processing of the entire Message Batch has ended.44574458      default: 044594460    - `errored: number`44614462      Number of requests in the Message Batch that encountered an error.44634464      This is zero until processing of the entire Message Batch has ended.44654466      default: 044674468    - `expired: number`44694470      Number of requests in the Message Batch that have expired.44714472      This is zero until processing of the entire Message Batch has ended.44734474      default: 044754476    - `processing: number`44774478      Number of requests in the Message Batch that are processing.44794480      default: 044814482    - `succeeded: number`44834484      Number of requests in the Message Batch that have completed successfully.44854486      This is zero until processing of the entire Message Batch has ended.44874488      default: 044894490  - `results_url: string or null`44914492    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.44934494    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.44954496### Example44974498```bash4499curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \4500    -H 'anthropic-version: 2023-06-01' \4501    -H 'anthropic-beta: message-batches-2024-09-24' \4502    -H "X-Api-Key: $ANTHROPIC_API_KEY"4503```45044505#### Response (200)45064507```json4508{4509  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",4510  "archived_at": "2024-08-20T18:37:24.100435Z",4511  "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",4512  "created_at": "2024-08-20T18:37:24.100435Z",4513  "ended_at": "2024-08-20T18:37:24.100435Z",4514  "expires_at": "2024-08-20T18:37:24.100435Z",4515  "processing_status": "in_progress",4516  "request_counts": {4517    "canceled": 10,4518    "errored": 30,4519    "expired": 10,4520    "processing": 100,4521    "succeeded": 504522  },4523  "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",4524  "type": "message_batch"4525}4526```45274528## List Message Batches45294530**GET** `/v1/messages/batches`45314532List all Message Batches within a Workspace. Most recently created batches are returned first.45334534Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)45354536### Query parameters45374538- `after_id: optional string`45394540  ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.45414542- `before_id: optional string`45434544  ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.45454546- `limit: optional number`45474548  Number of items to return per page.45494550  Defaults to `20`. Ranges from `1` to `1000`.45514552  default: 20, maximum: 1000, minimum: 145534554### Headers45554556- `"anthropic-beta": optional array of AnthropicBeta`45574558  Optional header to specify the beta version(s) you want to use.45594560  - `string`45614562  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`45634564    - `"message-batches-2024-09-24"`45654566    - `"prompt-caching-2024-07-31"`45674568    - `"computer-use-2024-10-22"`45694570    - `"computer-use-2025-01-24"`45714572    - `"pdfs-2024-09-25"`45734574    - `"token-counting-2024-11-01"`45754576    - `"token-efficient-tools-2025-02-19"`45774578    - `"output-128k-2025-02-19"`45794580    - `"files-api-2025-04-14"`45814582    - `"mcp-client-2025-04-04"`45834584    - `"mcp-client-2025-11-20"`45854586    - `"dev-full-thinking-2025-05-14"`45874588    - `"interleaved-thinking-2025-05-14"`45894590    - `"code-execution-2025-05-22"`45914592    - `"extended-cache-ttl-2025-04-11"`45934594    - `"context-1m-2025-08-07"`45954596    - `"context-management-2025-06-27"`45974598    - `"model-context-window-exceeded-2025-08-26"`45994600    - `"skills-2025-10-02"`46014602    - `"fast-mode-2026-02-01"`46034604    - `"output-300k-2026-03-24"`46054606    - `"user-profiles-2026-03-24"`46074608    - `"user-profiles-2026-08-18"`46094610    - `"user-profiles-2026-09-04"`46114612    - `"advisor-tool-2026-03-01"`46134614    - `"managed-agents-2026-04-01"`46154616    - `"cache-diagnosis-2026-04-07"`46174618    - `"dreaming-2026-04-21"`46194620    - `"thinking-token-count-2026-05-13"`46214622    - `"server-side-fallback-2026-06-01"`46234624    - `"server-side-fallback-2026-07-01"`46254626    - `"fallback-credit-2026-06-01"`46274628    - `"fallback-credit-2026-07-01"`46294630    - `"agent-memory-2026-07-22"`46314632    - `"mid-conversation-tool-changes-2026-07-01"`46334634    - `"compact-2026-01-12"`46354636    - `"computer-use-2025-11-24"`46374638    - `"mcp-tunnels-2026-06-22"`46394640    - `"structured-outputs-2025-11-13"`46414642    - `"task-budgets-2026-03-13"`46434644    - `"thinking-display-updates-2026-08-18"`46454646    - `"ce-user-management-2026-07-13"`46474648    - `"mid-conversation-output-config-2026-07-01"`46494650    - `"thinking-binding-controls-2026-08-01"`46514652    - `"mid-conversation-system-clear-at-2026-08-21"`46534654    - `"compact-2026-09-04"`46554656- `"anthropic-workspace-id": optional string`46574658### Returns46594660- `data: array of BetaMessageBatch`46614662  - `type: "message_batch"`46634664    Object type.46654666    For Message Batches, this is always `"message_batch"`.46674668    default: message_batch46694670  - `id: string`46714672    Unique object identifier.46734674    The format and length of IDs may change over time.46754676  - `archived_at: string or null`46774678    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.46794680    format: date-time46814682  - `cancel_initiated_at: string or null`46834684    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.46854686    format: date-time46874688  - `created_at: string`46894690    RFC 3339 datetime string representing the time at which the Message Batch was created.46914692    format: date-time46934694  - `ended_at: string or null`46954696    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.46974698    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.46994700    format: date-time47014702  - `expires_at: string`47034704    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.47054706    format: date-time47074708  - `processing_status: "in_progress" or "canceling" or "ended"`47094710    Processing status of the Message Batch.47114712    - `"in_progress"`47134714    - `"canceling"`47154716    - `"ended"`47174718  - `request_counts: BetaMessageBatchRequestCounts`47194720    Tallies requests within the Message Batch, categorized by their status.47214722    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.47234724    - `canceled: number`47254726      Number of requests in the Message Batch that have been canceled.47274728      This is zero until processing of the entire Message Batch has ended.47294730      default: 047314732    - `errored: number`47334734      Number of requests in the Message Batch that encountered an error.47354736      This is zero until processing of the entire Message Batch has ended.47374738      default: 047394740    - `expired: number`47414742      Number of requests in the Message Batch that have expired.47434744      This is zero until processing of the entire Message Batch has ended.47454746      default: 047474748    - `processing: number`47494750      Number of requests in the Message Batch that are processing.47514752      default: 047534754    - `succeeded: number`47554756      Number of requests in the Message Batch that have completed successfully.47574758      This is zero until processing of the entire Message Batch has ended.47594760      default: 047614762  - `results_url: string or null`47634764    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.47654766    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.47674768- `first_id: string or null`47694770  First ID in the `data` list. Can be used as the `before_id` for the previous page.47714772- `has_more: boolean`47734774  Indicates if there are more results in the requested page direction.47754776- `last_id: string or null`47774778  Last ID in the `data` list. Can be used as the `after_id` for the next page.47794780### Example47814782```bash4783curl https://api.anthropic.com/v1/messages/batches \4784    -H 'anthropic-version: 2023-06-01' \4785    -H 'anthropic-beta: message-batches-2024-09-24' \4786    -H "X-Api-Key: $ANTHROPIC_API_KEY"4787```47884789#### Response (200)47904791```json4792{4793  "data": [4794    {4795      "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",4796      "archived_at": "2024-08-20T18:37:24.100435Z",4797      "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",4798      "created_at": "2024-08-20T18:37:24.100435Z",4799      "ended_at": "2024-08-20T18:37:24.100435Z",4800      "expires_at": "2024-08-20T18:37:24.100435Z",4801      "processing_status": "in_progress",4802      "request_counts": {4803        "canceled": 10,4804        "errored": 30,4805        "expired": 10,4806        "processing": 100,4807        "succeeded": 504808      },4809      "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",4810      "type": "message_batch"4811    }4812  ],4813  "first_id": "first_id",4814  "has_more": true,4815  "last_id": "last_id"4816}4817```48184819## Cancel a Message Batch48204821**POST** `/v1/messages/batches/{message_batch_id}/cancel`48224823Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.48244825The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.48264827Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)48284829### Path parameters48304831- `message_batch_id: string`48324833  ID of the Message Batch.48344835### Headers48364837- `"anthropic-beta": optional array of AnthropicBeta`48384839  Optional header to specify the beta version(s) you want to use.48404841  - `string`48424843  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`48444845    - `"message-batches-2024-09-24"`48464847    - `"prompt-caching-2024-07-31"`48484849    - `"computer-use-2024-10-22"`48504851    - `"computer-use-2025-01-24"`48524853    - `"pdfs-2024-09-25"`48544855    - `"token-counting-2024-11-01"`48564857    - `"token-efficient-tools-2025-02-19"`48584859    - `"output-128k-2025-02-19"`48604861    - `"files-api-2025-04-14"`48624863    - `"mcp-client-2025-04-04"`48644865    - `"mcp-client-2025-11-20"`48664867    - `"dev-full-thinking-2025-05-14"`48684869    - `"interleaved-thinking-2025-05-14"`48704871    - `"code-execution-2025-05-22"`48724873    - `"extended-cache-ttl-2025-04-11"`48744875    - `"context-1m-2025-08-07"`48764877    - `"context-management-2025-06-27"`48784879    - `"model-context-window-exceeded-2025-08-26"`48804881    - `"skills-2025-10-02"`48824883    - `"fast-mode-2026-02-01"`48844885    - `"output-300k-2026-03-24"`48864887    - `"user-profiles-2026-03-24"`48884889    - `"user-profiles-2026-08-18"`48904891    - `"user-profiles-2026-09-04"`48924893    - `"advisor-tool-2026-03-01"`48944895    - `"managed-agents-2026-04-01"`48964897    - `"cache-diagnosis-2026-04-07"`48984899    - `"dreaming-2026-04-21"`49004901    - `"thinking-token-count-2026-05-13"`49024903    - `"server-side-fallback-2026-06-01"`49044905    - `"server-side-fallback-2026-07-01"`49064907    - `"fallback-credit-2026-06-01"`49084909    - `"fallback-credit-2026-07-01"`49104911    - `"agent-memory-2026-07-22"`49124913    - `"mid-conversation-tool-changes-2026-07-01"`49144915    - `"compact-2026-01-12"`49164917    - `"computer-use-2025-11-24"`49184919    - `"mcp-tunnels-2026-06-22"`49204921    - `"structured-outputs-2025-11-13"`49224923    - `"task-budgets-2026-03-13"`49244925    - `"thinking-display-updates-2026-08-18"`49264927    - `"ce-user-management-2026-07-13"`49284929    - `"mid-conversation-output-config-2026-07-01"`49304931    - `"thinking-binding-controls-2026-08-01"`49324933    - `"mid-conversation-system-clear-at-2026-08-21"`49344935    - `"compact-2026-09-04"`49364937- `"anthropic-workspace-id": optional string`49384939### Returns49404941- `BetaMessageBatch object`49424943  - `type: "message_batch"`49444945    Object type.49464947    For Message Batches, this is always `"message_batch"`.49484949    default: message_batch49504951  - `id: string`49524953    Unique object identifier.49544955    The format and length of IDs may change over time.49564957  - `archived_at: string or null`49584959    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.49604961    format: date-time49624963  - `cancel_initiated_at: string or null`49644965    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.49664967    format: date-time49684969  - `created_at: string`49704971    RFC 3339 datetime string representing the time at which the Message Batch was created.49724973    format: date-time49744975  - `ended_at: string or null`49764977    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.49784979    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.49804981    format: date-time49824983  - `expires_at: string`49844985    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.49864987    format: date-time49884989  - `processing_status: "in_progress" or "canceling" or "ended"`49904991    Processing status of the Message Batch.49924993    - `"in_progress"`49944995    - `"canceling"`49964997    - `"ended"`49984999  - `request_counts: BetaMessageBatchRequestCounts`50005001    Tallies requests within the Message Batch, categorized by their status.50025003    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.50045005    - `canceled: number`50065007      Number of requests in the Message Batch that have been canceled.50085009      This is zero until processing of the entire Message Batch has ended.50105011      default: 050125013    - `errored: number`50145015      Number of requests in the Message Batch that encountered an error.50165017      This is zero until processing of the entire Message Batch has ended.50185019      default: 050205021    - `expired: number`50225023      Number of requests in the Message Batch that have expired.50245025      This is zero until processing of the entire Message Batch has ended.50265027      default: 050285029    - `processing: number`50305031      Number of requests in the Message Batch that are processing.50325033      default: 050345035    - `succeeded: number`50365037      Number of requests in the Message Batch that have completed successfully.50385039      This is zero until processing of the entire Message Batch has ended.50405041      default: 050425043  - `results_url: string or null`50445045    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.50465047    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.50485049### Example50505051```bash5052curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \5053    -X POST \5054    -H 'anthropic-version: 2023-06-01' \5055    -H 'anthropic-beta: message-batches-2024-09-24' \5056    -H "X-Api-Key: $ANTHROPIC_API_KEY"5057```50585059#### Response (200)50605061```json5062{5063  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",5064  "archived_at": "2024-08-20T18:37:24.100435Z",5065  "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",5066  "created_at": "2024-08-20T18:37:24.100435Z",5067  "ended_at": "2024-08-20T18:37:24.100435Z",5068  "expires_at": "2024-08-20T18:37:24.100435Z",5069  "processing_status": "in_progress",5070  "request_counts": {5071    "canceled": 10,5072    "errored": 30,5073    "expired": 10,5074    "processing": 100,5075    "succeeded": 505076  },5077  "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",5078  "type": "message_batch"5079}5080```50815082## Delete a Message Batch50835084**DELETE** `/v1/messages/batches/{message_batch_id}`50855086Delete a Message Batch.50875088Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.50895090Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)50915092### Path parameters50935094- `message_batch_id: string`50955096  ID of the Message Batch.50975098### Headers50995100- `"anthropic-beta": optional array of AnthropicBeta`51015102  Optional header to specify the beta version(s) you want to use.51035104  - `string`51055106  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`51075108    - `"message-batches-2024-09-24"`51095110    - `"prompt-caching-2024-07-31"`51115112    - `"computer-use-2024-10-22"`51135114    - `"computer-use-2025-01-24"`51155116    - `"pdfs-2024-09-25"`51175118    - `"token-counting-2024-11-01"`51195120    - `"token-efficient-tools-2025-02-19"`51215122    - `"output-128k-2025-02-19"`51235124    - `"files-api-2025-04-14"`51255126    - `"mcp-client-2025-04-04"`51275128    - `"mcp-client-2025-11-20"`51295130    - `"dev-full-thinking-2025-05-14"`51315132    - `"interleaved-thinking-2025-05-14"`51335134    - `"code-execution-2025-05-22"`51355136    - `"extended-cache-ttl-2025-04-11"`51375138    - `"context-1m-2025-08-07"`51395140    - `"context-management-2025-06-27"`51415142    - `"model-context-window-exceeded-2025-08-26"`51435144    - `"skills-2025-10-02"`51455146    - `"fast-mode-2026-02-01"`51475148    - `"output-300k-2026-03-24"`51495150    - `"user-profiles-2026-03-24"`51515152    - `"user-profiles-2026-08-18"`51535154    - `"user-profiles-2026-09-04"`51555156    - `"advisor-tool-2026-03-01"`51575158    - `"managed-agents-2026-04-01"`51595160    - `"cache-diagnosis-2026-04-07"`51615162    - `"dreaming-2026-04-21"`51635164    - `"thinking-token-count-2026-05-13"`51655166    - `"server-side-fallback-2026-06-01"`51675168    - `"server-side-fallback-2026-07-01"`51695170    - `"fallback-credit-2026-06-01"`51715172    - `"fallback-credit-2026-07-01"`51735174    - `"agent-memory-2026-07-22"`51755176    - `"mid-conversation-tool-changes-2026-07-01"`51775178    - `"compact-2026-01-12"`51795180    - `"computer-use-2025-11-24"`51815182    - `"mcp-tunnels-2026-06-22"`51835184    - `"structured-outputs-2025-11-13"`51855186    - `"task-budgets-2026-03-13"`51875188    - `"thinking-display-updates-2026-08-18"`51895190    - `"ce-user-management-2026-07-13"`51915192    - `"mid-conversation-output-config-2026-07-01"`51935194    - `"thinking-binding-controls-2026-08-01"`51955196    - `"mid-conversation-system-clear-at-2026-08-21"`51975198    - `"compact-2026-09-04"`51995200- `"anthropic-workspace-id": optional string`52015202### Returns52035204- `BetaDeletedMessageBatch object`52055206  - `type: "message_batch_deleted"`52075208    Deleted object type.52095210    For Message Batches, this is always `"message_batch_deleted"`.52115212    default: message_batch_deleted52135214  - `id: string`52155216    ID of the Message Batch.52175218### Example52195220```bash5221curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \5222    -X DELETE \5223    -H 'anthropic-version: 2023-06-01' \5224    -H 'anthropic-beta: message-batches-2024-09-24' \5225    -H "X-Api-Key: $ANTHROPIC_API_KEY"5226```52275228#### Response (200)52295230```json5231{5232  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",5233  "type": "message_batch_deleted"5234}5235```52365237## Retrieve Message Batch results52385239**GET** `/v1/messages/batches/{message_batch_id}/results`52405241Streams the results of a Message Batch as a `.jsonl` file.52425243Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.52445245Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)52465247### Path parameters52485249- `message_batch_id: string`52505251  ID of the Message Batch.52525253### Headers52545255- `"anthropic-beta": optional array of AnthropicBeta`52565257  Optional header to specify the beta version(s) you want to use.52585259  - `string`52605261  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`52625263    - `"message-batches-2024-09-24"`52645265    - `"prompt-caching-2024-07-31"`52665267    - `"computer-use-2024-10-22"`52685269    - `"computer-use-2025-01-24"`52705271    - `"pdfs-2024-09-25"`52725273    - `"token-counting-2024-11-01"`52745275    - `"token-efficient-tools-2025-02-19"`52765277    - `"output-128k-2025-02-19"`52785279    - `"files-api-2025-04-14"`52805281    - `"mcp-client-2025-04-04"`52825283    - `"mcp-client-2025-11-20"`52845285    - `"dev-full-thinking-2025-05-14"`52865287    - `"interleaved-thinking-2025-05-14"`52885289    - `"code-execution-2025-05-22"`52905291    - `"extended-cache-ttl-2025-04-11"`52925293    - `"context-1m-2025-08-07"`52945295    - `"context-management-2025-06-27"`52965297    - `"model-context-window-exceeded-2025-08-26"`52985299    - `"skills-2025-10-02"`53005301    - `"fast-mode-2026-02-01"`53025303    - `"output-300k-2026-03-24"`53045305    - `"user-profiles-2026-03-24"`53065307    - `"user-profiles-2026-08-18"`53085309    - `"user-profiles-2026-09-04"`53105311    - `"advisor-tool-2026-03-01"`53125313    - `"managed-agents-2026-04-01"`53145315    - `"cache-diagnosis-2026-04-07"`53165317    - `"dreaming-2026-04-21"`53185319    - `"thinking-token-count-2026-05-13"`53205321    - `"server-side-fallback-2026-06-01"`53225323    - `"server-side-fallback-2026-07-01"`53245325    - `"fallback-credit-2026-06-01"`53265327    - `"fallback-credit-2026-07-01"`53285329    - `"agent-memory-2026-07-22"`53305331    - `"mid-conversation-tool-changes-2026-07-01"`53325333    - `"compact-2026-01-12"`53345335    - `"computer-use-2025-11-24"`53365337    - `"mcp-tunnels-2026-06-22"`53385339    - `"structured-outputs-2025-11-13"`53405341    - `"task-budgets-2026-03-13"`53425343    - `"thinking-display-updates-2026-08-18"`53445345    - `"ce-user-management-2026-07-13"`53465347    - `"mid-conversation-output-config-2026-07-01"`53485349    - `"thinking-binding-controls-2026-08-01"`53505351    - `"mid-conversation-system-clear-at-2026-08-21"`53525353    - `"compact-2026-09-04"`53545355- `"anthropic-workspace-id": optional string`53565357### Returns53585359- `BetaMessageBatchIndividualResponse object`53605361  This is a single line in the response `.jsonl` file and does not represent the response as a whole.53625363  - `custom_id: string`53645365    Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.53665367    Must be unique for each request within the Message Batch.53685369  - `result: BetaMessageBatchResult`53705371    Processing result for this request.53725373    Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.53745375    - `BetaMessageBatchSucceededResult object`53765377      - `type: "succeeded"`53785379        default: succeeded53805381      - `message: BetaMessage`53825383        - `type: "message"`53845385          Object type.53865387          For Messages, this is always `"message"`.53885389          default: message53905391        - `id: string`53925393          Unique object identifier.53945395          The format and length of IDs may change over time.53965397        - `container: BetaContainer or null`53985399          Information about the container used in the request (for the code execution tool)54005401          - `id: string`54025403            Identifier for the container used in this request54045405          - `expires_at: string`54065407            The time at which the container will expire.54085409            format: date-time54105411          - `skills: array of BetaContainerSkill or null`54125413            Skills loaded in the container54145415            - `type: "anthropic" or "custom"`54165417              Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)54185419              - `"anthropic"`54205421              - `"custom"`54225423            - `skill_id: string`54245425              Skill ID54265427              maxLength: 64, minLength: 154285429            - `version: string`54305431              The resolved version: a skill version ID for custom skills.54325433              maxLength: 64, minLength: 154345435        - `content: array of BetaContentBlock`54365437          Content generated by the model.54385439          This is an array of content blocks, each of which has a `type` that determines its shape.54405441          Example:54425443          ```json5444          [{"type": "text", "text": "Hi, I'm Claude."}]5445          ```54465447          If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.54485449          For example, if the input `messages` were:54505451          ```json5452          [5453            {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},5454            {"role": "assistant", "content": "The best answer is ("}5455          ]5456          ```54575458          Then the response `content` might be:54595460          ```json5461          [{"type": "text", "text": "B)"}]5462          ```54635464          - `BetaTextBlock object`54655466            - `type: "text"`54675468              default: text54695470            - `citations: array of BetaTextCitation or null`54715472              Citations supporting the text block.54735474              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`.54755476              - `BetaCitationCharLocation object`54775478                - `type: "char_location"`54795480                  default: char_location54815482                - `cited_text: string`54835484                - `document_index: number`54855486                  minimum: 054875488                - `document_title: string or null`54895490                - `end_char_index: number`54915492                - `file_id: string or null`54935494                - `start_char_index: number`54955496                  minimum: 054975498              - `BetaCitationPageLocation object`54995500                - `type: "page_location"`55015502                  default: page_location55035504                - `cited_text: string`55055506                - `document_index: number`55075508                  minimum: 055095510                - `document_title: string or null`55115512                - `end_page_number: number`55135514                - `file_id: string or null`55155516                - `start_page_number: number`55175518                  minimum: 155195520              - `BetaCitationContentBlockLocation object`55215522                - `type: "content_block_location"`55235524                  default: content_block_location55255526                - `cited_text: string`55275528                  The full text of the cited block range, concatenated.55295530                  Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.55315532                - `document_index: number`55335534                  minimum: 055355536                - `document_title: string or null`55375538                - `end_block_index: number`55395540                  Exclusive 0-based end index of the cited block range in the source's `content` array.55415542                  Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.55435544                - `file_id: string or null`55455546                - `start_block_index: number`55475548                  0-based index of the first cited block in the source's `content` array.55495550                  minimum: 055515552              - `BetaCitationsWebSearchResultLocation object`55535554                - `type: "web_search_result_location"`55555556                  default: web_search_result_location55575558                - `cited_text: string`55595560                - `encrypted_index: string`55615562                - `title: string or null`55635564                  maxLength: 51255655566                - `url: string`55675568              - `BetaCitationSearchResultLocation object`55695570                - `type: "search_result_location"`55715572                  default: search_result_location55735574                - `cited_text: string`55755576                  The full text of the cited block range, concatenated.55775578                  Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.55795580                - `end_block_index: number`55815582                  Exclusive 0-based end index of the cited block range in the source's `content` array.55835584                  Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.55855586                - `search_result_index: number`55875588                  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.55895590                  Counted separately from `document_index`; server-side web search results are not included in this count.55915592                  minimum: 055935594                - `source: string`55955596                - `start_block_index: number`55975598                  0-based index of the first cited block in the source's `content` array.55995600                  minimum: 056015602                - `title: string or null`56035604            - `text: string`56055606              minLength: 056075608          - `BetaThinkingBlock object`56095610            - `type: "thinking"`56115612              default: thinking56135614            - `signature: string`56155616              A value used to verify that this thinking block was generated by Claude when it is passed back to the API.56175618              This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.56195620              See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.56215622            - `thinking: string`56235624              The text of Claude's thinking process for this block.56255626          - `BetaRedactedThinkingBlock object`56275628            - `type: "redacted_thinking"`56295630              default: redacted_thinking56315632            - `data: string`56335634              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.56355636              Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.56375638              See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.56395640          - `BetaToolUseBlock object`56415642            - `type: "tool_use"`56435644              default: tool_use56455646            - `id: string`56475648              pattern: ^[a-zA-Z0-9_-]+$56495650            - `input: map[unknown]`56515652            - `name: string`56535654              minLength: 156555656            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`56575658              - `BetaDirectCaller object`56595660                Tool invocation directly from the model.56615662                - `type: "direct"`56635664              - `BetaServerToolCaller object`56655666                Tool invocation generated by a server-side tool.56675668                - `type: "code_execution_20250825"`56695670                - `tool_id: string`56715672                  pattern: ^srvtoolu_[a-zA-Z0-9_]+$56735674              - `BetaServerToolCaller20260120 object`56755676                - `type: "code_execution_20260120"`56775678                - `tool_id: string`56795680                  pattern: ^srvtoolu_[a-zA-Z0-9_]+$56815682            - `toolset_name: optional string or null`56835684              For a toolset member tool_use, the toolset family.56855686              maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$56875688          - `BetaServerToolUseBlock object`56895690            - `type: "server_tool_use"`56915692              default: server_tool_use56935694            - `id: string`56955696              pattern: ^srvtoolu_[a-zA-Z0-9_]+$56975698            - `input: map[unknown]`56995700            - `name: "advisor" or "web_search" or "web_fetch" or 5 more`57015702              - `"advisor"`57035704              - `"web_search"`57055706              - `"web_fetch"`57075708              - `"code_execution"`57095710              - `"bash_code_execution"`57115712              - `"text_editor_code_execution"`57135714              - `"tool_search_tool_regex"`57155716              - `"tool_search_tool_bm25"`57175718            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`57195720              - `BetaDirectCaller object`57215722                Tool invocation directly from the model.57235724              - `BetaServerToolCaller object`57255726                Tool invocation generated by a server-side tool.57275728              - `BetaServerToolCaller20260120 object`57295730          - `BetaWebSearchToolResultBlock object`57315732            - `type: "web_search_tool_result"`57335734              default: web_search_tool_result57355736            - `content: BetaWebSearchToolResultBlockContent`57375738              - `BetaWebSearchToolResultError object`57395740                - `type: "web_search_tool_result_error"`57415742                  default: web_search_tool_result_error57435744                - `error_code: BetaWebSearchToolResultErrorCode`57455746                  - `"invalid_tool_input"`57475748                  - `"unavailable"`57495750                  - `"max_uses_exceeded"`57515752                  - `"too_many_requests"`57535754                  - `"query_too_long"`57555756                  - `"request_too_large"`57575758              - `array of BetaWebSearchResultBlock`57595760                - `type: "web_search_result"`57615762                  default: web_search_result57635764                - `encrypted_content: string`57655766                - `page_age: string or null`57675768                - `title: string`57695770                - `url: string`57715772            - `tool_use_id: string`57735774              pattern: ^srvtoolu_[a-zA-Z0-9_]+$57755776            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`57775778              - `BetaDirectCaller object`57795780                Tool invocation directly from the model.57815782              - `BetaServerToolCaller object`57835784                Tool invocation generated by a server-side tool.57855786              - `BetaServerToolCaller20260120 object`57875788          - `BetaWebFetchToolResultBlock object`57895790            - `type: "web_fetch_tool_result"`57915792              default: web_fetch_tool_result57935794            - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`57955796              - `BetaWebFetchToolResultErrorBlock object`57975798                - `type: "web_fetch_tool_result_error"`57995800                  default: web_fetch_tool_result_error58015802                - `error_code: BetaWebFetchToolResultErrorCode`58035804                  - `"invalid_tool_input"`58055806                  - `"url_too_long"`58075808                  - `"url_not_allowed"`58095810                  - `"url_not_in_prior_context"`58115812                  - `"url_not_accessible"`58135814                  - `"unsupported_content_type"`58155816                  - `"too_many_requests"`58175818                  - `"max_uses_exceeded"`58195820                  - `"unavailable"`58215822                  - `"content_too_large"`58235824              - `BetaWebFetchBlock object`58255826                - `type: "web_fetch_result"`58275828                  default: web_fetch_result58295830                - `content: BetaDocumentBlock`58315832                  - `type: "document"`58335834                    default: document58355836                  - `citations: BetaCitationConfig or null`58375838                    Citation configuration for the document58395840                    - `enabled: boolean`58415842                      default: false58435844                  - `source: BetaBase64PDFSource or BetaPlainTextSource`58455846                    - `BetaBase64PDFSource object`58475848                      - `type: "base64"`58495850                      - `data: string`58515852                        format: byte58535854                      - `media_type: "application/pdf"`58555856                    - `BetaPlainTextSource object`58575858                      - `type: "text"`58595860                      - `data: string`58615862                      - `media_type: "text/plain"`58635864                  - `title: string or null`58655866                    The title of the document58675868                - `retrieved_at: string or null`58695870                  ISO 8601 timestamp when the content was retrieved58715872                - `url: string`58735874                  Fetched content URL58755876            - `tool_use_id: string`58775878              pattern: ^srvtoolu_[a-zA-Z0-9_]+$58795880            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`58815882              - `BetaDirectCaller object`58835884                Tool invocation directly from the model.58855886              - `BetaServerToolCaller object`58875888                Tool invocation generated by a server-side tool.58895890              - `BetaServerToolCaller20260120 object`58915892          - `BetaAdvisorToolResultBlock object`58935894            - `type: "advisor_tool_result"`58955896              default: advisor_tool_result58975898            - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`58995900              - `BetaAdvisorToolResultError object`59015902                - `type: "advisor_tool_result_error"`59035904                  default: advisor_tool_result_error59055906                - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`59075908                  - `"max_uses_exceeded"`59095910                  - `"prompt_too_long"`59115912                  - `"too_many_requests"`59135914                  - `"overloaded"`59155916                  - `"unavailable"`59175918                  - `"execution_time_exceeded"`59195920                  - `"model_not_found"`59215922              - `BetaAdvisorResultBlock object`59235924                - `type: "advisor_result"`59255926                  default: advisor_result59275928                - `stop_reason: string or null`59295930                  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.59315932                - `text: string`59335934              - `BetaAdvisorRedactedResultBlock object`59355936                - `type: "advisor_redacted_result"`59375938                  default: advisor_redacted_result59395940                - `encrypted_content: string`59415942                  Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.59435944                - `stop_reason: string or null`59455946                  The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).59475948            - `tool_use_id: string`59495950              pattern: ^srvtoolu_[a-zA-Z0-9_]+$59515952          - `BetaCodeExecutionToolResultBlock object`59535954            - `type: "code_execution_tool_result"`59555956              default: code_execution_tool_result59575958            - `content: BetaCodeExecutionToolResultBlockContent`59595960              - `BetaCodeExecutionToolResultError object`59615962                - `type: "code_execution_tool_result_error"`59635964                  default: code_execution_tool_result_error59655966                - `error_code: BetaCodeExecutionToolResultErrorCode`59675968                  - `"invalid_tool_input"`59695970                  - `"unavailable"`59715972                  - `"too_many_requests"`59735974                  - `"execution_time_exceeded"`59755976              - `BetaCodeExecutionResultBlock object`59775978                - `type: "code_execution_result"`59795980                  default: code_execution_result59815982                - `content: array of BetaCodeExecutionOutputBlock`59835984                  - `type: "code_execution_output"`59855986                    default: code_execution_output59875988                  - `file_id: string`59895990                - `return_code: number`59915992                - `stderr: string`59935994                - `stdout: string`59955996              - `BetaEncryptedCodeExecutionResultBlock object`59975998                Code execution result with encrypted stdout for PFC + web_search results.59996000                - `type: "encrypted_code_execution_result"`60016002                  default: encrypted_code_execution_result60036004                - `content: array of BetaCodeExecutionOutputBlock`60056006                  - `type: "code_execution_output"`60076008                    default: code_execution_output60096010                  - `file_id: string`60116012                - `encrypted_stdout: string`60136014                - `return_code: number`60156016                - `stderr: string`60176018            - `tool_use_id: string`60196020              pattern: ^srvtoolu_[a-zA-Z0-9_]+$60216022          - `BetaBashCodeExecutionToolResultBlock object`60236024            - `type: "bash_code_execution_tool_result"`60256026              default: bash_code_execution_tool_result60276028            - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`60296030              - `BetaBashCodeExecutionToolResultError object`60316032                - `type: "bash_code_execution_tool_result_error"`60336034                  default: bash_code_execution_tool_result_error60356036                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`60376038                  - `"invalid_tool_input"`60396040                  - `"unavailable"`60416042                  - `"too_many_requests"`60436044                  - `"execution_time_exceeded"`60456046                  - `"output_file_too_large"`60476048              - `BetaBashCodeExecutionResultBlock object`60496050                - `type: "bash_code_execution_result"`60516052                  default: bash_code_execution_result60536054                - `content: array of BetaBashCodeExecutionOutputBlock`60556056                  - `type: "bash_code_execution_output"`60576058                    default: bash_code_execution_output60596060                  - `file_id: string`60616062                - `return_code: number`60636064                - `stderr: string`60656066                - `stdout: string`60676068            - `tool_use_id: string`60696070              pattern: ^srvtoolu_[a-zA-Z0-9_]+$60716072          - `BetaTextEditorCodeExecutionToolResultBlock object`60736074            - `type: "text_editor_code_execution_tool_result"`60756076              default: text_editor_code_execution_tool_result60776078            - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`60796080              - `BetaTextEditorCodeExecutionToolResultError object`60816082                - `type: "text_editor_code_execution_tool_result_error"`60836084                  default: text_editor_code_execution_tool_result_error60856086                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`60876088                  - `"invalid_tool_input"`60896090                  - `"unavailable"`60916092                  - `"too_many_requests"`60936094                  - `"execution_time_exceeded"`60956096                  - `"file_not_found"`60976098                - `error_message: string or null`60996100              - `BetaTextEditorCodeExecutionViewResultBlock object`61016102                - `type: "text_editor_code_execution_view_result"`61036104                  default: text_editor_code_execution_view_result61056106                - `content: string`61076108                - `file_type: "text" or "image" or "pdf"`61096110                  - `"text"`61116112                  - `"image"`61136114                  - `"pdf"`61156116                - `num_lines: number or null`61176118                - `start_line: number or null`61196120                - `total_lines: number or null`61216122              - `BetaTextEditorCodeExecutionCreateResultBlock object`61236124                - `type: "text_editor_code_execution_create_result"`61256126                  default: text_editor_code_execution_create_result61276128                - `is_file_update: boolean`61296130              - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`61316132                - `type: "text_editor_code_execution_str_replace_result"`61336134                  default: text_editor_code_execution_str_replace_result61356136                - `lines: array of string or null`61376138                - `new_lines: number or null`61396140                - `new_start: number or null`61416142                - `old_lines: number or null`61436144                - `old_start: number or null`61456146            - `tool_use_id: string`61476148              pattern: ^srvtoolu_[a-zA-Z0-9_]+$61496150          - `BetaToolSearchToolResultBlock object`61516152            - `type: "tool_search_tool_result"`61536154              default: tool_search_tool_result61556156            - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`61576158              - `BetaToolSearchToolResultError object`61596160                - `type: "tool_search_tool_result_error"`61616162                  default: tool_search_tool_result_error61636164                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`61656166                  - `"invalid_tool_input"`61676168                  - `"unavailable"`61696170                  - `"too_many_requests"`61716172                  - `"execution_time_exceeded"`61736174                - `error_message: string or null`61756176              - `BetaToolSearchToolSearchResultBlock object`61776178                - `type: "tool_search_tool_search_result"`61796180                  default: tool_search_tool_search_result61816182                - `tool_references: array of BetaToolReferenceBlock`61836184                  - `type: "tool_reference"`61856186                    default: tool_reference61876188                  - `tool_name: string`61896190                    maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$61916192            - `tool_use_id: string`61936194              pattern: ^srvtoolu_[a-zA-Z0-9_]+$61956196          - `BetaMCPToolUseBlock object`61976198            - `type: "mcp_tool_use"`61996200              default: mcp_tool_use62016202            - `id: string`62036204              pattern: ^[a-zA-Z0-9_-]+$62056206            - `input: map[unknown]`62076208            - `name: string`62096210              The name of the MCP tool62116212            - `server_name: string`62136214              The name of the MCP server62156216          - `BetaMCPToolResultBlock object`62176218            - `type: "mcp_tool_result"`62196220              default: mcp_tool_result62216222            - `content: string or array of BetaTextBlock`62236224              - `string`62256226              - `BetaMCPToolResultBlockContent = array of BetaTextBlock`62276228                - `type: "text"`62296230                  default: text62316232                - `citations: array of BetaTextCitation or null`62336234                  Citations supporting the text block.62356236                  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`.62376238                - `text: string`62396240                  minLength: 062416242            - `is_error: boolean`62436244              default: false62456246            - `tool_use_id: string`62476248              pattern: ^[a-zA-Z0-9_-]+$62496250          - `BetaContainerUploadBlock object`62516252            Response model for a file uploaded to the container.62536254            - `type: "container_upload"`62556256              default: container_upload62576258            - `file_id: string`62596260          - `BetaCompactionBlock object`62616262            A compaction block returned when autocompact is triggered.62636264            When content is None, it indicates the compaction failed to produce a valid6265            summary (e.g., malformed output from the model). Clients may round-trip6266            compaction blocks with null content; the server treats them as no-ops.62676268            - `type: "compaction"`62696270              default: compaction62716272            - `content: string or null`62736274              Summary of compacted content, or null if compaction failed62756276            - `encrypted_content: string or null`62776278              Opaque metadata from prior compaction, to be round-tripped verbatim62796280            - `signature: optional string or null`62816282              Signature over the summary, to be sent back with the block verbatim62836284          - `BetaFallbackBlock object`62856286            Marks the point in `content` where one model's output gives way to the next.62876288            One block appears per hop where a preceding model actually ran this turn and6289            declined. A turn where no preceding model ran and declined has no such6290            boundary and carries no block — the signal for whether a fallback model6291            served the response is the presence of a `fallback_message` entry in6292            `usage.iterations`, not this block.62936294            The block is treated like a server-tool content block for streaming: it6295            arrives via the standard `content_block_start` / `content_block_stop`6296            pair and carries no deltas.62976298            - `type: "fallback"`62996300              default: fallback63016302            - `from: BetaFallbackInfo`63036304              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, its `model` is that model's canonical id.63056306              - `model: Model`63076308                The model that will complete your prompt.63096310                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.63116312                - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`63136314                  The model that will complete your prompt.63156316                  See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.63176318                  - `"claude-fable-5-1"`63196320                    Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows63216322                  - `"claude-mythos-5-1"`63236324                    Our most capable model for cybersecurity and biology research, available through trusted access programs63256326                  - `"claude-sonnet-5"`63276328                    High-performance model for coding and agents63296330                  - `"claude-fable-5"`63316332                    Next generation of intelligence for the hardest knowledge work and coding problems63336334                  - `"claude-mythos-5"`63356336                    Most capable model for cybersecurity and biology research63376338                  - `"claude-opus-5"`63396340                    Powerful intelligence for long-running agents and coding63416342                  - `"claude-opus-4-8"`63436344                    Powerful intelligence for long-running agents and coding63456346                  - `"claude-opus-4-7"`63476348                    Powerful intelligence for long-running agents and coding63496350                  - `"claude-mythos-preview"`63516352                    New class of intelligence, strongest in coding and cybersecurity63536354                  - `"claude-opus-4-6"`63556356                    Powerful intelligence for long-running agents and coding63576358                  - `"claude-sonnet-4-6"`63596360                    Best combination of speed and intelligence63616362                  - `"claude-haiku-4-5"`63636364                    Fastest model with near-frontier intelligence63656366                  - `"claude-haiku-4-5-20251001"`63676368                    Fastest model with near-frontier intelligence63696370                  - `"claude-opus-4-5"`63716372                    Powerful intelligence for long-running agents and coding63736374                  - `"claude-opus-4-5-20251101"`63756376                    Powerful intelligence for long-running agents and coding63776378                  - `"claude-sonnet-4-5"`63796380                    High-performance model for agents and coding63816382                  - `"claude-sonnet-4-5-20250929"`63836384                    High-performance model for agents and coding63856386                - `string`63876388            - `to: BetaFallbackInfo`63896390              The fallback model producing the content that follows this block. Its `model` is always the canonical id.63916392            - `trigger: BetaFallbackRefusalTrigger`63936394              What caused the `from` model to hand over at this hop.63956396              - `type: "refusal"`63976398                default: refusal63996400              - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`64016402                The policy category that triggered a refusal.64036404                - `"cyber"`64056406                  The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.64076408                - `"bio"`64096410                  The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.64116412                - `"frontier_llm"`64136414                  The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.64156416                - `"reasoning_extraction"`64176418                  The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).64196420                - `"general_harms"`64216422                  The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.64236424        - `context_management: BetaContextManagementResponse or null`64256426          Context management response.64276428          Information about context management strategies applied during the request.64296430          - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`64316432            List of context management edits that were applied.64336434            - `BetaClearToolUses20250919EditResponse object`64356436              - `type: "clear_tool_uses_20250919"`64376438                The type of context management edit applied.64396440                default: clear_tool_uses_2025091964416442              - `cleared_input_tokens: number`64436444                Number of input tokens cleared by this edit.64456446                minimum: 064476448              - `cleared_tool_uses: number`64496450                Number of tool uses that were cleared.64516452                minimum: 064536454            - `BetaClearThinking20251015EditResponse object`64556456              - `type: "clear_thinking_20251015"`64576458                The type of context management edit applied.64596460                default: clear_thinking_2025101564616462              - `cleared_input_tokens: number`64636464                Number of input tokens cleared by this edit.64656466                minimum: 064676468              - `cleared_thinking_turns: number`64696470                Number of thinking turns that were cleared.64716472                minimum: 064736474        - `diagnostics: BetaDiagnostics or null`64756476          Response envelope for request-level diagnostics. Present (possibly6477          null) whenever the caller supplied `diagnostics` on the request.64786479          - `cache_miss_reason: BetaCacheMissModelChanged or BetaCacheMissSystemChanged or BetaCacheMissToolsChanged or 3 more or null`64806481            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.64826483            - `BetaCacheMissModelChanged object`64846485              - `type: "model_changed"`64866487                default: model_changed64886489              - `cache_missed_input_tokens: number`64906491                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.64926493            - `BetaCacheMissSystemChanged object`64946495              - `type: "system_changed"`64966497                default: system_changed64986499              - `cache_missed_input_tokens: number`65006501                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.65026503            - `BetaCacheMissToolsChanged object`65046505              - `type: "tools_changed"`65066507                default: tools_changed65086509              - `cache_missed_input_tokens: number`65106511                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.65126513            - `BetaCacheMissMessagesChanged object`65146515              - `type: "messages_changed"`65166517                default: messages_changed65186519              - `cache_missed_input_tokens: number`65206521                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.65226523            - `BetaCacheMissPreviousMessageNotFound object`65246525              - `type: "previous_message_not_found"`65266527                default: previous_message_not_found65286529            - `BetaCacheMissUnavailable object`65306531              - `type: "unavailable"`65326533                default: unavailable65346535        - `model: Model`65366537          The model that will complete your prompt.65386539          See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.65406541        - `role: "assistant"`65426543          Conversational role of the generated message.65446545          This will always be `"assistant"`.65466547          default: assistant65486549        - `stop_details: BetaRefusalStopDetails or null`65506551          Structured information about a refusal.65526553          - `type: "refusal"`65546555            default: refusal65566557          - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`65586559            The policy category that triggered a refusal.65606561            - `"cyber"`65626563              The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.65646565            - `"bio"`65666567              The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.65686569            - `"frontier_llm"`65706571              The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.65726573            - `"reasoning_extraction"`65746575              The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).65766577            - `"general_harms"`65786579              The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.65806581          - `explanation: string or null`65826583            Human-readable explanation of the refusal.65846585            This text is not guaranteed to be stable. `null` when no explanation is available for the category.65866587          - `fallback_credit_token: string or null`65886589            Opaque code that refunds the cache-miss cost when retrying this refused6590            request on the fallback model. Pass it as `fallback_credit_token` on the6591            retry request. Expires 5 minutes after the refusal.65926593            The retry is sent either with the same request body (`system`, `messages`,6594            `tools`, and other render-shaping fields), or with the same body plus one6595            appended `assistant` message whose content is the partial text (with any6596            trailing whitespace stripped from the final text block) and paired6597            server-tool blocks from this refusal — which also authorizes that6598            appended turn as an assistant-prefill continuation on models that otherwise6599            disallow prefill. A token minted mid-server-tool-loop whose partial content6600            was continuable may only be redeemed the second way — if a same-body retry6601            is rejected with a 400 saying the token must be redeemed by continuing the6602            partial response, retry the second way instead. Either way: same workspace,6603            same platform; a mismatch is a 400. Resending a token for an already-warm6604            prefix is permitted but yields no additional credit.66056606            `null` when the refused model isn't eligible for a fallback credit.66076608          - `fallback_has_prefill_claim: boolean or null`66096610            Whether the accompanying `fallback_credit_token` may be redeemed with the6611            appended-assistant retry form. Only set when `fallback_credit_token` is6612            present.66136614            `true`: retry by resending the same request body plus one appended6615            `assistant` message whose content is this response's `content` with any6616            trailing whitespace stripped from the final text block and unpaired6617            `tool_use` blocks omitted (the same appended-turn shape described on6618            `fallback_credit_token`), with the token attached. `false`: retry by6619            resending the original request body unchanged, with the token attached —6620            the appended-assistant form is not available for this refusal (no6621            continuable partial content, or the request uses `output_format` or a6622            `tool_choice` that forces tool use). One exception: when the request used6623            `output_format` or a forced `tool_choice` and the refusal arrived after6624            server tools (including MCP connector tools) had already executed, the6625            token may not be redeemable by either retry form; if the exact-body retry6626            is then rejected with a 400 saying the token must be redeemed by6627            continuing the partial response, discard the token and retry without it.66286629            Advisory: if an appended-assistant retry is rejected with a 400 despite6630            `true`, fall back to resending the original request body with the token.66316632          - `recommended_model: string or null`66336634            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.66356636        - `stop_reason: BetaStopReason or null`66376638          The reason that we stopped.66396640          This may be one the following values:66416642          * `"end_turn"`: the model reached a natural stopping point6643          * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum6644          * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated6645          * `"tool_use"`: the model invoked one or more tools6646          * `"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.6647          * `"refusal"`: when streaming classifiers intervene to handle potential policy violations6648          * `"model_context_window_exceeded"`: we exceeded the model's context window66496650          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.66516652          - `"end_turn"`66536654          - `"max_tokens"`66556656          - `"stop_sequence"`66576658          - `"tool_use"`66596660          - `"pause_turn"`66616662          - `"compaction"`66636664          - `"refusal"`66656666          - `"model_context_window_exceeded"`66676668        - `stop_sequence: string or null`66696670          Which custom stop sequence was generated, if any.66716672          This value will be a non-null string if one of your custom stop sequences was generated.66736674        - `usage: BetaUsage`66756676          Billing and rate-limit usage.66776678          Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.66796680          Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.66816682          For example, `output_tokens` will be non-zero, even for an empty string response from Claude.66836684          Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.66856686          - `cache_creation: BetaCacheCreation or null`66876688            Breakdown of cached tokens by TTL66896690            - `ephemeral_1h_input_tokens: number`66916692              The number of input tokens used to create the 1 hour cache entry.66936694              default: 0, minimum: 066956696            - `ephemeral_5m_input_tokens: number`66976698              The number of input tokens used to create the 5 minute cache entry.66996700              default: 0, minimum: 067016702          - `cache_creation_input_tokens: number or null`67036704            The number of input tokens used to create the cache entry.67056706            minimum: 067076708          - `cache_read_input_tokens: number or null`67096710            The number of input tokens read from the cache.67116712            minimum: 067136714          - `fallback_credit: BetaFallbackCreditUsage or null`67156716            Outcome of the `fallback_credit_token` presented on this request.67176718            - `status: BetaFallbackCreditRedeemed or BetaFallbackCreditNotApplied`67196720              Whether the fallback-credit reprice was applied to this response's billing.67216722              A union discriminated on `type`. `redeemed`: the retry is billed as if6723              the conversation had been on the retry model all along — including when the6724              resulting shift is zero because there was nothing to move. `not_applied`:6725              no reprice was applied; the arm's `reason` says why.67266727              - `BetaFallbackCreditRedeemed object`67286729                The reprice was applied: the retry is billed as if the conversation6730                had been on the retry model all along.67316732                - `type: "redeemed"`67336734                  default: redeemed67356736              - `BetaFallbackCreditNotApplied object`67376738                No reprice was applied; `reason` says why.67396740                - `type: "not_applied"`67416742                  default: not_applied67436744                - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`67456746                  Why the reprice was not applied.67476748                  A closed enum; additions to the redemption-check vocabulary arrive as6749                  deliberate schema updates.67506751                  - `"body_mismatch"`67526753                  - `"continuation_excluded"`67546755                  - `"continuation_only"`67566757                  - `"expired"`67586759                  - `"invalid_target_model"`67606761                  - `"not_enabled"`67626763                  - `"reprice_unavailable"`67646765                  - `"temporarily_unavailable"`67666767                  - `"variant_fields_present"`67686769                  - `"wrong_organization"`67706771                  - `"wrong_platform"`67726773                  - `"wrong_workspace"`67746775                - `remove_to_redeem: optional array of string or null`67766777                  Request fields to remove before retrying, so the retry can redeem this6778                  token.67796780                  Present exactly when `reason` is `variant_fields_present` — never null,6781                  never an empty array; absent otherwise. Fields are named only from your own request, and only after6782                  the sealed variant hash matched. A served best-effort retry has already6783                  been billed at normal price; nothing redeems retroactively, but a corrected6784                  re-send inside the token's five-minute window can still redeem.67856786          - `inference_geo: string or null`67876788            The geographic region where inference was performed for this request.67896790          - `input_tokens: number`67916792            The number of input tokens which were used.67936794            minimum: 067956796          - `iterations: BetaIterationsUsage or null`67976798            Per-iteration token usage breakdown.67996800            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:68016802            - Determine which iterations exceeded long context thresholds (>=200k tokens)6803            - Calculate the context window size from the last `message` entry6804            - Understand token accumulation across server-side tool use loops68056806            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.68076808            - `BetaMessageIterationUsage object`68096810              Token usage for a sampling iteration.68116812              - `type: "message"`68136814                Usage for a sampling iteration68156816                default: message68176818              - `cache_creation: BetaCacheCreation or null`68196820                Breakdown of cached tokens by TTL68216822              - `cache_creation_input_tokens: number`68236824                The number of input tokens used to create the cache entry.68256826                default: 0, minimum: 068276828              - `cache_read_input_tokens: number`68296830                The number of input tokens read from the cache.68316832                default: 0, minimum: 068336834              - `input_tokens: number`68356836                The number of input tokens which were used.68376838                minimum: 068396840              - `model: Model or null`68416842                The model that will complete your prompt.68436844                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.68456846              - `output_tokens: number`68476848                The number of output tokens which were used.68496850                minimum: 068516852            - `BetaCompactionIterationUsage object`68536854              Token usage for a compaction iteration.68556856              - `type: "compaction"`68576858                Usage for a compaction iteration68596860                default: compaction68616862              - `cache_creation: BetaCacheCreation or null`68636864                Breakdown of cached tokens by TTL68656866              - `cache_creation_input_tokens: number`68676868                The number of input tokens used to create the cache entry.68696870                default: 0, minimum: 068716872              - `cache_read_input_tokens: number`68736874                The number of input tokens read from the cache.68756876                default: 0, minimum: 068776878              - `input_tokens: number`68796880                The number of input tokens which were used.68816882                minimum: 068836884              - `output_tokens: number`68856886                The number of output tokens which were used.68876888                minimum: 068896890            - `BetaAdvisorMessageIterationUsage object`68916892              Token usage for an advisor sub-inference iteration.68936894              - `type: "advisor_message"`68956896                Usage for an advisor sub-inference iteration68976898                default: advisor_message68996900              - `cache_creation: BetaCacheCreation or null`69016902                Breakdown of cached tokens by TTL69036904              - `cache_creation_input_tokens: number`69056906                The number of input tokens used to create the cache entry.69076908                default: 0, minimum: 069096910              - `cache_read_input_tokens: number`69116912                The number of input tokens read from the cache.69136914                default: 0, minimum: 069156916              - `input_tokens: number`69176918                The number of input tokens which were used.69196920                minimum: 069216922              - `model: Model`69236924                The model that will complete your prompt.69256926                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.69276928              - `output_tokens: number`69296930                The number of output tokens which were used.69316932                minimum: 069336934            - `BetaFallbackMessageIterationUsage object`69356936              Token usage for the fallback-model attempt of a server-side fallback request.69376938              The terminal entry of a fallback-served turn: when a fallback hop's6939              output is the returned message, the entry for the iteration that6940              completed it carries this type in place of `message`. A declined hop6941              and the serving hop's earlier tool-loop iterations produce `message`6942              entries. Whether a fallback model served the response is signalled by6943              the presence of this entry in `usage.iterations`.69446945              - `type: "fallback_message"`69466947                Usage for the fallback-model attempt that served the response69486949                default: fallback_message69506951              - `cache_creation: BetaCacheCreation or null`69526953                Breakdown of cached tokens by TTL69546955              - `cache_creation_input_tokens: number`69566957                The number of input tokens used to create the cache entry.69586959                default: 0, minimum: 069606961              - `cache_read_input_tokens: number`69626963                The number of input tokens read from the cache.69646965                default: 0, minimum: 069666967              - `input_tokens: number`69686969                The number of input tokens which were used.69706971                minimum: 069726973              - `model: Model`69746975                The model that will complete your prompt.69766977                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.69786979              - `output_tokens: number`69806981                The number of output tokens which were used.69826983                minimum: 069846985          - `output_tokens: number`69866987            The number of output tokens which were used.69886989            minimum: 069906991          - `output_tokens_details: BetaOutputTokensDetails or null`69926993            Breakdown of output tokens by category.69946995            `output_tokens` remains the inclusive, authoritative total used for billing.6996            This object provides a read-only decomposition for observability — for example,6997            how many of the billed output tokens were spent on internal reasoning that may6998            have been summarized before being returned to you.69997000            - `thinking_tokens: number`70017002              Number of output tokens the model generated as internal reasoning, including7003              the thinking-block delimiter tokens.70047005              Reflects the raw reasoning the model produced, not the (possibly shorter)7006              summarized thinking text returned in the response body. Computed by7007              re-tokenizing the raw reasoning text, so it may differ from the model's exact7008              generation count by a small number of tokens. Always ≤ `output_tokens`;7009              `output_tokens - thinking_tokens` approximates the non-reasoning output.70107011              default: 0, minimum: 070127013          - `server_tool_use: BetaServerToolUsage or null`70147015            The number of server tool requests.70167017            - `web_fetch_requests: number`70187019              The number of web fetch tool requests.70207021              default: 0, minimum: 070227023            - `web_search_requests: number`70247025              The number of web search tool requests.70267027              default: 0, minimum: 070287029          - `service_tier: "standard" or "priority" or "batch" or null`70307031            If the request used the priority, standard, or batch tier.70327033            - `"standard"`70347035            - `"priority"`70367037            - `"batch"`70387039          - `speed: "standard" or "fast" or null`70407041            Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.70427043            - `"standard"`70447045            - `"fast"`70467047        - `input_transformations: optional array of BetaInputTransformation or null`70487049          Changes the API made to the request's input before showing it to the model,7050          and blocks that failed a binding check but were left unchanged: one entry per7051          block, in request order. Two entry types today. `thinking_dropped` — a7052          `thinking`, `redacted_thinking` or `connector_text` block from the request's7053          `messages` that was removed from the prompt instead of being shown to the7054          model because it failed a binding check. `thinking_mismatch_allowed` — a7055          `thinking` or `redacted_thinking` block that failed the conversation check7056          (the conversation before it differs from the one it was created in, or it7057          carries no record of one on a model that requires it) and was shown to the7058          model all the same, because that check is not enforced for this request.7059          More entry types may be added over time; ignore types you do not recognize.70607061          Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on7062          every such response from a model that supports extended thinking, as `[]`7063          when there is no entry to report; without the beta, blocks are removed or7064          left in place all the same but nothing is reported. Removed blocks contribute7065          nothing to `usage.input_tokens`; blocks left in place count as sent. When7066          streaming, the array is final in `message_start`; the final `message_delta`7067          event carries it only when a server-side model fallback happened mid-stream,7068          in which case it holds the serving model's entries and replaces the one in7069          `message_start`.70707071          - `BetaThinkingDroppedInputTransformation object`70727073            - `type: "thinking_dropped"`70747075              Always `thinking_dropped` for this entry type.70767077              default: thinking_dropped70787079            - `path: string`70807081              Where the removed block was in your request, as `messages.{i}.content.{j}`:7082              `i` indexes the `messages` array you sent and `j` that message's `content`7083              array — the same form error messages use.70847085            - `reason: "model_binding_mismatch" or "prefix_binding_mismatch" or "organization_binding_mismatch" or "end_user_binding_mismatch"`70867087              Which binding check removed the block: `model_binding_mismatch` — it was7088              created by a model whose reasoning the requested model may not read;7089              `prefix_binding_mismatch` — the conversation before it differs from the7090              conversation it was created in (the rest of that turn's consecutive thinking7091              blocks are removed with it, each with this reason);7092              `organization_binding_mismatch` — it was created under a different7093              organization (an Anthropic organization, AWS account or Google Cloud project)7094              and this organization is not one of its additional organizations;7095              `end_user_binding_mismatch` — it was created for a different end user, or7096              was removed by the consumer-organization binding. A block that would fail7097              several checks reports one reason, in this order of precedence:7098              `organization_binding_mismatch`, `end_user_binding_mismatch`,7099              `model_binding_mismatch`, `prefix_binding_mismatch`.71007101              - `"model_binding_mismatch"`71027103              - `"prefix_binding_mismatch"`71047105              - `"organization_binding_mismatch"`71067107              - `"end_user_binding_mismatch"`71087109          - `BetaThinkingMismatchAllowedInputTransformation object`71107111            - `type: "thinking_mismatch_allowed"`71127113              Always `thinking_mismatch_allowed` for this entry type.71147115              default: thinking_mismatch_allowed71167117            - `path: string`71187119              Where the block is in your request, as `messages.{i}.content.{j}`:7120              `i` indexes the `messages` array you sent and `j` that message's `content`7121              array — the same form error messages use.71227123            - `reason: "model_binding_mismatch" or "prefix_binding_mismatch" or "organization_binding_mismatch" or "end_user_binding_mismatch"`71247125              Which binding check the block failed; the block was shown to the model all7126              the same. Always `prefix_binding_mismatch` today — the conversation before7127              the block differs from the conversation it was created in, or the block7128              carries no record of one on a model that requires it. Were the check7129              enforced for this request, the block would have been removed or the request7130              rejected (`thinking.block_binding.prefix_mismatch_behavior`). A removal also7131              takes the rest of that turn's consecutive thinking blocks, whereas here each7132              block is checked on its own, so `thinking_mismatch_allowed` entries are a7133              lower bound on what enforcement would remove.71347135              - `"model_binding_mismatch"`71367137              - `"prefix_binding_mismatch"`71387139              - `"organization_binding_mismatch"`71407141              - `"end_user_binding_mismatch"`71427143    - `BetaMessageBatchErroredResult object`71447145      - `type: "errored"`71467147        default: errored71487149      - `error: BetaErrorResponse`71507151        - `type: "error"`71527153          default: error71547155        - `error: BetaError`71567157          - `BetaInvalidRequestError object`71587159            - `type: "invalid_request_error"`71607161              default: invalid_request_error71627163            - `message: string`71647165              default: Invalid request71667167          - `BetaAuthenticationError object`71687169            - `type: "authentication_error"`71707171              default: authentication_error71727173            - `message: string`71747175              default: Authentication error71767177          - `BetaBillingError object`71787179            - `type: "billing_error"`71807181              default: billing_error71827183            - `message: string`71847185              default: Billing error71867187          - `BetaPermissionError object`71887189            - `type: "permission_error"`71907191              default: permission_error71927193            - `message: string`71947195              default: Permission denied71967197          - `BetaNotFoundError object`71987199            - `type: "not_found_error"`72007201              default: not_found_error72027203            - `message: string`72047205              default: Not found72067207          - `BetaRateLimitError object`72087209            - `type: "rate_limit_error"`72107211              default: rate_limit_error72127213            - `message: string`72147215              default: Rate limited72167217          - `BetaGatewayTimeoutError object`72187219            - `type: "timeout_error"`72207221              default: timeout_error72227223            - `message: string`72247225              default: Request timeout72267227          - `BetaAPIError object`72287229            - `type: "api_error"`72307231              default: api_error72327233            - `message: string`72347235              default: Internal server error72367237          - `BetaOverloadedError object`72387239            - `type: "overloaded_error"`72407241              default: overloaded_error72427243            - `message: string`72447245              default: Overloaded72467247        - `request_id: string or null`72487249    - `BetaMessageBatchCanceledResult object`72507251      - `type: "canceled"`72527253        default: canceled72547255    - `BetaMessageBatchExpiredResult object`72567257      - `type: "expired"`72587259        default: expired72607261### Example72627263```bash7264curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/results \7265    -H 'anthropic-version: 2023-06-01' \7266    -H 'anthropic-beta: message-batches-2024-09-24' \7267    -H "X-Api-Key: $ANTHROPIC_API_KEY"7268```72697270## Domain types72717272### Beta Deleted Message Batch72737274- `BetaDeletedMessageBatch object`72757276  - `type: "message_batch_deleted"`72777278    Deleted object type.72797280    For Message Batches, this is always `"message_batch_deleted"`.72817282    default: message_batch_deleted72837284  - `id: string`72857286    ID of the Message Batch.72877288### Beta Message Batch72897290- `BetaMessageBatch object`72917292  - `type: "message_batch"`72937294    Object type.72957296    For Message Batches, this is always `"message_batch"`.72977298    default: message_batch72997300  - `id: string`73017302    Unique object identifier.73037304    The format and length of IDs may change over time.73057306  - `archived_at: string or null`73077308    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.73097310    format: date-time73117312  - `cancel_initiated_at: string or null`73137314    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.73157316    format: date-time73177318  - `created_at: string`73197320    RFC 3339 datetime string representing the time at which the Message Batch was created.73217322    format: date-time73237324  - `ended_at: string or null`73257326    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.73277328    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.73297330    format: date-time73317332  - `expires_at: string`73337334    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.73357336    format: date-time73377338  - `processing_status: "in_progress" or "canceling" or "ended"`73397340    Processing status of the Message Batch.73417342    - `"in_progress"`73437344    - `"canceling"`73457346    - `"ended"`73477348  - `request_counts: BetaMessageBatchRequestCounts`73497350    Tallies requests within the Message Batch, categorized by their status.73517352    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.73537354    - `canceled: number`73557356      Number of requests in the Message Batch that have been canceled.73577358      This is zero until processing of the entire Message Batch has ended.73597360      default: 073617362    - `errored: number`73637364      Number of requests in the Message Batch that encountered an error.73657366      This is zero until processing of the entire Message Batch has ended.73677368      default: 073697370    - `expired: number`73717372      Number of requests in the Message Batch that have expired.73737374      This is zero until processing of the entire Message Batch has ended.73757376      default: 073777378    - `processing: number`73797380      Number of requests in the Message Batch that are processing.73817382      default: 073837384    - `succeeded: number`73857386      Number of requests in the Message Batch that have completed successfully.73877388      This is zero until processing of the entire Message Batch has ended.73897390      default: 073917392  - `results_url: string or null`73937394    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.73957396    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.73977398### Beta Message Batch Canceled Result73997400- `BetaMessageBatchCanceledResult object`74017402  - `type: "canceled"`74037404    default: canceled74057406### Beta Message Batch Errored Result74077408- `BetaMessageBatchErroredResult object`74097410  - `type: "errored"`74117412    default: errored74137414  - `error: BetaErrorResponse`74157416    - `type: "error"`74177418      default: error74197420    - `error: BetaError`74217422      - `BetaInvalidRequestError object`74237424        - `type: "invalid_request_error"`74257426          default: invalid_request_error74277428        - `message: string`74297430          default: Invalid request74317432      - `BetaAuthenticationError object`74337434        - `type: "authentication_error"`74357436          default: authentication_error74377438        - `message: string`74397440          default: Authentication error74417442      - `BetaBillingError object`74437444        - `type: "billing_error"`74457446          default: billing_error74477448        - `message: string`74497450          default: Billing error74517452      - `BetaPermissionError object`74537454        - `type: "permission_error"`74557456          default: permission_error74577458        - `message: string`74597460          default: Permission denied74617462      - `BetaNotFoundError object`74637464        - `type: "not_found_error"`74657466          default: not_found_error74677468        - `message: string`74697470          default: Not found74717472      - `BetaRateLimitError object`74737474        - `type: "rate_limit_error"`74757476          default: rate_limit_error74777478        - `message: string`74797480          default: Rate limited74817482      - `BetaGatewayTimeoutError object`74837484        - `type: "timeout_error"`74857486          default: timeout_error74877488        - `message: string`74897490          default: Request timeout74917492      - `BetaAPIError object`74937494        - `type: "api_error"`74957496          default: api_error74977498        - `message: string`74997500          default: Internal server error75017502      - `BetaOverloadedError object`75037504        - `type: "overloaded_error"`75057506          default: overloaded_error75077508        - `message: string`75097510          default: Overloaded75117512    - `request_id: string or null`75137514### Beta Message Batch Expired Result75157516- `BetaMessageBatchExpiredResult object`75177518  - `type: "expired"`75197520    default: expired75217522### Beta Message Batch Individual Response75237524- `BetaMessageBatchIndividualResponse object`75257526  This is a single line in the response `.jsonl` file and does not represent the response as a whole.75277528  - `custom_id: string`75297530    Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.75317532    Must be unique for each request within the Message Batch.75337534  - `result: BetaMessageBatchResult`75357536    Processing result for this request.75377538    Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.75397540    - `BetaMessageBatchSucceededResult object`75417542      - `type: "succeeded"`75437544        default: succeeded75457546      - `message: BetaMessage`75477548        - `type: "message"`75497550          Object type.75517552          For Messages, this is always `"message"`.75537554          default: message75557556        - `id: string`75577558          Unique object identifier.75597560          The format and length of IDs may change over time.75617562        - `container: BetaContainer or null`75637564          Information about the container used in the request (for the code execution tool)75657566          - `id: string`75677568            Identifier for the container used in this request75697570          - `expires_at: string`75717572            The time at which the container will expire.75737574            format: date-time75757576          - `skills: array of BetaContainerSkill or null`75777578            Skills loaded in the container75797580            - `type: "anthropic" or "custom"`75817582              Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)75837584              - `"anthropic"`75857586              - `"custom"`75877588            - `skill_id: string`75897590              Skill ID75917592              maxLength: 64, minLength: 175937594            - `version: string`75957596              The resolved version: a skill version ID for custom skills.75977598              maxLength: 64, minLength: 175997600        - `content: array of BetaContentBlock`76017602          Content generated by the model.76037604          This is an array of content blocks, each of which has a `type` that determines its shape.76057606          Example:76077608          ```json7609          [{"type": "text", "text": "Hi, I'm Claude."}]7610          ```76117612          If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.76137614          For example, if the input `messages` were:76157616          ```json7617          [7618            {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},7619            {"role": "assistant", "content": "The best answer is ("}7620          ]7621          ```76227623          Then the response `content` might be:76247625          ```json7626          [{"type": "text", "text": "B)"}]7627          ```76287629          - `BetaTextBlock object`76307631            - `type: "text"`76327633              default: text76347635            - `citations: array of BetaTextCitation or null`76367637              Citations supporting the text block.76387639              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`.76407641              - `BetaCitationCharLocation object`76427643                - `type: "char_location"`76447645                  default: char_location76467647                - `cited_text: string`76487649                - `document_index: number`76507651                  minimum: 076527653                - `document_title: string or null`76547655                - `end_char_index: number`76567657                - `file_id: string or null`76587659                - `start_char_index: number`76607661                  minimum: 076627663              - `BetaCitationPageLocation object`76647665                - `type: "page_location"`76667667                  default: page_location76687669                - `cited_text: string`76707671                - `document_index: number`76727673                  minimum: 076747675                - `document_title: string or null`76767677                - `end_page_number: number`76787679                - `file_id: string or null`76807681                - `start_page_number: number`76827683                  minimum: 176847685              - `BetaCitationContentBlockLocation object`76867687                - `type: "content_block_location"`76887689                  default: content_block_location76907691                - `cited_text: string`76927693                  The full text of the cited block range, concatenated.76947695                  Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.76967697                - `document_index: number`76987699                  minimum: 077007701                - `document_title: string or null`77027703                - `end_block_index: number`77047705                  Exclusive 0-based end index of the cited block range in the source's `content` array.77067707                  Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.77087709                - `file_id: string or null`77107711                - `start_block_index: number`77127713                  0-based index of the first cited block in the source's `content` array.77147715                  minimum: 077167717              - `BetaCitationsWebSearchResultLocation object`77187719                - `type: "web_search_result_location"`77207721                  default: web_search_result_location77227723                - `cited_text: string`77247725                - `encrypted_index: string`77267727                - `title: string or null`77287729                  maxLength: 51277307731                - `url: string`77327733              - `BetaCitationSearchResultLocation object`77347735                - `type: "search_result_location"`77367737                  default: search_result_location77387739                - `cited_text: string`77407741                  The full text of the cited block range, concatenated.77427743                  Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.77447745                - `end_block_index: number`77467747                  Exclusive 0-based end index of the cited block range in the source's `content` array.77487749                  Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.77507751                - `search_result_index: number`77527753                  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.77547755                  Counted separately from `document_index`; server-side web search results are not included in this count.77567757                  minimum: 077587759                - `source: string`77607761                - `start_block_index: number`77627763                  0-based index of the first cited block in the source's `content` array.77647765                  minimum: 077667767                - `title: string or null`77687769            - `text: string`77707771              minLength: 077727773          - `BetaThinkingBlock object`77747775            - `type: "thinking"`77767777              default: thinking77787779            - `signature: string`77807781              A value used to verify that this thinking block was generated by Claude when it is passed back to the API.77827783              This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.77847785              See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.77867787            - `thinking: string`77887789              The text of Claude's thinking process for this block.77907791          - `BetaRedactedThinkingBlock object`77927793            - `type: "redacted_thinking"`77947795              default: redacted_thinking77967797            - `data: string`77987799              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.78007801              Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.78027803              See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.78047805          - `BetaToolUseBlock object`78067807            - `type: "tool_use"`78087809              default: tool_use78107811            - `id: string`78127813              pattern: ^[a-zA-Z0-9_-]+$78147815            - `input: map[unknown]`78167817            - `name: string`78187819              minLength: 178207821            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`78227823              - `BetaDirectCaller object`78247825                Tool invocation directly from the model.78267827                - `type: "direct"`78287829              - `BetaServerToolCaller object`78307831                Tool invocation generated by a server-side tool.78327833                - `type: "code_execution_20250825"`78347835                - `tool_id: string`78367837                  pattern: ^srvtoolu_[a-zA-Z0-9_]+$78387839              - `BetaServerToolCaller20260120 object`78407841                - `type: "code_execution_20260120"`78427843                - `tool_id: string`78447845                  pattern: ^srvtoolu_[a-zA-Z0-9_]+$78467847            - `toolset_name: optional string or null`78487849              For a toolset member tool_use, the toolset family.78507851              maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$78527853          - `BetaServerToolUseBlock object`78547855            - `type: "server_tool_use"`78567857              default: server_tool_use78587859            - `id: string`78607861              pattern: ^srvtoolu_[a-zA-Z0-9_]+$78627863            - `input: map[unknown]`78647865            - `name: "advisor" or "web_search" or "web_fetch" or 5 more`78667867              - `"advisor"`78687869              - `"web_search"`78707871              - `"web_fetch"`78727873              - `"code_execution"`78747875              - `"bash_code_execution"`78767877              - `"text_editor_code_execution"`78787879              - `"tool_search_tool_regex"`78807881              - `"tool_search_tool_bm25"`78827883            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`78847885              - `BetaDirectCaller object`78867887                Tool invocation directly from the model.78887889              - `BetaServerToolCaller object`78907891                Tool invocation generated by a server-side tool.78927893              - `BetaServerToolCaller20260120 object`78947895          - `BetaWebSearchToolResultBlock object`78967897            - `type: "web_search_tool_result"`78987899              default: web_search_tool_result79007901            - `content: BetaWebSearchToolResultBlockContent`79027903              - `BetaWebSearchToolResultError object`79047905                - `type: "web_search_tool_result_error"`79067907                  default: web_search_tool_result_error79087909                - `error_code: BetaWebSearchToolResultErrorCode`79107911                  - `"invalid_tool_input"`79127913                  - `"unavailable"`79147915                  - `"max_uses_exceeded"`79167917                  - `"too_many_requests"`79187919                  - `"query_too_long"`79207921                  - `"request_too_large"`79227923              - `array of BetaWebSearchResultBlock`79247925                - `type: "web_search_result"`79267927                  default: web_search_result79287929                - `encrypted_content: string`79307931                - `page_age: string or null`79327933                - `title: string`79347935                - `url: string`79367937            - `tool_use_id: string`79387939              pattern: ^srvtoolu_[a-zA-Z0-9_]+$79407941            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`79427943              - `BetaDirectCaller object`79447945                Tool invocation directly from the model.79467947              - `BetaServerToolCaller object`79487949                Tool invocation generated by a server-side tool.79507951              - `BetaServerToolCaller20260120 object`79527953          - `BetaWebFetchToolResultBlock object`79547955            - `type: "web_fetch_tool_result"`79567957              default: web_fetch_tool_result79587959            - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`79607961              - `BetaWebFetchToolResultErrorBlock object`79627963                - `type: "web_fetch_tool_result_error"`79647965                  default: web_fetch_tool_result_error79667967                - `error_code: BetaWebFetchToolResultErrorCode`79687969                  - `"invalid_tool_input"`79707971                  - `"url_too_long"`79727973                  - `"url_not_allowed"`79747975                  - `"url_not_in_prior_context"`79767977                  - `"url_not_accessible"`79787979                  - `"unsupported_content_type"`79807981                  - `"too_many_requests"`79827983                  - `"max_uses_exceeded"`79847985                  - `"unavailable"`79867987                  - `"content_too_large"`79887989              - `BetaWebFetchBlock object`79907991                - `type: "web_fetch_result"`79927993                  default: web_fetch_result79947995                - `content: BetaDocumentBlock`79967997                  - `type: "document"`79987999                    default: document80008001                  - `citations: BetaCitationConfig or null`80028003                    Citation configuration for the document80048005                    - `enabled: boolean`80068007                      default: false80088009                  - `source: BetaBase64PDFSource or BetaPlainTextSource`80108011                    - `BetaBase64PDFSource object`80128013                      - `type: "base64"`80148015                      - `data: string`80168017                        format: byte80188019                      - `media_type: "application/pdf"`80208021                    - `BetaPlainTextSource object`80228023                      - `type: "text"`80248025                      - `data: string`80268027                      - `media_type: "text/plain"`80288029                  - `title: string or null`80308031                    The title of the document80328033                - `retrieved_at: string or null`80348035                  ISO 8601 timestamp when the content was retrieved80368037                - `url: string`80388039                  Fetched content URL80408041            - `tool_use_id: string`80428043              pattern: ^srvtoolu_[a-zA-Z0-9_]+$80448045            - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`80468047              - `BetaDirectCaller object`80488049                Tool invocation directly from the model.80508051              - `BetaServerToolCaller object`80528053                Tool invocation generated by a server-side tool.80548055              - `BetaServerToolCaller20260120 object`80568057          - `BetaAdvisorToolResultBlock object`80588059            - `type: "advisor_tool_result"`80608061              default: advisor_tool_result80628063            - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`80648065              - `BetaAdvisorToolResultError object`80668067                - `type: "advisor_tool_result_error"`80688069                  default: advisor_tool_result_error80708071                - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`80728073                  - `"max_uses_exceeded"`80748075                  - `"prompt_too_long"`80768077                  - `"too_many_requests"`80788079                  - `"overloaded"`80808081                  - `"unavailable"`80828083                  - `"execution_time_exceeded"`80848085                  - `"model_not_found"`80868087              - `BetaAdvisorResultBlock object`80888089                - `type: "advisor_result"`80908091                  default: advisor_result80928093                - `stop_reason: string or null`80948095                  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.80968097                - `text: string`80988099              - `BetaAdvisorRedactedResultBlock object`81008101                - `type: "advisor_redacted_result"`81028103                  default: advisor_redacted_result81048105                - `encrypted_content: string`81068107                  Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.81088109                - `stop_reason: string or null`81108111                  The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).81128113            - `tool_use_id: string`81148115              pattern: ^srvtoolu_[a-zA-Z0-9_]+$81168117          - `BetaCodeExecutionToolResultBlock object`81188119            - `type: "code_execution_tool_result"`81208121              default: code_execution_tool_result81228123            - `content: BetaCodeExecutionToolResultBlockContent`81248125              - `BetaCodeExecutionToolResultError object`81268127                - `type: "code_execution_tool_result_error"`81288129                  default: code_execution_tool_result_error81308131                - `error_code: BetaCodeExecutionToolResultErrorCode`81328133                  - `"invalid_tool_input"`81348135                  - `"unavailable"`81368137                  - `"too_many_requests"`81388139                  - `"execution_time_exceeded"`81408141              - `BetaCodeExecutionResultBlock object`81428143                - `type: "code_execution_result"`81448145                  default: code_execution_result81468147                - `content: array of BetaCodeExecutionOutputBlock`81488149                  - `type: "code_execution_output"`81508151                    default: code_execution_output81528153                  - `file_id: string`81548155                - `return_code: number`81568157                - `stderr: string`81588159                - `stdout: string`81608161              - `BetaEncryptedCodeExecutionResultBlock object`81628163                Code execution result with encrypted stdout for PFC + web_search results.81648165                - `type: "encrypted_code_execution_result"`81668167                  default: encrypted_code_execution_result81688169                - `content: array of BetaCodeExecutionOutputBlock`81708171                  - `type: "code_execution_output"`81728173                    default: code_execution_output81748175                  - `file_id: string`81768177                - `encrypted_stdout: string`81788179                - `return_code: number`81808181                - `stderr: string`81828183            - `tool_use_id: string`81848185              pattern: ^srvtoolu_[a-zA-Z0-9_]+$81868187          - `BetaBashCodeExecutionToolResultBlock object`81888189            - `type: "bash_code_execution_tool_result"`81908191              default: bash_code_execution_tool_result81928193            - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`81948195              - `BetaBashCodeExecutionToolResultError object`81968197                - `type: "bash_code_execution_tool_result_error"`81988199                  default: bash_code_execution_tool_result_error82008201                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`82028203                  - `"invalid_tool_input"`82048205                  - `"unavailable"`82068207                  - `"too_many_requests"`82088209                  - `"execution_time_exceeded"`82108211                  - `"output_file_too_large"`82128213              - `BetaBashCodeExecutionResultBlock object`82148215                - `type: "bash_code_execution_result"`82168217                  default: bash_code_execution_result82188219                - `content: array of BetaBashCodeExecutionOutputBlock`82208221                  - `type: "bash_code_execution_output"`82228223                    default: bash_code_execution_output82248225                  - `file_id: string`82268227                - `return_code: number`82288229                - `stderr: string`82308231                - `stdout: string`82328233            - `tool_use_id: string`82348235              pattern: ^srvtoolu_[a-zA-Z0-9_]+$82368237          - `BetaTextEditorCodeExecutionToolResultBlock object`82388239            - `type: "text_editor_code_execution_tool_result"`82408241              default: text_editor_code_execution_tool_result82428243            - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`82448245              - `BetaTextEditorCodeExecutionToolResultError object`82468247                - `type: "text_editor_code_execution_tool_result_error"`82488249                  default: text_editor_code_execution_tool_result_error82508251                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`82528253                  - `"invalid_tool_input"`82548255                  - `"unavailable"`82568257                  - `"too_many_requests"`82588259                  - `"execution_time_exceeded"`82608261                  - `"file_not_found"`82628263                - `error_message: string or null`82648265              - `BetaTextEditorCodeExecutionViewResultBlock object`82668267                - `type: "text_editor_code_execution_view_result"`82688269                  default: text_editor_code_execution_view_result82708271                - `content: string`82728273                - `file_type: "text" or "image" or "pdf"`82748275                  - `"text"`82768277                  - `"image"`82788279                  - `"pdf"`82808281                - `num_lines: number or null`82828283                - `start_line: number or null`82848285                - `total_lines: number or null`82868287              - `BetaTextEditorCodeExecutionCreateResultBlock object`82888289                - `type: "text_editor_code_execution_create_result"`82908291                  default: text_editor_code_execution_create_result82928293                - `is_file_update: boolean`82948295              - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`82968297                - `type: "text_editor_code_execution_str_replace_result"`82988299                  default: text_editor_code_execution_str_replace_result83008301                - `lines: array of string or null`83028303                - `new_lines: number or null`83048305                - `new_start: number or null`83068307                - `old_lines: number or null`83088309                - `old_start: number or null`83108311            - `tool_use_id: string`83128313              pattern: ^srvtoolu_[a-zA-Z0-9_]+$83148315          - `BetaToolSearchToolResultBlock object`83168317            - `type: "tool_search_tool_result"`83188319              default: tool_search_tool_result83208321            - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`83228323              - `BetaToolSearchToolResultError object`83248325                - `type: "tool_search_tool_result_error"`83268327                  default: tool_search_tool_result_error83288329                - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`83308331                  - `"invalid_tool_input"`83328333                  - `"unavailable"`83348335                  - `"too_many_requests"`83368337                  - `"execution_time_exceeded"`83388339                - `error_message: string or null`83408341              - `BetaToolSearchToolSearchResultBlock object`83428343                - `type: "tool_search_tool_search_result"`83448345                  default: tool_search_tool_search_result83468347                - `tool_references: array of BetaToolReferenceBlock`83488349                  - `type: "tool_reference"`83508351                    default: tool_reference83528353                  - `tool_name: string`83548355                    maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$83568357            - `tool_use_id: string`83588359              pattern: ^srvtoolu_[a-zA-Z0-9_]+$83608361          - `BetaMCPToolUseBlock object`83628363            - `type: "mcp_tool_use"`83648365              default: mcp_tool_use83668367            - `id: string`83688369              pattern: ^[a-zA-Z0-9_-]+$83708371            - `input: map[unknown]`83728373            - `name: string`83748375              The name of the MCP tool83768377            - `server_name: string`83788379              The name of the MCP server83808381          - `BetaMCPToolResultBlock object`83828383            - `type: "mcp_tool_result"`83848385              default: mcp_tool_result83868387            - `content: string or array of BetaTextBlock`83888389              - `string`83908391              - `BetaMCPToolResultBlockContent = array of BetaTextBlock`83928393                - `type: "text"`83948395                  default: text83968397                - `citations: array of BetaTextCitation or null`83988399                  Citations supporting the text block.84008401                  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`.84028403                - `text: string`84048405                  minLength: 084068407            - `is_error: boolean`84088409              default: false84108411            - `tool_use_id: string`84128413              pattern: ^[a-zA-Z0-9_-]+$84148415          - `BetaContainerUploadBlock object`84168417            Response model for a file uploaded to the container.84188419            - `type: "container_upload"`84208421              default: container_upload84228423            - `file_id: string`84248425          - `BetaCompactionBlock object`84268427            A compaction block returned when autocompact is triggered.84288429            When content is None, it indicates the compaction failed to produce a valid8430            summary (e.g., malformed output from the model). Clients may round-trip8431            compaction blocks with null content; the server treats them as no-ops.84328433            - `type: "compaction"`84348435              default: compaction84368437            - `content: string or null`84388439              Summary of compacted content, or null if compaction failed84408441            - `encrypted_content: string or null`84428443              Opaque metadata from prior compaction, to be round-tripped verbatim84448445            - `signature: optional string or null`84468447              Signature over the summary, to be sent back with the block verbatim84488449          - `BetaFallbackBlock object`84508451            Marks the point in `content` where one model's output gives way to the next.84528453            One block appears per hop where a preceding model actually ran this turn and8454            declined. A turn where no preceding model ran and declined has no such8455            boundary and carries no block — the signal for whether a fallback model8456            served the response is the presence of a `fallback_message` entry in8457            `usage.iterations`, not this block.84588459            The block is treated like a server-tool content block for streaming: it8460            arrives via the standard `content_block_start` / `content_block_stop`8461            pair and carries no deltas.84628463            - `type: "fallback"`84648465              default: fallback84668467            - `from: BetaFallbackInfo`84688469              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, its `model` is that model's canonical id.84708471              - `model: Model`84728473                The model that will complete your prompt.84748475                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.84768477                - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`84788479                  The model that will complete your prompt.84808481                  See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.84828483                  - `"claude-fable-5-1"`84848485                    Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows84868487                  - `"claude-mythos-5-1"`84888489                    Our most capable model for cybersecurity and biology research, available through trusted access programs84908491                  - `"claude-sonnet-5"`84928493                    High-performance model for coding and agents84948495                  - `"claude-fable-5"`84968497                    Next generation of intelligence for the hardest knowledge work and coding problems84988499                  - `"claude-mythos-5"`85008501                    Most capable model for cybersecurity and biology research85028503                  - `"claude-opus-5"`85048505                    Powerful intelligence for long-running agents and coding85068507                  - `"claude-opus-4-8"`85088509                    Powerful intelligence for long-running agents and coding85108511                  - `"claude-opus-4-7"`85128513                    Powerful intelligence for long-running agents and coding85148515                  - `"claude-mythos-preview"`85168517                    New class of intelligence, strongest in coding and cybersecurity85188519                  - `"claude-opus-4-6"`85208521                    Powerful intelligence for long-running agents and coding85228523                  - `"claude-sonnet-4-6"`85248525                    Best combination of speed and intelligence85268527                  - `"claude-haiku-4-5"`85288529                    Fastest model with near-frontier intelligence85308531                  - `"claude-haiku-4-5-20251001"`85328533                    Fastest model with near-frontier intelligence85348535                  - `"claude-opus-4-5"`85368537                    Powerful intelligence for long-running agents and coding85388539                  - `"claude-opus-4-5-20251101"`85408541                    Powerful intelligence for long-running agents and coding85428543                  - `"claude-sonnet-4-5"`85448545                    High-performance model for agents and coding85468547                  - `"claude-sonnet-4-5-20250929"`85488549                    High-performance model for agents and coding85508551                - `string`85528553            - `to: BetaFallbackInfo`85548555              The fallback model producing the content that follows this block. Its `model` is always the canonical id.85568557            - `trigger: BetaFallbackRefusalTrigger`85588559              What caused the `from` model to hand over at this hop.85608561              - `type: "refusal"`85628563                default: refusal85648565              - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`85668567                The policy category that triggered a refusal.85688569                - `"cyber"`85708571                  The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.85728573                - `"bio"`85748575                  The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.85768577                - `"frontier_llm"`85788579                  The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.85808581                - `"reasoning_extraction"`85828583                  The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).85848585                - `"general_harms"`85868587                  The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.85888589        - `context_management: BetaContextManagementResponse or null`85908591          Context management response.85928593          Information about context management strategies applied during the request.85948595          - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`85968597            List of context management edits that were applied.85988599            - `BetaClearToolUses20250919EditResponse object`86008601              - `type: "clear_tool_uses_20250919"`86028603                The type of context management edit applied.86048605                default: clear_tool_uses_2025091986068607              - `cleared_input_tokens: number`86088609                Number of input tokens cleared by this edit.86108611                minimum: 086128613              - `cleared_tool_uses: number`86148615                Number of tool uses that were cleared.86168617                minimum: 086188619            - `BetaClearThinking20251015EditResponse object`86208621              - `type: "clear_thinking_20251015"`86228623                The type of context management edit applied.86248625                default: clear_thinking_2025101586268627              - `cleared_input_tokens: number`86288629                Number of input tokens cleared by this edit.86308631                minimum: 086328633              - `cleared_thinking_turns: number`86348635                Number of thinking turns that were cleared.86368637                minimum: 086388639        - `diagnostics: BetaDiagnostics or null`86408641          Response envelope for request-level diagnostics. Present (possibly8642          null) whenever the caller supplied `diagnostics` on the request.86438644          - `cache_miss_reason: BetaCacheMissModelChanged or BetaCacheMissSystemChanged or BetaCacheMissToolsChanged or 3 more or null`86458646            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.86478648            - `BetaCacheMissModelChanged object`86498650              - `type: "model_changed"`86518652                default: model_changed86538654              - `cache_missed_input_tokens: number`86558656                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.86578658            - `BetaCacheMissSystemChanged object`86598660              - `type: "system_changed"`86618662                default: system_changed86638664              - `cache_missed_input_tokens: number`86658666                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.86678668            - `BetaCacheMissToolsChanged object`86698670              - `type: "tools_changed"`86718672                default: tools_changed86738674              - `cache_missed_input_tokens: number`86758676                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.86778678            - `BetaCacheMissMessagesChanged object`86798680              - `type: "messages_changed"`86818682                default: messages_changed86838684              - `cache_missed_input_tokens: number`86858686                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.86878688            - `BetaCacheMissPreviousMessageNotFound object`86898690              - `type: "previous_message_not_found"`86918692                default: previous_message_not_found86938694            - `BetaCacheMissUnavailable object`86958696              - `type: "unavailable"`86978698                default: unavailable86998700        - `model: Model`87018702          The model that will complete your prompt.87038704          See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.87058706        - `role: "assistant"`87078708          Conversational role of the generated message.87098710          This will always be `"assistant"`.87118712          default: assistant87138714        - `stop_details: BetaRefusalStopDetails or null`87158716          Structured information about a refusal.87178718          - `type: "refusal"`87198720            default: refusal87218722          - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`87238724            The policy category that triggered a refusal.87258726            - `"cyber"`87278728              The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.87298730            - `"bio"`87318732              The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.87338734            - `"frontier_llm"`87358736              The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.87378738            - `"reasoning_extraction"`87398740              The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).87418742            - `"general_harms"`87438744              The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.87458746          - `explanation: string or null`87478748            Human-readable explanation of the refusal.87498750            This text is not guaranteed to be stable. `null` when no explanation is available for the category.87518752          - `fallback_credit_token: string or null`87538754            Opaque code that refunds the cache-miss cost when retrying this refused8755            request on the fallback model. Pass it as `fallback_credit_token` on the8756            retry request. Expires 5 minutes after the refusal.87578758            The retry is sent either with the same request body (`system`, `messages`,8759            `tools`, and other render-shaping fields), or with the same body plus one8760            appended `assistant` message whose content is the partial text (with any8761            trailing whitespace stripped from the final text block) and paired8762            server-tool blocks from this refusal — which also authorizes that8763            appended turn as an assistant-prefill continuation on models that otherwise8764            disallow prefill. A token minted mid-server-tool-loop whose partial content8765            was continuable may only be redeemed the second way — if a same-body retry8766            is rejected with a 400 saying the token must be redeemed by continuing the8767            partial response, retry the second way instead. Either way: same workspace,8768            same platform; a mismatch is a 400. Resending a token for an already-warm8769            prefix is permitted but yields no additional credit.87708771            `null` when the refused model isn't eligible for a fallback credit.87728773          - `fallback_has_prefill_claim: boolean or null`87748775            Whether the accompanying `fallback_credit_token` may be redeemed with the8776            appended-assistant retry form. Only set when `fallback_credit_token` is8777            present.87788779            `true`: retry by resending the same request body plus one appended8780            `assistant` message whose content is this response's `content` with any8781            trailing whitespace stripped from the final text block and unpaired8782            `tool_use` blocks omitted (the same appended-turn shape described on8783            `fallback_credit_token`), with the token attached. `false`: retry by8784            resending the original request body unchanged, with the token attached —8785            the appended-assistant form is not available for this refusal (no8786            continuable partial content, or the request uses `output_format` or a8787            `tool_choice` that forces tool use). One exception: when the request used8788            `output_format` or a forced `tool_choice` and the refusal arrived after8789            server tools (including MCP connector tools) had already executed, the8790            token may not be redeemable by either retry form; if the exact-body retry8791            is then rejected with a 400 saying the token must be redeemed by8792            continuing the partial response, discard the token and retry without it.87938794            Advisory: if an appended-assistant retry is rejected with a 400 despite8795            `true`, fall back to resending the original request body with the token.87968797          - `recommended_model: string or null`87988799            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.88008801        - `stop_reason: BetaStopReason or null`88028803          The reason that we stopped.88048805          This may be one the following values:88068807          * `"end_turn"`: the model reached a natural stopping point8808          * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum8809          * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated8810          * `"tool_use"`: the model invoked one or more tools8811          * `"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.8812          * `"refusal"`: when streaming classifiers intervene to handle potential policy violations8813          * `"model_context_window_exceeded"`: we exceeded the model's context window88148815          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.88168817          - `"end_turn"`88188819          - `"max_tokens"`88208821          - `"stop_sequence"`88228823          - `"tool_use"`88248825          - `"pause_turn"`88268827          - `"compaction"`88288829          - `"refusal"`88308831          - `"model_context_window_exceeded"`88328833        - `stop_sequence: string or null`88348835          Which custom stop sequence was generated, if any.88368837          This value will be a non-null string if one of your custom stop sequences was generated.88388839        - `usage: BetaUsage`88408841          Billing and rate-limit usage.88428843          Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.88448845          Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.88468847          For example, `output_tokens` will be non-zero, even for an empty string response from Claude.88488849          Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.88508851          - `cache_creation: BetaCacheCreation or null`88528853            Breakdown of cached tokens by TTL88548855            - `ephemeral_1h_input_tokens: number`88568857              The number of input tokens used to create the 1 hour cache entry.88588859              default: 0, minimum: 088608861            - `ephemeral_5m_input_tokens: number`88628863              The number of input tokens used to create the 5 minute cache entry.88648865              default: 0, minimum: 088668867          - `cache_creation_input_tokens: number or null`88688869            The number of input tokens used to create the cache entry.88708871            minimum: 088728873          - `cache_read_input_tokens: number or null`88748875            The number of input tokens read from the cache.88768877            minimum: 088788879          - `fallback_credit: BetaFallbackCreditUsage or null`88808881            Outcome of the `fallback_credit_token` presented on this request.88828883            - `status: BetaFallbackCreditRedeemed or BetaFallbackCreditNotApplied`88848885              Whether the fallback-credit reprice was applied to this response's billing.88868887              A union discriminated on `type`. `redeemed`: the retry is billed as if8888              the conversation had been on the retry model all along — including when the8889              resulting shift is zero because there was nothing to move. `not_applied`:8890              no reprice was applied; the arm's `reason` says why.88918892              - `BetaFallbackCreditRedeemed object`88938894                The reprice was applied: the retry is billed as if the conversation8895                had been on the retry model all along.88968897                - `type: "redeemed"`88988899                  default: redeemed89008901              - `BetaFallbackCreditNotApplied object`89028903                No reprice was applied; `reason` says why.89048905                - `type: "not_applied"`89068907                  default: not_applied89088909                - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`89108911                  Why the reprice was not applied.89128913                  A closed enum; additions to the redemption-check vocabulary arrive as8914                  deliberate schema updates.89158916                  - `"body_mismatch"`89178918                  - `"continuation_excluded"`89198920                  - `"continuation_only"`89218922                  - `"expired"`89238924                  - `"invalid_target_model"`89258926                  - `"not_enabled"`89278928                  - `"reprice_unavailable"`89298930                  - `"temporarily_unavailable"`89318932                  - `"variant_fields_present"`89338934                  - `"wrong_organization"`89358936                  - `"wrong_platform"`89378938                  - `"wrong_workspace"`89398940                - `remove_to_redeem: optional array of string or null`89418942                  Request fields to remove before retrying, so the retry can redeem this8943                  token.89448945                  Present exactly when `reason` is `variant_fields_present` — never null,8946                  never an empty array; absent otherwise. Fields are named only from your own request, and only after8947                  the sealed variant hash matched. A served best-effort retry has already8948                  been billed at normal price; nothing redeems retroactively, but a corrected8949                  re-send inside the token's five-minute window can still redeem.89508951          - `inference_geo: string or null`89528953            The geographic region where inference was performed for this request.89548955          - `input_tokens: number`89568957            The number of input tokens which were used.89588959            minimum: 089608961          - `iterations: BetaIterationsUsage or null`89628963            Per-iteration token usage breakdown.89648965            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:89668967            - Determine which iterations exceeded long context thresholds (>=200k tokens)8968            - Calculate the context window size from the last `message` entry8969            - Understand token accumulation across server-side tool use loops89708971            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.89728973            - `BetaMessageIterationUsage object`89748975              Token usage for a sampling iteration.89768977              - `type: "message"`89788979                Usage for a sampling iteration89808981                default: message89828983              - `cache_creation: BetaCacheCreation or null`89848985                Breakdown of cached tokens by TTL89868987              - `cache_creation_input_tokens: number`89888989                The number of input tokens used to create the cache entry.89908991                default: 0, minimum: 089928993              - `cache_read_input_tokens: number`89948995                The number of input tokens read from the cache.89968997                default: 0, minimum: 089988999              - `input_tokens: number`90009001                The number of input tokens which were used.90029003                minimum: 090049005              - `model: Model or null`90069007                The model that will complete your prompt.90089009                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.90109011              - `output_tokens: number`90129013                The number of output tokens which were used.90149015                minimum: 090169017            - `BetaCompactionIterationUsage object`90189019              Token usage for a compaction iteration.90209021              - `type: "compaction"`90229023                Usage for a compaction iteration90249025                default: compaction90269027              - `cache_creation: BetaCacheCreation or null`90289029                Breakdown of cached tokens by TTL90309031              - `cache_creation_input_tokens: number`90329033                The number of input tokens used to create the cache entry.90349035                default: 0, minimum: 090369037              - `cache_read_input_tokens: number`90389039                The number of input tokens read from the cache.90409041                default: 0, minimum: 090429043              - `input_tokens: number`90449045                The number of input tokens which were used.90469047                minimum: 090489049              - `output_tokens: number`90509051                The number of output tokens which were used.90529053                minimum: 090549055            - `BetaAdvisorMessageIterationUsage object`90569057              Token usage for an advisor sub-inference iteration.90589059              - `type: "advisor_message"`90609061                Usage for an advisor sub-inference iteration90629063                default: advisor_message90649065              - `cache_creation: BetaCacheCreation or null`90669067                Breakdown of cached tokens by TTL90689069              - `cache_creation_input_tokens: number`90709071                The number of input tokens used to create the cache entry.90729073                default: 0, minimum: 090749075              - `cache_read_input_tokens: number`90769077                The number of input tokens read from the cache.90789079                default: 0, minimum: 090809081              - `input_tokens: number`90829083                The number of input tokens which were used.90849085                minimum: 090869087              - `model: Model`90889089                The model that will complete your prompt.90909091                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.90929093              - `output_tokens: number`90949095                The number of output tokens which were used.90969097                minimum: 090989099            - `BetaFallbackMessageIterationUsage object`91009101              Token usage for the fallback-model attempt of a server-side fallback request.91029103              The terminal entry of a fallback-served turn: when a fallback hop's9104              output is the returned message, the entry for the iteration that9105              completed it carries this type in place of `message`. A declined hop9106              and the serving hop's earlier tool-loop iterations produce `message`9107              entries. Whether a fallback model served the response is signalled by9108              the presence of this entry in `usage.iterations`.91099110              - `type: "fallback_message"`91119112                Usage for the fallback-model attempt that served the response91139114                default: fallback_message91159116              - `cache_creation: BetaCacheCreation or null`91179118                Breakdown of cached tokens by TTL91199120              - `cache_creation_input_tokens: number`91219122                The number of input tokens used to create the cache entry.91239124                default: 0, minimum: 091259126              - `cache_read_input_tokens: number`91279128                The number of input tokens read from the cache.91299130                default: 0, minimum: 091319132              - `input_tokens: number`91339134                The number of input tokens which were used.91359136                minimum: 091379138              - `model: Model`91399140                The model that will complete your prompt.91419142                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.91439144              - `output_tokens: number`91459146                The number of output tokens which were used.91479148                minimum: 091499150          - `output_tokens: number`91519152            The number of output tokens which were used.91539154            minimum: 091559156          - `output_tokens_details: BetaOutputTokensDetails or null`91579158            Breakdown of output tokens by category.91599160            `output_tokens` remains the inclusive, authoritative total used for billing.9161            This object provides a read-only decomposition for observability — for example,9162            how many of the billed output tokens were spent on internal reasoning that may9163            have been summarized before being returned to you.91649165            - `thinking_tokens: number`91669167              Number of output tokens the model generated as internal reasoning, including9168              the thinking-block delimiter tokens.91699170              Reflects the raw reasoning the model produced, not the (possibly shorter)9171              summarized thinking text returned in the response body. Computed by9172              re-tokenizing the raw reasoning text, so it may differ from the model's exact9173              generation count by a small number of tokens. Always ≤ `output_tokens`;9174              `output_tokens - thinking_tokens` approximates the non-reasoning output.91759176              default: 0, minimum: 091779178          - `server_tool_use: BetaServerToolUsage or null`91799180            The number of server tool requests.91819182            - `web_fetch_requests: number`91839184              The number of web fetch tool requests.91859186              default: 0, minimum: 091879188            - `web_search_requests: number`91899190              The number of web search tool requests.91919192              default: 0, minimum: 091939194          - `service_tier: "standard" or "priority" or "batch" or null`91959196            If the request used the priority, standard, or batch tier.91979198            - `"standard"`91999200            - `"priority"`92019202            - `"batch"`92039204          - `speed: "standard" or "fast" or null`92059206            Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.92079208            - `"standard"`92099210            - `"fast"`92119212        - `input_transformations: optional array of BetaInputTransformation or null`92139214          Changes the API made to the request's input before showing it to the model,9215          and blocks that failed a binding check but were left unchanged: one entry per9216          block, in request order. Two entry types today. `thinking_dropped` — a9217          `thinking`, `redacted_thinking` or `connector_text` block from the request's9218          `messages` that was removed from the prompt instead of being shown to the9219          model because it failed a binding check. `thinking_mismatch_allowed` — a9220          `thinking` or `redacted_thinking` block that failed the conversation check9221          (the conversation before it differs from the one it was created in, or it9222          carries no record of one on a model that requires it) and was shown to the9223          model all the same, because that check is not enforced for this request.9224          More entry types may be added over time; ignore types you do not recognize.92259226          Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on9227          every such response from a model that supports extended thinking, as `[]`9228          when there is no entry to report; without the beta, blocks are removed or9229          left in place all the same but nothing is reported. Removed blocks contribute9230          nothing to `usage.input_tokens`; blocks left in place count as sent. When9231          streaming, the array is final in `message_start`; the final `message_delta`9232          event carries it only when a server-side model fallback happened mid-stream,9233          in which case it holds the serving model's entries and replaces the one in9234          `message_start`.92359236          - `BetaThinkingDroppedInputTransformation object`92379238            - `type: "thinking_dropped"`92399240              Always `thinking_dropped` for this entry type.92419242              default: thinking_dropped92439244            - `path: string`92459246              Where the removed block was in your request, as `messages.{i}.content.{j}`:9247              `i` indexes the `messages` array you sent and `j` that message's `content`9248              array — the same form error messages use.92499250            - `reason: "model_binding_mismatch" or "prefix_binding_mismatch" or "organization_binding_mismatch" or "end_user_binding_mismatch"`92519252              Which binding check removed the block: `model_binding_mismatch` — it was9253              created by a model whose reasoning the requested model may not read;9254              `prefix_binding_mismatch` — the conversation before it differs from the9255              conversation it was created in (the rest of that turn's consecutive thinking9256              blocks are removed with it, each with this reason);9257              `organization_binding_mismatch` — it was created under a different9258              organization (an Anthropic organization, AWS account or Google Cloud project)9259              and this organization is not one of its additional organizations;9260              `end_user_binding_mismatch` — it was created for a different end user, or9261              was removed by the consumer-organization binding. A block that would fail9262              several checks reports one reason, in this order of precedence:9263              `organization_binding_mismatch`, `end_user_binding_mismatch`,9264              `model_binding_mismatch`, `prefix_binding_mismatch`.92659266              - `"model_binding_mismatch"`92679268              - `"prefix_binding_mismatch"`92699270              - `"organization_binding_mismatch"`92719272              - `"end_user_binding_mismatch"`92739274          - `BetaThinkingMismatchAllowedInputTransformation object`92759276            - `type: "thinking_mismatch_allowed"`92779278              Always `thinking_mismatch_allowed` for this entry type.92799280              default: thinking_mismatch_allowed92819282            - `path: string`92839284              Where the block is in your request, as `messages.{i}.content.{j}`:9285              `i` indexes the `messages` array you sent and `j` that message's `content`9286              array — the same form error messages use.92879288            - `reason: "model_binding_mismatch" or "prefix_binding_mismatch" or "organization_binding_mismatch" or "end_user_binding_mismatch"`92899290              Which binding check the block failed; the block was shown to the model all9291              the same. Always `prefix_binding_mismatch` today — the conversation before9292              the block differs from the conversation it was created in, or the block9293              carries no record of one on a model that requires it. Were the check9294              enforced for this request, the block would have been removed or the request9295              rejected (`thinking.block_binding.prefix_mismatch_behavior`). A removal also9296              takes the rest of that turn's consecutive thinking blocks, whereas here each9297              block is checked on its own, so `thinking_mismatch_allowed` entries are a9298              lower bound on what enforcement would remove.92999300              - `"model_binding_mismatch"`93019302              - `"prefix_binding_mismatch"`93039304              - `"organization_binding_mismatch"`93059306              - `"end_user_binding_mismatch"`93079308    - `BetaMessageBatchErroredResult object`93099310      - `type: "errored"`93119312        default: errored93139314      - `error: BetaErrorResponse`93159316        - `type: "error"`93179318          default: error93199320        - `error: BetaError`93219322          - `BetaInvalidRequestError object`93239324            - `type: "invalid_request_error"`93259326              default: invalid_request_error93279328            - `message: string`93299330              default: Invalid request93319332          - `BetaAuthenticationError object`93339334            - `type: "authentication_error"`93359336              default: authentication_error93379338            - `message: string`93399340              default: Authentication error93419342          - `BetaBillingError object`93439344            - `type: "billing_error"`93459346              default: billing_error93479348            - `message: string`93499350              default: Billing error93519352          - `BetaPermissionError object`93539354            - `type: "permission_error"`93559356              default: permission_error93579358            - `message: string`93599360              default: Permission denied93619362          - `BetaNotFoundError object`93639364            - `type: "not_found_error"`93659366              default: not_found_error93679368            - `message: string`93699370              default: Not found93719372          - `BetaRateLimitError object`93739374            - `type: "rate_limit_error"`93759376              default: rate_limit_error93779378            - `message: string`93799380              default: Rate limited93819382          - `BetaGatewayTimeoutError object`93839384            - `type: "timeout_error"`93859386              default: timeout_error93879388            - `message: string`93899390              default: Request timeout93919392          - `BetaAPIError object`93939394            - `type: "api_error"`93959396              default: api_error93979398            - `message: string`93999400              default: Internal server error94019402          - `BetaOverloadedError object`94039404            - `type: "overloaded_error"`94059406              default: overloaded_error94079408            - `message: string`94099410              default: Overloaded94119412        - `request_id: string or null`94139414    - `BetaMessageBatchCanceledResult object`94159416      - `type: "canceled"`94179418        default: canceled94199420    - `BetaMessageBatchExpiredResult object`94219422      - `type: "expired"`94239424        default: expired94259426### Beta Message Batch Request Counts94279428- `BetaMessageBatchRequestCounts object`94299430  - `canceled: number`94319432    Number of requests in the Message Batch that have been canceled.94339434    This is zero until processing of the entire Message Batch has ended.94359436    default: 094379438  - `errored: number`94399440    Number of requests in the Message Batch that encountered an error.94419442    This is zero until processing of the entire Message Batch has ended.94439444    default: 094459446  - `expired: number`94479448    Number of requests in the Message Batch that have expired.94499450    This is zero until processing of the entire Message Batch has ended.94519452    default: 094539454  - `processing: number`94559456    Number of requests in the Message Batch that are processing.94579458    default: 094599460  - `succeeded: number`94619462    Number of requests in the Message Batch that have completed successfully.94639464    This is zero until processing of the entire Message Batch has ended.94659466    default: 094679468### Beta Message Batch Result94699470- `BetaMessageBatchResult = BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`94719472  Processing result for this request.94739474  Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.94759476  - `BetaMessageBatchSucceededResult object`94779478    - `type: "succeeded"`94799480      default: succeeded94819482    - `message: BetaMessage`94839484      - `type: "message"`94859486        Object type.94879488        For Messages, this is always `"message"`.94899490        default: message94919492      - `id: string`94939494        Unique object identifier.94959496        The format and length of IDs may change over time.94979498      - `container: BetaContainer or null`94999500        Information about the container used in the request (for the code execution tool)95019502        - `id: string`95039504          Identifier for the container used in this request95059506        - `expires_at: string`95079508          The time at which the container will expire.95099510          format: date-time95119512        - `skills: array of BetaContainerSkill or null`95139514          Skills loaded in the container95159516          - `type: "anthropic" or "custom"`95179518            Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)95199520            - `"anthropic"`95219522            - `"custom"`95239524          - `skill_id: string`95259526            Skill ID95279528            maxLength: 64, minLength: 195299530          - `version: string`95319532            The resolved version: a skill version ID for custom skills.95339534            maxLength: 64, minLength: 195359536      - `content: array of BetaContentBlock`95379538        Content generated by the model.95399540        This is an array of content blocks, each of which has a `type` that determines its shape.95419542        Example:95439544        ```json9545        [{"type": "text", "text": "Hi, I'm Claude."}]9546        ```95479548        If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.95499550        For example, if the input `messages` were:95519552        ```json9553        [9554          {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},9555          {"role": "assistant", "content": "The best answer is ("}9556        ]9557        ```95589559        Then the response `content` might be:95609561        ```json9562        [{"type": "text", "text": "B)"}]9563        ```95649565        - `BetaTextBlock object`95669567          - `type: "text"`95689569            default: text95709571          - `citations: array of BetaTextCitation or null`95729573            Citations supporting the text block.95749575            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`.95769577            - `BetaCitationCharLocation object`95789579              - `type: "char_location"`95809581                default: char_location95829583              - `cited_text: string`95849585              - `document_index: number`95869587                minimum: 095889589              - `document_title: string or null`95909591              - `end_char_index: number`95929593              - `file_id: string or null`95949595              - `start_char_index: number`95969597                minimum: 095989599            - `BetaCitationPageLocation object`96009601              - `type: "page_location"`96029603                default: page_location96049605              - `cited_text: string`96069607              - `document_index: number`96089609                minimum: 096109611              - `document_title: string or null`96129613              - `end_page_number: number`96149615              - `file_id: string or null`96169617              - `start_page_number: number`96189619                minimum: 196209621            - `BetaCitationContentBlockLocation object`96229623              - `type: "content_block_location"`96249625                default: content_block_location96269627              - `cited_text: string`96289629                The full text of the cited block range, concatenated.96309631                Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.96329633              - `document_index: number`96349635                minimum: 096369637              - `document_title: string or null`96389639              - `end_block_index: number`96409641                Exclusive 0-based end index of the cited block range in the source's `content` array.96429643                Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.96449645              - `file_id: string or null`96469647              - `start_block_index: number`96489649                0-based index of the first cited block in the source's `content` array.96509651                minimum: 096529653            - `BetaCitationsWebSearchResultLocation object`96549655              - `type: "web_search_result_location"`96569657                default: web_search_result_location96589659              - `cited_text: string`96609661              - `encrypted_index: string`96629663              - `title: string or null`96649665                maxLength: 51296669667              - `url: string`96689669            - `BetaCitationSearchResultLocation object`96709671              - `type: "search_result_location"`96729673                default: search_result_location96749675              - `cited_text: string`96769677                The full text of the cited block range, concatenated.96789679                Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.96809681              - `end_block_index: number`96829683                Exclusive 0-based end index of the cited block range in the source's `content` array.96849685                Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.96869687              - `search_result_index: number`96889689                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.96909691                Counted separately from `document_index`; server-side web search results are not included in this count.96929693                minimum: 096949695              - `source: string`96969697              - `start_block_index: number`96989699                0-based index of the first cited block in the source's `content` array.97009701                minimum: 097029703              - `title: string or null`97049705          - `text: string`97069707            minLength: 097089709        - `BetaThinkingBlock object`97109711          - `type: "thinking"`97129713            default: thinking97149715          - `signature: string`97169717            A value used to verify that this thinking block was generated by Claude when it is passed back to the API.97189719            This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.97209721            See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.97229723          - `thinking: string`97249725            The text of Claude's thinking process for this block.97269727        - `BetaRedactedThinkingBlock object`97289729          - `type: "redacted_thinking"`97309731            default: redacted_thinking97329733          - `data: string`97349735            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.97369737            Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.97389739            See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.97409741        - `BetaToolUseBlock object`97429743          - `type: "tool_use"`97449745            default: tool_use97469747          - `id: string`97489749            pattern: ^[a-zA-Z0-9_-]+$97509751          - `input: map[unknown]`97529753          - `name: string`97549755            minLength: 197569757          - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`97589759            - `BetaDirectCaller object`97609761              Tool invocation directly from the model.97629763              - `type: "direct"`97649765            - `BetaServerToolCaller object`97669767              Tool invocation generated by a server-side tool.97689769              - `type: "code_execution_20250825"`97709771              - `tool_id: string`97729773                pattern: ^srvtoolu_[a-zA-Z0-9_]+$97749775            - `BetaServerToolCaller20260120 object`97769777              - `type: "code_execution_20260120"`97789779              - `tool_id: string`97809781                pattern: ^srvtoolu_[a-zA-Z0-9_]+$97829783          - `toolset_name: optional string or null`97849785            For a toolset member tool_use, the toolset family.97869787            maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$97889789        - `BetaServerToolUseBlock object`97909791          - `type: "server_tool_use"`97929793            default: server_tool_use97949795          - `id: string`97969797            pattern: ^srvtoolu_[a-zA-Z0-9_]+$97989799          - `input: map[unknown]`98009801          - `name: "advisor" or "web_search" or "web_fetch" or 5 more`98029803            - `"advisor"`98049805            - `"web_search"`98069807            - `"web_fetch"`98089809            - `"code_execution"`98109811            - `"bash_code_execution"`98129813            - `"text_editor_code_execution"`98149815            - `"tool_search_tool_regex"`98169817            - `"tool_search_tool_bm25"`98189819          - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`98209821            - `BetaDirectCaller object`98229823              Tool invocation directly from the model.98249825            - `BetaServerToolCaller object`98269827              Tool invocation generated by a server-side tool.98289829            - `BetaServerToolCaller20260120 object`98309831        - `BetaWebSearchToolResultBlock object`98329833          - `type: "web_search_tool_result"`98349835            default: web_search_tool_result98369837          - `content: BetaWebSearchToolResultBlockContent`98389839            - `BetaWebSearchToolResultError object`98409841              - `type: "web_search_tool_result_error"`98429843                default: web_search_tool_result_error98449845              - `error_code: BetaWebSearchToolResultErrorCode`98469847                - `"invalid_tool_input"`98489849                - `"unavailable"`98509851                - `"max_uses_exceeded"`98529853                - `"too_many_requests"`98549855                - `"query_too_long"`98569857                - `"request_too_large"`98589859            - `array of BetaWebSearchResultBlock`98609861              - `type: "web_search_result"`98629863                default: web_search_result98649865              - `encrypted_content: string`98669867              - `page_age: string or null`98689869              - `title: string`98709871              - `url: string`98729873          - `tool_use_id: string`98749875            pattern: ^srvtoolu_[a-zA-Z0-9_]+$98769877          - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`98789879            - `BetaDirectCaller object`98809881              Tool invocation directly from the model.98829883            - `BetaServerToolCaller object`98849885              Tool invocation generated by a server-side tool.98869887            - `BetaServerToolCaller20260120 object`98889889        - `BetaWebFetchToolResultBlock object`98909891          - `type: "web_fetch_tool_result"`98929893            default: web_fetch_tool_result98949895          - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`98969897            - `BetaWebFetchToolResultErrorBlock object`98989899              - `type: "web_fetch_tool_result_error"`99009901                default: web_fetch_tool_result_error99029903              - `error_code: BetaWebFetchToolResultErrorCode`99049905                - `"invalid_tool_input"`99069907                - `"url_too_long"`99089909                - `"url_not_allowed"`99109911                - `"url_not_in_prior_context"`99129913                - `"url_not_accessible"`99149915                - `"unsupported_content_type"`99169917                - `"too_many_requests"`99189919                - `"max_uses_exceeded"`99209921                - `"unavailable"`99229923                - `"content_too_large"`99249925            - `BetaWebFetchBlock object`99269927              - `type: "web_fetch_result"`99289929                default: web_fetch_result99309931              - `content: BetaDocumentBlock`99329933                - `type: "document"`99349935                  default: document99369937                - `citations: BetaCitationConfig or null`99389939                  Citation configuration for the document99409941                  - `enabled: boolean`99429943                    default: false99449945                - `source: BetaBase64PDFSource or BetaPlainTextSource`99469947                  - `BetaBase64PDFSource object`99489949                    - `type: "base64"`99509951                    - `data: string`99529953                      format: byte99549955                    - `media_type: "application/pdf"`99569957                  - `BetaPlainTextSource object`99589959                    - `type: "text"`99609961                    - `data: string`99629963                    - `media_type: "text/plain"`99649965                - `title: string or null`99669967                  The title of the document99689969              - `retrieved_at: string or null`99709971                ISO 8601 timestamp when the content was retrieved99729973              - `url: string`99749975                Fetched content URL99769977          - `tool_use_id: string`99789979            pattern: ^srvtoolu_[a-zA-Z0-9_]+$99809981          - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`99829983            - `BetaDirectCaller object`99849985              Tool invocation directly from the model.99869987            - `BetaServerToolCaller object`99889989              Tool invocation generated by a server-side tool.99909991            - `BetaServerToolCaller20260120 object`99929993        - `BetaAdvisorToolResultBlock object`99949995          - `type: "advisor_tool_result"`99969997            default: advisor_tool_result99989999          - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`1000010001            - `BetaAdvisorToolResultError object`1000210003              - `type: "advisor_tool_result_error"`1000410005                default: advisor_tool_result_error1000610007              - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`1000810009                - `"max_uses_exceeded"`1001010011                - `"prompt_too_long"`1001210013                - `"too_many_requests"`1001410015                - `"overloaded"`1001610017                - `"unavailable"`1001810019                - `"execution_time_exceeded"`1002010021                - `"model_not_found"`1002210023            - `BetaAdvisorResultBlock object`1002410025              - `type: "advisor_result"`1002610027                default: advisor_result1002810029              - `stop_reason: string or null`1003010031                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.1003210033              - `text: string`1003410035            - `BetaAdvisorRedactedResultBlock object`1003610037              - `type: "advisor_redacted_result"`1003810039                default: advisor_redacted_result1004010041              - `encrypted_content: string`1004210043                Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.1004410045              - `stop_reason: string or null`1004610047                The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).1004810049          - `tool_use_id: string`1005010051            pattern: ^srvtoolu_[a-zA-Z0-9_]+$1005210053        - `BetaCodeExecutionToolResultBlock object`1005410055          - `type: "code_execution_tool_result"`1005610057            default: code_execution_tool_result1005810059          - `content: BetaCodeExecutionToolResultBlockContent`1006010061            - `BetaCodeExecutionToolResultError object`1006210063              - `type: "code_execution_tool_result_error"`1006410065                default: code_execution_tool_result_error1006610067              - `error_code: BetaCodeExecutionToolResultErrorCode`1006810069                - `"invalid_tool_input"`1007010071                - `"unavailable"`1007210073                - `"too_many_requests"`1007410075                - `"execution_time_exceeded"`1007610077            - `BetaCodeExecutionResultBlock object`1007810079              - `type: "code_execution_result"`1008010081                default: code_execution_result1008210083              - `content: array of BetaCodeExecutionOutputBlock`1008410085                - `type: "code_execution_output"`1008610087                  default: code_execution_output1008810089                - `file_id: string`1009010091              - `return_code: number`1009210093              - `stderr: string`1009410095              - `stdout: string`1009610097            - `BetaEncryptedCodeExecutionResultBlock object`1009810099              Code execution result with encrypted stdout for PFC + web_search results.1010010101              - `type: "encrypted_code_execution_result"`1010210103                default: encrypted_code_execution_result1010410105              - `content: array of BetaCodeExecutionOutputBlock`1010610107                - `type: "code_execution_output"`1010810109                  default: code_execution_output1011010111                - `file_id: string`1011210113              - `encrypted_stdout: string`1011410115              - `return_code: number`1011610117              - `stderr: string`1011810119          - `tool_use_id: string`1012010121            pattern: ^srvtoolu_[a-zA-Z0-9_]+$1012210123        - `BetaBashCodeExecutionToolResultBlock object`1012410125          - `type: "bash_code_execution_tool_result"`1012610127            default: bash_code_execution_tool_result1012810129          - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`1013010131            - `BetaBashCodeExecutionToolResultError object`1013210133              - `type: "bash_code_execution_tool_result_error"`1013410135                default: bash_code_execution_tool_result_error1013610137              - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`1013810139                - `"invalid_tool_input"`1014010141                - `"unavailable"`1014210143                - `"too_many_requests"`1014410145                - `"execution_time_exceeded"`1014610147                - `"output_file_too_large"`1014810149            - `BetaBashCodeExecutionResultBlock object`1015010151              - `type: "bash_code_execution_result"`1015210153                default: bash_code_execution_result1015410155              - `content: array of BetaBashCodeExecutionOutputBlock`1015610157                - `type: "bash_code_execution_output"`1015810159                  default: bash_code_execution_output1016010161                - `file_id: string`1016210163              - `return_code: number`1016410165              - `stderr: string`1016610167              - `stdout: string`1016810169          - `tool_use_id: string`1017010171            pattern: ^srvtoolu_[a-zA-Z0-9_]+$1017210173        - `BetaTextEditorCodeExecutionToolResultBlock object`1017410175          - `type: "text_editor_code_execution_tool_result"`1017610177            default: text_editor_code_execution_tool_result1017810179          - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`1018010181            - `BetaTextEditorCodeExecutionToolResultError object`1018210183              - `type: "text_editor_code_execution_tool_result_error"`1018410185                default: text_editor_code_execution_tool_result_error1018610187              - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`1018810189                - `"invalid_tool_input"`1019010191                - `"unavailable"`1019210193                - `"too_many_requests"`1019410195                - `"execution_time_exceeded"`1019610197                - `"file_not_found"`1019810199              - `error_message: string or null`1020010201            - `BetaTextEditorCodeExecutionViewResultBlock object`1020210203              - `type: "text_editor_code_execution_view_result"`1020410205                default: text_editor_code_execution_view_result1020610207              - `content: string`1020810209              - `file_type: "text" or "image" or "pdf"`1021010211                - `"text"`1021210213                - `"image"`1021410215                - `"pdf"`1021610217              - `num_lines: number or null`1021810219              - `start_line: number or null`1022010221              - `total_lines: number or null`1022210223            - `BetaTextEditorCodeExecutionCreateResultBlock object`1022410225              - `type: "text_editor_code_execution_create_result"`1022610227                default: text_editor_code_execution_create_result1022810229              - `is_file_update: boolean`1023010231            - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`1023210233              - `type: "text_editor_code_execution_str_replace_result"`1023410235                default: text_editor_code_execution_str_replace_result1023610237              - `lines: array of string or null`1023810239              - `new_lines: number or null`1024010241              - `new_start: number or null`1024210243              - `old_lines: number or null`1024410245              - `old_start: number or null`1024610247          - `tool_use_id: string`1024810249            pattern: ^srvtoolu_[a-zA-Z0-9_]+$1025010251        - `BetaToolSearchToolResultBlock object`1025210253          - `type: "tool_search_tool_result"`1025410255            default: tool_search_tool_result1025610257          - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`1025810259            - `BetaToolSearchToolResultError object`1026010261              - `type: "tool_search_tool_result_error"`1026210263                default: tool_search_tool_result_error1026410265              - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`1026610267                - `"invalid_tool_input"`1026810269                - `"unavailable"`1027010271                - `"too_many_requests"`1027210273                - `"execution_time_exceeded"`1027410275              - `error_message: string or null`1027610277            - `BetaToolSearchToolSearchResultBlock object`1027810279              - `type: "tool_search_tool_search_result"`1028010281                default: tool_search_tool_search_result1028210283              - `tool_references: array of BetaToolReferenceBlock`1028410285                - `type: "tool_reference"`1028610287                  default: tool_reference1028810289                - `tool_name: string`1029010291                  maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$1029210293          - `tool_use_id: string`1029410295            pattern: ^srvtoolu_[a-zA-Z0-9_]+$1029610297        - `BetaMCPToolUseBlock object`1029810299          - `type: "mcp_tool_use"`1030010301            default: mcp_tool_use1030210303          - `id: string`1030410305            pattern: ^[a-zA-Z0-9_-]+$1030610307          - `input: map[unknown]`1030810309          - `name: string`1031010311            The name of the MCP tool1031210313          - `server_name: string`1031410315            The name of the MCP server1031610317        - `BetaMCPToolResultBlock object`1031810319          - `type: "mcp_tool_result"`1032010321            default: mcp_tool_result1032210323          - `content: string or array of BetaTextBlock`1032410325            - `string`1032610327            - `BetaMCPToolResultBlockContent = array of BetaTextBlock`1032810329              - `type: "text"`1033010331                default: text1033210333              - `citations: array of BetaTextCitation or null`1033410335                Citations supporting the text block.1033610337                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`.1033810339              - `text: string`1034010341                minLength: 01034210343          - `is_error: boolean`1034410345            default: false1034610347          - `tool_use_id: string`1034810349            pattern: ^[a-zA-Z0-9_-]+$1035010351        - `BetaContainerUploadBlock object`1035210353          Response model for a file uploaded to the container.1035410355          - `type: "container_upload"`1035610357            default: container_upload1035810359          - `file_id: string`1036010361        - `BetaCompactionBlock object`1036210363          A compaction block returned when autocompact is triggered.1036410365          When content is None, it indicates the compaction failed to produce a valid10366          summary (e.g., malformed output from the model). Clients may round-trip10367          compaction blocks with null content; the server treats them as no-ops.1036810369          - `type: "compaction"`1037010371            default: compaction1037210373          - `content: string or null`1037410375            Summary of compacted content, or null if compaction failed1037610377          - `encrypted_content: string or null`1037810379            Opaque metadata from prior compaction, to be round-tripped verbatim1038010381          - `signature: optional string or null`1038210383            Signature over the summary, to be sent back with the block verbatim1038410385        - `BetaFallbackBlock object`1038610387          Marks the point in `content` where one model's output gives way to the next.1038810389          One block appears per hop where a preceding model actually ran this turn and10390          declined. A turn where no preceding model ran and declined has no such10391          boundary and carries no block — the signal for whether a fallback model10392          served the response is the presence of a `fallback_message` entry in10393          `usage.iterations`, not this block.1039410395          The block is treated like a server-tool content block for streaming: it10396          arrives via the standard `content_block_start` / `content_block_stop`10397          pair and carries no deltas.1039810399          - `type: "fallback"`1040010401            default: fallback1040210403          - `from: BetaFallbackInfo`1040410405            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, its `model` is that model's canonical id.1040610407            - `model: Model`1040810409              The model that will complete your prompt.1041010411              See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1041210413              - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`1041410415                The model that will complete your prompt.1041610417                See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1041810419                - `"claude-fable-5-1"`1042010421                  Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows1042210423                - `"claude-mythos-5-1"`1042410425                  Our most capable model for cybersecurity and biology research, available through trusted access programs1042610427                - `"claude-sonnet-5"`1042810429                  High-performance model for coding and agents1043010431                - `"claude-fable-5"`1043210433                  Next generation of intelligence for the hardest knowledge work and coding problems1043410435                - `"claude-mythos-5"`1043610437                  Most capable model for cybersecurity and biology research1043810439                - `"claude-opus-5"`1044010441                  Powerful intelligence for long-running agents and coding1044210443                - `"claude-opus-4-8"`1044410445                  Powerful intelligence for long-running agents and coding1044610447                - `"claude-opus-4-7"`1044810449                  Powerful intelligence for long-running agents and coding1045010451                - `"claude-mythos-preview"`1045210453                  New class of intelligence, strongest in coding and cybersecurity1045410455                - `"claude-opus-4-6"`1045610457                  Powerful intelligence for long-running agents and coding1045810459                - `"claude-sonnet-4-6"`1046010461                  Best combination of speed and intelligence1046210463                - `"claude-haiku-4-5"`1046410465                  Fastest model with near-frontier intelligence1046610467                - `"claude-haiku-4-5-20251001"`1046810469                  Fastest model with near-frontier intelligence1047010471                - `"claude-opus-4-5"`1047210473                  Powerful intelligence for long-running agents and coding1047410475                - `"claude-opus-4-5-20251101"`1047610477                  Powerful intelligence for long-running agents and coding1047810479                - `"claude-sonnet-4-5"`1048010481                  High-performance model for agents and coding1048210483                - `"claude-sonnet-4-5-20250929"`1048410485                  High-performance model for agents and coding1048610487              - `string`1048810489          - `to: BetaFallbackInfo`1049010491            The fallback model producing the content that follows this block. Its `model` is always the canonical id.1049210493          - `trigger: BetaFallbackRefusalTrigger`1049410495            What caused the `from` model to hand over at this hop.1049610497            - `type: "refusal"`1049810499              default: refusal1050010501            - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`1050210503              The policy category that triggered a refusal.1050410505              - `"cyber"`1050610507                The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.1050810509              - `"bio"`1051010511                The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.1051210513              - `"frontier_llm"`1051410515                The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.1051610517              - `"reasoning_extraction"`1051810519                The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).1052010521              - `"general_harms"`1052210523                The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.1052410525      - `context_management: BetaContextManagementResponse or null`1052610527        Context management response.1052810529        Information about context management strategies applied during the request.1053010531        - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`1053210533          List of context management edits that were applied.1053410535          - `BetaClearToolUses20250919EditResponse object`1053610537            - `type: "clear_tool_uses_20250919"`1053810539              The type of context management edit applied.1054010541              default: clear_tool_uses_202509191054210543            - `cleared_input_tokens: number`1054410545              Number of input tokens cleared by this edit.1054610547              minimum: 01054810549            - `cleared_tool_uses: number`1055010551              Number of tool uses that were cleared.1055210553              minimum: 01055410555          - `BetaClearThinking20251015EditResponse object`1055610557            - `type: "clear_thinking_20251015"`1055810559              The type of context management edit applied.1056010561              default: clear_thinking_202510151056210563            - `cleared_input_tokens: number`1056410565              Number of input tokens cleared by this edit.1056610567              minimum: 01056810569            - `cleared_thinking_turns: number`1057010571              Number of thinking turns that were cleared.1057210573              minimum: 01057410575      - `diagnostics: BetaDiagnostics or null`1057610577        Response envelope for request-level diagnostics. Present (possibly10578        null) whenever the caller supplied `diagnostics` on the request.1057910580        - `cache_miss_reason: BetaCacheMissModelChanged or BetaCacheMissSystemChanged or BetaCacheMissToolsChanged or 3 more or null`1058110582          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.1058310584          - `BetaCacheMissModelChanged object`1058510586            - `type: "model_changed"`1058710588              default: model_changed1058910590            - `cache_missed_input_tokens: number`1059110592              Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.1059310594          - `BetaCacheMissSystemChanged object`1059510596            - `type: "system_changed"`1059710598              default: system_changed1059910600            - `cache_missed_input_tokens: number`1060110602              Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.1060310604          - `BetaCacheMissToolsChanged object`1060510606            - `type: "tools_changed"`1060710608              default: tools_changed1060910610            - `cache_missed_input_tokens: number`1061110612              Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.1061310614          - `BetaCacheMissMessagesChanged object`1061510616            - `type: "messages_changed"`1061710618              default: messages_changed1061910620            - `cache_missed_input_tokens: number`1062110622              Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.1062310624          - `BetaCacheMissPreviousMessageNotFound object`1062510626            - `type: "previous_message_not_found"`1062710628              default: previous_message_not_found1062910630          - `BetaCacheMissUnavailable object`1063110632            - `type: "unavailable"`1063310634              default: unavailable1063510636      - `model: Model`1063710638        The model that will complete your prompt.1063910640        See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1064110642      - `role: "assistant"`1064310644        Conversational role of the generated message.1064510646        This will always be `"assistant"`.1064710648        default: assistant1064910650      - `stop_details: BetaRefusalStopDetails or null`1065110652        Structured information about a refusal.1065310654        - `type: "refusal"`1065510656          default: refusal1065710658        - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`1065910660          The policy category that triggered a refusal.1066110662          - `"cyber"`1066310664            The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.1066510666          - `"bio"`1066710668            The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.1066910670          - `"frontier_llm"`1067110672            The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.1067310674          - `"reasoning_extraction"`1067510676            The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).1067710678          - `"general_harms"`1067910680            The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.1068110682        - `explanation: string or null`1068310684          Human-readable explanation of the refusal.1068510686          This text is not guaranteed to be stable. `null` when no explanation is available for the category.1068710688        - `fallback_credit_token: string or null`1068910690          Opaque code that refunds the cache-miss cost when retrying this refused10691          request on the fallback model. Pass it as `fallback_credit_token` on the10692          retry request. Expires 5 minutes after the refusal.1069310694          The retry is sent either with the same request body (`system`, `messages`,10695          `tools`, and other render-shaping fields), or with the same body plus one10696          appended `assistant` message whose content is the partial text (with any10697          trailing whitespace stripped from the final text block) and paired10698          server-tool blocks from this refusal — which also authorizes that10699          appended turn as an assistant-prefill continuation on models that otherwise10700          disallow prefill. A token minted mid-server-tool-loop whose partial content10701          was continuable may only be redeemed the second way — if a same-body retry10702          is rejected with a 400 saying the token must be redeemed by continuing the10703          partial response, retry the second way instead. Either way: same workspace,10704          same platform; a mismatch is a 400. Resending a token for an already-warm10705          prefix is permitted but yields no additional credit.1070610707          `null` when the refused model isn't eligible for a fallback credit.1070810709        - `fallback_has_prefill_claim: boolean or null`1071010711          Whether the accompanying `fallback_credit_token` may be redeemed with the10712          appended-assistant retry form. Only set when `fallback_credit_token` is10713          present.1071410715          `true`: retry by resending the same request body plus one appended10716          `assistant` message whose content is this response's `content` with any10717          trailing whitespace stripped from the final text block and unpaired10718          `tool_use` blocks omitted (the same appended-turn shape described on10719          `fallback_credit_token`), with the token attached. `false`: retry by10720          resending the original request body unchanged, with the token attached —10721          the appended-assistant form is not available for this refusal (no10722          continuable partial content, or the request uses `output_format` or a10723          `tool_choice` that forces tool use). One exception: when the request used10724          `output_format` or a forced `tool_choice` and the refusal arrived after10725          server tools (including MCP connector tools) had already executed, the10726          token may not be redeemable by either retry form; if the exact-body retry10727          is then rejected with a 400 saying the token must be redeemed by10728          continuing the partial response, discard the token and retry without it.1072910730          Advisory: if an appended-assistant retry is rejected with a 400 despite10731          `true`, fall back to resending the original request body with the token.1073210733        - `recommended_model: string or null`1073410735          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.1073610737      - `stop_reason: BetaStopReason or null`1073810739        The reason that we stopped.1074010741        This may be one the following values:1074210743        * `"end_turn"`: the model reached a natural stopping point10744        * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum10745        * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated10746        * `"tool_use"`: the model invoked one or more tools10747        * `"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.10748        * `"refusal"`: when streaming classifiers intervene to handle potential policy violations10749        * `"model_context_window_exceeded"`: we exceeded the model's context window1075010751        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.1075210753        - `"end_turn"`1075410755        - `"max_tokens"`1075610757        - `"stop_sequence"`1075810759        - `"tool_use"`1076010761        - `"pause_turn"`1076210763        - `"compaction"`1076410765        - `"refusal"`1076610767        - `"model_context_window_exceeded"`1076810769      - `stop_sequence: string or null`1077010771        Which custom stop sequence was generated, if any.1077210773        This value will be a non-null string if one of your custom stop sequences was generated.1077410775      - `usage: BetaUsage`1077610777        Billing and rate-limit usage.1077810779        Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.1078010781        Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.1078210783        For example, `output_tokens` will be non-zero, even for an empty string response from Claude.1078410785        Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.1078610787        - `cache_creation: BetaCacheCreation or null`1078810789          Breakdown of cached tokens by TTL1079010791          - `ephemeral_1h_input_tokens: number`1079210793            The number of input tokens used to create the 1 hour cache entry.1079410795            default: 0, minimum: 01079610797          - `ephemeral_5m_input_tokens: number`1079810799            The number of input tokens used to create the 5 minute cache entry.1080010801            default: 0, minimum: 01080210803        - `cache_creation_input_tokens: number or null`1080410805          The number of input tokens used to create the cache entry.1080610807          minimum: 01080810809        - `cache_read_input_tokens: number or null`1081010811          The number of input tokens read from the cache.1081210813          minimum: 01081410815        - `fallback_credit: BetaFallbackCreditUsage or null`1081610817          Outcome of the `fallback_credit_token` presented on this request.1081810819          - `status: BetaFallbackCreditRedeemed or BetaFallbackCreditNotApplied`1082010821            Whether the fallback-credit reprice was applied to this response's billing.1082210823            A union discriminated on `type`. `redeemed`: the retry is billed as if10824            the conversation had been on the retry model all along — including when the10825            resulting shift is zero because there was nothing to move. `not_applied`:10826            no reprice was applied; the arm's `reason` says why.1082710828            - `BetaFallbackCreditRedeemed object`1082910830              The reprice was applied: the retry is billed as if the conversation10831              had been on the retry model all along.1083210833              - `type: "redeemed"`1083410835                default: redeemed1083610837            - `BetaFallbackCreditNotApplied object`1083810839              No reprice was applied; `reason` says why.1084010841              - `type: "not_applied"`1084210843                default: not_applied1084410845              - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`1084610847                Why the reprice was not applied.1084810849                A closed enum; additions to the redemption-check vocabulary arrive as10850                deliberate schema updates.1085110852                - `"body_mismatch"`1085310854                - `"continuation_excluded"`1085510856                - `"continuation_only"`1085710858                - `"expired"`1085910860                - `"invalid_target_model"`1086110862                - `"not_enabled"`1086310864                - `"reprice_unavailable"`1086510866                - `"temporarily_unavailable"`1086710868                - `"variant_fields_present"`1086910870                - `"wrong_organization"`1087110872                - `"wrong_platform"`1087310874                - `"wrong_workspace"`1087510876              - `remove_to_redeem: optional array of string or null`1087710878                Request fields to remove before retrying, so the retry can redeem this10879                token.1088010881                Present exactly when `reason` is `variant_fields_present` — never null,10882                never an empty array; absent otherwise. Fields are named only from your own request, and only after10883                the sealed variant hash matched. A served best-effort retry has already10884                been billed at normal price; nothing redeems retroactively, but a corrected10885                re-send inside the token's five-minute window can still redeem.1088610887        - `inference_geo: string or null`1088810889          The geographic region where inference was performed for this request.1089010891        - `input_tokens: number`1089210893          The number of input tokens which were used.1089410895          minimum: 01089610897        - `iterations: BetaIterationsUsage or null`1089810899          Per-iteration token usage breakdown.1090010901          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:1090210903          - Determine which iterations exceeded long context thresholds (>=200k tokens)10904          - Calculate the context window size from the last `message` entry10905          - Understand token accumulation across server-side tool use loops1090610907          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.1090810909          - `BetaMessageIterationUsage object`1091010911            Token usage for a sampling iteration.1091210913            - `type: "message"`1091410915              Usage for a sampling iteration1091610917              default: message1091810919            - `cache_creation: BetaCacheCreation or null`1092010921              Breakdown of cached tokens by TTL1092210923            - `cache_creation_input_tokens: number`1092410925              The number of input tokens used to create the cache entry.1092610927              default: 0, minimum: 01092810929            - `cache_read_input_tokens: number`1093010931              The number of input tokens read from the cache.1093210933              default: 0, minimum: 01093410935            - `input_tokens: number`1093610937              The number of input tokens which were used.1093810939              minimum: 01094010941            - `model: Model or null`1094210943              The model that will complete your prompt.1094410945              See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1094610947            - `output_tokens: number`1094810949              The number of output tokens which were used.1095010951              minimum: 01095210953          - `BetaCompactionIterationUsage object`1095410955            Token usage for a compaction iteration.1095610957            - `type: "compaction"`1095810959              Usage for a compaction iteration1096010961              default: compaction1096210963            - `cache_creation: BetaCacheCreation or null`1096410965              Breakdown of cached tokens by TTL1096610967            - `cache_creation_input_tokens: number`1096810969              The number of input tokens used to create the cache entry.1097010971              default: 0, minimum: 01097210973            - `cache_read_input_tokens: number`1097410975              The number of input tokens read from the cache.1097610977              default: 0, minimum: 01097810979            - `input_tokens: number`1098010981              The number of input tokens which were used.1098210983              minimum: 01098410985            - `output_tokens: number`1098610987              The number of output tokens which were used.1098810989              minimum: 01099010991          - `BetaAdvisorMessageIterationUsage object`1099210993            Token usage for an advisor sub-inference iteration.1099410995            - `type: "advisor_message"`1099610997              Usage for an advisor sub-inference iteration1099810999              default: advisor_message1100011001            - `cache_creation: BetaCacheCreation or null`1100211003              Breakdown of cached tokens by TTL1100411005            - `cache_creation_input_tokens: number`1100611007              The number of input tokens used to create the cache entry.1100811009              default: 0, minimum: 01101011011            - `cache_read_input_tokens: number`1101211013              The number of input tokens read from the cache.1101411015              default: 0, minimum: 01101611017            - `input_tokens: number`1101811019              The number of input tokens which were used.1102011021              minimum: 01102211023            - `model: Model`1102411025              The model that will complete your prompt.1102611027              See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1102811029            - `output_tokens: number`1103011031              The number of output tokens which were used.1103211033              minimum: 01103411035          - `BetaFallbackMessageIterationUsage object`1103611037            Token usage for the fallback-model attempt of a server-side fallback request.1103811039            The terminal entry of a fallback-served turn: when a fallback hop's11040            output is the returned message, the entry for the iteration that11041            completed it carries this type in place of `message`. A declined hop11042            and the serving hop's earlier tool-loop iterations produce `message`11043            entries. Whether a fallback model served the response is signalled by11044            the presence of this entry in `usage.iterations`.1104511046            - `type: "fallback_message"`1104711048              Usage for the fallback-model attempt that served the response1104911050              default: fallback_message1105111052            - `cache_creation: BetaCacheCreation or null`1105311054              Breakdown of cached tokens by TTL1105511056            - `cache_creation_input_tokens: number`1105711058              The number of input tokens used to create the cache entry.1105911060              default: 0, minimum: 01106111062            - `cache_read_input_tokens: number`1106311064              The number of input tokens read from the cache.1106511066              default: 0, minimum: 01106711068            - `input_tokens: number`1106911070              The number of input tokens which were used.1107111072              minimum: 01107311074            - `model: Model`1107511076              The model that will complete your prompt.1107711078              See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1107911080            - `output_tokens: number`1108111082              The number of output tokens which were used.1108311084              minimum: 01108511086        - `output_tokens: number`1108711088          The number of output tokens which were used.1108911090          minimum: 01109111092        - `output_tokens_details: BetaOutputTokensDetails or null`1109311094          Breakdown of output tokens by category.1109511096          `output_tokens` remains the inclusive, authoritative total used for billing.11097          This object provides a read-only decomposition for observability — for example,11098          how many of the billed output tokens were spent on internal reasoning that may11099          have been summarized before being returned to you.1110011101          - `thinking_tokens: number`1110211103            Number of output tokens the model generated as internal reasoning, including11104            the thinking-block delimiter tokens.1110511106            Reflects the raw reasoning the model produced, not the (possibly shorter)11107            summarized thinking text returned in the response body. Computed by11108            re-tokenizing the raw reasoning text, so it may differ from the model's exact11109            generation count by a small number of tokens. Always ≤ `output_tokens`;11110            `output_tokens - thinking_tokens` approximates the non-reasoning output.1111111112            default: 0, minimum: 01111311114        - `server_tool_use: BetaServerToolUsage or null`1111511116          The number of server tool requests.1111711118          - `web_fetch_requests: number`1111911120            The number of web fetch tool requests.1112111122            default: 0, minimum: 01112311124          - `web_search_requests: number`1112511126            The number of web search tool requests.1112711128            default: 0, minimum: 01112911130        - `service_tier: "standard" or "priority" or "batch" or null`1113111132          If the request used the priority, standard, or batch tier.1113311134          - `"standard"`1113511136          - `"priority"`1113711138          - `"batch"`1113911140        - `speed: "standard" or "fast" or null`1114111142          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.1114311144          - `"standard"`1114511146          - `"fast"`1114711148      - `input_transformations: optional array of BetaInputTransformation or null`1114911150        Changes the API made to the request's input before showing it to the model,11151        and blocks that failed a binding check but were left unchanged: one entry per11152        block, in request order. Two entry types today. `thinking_dropped` — a11153        `thinking`, `redacted_thinking` or `connector_text` block from the request's11154        `messages` that was removed from the prompt instead of being shown to the11155        model because it failed a binding check. `thinking_mismatch_allowed` — a11156        `thinking` or `redacted_thinking` block that failed the conversation check11157        (the conversation before it differs from the one it was created in, or it11158        carries no record of one on a model that requires it) and was shown to the11159        model all the same, because that check is not enforced for this request.11160        More entry types may be added over time; ignore types you do not recognize.1116111162        Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on11163        every such response from a model that supports extended thinking, as `[]`11164        when there is no entry to report; without the beta, blocks are removed or11165        left in place all the same but nothing is reported. Removed blocks contribute11166        nothing to `usage.input_tokens`; blocks left in place count as sent. When11167        streaming, the array is final in `message_start`; the final `message_delta`11168        event carries it only when a server-side model fallback happened mid-stream,11169        in which case it holds the serving model's entries and replaces the one in11170        `message_start`.1117111172        - `BetaThinkingDroppedInputTransformation object`1117311174          - `type: "thinking_dropped"`1117511176            Always `thinking_dropped` for this entry type.1117711178            default: thinking_dropped1117911180          - `path: string`1118111182            Where the removed block was in your request, as `messages.{i}.content.{j}`:11183            `i` indexes the `messages` array you sent and `j` that message's `content`11184            array — the same form error messages use.1118511186          - `reason: "model_binding_mismatch" or "prefix_binding_mismatch" or "organization_binding_mismatch" or "end_user_binding_mismatch"`1118711188            Which binding check removed the block: `model_binding_mismatch` — it was11189            created by a model whose reasoning the requested model may not read;11190            `prefix_binding_mismatch` — the conversation before it differs from the11191            conversation it was created in (the rest of that turn's consecutive thinking11192            blocks are removed with it, each with this reason);11193            `organization_binding_mismatch` — it was created under a different11194            organization (an Anthropic organization, AWS account or Google Cloud project)11195            and this organization is not one of its additional organizations;11196            `end_user_binding_mismatch` — it was created for a different end user, or11197            was removed by the consumer-organization binding. A block that would fail11198            several checks reports one reason, in this order of precedence:11199            `organization_binding_mismatch`, `end_user_binding_mismatch`,11200            `model_binding_mismatch`, `prefix_binding_mismatch`.1120111202            - `"model_binding_mismatch"`1120311204            - `"prefix_binding_mismatch"`1120511206            - `"organization_binding_mismatch"`1120711208            - `"end_user_binding_mismatch"`1120911210        - `BetaThinkingMismatchAllowedInputTransformation object`1121111212          - `type: "thinking_mismatch_allowed"`1121311214            Always `thinking_mismatch_allowed` for this entry type.1121511216            default: thinking_mismatch_allowed1121711218          - `path: string`1121911220            Where the block is in your request, as `messages.{i}.content.{j}`:11221            `i` indexes the `messages` array you sent and `j` that message's `content`11222            array — the same form error messages use.1122311224          - `reason: "model_binding_mismatch" or "prefix_binding_mismatch" or "organization_binding_mismatch" or "end_user_binding_mismatch"`1122511226            Which binding check the block failed; the block was shown to the model all11227            the same. Always `prefix_binding_mismatch` today — the conversation before11228            the block differs from the conversation it was created in, or the block11229            carries no record of one on a model that requires it. Were the check11230            enforced for this request, the block would have been removed or the request11231            rejected (`thinking.block_binding.prefix_mismatch_behavior`). A removal also11232            takes the rest of that turn's consecutive thinking blocks, whereas here each11233            block is checked on its own, so `thinking_mismatch_allowed` entries are a11234            lower bound on what enforcement would remove.1123511236            - `"model_binding_mismatch"`1123711238            - `"prefix_binding_mismatch"`1123911240            - `"organization_binding_mismatch"`1124111242            - `"end_user_binding_mismatch"`1124311244  - `BetaMessageBatchErroredResult object`1124511246    - `type: "errored"`1124711248      default: errored1124911250    - `error: BetaErrorResponse`1125111252      - `type: "error"`1125311254        default: error1125511256      - `error: BetaError`1125711258        - `BetaInvalidRequestError object`1125911260          - `type: "invalid_request_error"`1126111262            default: invalid_request_error1126311264          - `message: string`1126511266            default: Invalid request1126711268        - `BetaAuthenticationError object`1126911270          - `type: "authentication_error"`1127111272            default: authentication_error1127311274          - `message: string`1127511276            default: Authentication error1127711278        - `BetaBillingError object`1127911280          - `type: "billing_error"`1128111282            default: billing_error1128311284          - `message: string`1128511286            default: Billing error1128711288        - `BetaPermissionError object`1128911290          - `type: "permission_error"`1129111292            default: permission_error1129311294          - `message: string`1129511296            default: Permission denied1129711298        - `BetaNotFoundError object`1129911300          - `type: "not_found_error"`1130111302            default: not_found_error1130311304          - `message: string`1130511306            default: Not found1130711308        - `BetaRateLimitError object`1130911310          - `type: "rate_limit_error"`1131111312            default: rate_limit_error1131311314          - `message: string`1131511316            default: Rate limited1131711318        - `BetaGatewayTimeoutError object`1131911320          - `type: "timeout_error"`1132111322            default: timeout_error1132311324          - `message: string`1132511326            default: Request timeout1132711328        - `BetaAPIError object`1132911330          - `type: "api_error"`1133111332            default: api_error1133311334          - `message: string`1133511336            default: Internal server error1133711338        - `BetaOverloadedError object`1133911340          - `type: "overloaded_error"`1134111342            default: overloaded_error1134311344          - `message: string`1134511346            default: Overloaded1134711348      - `request_id: string or null`1134911350  - `BetaMessageBatchCanceledResult object`1135111352    - `type: "canceled"`1135311354      default: canceled1135511356  - `BetaMessageBatchExpiredResult object`1135711358    - `type: "expired"`1135911360      default: expired1136111362### Beta Message Batch Succeeded Result1136311364- `BetaMessageBatchSucceededResult object`1136511366  - `type: "succeeded"`1136711368    default: succeeded1136911370  - `message: BetaMessage`1137111372    - `type: "message"`1137311374      Object type.1137511376      For Messages, this is always `"message"`.1137711378      default: message1137911380    - `id: string`1138111382      Unique object identifier.1138311384      The format and length of IDs may change over time.1138511386    - `container: BetaContainer or null`1138711388      Information about the container used in the request (for the code execution tool)1138911390      - `id: string`1139111392        Identifier for the container used in this request1139311394      - `expires_at: string`1139511396        The time at which the container will expire.1139711398        format: date-time1139911400      - `skills: array of BetaContainerSkill or null`1140111402        Skills loaded in the container1140311404        - `type: "anthropic" or "custom"`1140511406          Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)1140711408          - `"anthropic"`1140911410          - `"custom"`1141111412        - `skill_id: string`1141311414          Skill ID1141511416          maxLength: 64, minLength: 11141711418        - `version: string`1141911420          The resolved version: a skill version ID for custom skills.1142111422          maxLength: 64, minLength: 11142311424    - `content: array of BetaContentBlock`1142511426      Content generated by the model.1142711428      This is an array of content blocks, each of which has a `type` that determines its shape.1142911430      Example:1143111432      ```json11433      [{"type": "text", "text": "Hi, I'm Claude."}]11434      ```1143511436      If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.1143711438      For example, if the input `messages` were:1143911440      ```json11441      [11442        {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},11443        {"role": "assistant", "content": "The best answer is ("}11444      ]11445      ```1144611447      Then the response `content` might be:1144811449      ```json11450      [{"type": "text", "text": "B)"}]11451      ```1145211453      - `BetaTextBlock object`1145411455        - `type: "text"`1145611457          default: text1145811459        - `citations: array of BetaTextCitation or null`1146011461          Citations supporting the text block.1146211463          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`.1146411465          - `BetaCitationCharLocation object`1146611467            - `type: "char_location"`1146811469              default: char_location1147011471            - `cited_text: string`1147211473            - `document_index: number`1147411475              minimum: 01147611477            - `document_title: string or null`1147811479            - `end_char_index: number`1148011481            - `file_id: string or null`1148211483            - `start_char_index: number`1148411485              minimum: 01148611487          - `BetaCitationPageLocation object`1148811489            - `type: "page_location"`1149011491              default: page_location1149211493            - `cited_text: string`1149411495            - `document_index: number`1149611497              minimum: 01149811499            - `document_title: string or null`1150011501            - `end_page_number: number`1150211503            - `file_id: string or null`1150411505            - `start_page_number: number`1150611507              minimum: 11150811509          - `BetaCitationContentBlockLocation object`1151011511            - `type: "content_block_location"`1151211513              default: content_block_location1151411515            - `cited_text: string`1151611517              The full text of the cited block range, concatenated.1151811519              Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.1152011521            - `document_index: number`1152211523              minimum: 01152411525            - `document_title: string or null`1152611527            - `end_block_index: number`1152811529              Exclusive 0-based end index of the cited block range in the source's `content` array.1153011531              Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.1153211533            - `file_id: string or null`1153411535            - `start_block_index: number`1153611537              0-based index of the first cited block in the source's `content` array.1153811539              minimum: 01154011541          - `BetaCitationsWebSearchResultLocation object`1154211543            - `type: "web_search_result_location"`1154411545              default: web_search_result_location1154611547            - `cited_text: string`1154811549            - `encrypted_index: string`1155011551            - `title: string or null`1155211553              maxLength: 5121155411555            - `url: string`1155611557          - `BetaCitationSearchResultLocation object`1155811559            - `type: "search_result_location"`1156011561              default: search_result_location1156211563            - `cited_text: string`1156411565              The full text of the cited block range, concatenated.1156611567              Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.1156811569            - `end_block_index: number`1157011571              Exclusive 0-based end index of the cited block range in the source's `content` array.1157211573              Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.1157411575            - `search_result_index: number`1157611577              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.1157811579              Counted separately from `document_index`; server-side web search results are not included in this count.1158011581              minimum: 01158211583            - `source: string`1158411585            - `start_block_index: number`1158611587              0-based index of the first cited block in the source's `content` array.1158811589              minimum: 01159011591            - `title: string or null`1159211593        - `text: string`1159411595          minLength: 01159611597      - `BetaThinkingBlock object`1159811599        - `type: "thinking"`1160011601          default: thinking1160211603        - `signature: string`1160411605          A value used to verify that this thinking block was generated by Claude when it is passed back to the API.1160611607          This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.1160811609          See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.1161011611        - `thinking: string`1161211613          The text of Claude's thinking process for this block.1161411615      - `BetaRedactedThinkingBlock object`1161611617        - `type: "redacted_thinking"`1161811619          default: redacted_thinking1162011621        - `data: string`1162211623          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.1162411625          Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.1162611627          See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.1162811629      - `BetaToolUseBlock object`1163011631        - `type: "tool_use"`1163211633          default: tool_use1163411635        - `id: string`1163611637          pattern: ^[a-zA-Z0-9_-]+$1163811639        - `input: map[unknown]`1164011641        - `name: string`1164211643          minLength: 11164411645        - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`1164611647          - `BetaDirectCaller object`1164811649            Tool invocation directly from the model.1165011651            - `type: "direct"`1165211653          - `BetaServerToolCaller object`1165411655            Tool invocation generated by a server-side tool.1165611657            - `type: "code_execution_20250825"`1165811659            - `tool_id: string`1166011661              pattern: ^srvtoolu_[a-zA-Z0-9_]+$1166211663          - `BetaServerToolCaller20260120 object`1166411665            - `type: "code_execution_20260120"`1166611667            - `tool_id: string`1166811669              pattern: ^srvtoolu_[a-zA-Z0-9_]+$1167011671        - `toolset_name: optional string or null`1167211673          For a toolset member tool_use, the toolset family.1167411675          maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$1167611677      - `BetaServerToolUseBlock object`1167811679        - `type: "server_tool_use"`1168011681          default: server_tool_use1168211683        - `id: string`1168411685          pattern: ^srvtoolu_[a-zA-Z0-9_]+$1168611687        - `input: map[unknown]`1168811689        - `name: "advisor" or "web_search" or "web_fetch" or 5 more`1169011691          - `"advisor"`1169211693          - `"web_search"`1169411695          - `"web_fetch"`1169611697          - `"code_execution"`1169811699          - `"bash_code_execution"`1170011701          - `"text_editor_code_execution"`1170211703          - `"tool_search_tool_regex"`1170411705          - `"tool_search_tool_bm25"`1170611707        - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`1170811709          - `BetaDirectCaller object`1171011711            Tool invocation directly from the model.1171211713          - `BetaServerToolCaller object`1171411715            Tool invocation generated by a server-side tool.1171611717          - `BetaServerToolCaller20260120 object`1171811719      - `BetaWebSearchToolResultBlock object`1172011721        - `type: "web_search_tool_result"`1172211723          default: web_search_tool_result1172411725        - `content: BetaWebSearchToolResultBlockContent`1172611727          - `BetaWebSearchToolResultError object`1172811729            - `type: "web_search_tool_result_error"`1173011731              default: web_search_tool_result_error1173211733            - `error_code: BetaWebSearchToolResultErrorCode`1173411735              - `"invalid_tool_input"`1173611737              - `"unavailable"`1173811739              - `"max_uses_exceeded"`1174011741              - `"too_many_requests"`1174211743              - `"query_too_long"`1174411745              - `"request_too_large"`1174611747          - `array of BetaWebSearchResultBlock`1174811749            - `type: "web_search_result"`1175011751              default: web_search_result1175211753            - `encrypted_content: string`1175411755            - `page_age: string or null`1175611757            - `title: string`1175811759            - `url: string`1176011761        - `tool_use_id: string`1176211763          pattern: ^srvtoolu_[a-zA-Z0-9_]+$1176411765        - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`1176611767          - `BetaDirectCaller object`1176811769            Tool invocation directly from the model.1177011771          - `BetaServerToolCaller object`1177211773            Tool invocation generated by a server-side tool.1177411775          - `BetaServerToolCaller20260120 object`1177611777      - `BetaWebFetchToolResultBlock object`1177811779        - `type: "web_fetch_tool_result"`1178011781          default: web_fetch_tool_result1178211783        - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`1178411785          - `BetaWebFetchToolResultErrorBlock object`1178611787            - `type: "web_fetch_tool_result_error"`1178811789              default: web_fetch_tool_result_error1179011791            - `error_code: BetaWebFetchToolResultErrorCode`1179211793              - `"invalid_tool_input"`1179411795              - `"url_too_long"`1179611797              - `"url_not_allowed"`1179811799              - `"url_not_in_prior_context"`1180011801              - `"url_not_accessible"`1180211803              - `"unsupported_content_type"`1180411805              - `"too_many_requests"`1180611807              - `"max_uses_exceeded"`1180811809              - `"unavailable"`1181011811              - `"content_too_large"`1181211813          - `BetaWebFetchBlock object`1181411815            - `type: "web_fetch_result"`1181611817              default: web_fetch_result1181811819            - `content: BetaDocumentBlock`1182011821              - `type: "document"`1182211823                default: document1182411825              - `citations: BetaCitationConfig or null`1182611827                Citation configuration for the document1182811829                - `enabled: boolean`1183011831                  default: false1183211833              - `source: BetaBase64PDFSource or BetaPlainTextSource`1183411835                - `BetaBase64PDFSource object`1183611837                  - `type: "base64"`1183811839                  - `data: string`1184011841                    format: byte1184211843                  - `media_type: "application/pdf"`1184411845                - `BetaPlainTextSource object`1184611847                  - `type: "text"`1184811849                  - `data: string`1185011851                  - `media_type: "text/plain"`1185211853              - `title: string or null`1185411855                The title of the document1185611857            - `retrieved_at: string or null`1185811859              ISO 8601 timestamp when the content was retrieved1186011861            - `url: string`1186211863              Fetched content URL1186411865        - `tool_use_id: string`1186611867          pattern: ^srvtoolu_[a-zA-Z0-9_]+$1186811869        - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`1187011871          - `BetaDirectCaller object`1187211873            Tool invocation directly from the model.1187411875          - `BetaServerToolCaller object`1187611877            Tool invocation generated by a server-side tool.1187811879          - `BetaServerToolCaller20260120 object`1188011881      - `BetaAdvisorToolResultBlock object`1188211883        - `type: "advisor_tool_result"`1188411885          default: advisor_tool_result1188611887        - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`1188811889          - `BetaAdvisorToolResultError object`1189011891            - `type: "advisor_tool_result_error"`1189211893              default: advisor_tool_result_error1189411895            - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`1189611897              - `"max_uses_exceeded"`1189811899              - `"prompt_too_long"`1190011901              - `"too_many_requests"`1190211903              - `"overloaded"`1190411905              - `"unavailable"`1190611907              - `"execution_time_exceeded"`1190811909              - `"model_not_found"`1191011911          - `BetaAdvisorResultBlock object`1191211913            - `type: "advisor_result"`1191411915              default: advisor_result1191611917            - `stop_reason: string or null`1191811919              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.1192011921            - `text: string`1192211923          - `BetaAdvisorRedactedResultBlock object`1192411925            - `type: "advisor_redacted_result"`1192611927              default: advisor_redacted_result1192811929            - `encrypted_content: string`1193011931              Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.1193211933            - `stop_reason: string or null`1193411935              The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).1193611937        - `tool_use_id: string`1193811939          pattern: ^srvtoolu_[a-zA-Z0-9_]+$1194011941      - `BetaCodeExecutionToolResultBlock object`1194211943        - `type: "code_execution_tool_result"`1194411945          default: code_execution_tool_result1194611947        - `content: BetaCodeExecutionToolResultBlockContent`1194811949          - `BetaCodeExecutionToolResultError object`1195011951            - `type: "code_execution_tool_result_error"`1195211953              default: code_execution_tool_result_error1195411955            - `error_code: BetaCodeExecutionToolResultErrorCode`1195611957              - `"invalid_tool_input"`1195811959              - `"unavailable"`1196011961              - `"too_many_requests"`1196211963              - `"execution_time_exceeded"`1196411965          - `BetaCodeExecutionResultBlock object`1196611967            - `type: "code_execution_result"`1196811969              default: code_execution_result1197011971            - `content: array of BetaCodeExecutionOutputBlock`1197211973              - `type: "code_execution_output"`1197411975                default: code_execution_output1197611977              - `file_id: string`1197811979            - `return_code: number`1198011981            - `stderr: string`1198211983            - `stdout: string`1198411985          - `BetaEncryptedCodeExecutionResultBlock object`1198611987            Code execution result with encrypted stdout for PFC + web_search results.1198811989            - `type: "encrypted_code_execution_result"`1199011991              default: encrypted_code_execution_result1199211993            - `content: array of BetaCodeExecutionOutputBlock`1199411995              - `type: "code_execution_output"`1199611997                default: code_execution_output1199811999              - `file_id: string`1200012001            - `encrypted_stdout: string`1200212003            - `return_code: number`1200412005            - `stderr: string`1200612007        - `tool_use_id: string`1200812009          pattern: ^srvtoolu_[a-zA-Z0-9_]+$1201012011      - `BetaBashCodeExecutionToolResultBlock object`1201212013        - `type: "bash_code_execution_tool_result"`1201412015          default: bash_code_execution_tool_result1201612017        - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`1201812019          - `BetaBashCodeExecutionToolResultError object`1202012021            - `type: "bash_code_execution_tool_result_error"`1202212023              default: bash_code_execution_tool_result_error1202412025            - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`1202612027              - `"invalid_tool_input"`1202812029              - `"unavailable"`1203012031              - `"too_many_requests"`1203212033              - `"execution_time_exceeded"`1203412035              - `"output_file_too_large"`1203612037          - `BetaBashCodeExecutionResultBlock object`1203812039            - `type: "bash_code_execution_result"`1204012041              default: bash_code_execution_result1204212043            - `content: array of BetaBashCodeExecutionOutputBlock`1204412045              - `type: "bash_code_execution_output"`1204612047                default: bash_code_execution_output1204812049              - `file_id: string`1205012051            - `return_code: number`1205212053            - `stderr: string`1205412055            - `stdout: string`1205612057        - `tool_use_id: string`1205812059          pattern: ^srvtoolu_[a-zA-Z0-9_]+$1206012061      - `BetaTextEditorCodeExecutionToolResultBlock object`1206212063        - `type: "text_editor_code_execution_tool_result"`1206412065          default: text_editor_code_execution_tool_result1206612067        - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`1206812069          - `BetaTextEditorCodeExecutionToolResultError object`1207012071            - `type: "text_editor_code_execution_tool_result_error"`1207212073              default: text_editor_code_execution_tool_result_error1207412075            - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`1207612077              - `"invalid_tool_input"`1207812079              - `"unavailable"`1208012081              - `"too_many_requests"`1208212083              - `"execution_time_exceeded"`1208412085              - `"file_not_found"`1208612087            - `error_message: string or null`1208812089          - `BetaTextEditorCodeExecutionViewResultBlock object`1209012091            - `type: "text_editor_code_execution_view_result"`1209212093              default: text_editor_code_execution_view_result1209412095            - `content: string`1209612097            - `file_type: "text" or "image" or "pdf"`1209812099              - `"text"`1210012101              - `"image"`1210212103              - `"pdf"`1210412105            - `num_lines: number or null`1210612107            - `start_line: number or null`1210812109            - `total_lines: number or null`1211012111          - `BetaTextEditorCodeExecutionCreateResultBlock object`1211212113            - `type: "text_editor_code_execution_create_result"`1211412115              default: text_editor_code_execution_create_result1211612117            - `is_file_update: boolean`1211812119          - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`1212012121            - `type: "text_editor_code_execution_str_replace_result"`1212212123              default: text_editor_code_execution_str_replace_result1212412125            - `lines: array of string or null`1212612127            - `new_lines: number or null`1212812129            - `new_start: number or null`1213012131            - `old_lines: number or null`1213212133            - `old_start: number or null`1213412135        - `tool_use_id: string`1213612137          pattern: ^srvtoolu_[a-zA-Z0-9_]+$1213812139      - `BetaToolSearchToolResultBlock object`1214012141        - `type: "tool_search_tool_result"`1214212143          default: tool_search_tool_result1214412145        - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`1214612147          - `BetaToolSearchToolResultError object`1214812149            - `type: "tool_search_tool_result_error"`1215012151              default: tool_search_tool_result_error1215212153            - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`1215412155              - `"invalid_tool_input"`1215612157              - `"unavailable"`1215812159              - `"too_many_requests"`1216012161              - `"execution_time_exceeded"`1216212163            - `error_message: string or null`1216412165          - `BetaToolSearchToolSearchResultBlock object`1216612167            - `type: "tool_search_tool_search_result"`1216812169              default: tool_search_tool_search_result1217012171            - `tool_references: array of BetaToolReferenceBlock`1217212173              - `type: "tool_reference"`1217412175                default: tool_reference1217612177              - `tool_name: string`1217812179                maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$1218012181        - `tool_use_id: string`1218212183          pattern: ^srvtoolu_[a-zA-Z0-9_]+$1218412185      - `BetaMCPToolUseBlock object`1218612187        - `type: "mcp_tool_use"`1218812189          default: mcp_tool_use1219012191        - `id: string`1219212193          pattern: ^[a-zA-Z0-9_-]+$1219412195        - `input: map[unknown]`1219612197        - `name: string`1219812199          The name of the MCP tool1220012201        - `server_name: string`1220212203          The name of the MCP server1220412205      - `BetaMCPToolResultBlock object`1220612207        - `type: "mcp_tool_result"`1220812209          default: mcp_tool_result1221012211        - `content: string or array of BetaTextBlock`1221212213          - `string`1221412215          - `BetaMCPToolResultBlockContent = array of BetaTextBlock`1221612217            - `type: "text"`1221812219              default: text1222012221            - `citations: array of BetaTextCitation or null`1222212223              Citations supporting the text block.1222412225              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`.1222612227            - `text: string`1222812229              minLength: 01223012231        - `is_error: boolean`1223212233          default: false1223412235        - `tool_use_id: string`1223612237          pattern: ^[a-zA-Z0-9_-]+$1223812239      - `BetaContainerUploadBlock object`1224012241        Response model for a file uploaded to the container.1224212243        - `type: "container_upload"`1224412245          default: container_upload1224612247        - `file_id: string`1224812249      - `BetaCompactionBlock object`1225012251        A compaction block returned when autocompact is triggered.1225212253        When content is None, it indicates the compaction failed to produce a valid12254        summary (e.g., malformed output from the model). Clients may round-trip12255        compaction blocks with null content; the server treats them as no-ops.1225612257        - `type: "compaction"`1225812259          default: compaction1226012261        - `content: string or null`1226212263          Summary of compacted content, or null if compaction failed1226412265        - `encrypted_content: string or null`1226612267          Opaque metadata from prior compaction, to be round-tripped verbatim1226812269        - `signature: optional string or null`1227012271          Signature over the summary, to be sent back with the block verbatim1227212273      - `BetaFallbackBlock object`1227412275        Marks the point in `content` where one model's output gives way to the next.1227612277        One block appears per hop where a preceding model actually ran this turn and12278        declined. A turn where no preceding model ran and declined has no such12279        boundary and carries no block — the signal for whether a fallback model12280        served the response is the presence of a `fallback_message` entry in12281        `usage.iterations`, not this block.1228212283        The block is treated like a server-tool content block for streaming: it12284        arrives via the standard `content_block_start` / `content_block_stop`12285        pair and carries no deltas.1228612287        - `type: "fallback"`1228812289          default: fallback1229012291        - `from: BetaFallbackInfo`1229212293          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, its `model` is that model's canonical id.1229412295          - `model: Model`1229612297            The model that will complete your prompt.1229812299            See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1230012301            - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`1230212303              The model that will complete your prompt.1230412305              See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1230612307              - `"claude-fable-5-1"`1230812309                Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows1231012311              - `"claude-mythos-5-1"`1231212313                Our most capable model for cybersecurity and biology research, available through trusted access programs1231412315              - `"claude-sonnet-5"`1231612317                High-performance model for coding and agents1231812319              - `"claude-fable-5"`1232012321                Next generation of intelligence for the hardest knowledge work and coding problems1232212323              - `"claude-mythos-5"`1232412325                Most capable model for cybersecurity and biology research1232612327              - `"claude-opus-5"`1232812329                Powerful intelligence for long-running agents and coding1233012331              - `"claude-opus-4-8"`1233212333                Powerful intelligence for long-running agents and coding1233412335              - `"claude-opus-4-7"`1233612337                Powerful intelligence for long-running agents and coding1233812339              - `"claude-mythos-preview"`1234012341                New class of intelligence, strongest in coding and cybersecurity1234212343              - `"claude-opus-4-6"`1234412345                Powerful intelligence for long-running agents and coding1234612347              - `"claude-sonnet-4-6"`1234812349                Best combination of speed and intelligence1235012351              - `"claude-haiku-4-5"`1235212353                Fastest model with near-frontier intelligence1235412355              - `"claude-haiku-4-5-20251001"`1235612357                Fastest model with near-frontier intelligence1235812359              - `"claude-opus-4-5"`1236012361                Powerful intelligence for long-running agents and coding1236212363              - `"claude-opus-4-5-20251101"`1236412365                Powerful intelligence for long-running agents and coding1236612367              - `"claude-sonnet-4-5"`1236812369                High-performance model for agents and coding1237012371              - `"claude-sonnet-4-5-20250929"`1237212373                High-performance model for agents and coding1237412375            - `string`1237612377        - `to: BetaFallbackInfo`1237812379          The fallback model producing the content that follows this block. Its `model` is always the canonical id.1238012381        - `trigger: BetaFallbackRefusalTrigger`1238212383          What caused the `from` model to hand over at this hop.1238412385          - `type: "refusal"`1238612387            default: refusal1238812389          - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`1239012391            The policy category that triggered a refusal.1239212393            - `"cyber"`1239412395              The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.1239612397            - `"bio"`1239812399              The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.1240012401            - `"frontier_llm"`1240212403              The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.1240412405            - `"reasoning_extraction"`1240612407              The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).1240812409            - `"general_harms"`1241012411              The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.1241212413    - `context_management: BetaContextManagementResponse or null`1241412415      Context management response.1241612417      Information about context management strategies applied during the request.1241812419      - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`1242012421        List of context management edits that were applied.1242212423        - `BetaClearToolUses20250919EditResponse object`1242412425          - `type: "clear_tool_uses_20250919"`1242612427            The type of context management edit applied.1242812429            default: clear_tool_uses_202509191243012431          - `cleared_input_tokens: number`1243212433            Number of input tokens cleared by this edit.1243412435            minimum: 01243612437          - `cleared_tool_uses: number`1243812439            Number of tool uses that were cleared.1244012441            minimum: 01244212443        - `BetaClearThinking20251015EditResponse object`1244412445          - `type: "clear_thinking_20251015"`1244612447            The type of context management edit applied.1244812449            default: clear_thinking_202510151245012451          - `cleared_input_tokens: number`1245212453            Number of input tokens cleared by this edit.1245412455            minimum: 01245612457          - `cleared_thinking_turns: number`1245812459            Number of thinking turns that were cleared.1246012461            minimum: 01246212463    - `diagnostics: BetaDiagnostics or null`1246412465      Response envelope for request-level diagnostics. Present (possibly12466      null) whenever the caller supplied `diagnostics` on the request.1246712468      - `cache_miss_reason: BetaCacheMissModelChanged or BetaCacheMissSystemChanged or BetaCacheMissToolsChanged or 3 more or null`1246912470        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.1247112472        - `BetaCacheMissModelChanged object`1247312474          - `type: "model_changed"`1247512476            default: model_changed1247712478          - `cache_missed_input_tokens: number`1247912480            Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.1248112482        - `BetaCacheMissSystemChanged object`1248312484          - `type: "system_changed"`1248512486            default: system_changed1248712488          - `cache_missed_input_tokens: number`1248912490            Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.1249112492        - `BetaCacheMissToolsChanged object`1249312494          - `type: "tools_changed"`1249512496            default: tools_changed1249712498          - `cache_missed_input_tokens: number`1249912500            Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.1250112502        - `BetaCacheMissMessagesChanged object`1250312504          - `type: "messages_changed"`1250512506            default: messages_changed1250712508          - `cache_missed_input_tokens: number`1250912510            Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.1251112512        - `BetaCacheMissPreviousMessageNotFound object`1251312514          - `type: "previous_message_not_found"`1251512516            default: previous_message_not_found1251712518        - `BetaCacheMissUnavailable object`1251912520          - `type: "unavailable"`1252112522            default: unavailable1252312524    - `model: Model`1252512526      The model that will complete your prompt.1252712528      See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1252912530    - `role: "assistant"`1253112532      Conversational role of the generated message.1253312534      This will always be `"assistant"`.1253512536      default: assistant1253712538    - `stop_details: BetaRefusalStopDetails or null`1253912540      Structured information about a refusal.1254112542      - `type: "refusal"`1254312544        default: refusal1254512546      - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`1254712548        The policy category that triggered a refusal.1254912550        - `"cyber"`1255112552          The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.1255312554        - `"bio"`1255512556          The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.1255712558        - `"frontier_llm"`1255912560          The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.1256112562        - `"reasoning_extraction"`1256312564          The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).1256512566        - `"general_harms"`1256712568          The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.1256912570      - `explanation: string or null`1257112572        Human-readable explanation of the refusal.1257312574        This text is not guaranteed to be stable. `null` when no explanation is available for the category.1257512576      - `fallback_credit_token: string or null`1257712578        Opaque code that refunds the cache-miss cost when retrying this refused12579        request on the fallback model. Pass it as `fallback_credit_token` on the12580        retry request. Expires 5 minutes after the refusal.1258112582        The retry is sent either with the same request body (`system`, `messages`,12583        `tools`, and other render-shaping fields), or with the same body plus one12584        appended `assistant` message whose content is the partial text (with any12585        trailing whitespace stripped from the final text block) and paired12586        server-tool blocks from this refusal — which also authorizes that12587        appended turn as an assistant-prefill continuation on models that otherwise12588        disallow prefill. A token minted mid-server-tool-loop whose partial content12589        was continuable may only be redeemed the second way — if a same-body retry12590        is rejected with a 400 saying the token must be redeemed by continuing the12591        partial response, retry the second way instead. Either way: same workspace,12592        same platform; a mismatch is a 400. Resending a token for an already-warm12593        prefix is permitted but yields no additional credit.1259412595        `null` when the refused model isn't eligible for a fallback credit.1259612597      - `fallback_has_prefill_claim: boolean or null`1259812599        Whether the accompanying `fallback_credit_token` may be redeemed with the12600        appended-assistant retry form. Only set when `fallback_credit_token` is12601        present.1260212603        `true`: retry by resending the same request body plus one appended12604        `assistant` message whose content is this response's `content` with any12605        trailing whitespace stripped from the final text block and unpaired12606        `tool_use` blocks omitted (the same appended-turn shape described on12607        `fallback_credit_token`), with the token attached. `false`: retry by12608        resending the original request body unchanged, with the token attached —12609        the appended-assistant form is not available for this refusal (no12610        continuable partial content, or the request uses `output_format` or a12611        `tool_choice` that forces tool use). One exception: when the request used12612        `output_format` or a forced `tool_choice` and the refusal arrived after12613        server tools (including MCP connector tools) had already executed, the12614        token may not be redeemable by either retry form; if the exact-body retry12615        is then rejected with a 400 saying the token must be redeemed by12616        continuing the partial response, discard the token and retry without it.1261712618        Advisory: if an appended-assistant retry is rejected with a 400 despite12619        `true`, fall back to resending the original request body with the token.1262012621      - `recommended_model: string or null`1262212623        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.1262412625    - `stop_reason: BetaStopReason or null`1262612627      The reason that we stopped.1262812629      This may be one the following values:1263012631      * `"end_turn"`: the model reached a natural stopping point12632      * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum12633      * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated12634      * `"tool_use"`: the model invoked one or more tools12635      * `"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.12636      * `"refusal"`: when streaming classifiers intervene to handle potential policy violations12637      * `"model_context_window_exceeded"`: we exceeded the model's context window1263812639      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.1264012641      - `"end_turn"`1264212643      - `"max_tokens"`1264412645      - `"stop_sequence"`1264612647      - `"tool_use"`1264812649      - `"pause_turn"`1265012651      - `"compaction"`1265212653      - `"refusal"`1265412655      - `"model_context_window_exceeded"`1265612657    - `stop_sequence: string or null`1265812659      Which custom stop sequence was generated, if any.1266012661      This value will be a non-null string if one of your custom stop sequences was generated.1266212663    - `usage: BetaUsage`1266412665      Billing and rate-limit usage.1266612667      Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.1266812669      Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.1267012671      For example, `output_tokens` will be non-zero, even for an empty string response from Claude.1267212673      Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.1267412675      - `cache_creation: BetaCacheCreation or null`1267612677        Breakdown of cached tokens by TTL1267812679        - `ephemeral_1h_input_tokens: number`1268012681          The number of input tokens used to create the 1 hour cache entry.1268212683          default: 0, minimum: 01268412685        - `ephemeral_5m_input_tokens: number`1268612687          The number of input tokens used to create the 5 minute cache entry.1268812689          default: 0, minimum: 01269012691      - `cache_creation_input_tokens: number or null`1269212693        The number of input tokens used to create the cache entry.1269412695        minimum: 01269612697      - `cache_read_input_tokens: number or null`1269812699        The number of input tokens read from the cache.1270012701        minimum: 01270212703      - `fallback_credit: BetaFallbackCreditUsage or null`1270412705        Outcome of the `fallback_credit_token` presented on this request.1270612707        - `status: BetaFallbackCreditRedeemed or BetaFallbackCreditNotApplied`1270812709          Whether the fallback-credit reprice was applied to this response's billing.1271012711          A union discriminated on `type`. `redeemed`: the retry is billed as if12712          the conversation had been on the retry model all along — including when the12713          resulting shift is zero because there was nothing to move. `not_applied`:12714          no reprice was applied; the arm's `reason` says why.1271512716          - `BetaFallbackCreditRedeemed object`1271712718            The reprice was applied: the retry is billed as if the conversation12719            had been on the retry model all along.1272012721            - `type: "redeemed"`1272212723              default: redeemed1272412725          - `BetaFallbackCreditNotApplied object`1272612727            No reprice was applied; `reason` says why.1272812729            - `type: "not_applied"`1273012731              default: not_applied1273212733            - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`1273412735              Why the reprice was not applied.1273612737              A closed enum; additions to the redemption-check vocabulary arrive as12738              deliberate schema updates.1273912740              - `"body_mismatch"`1274112742              - `"continuation_excluded"`1274312744              - `"continuation_only"`1274512746              - `"expired"`1274712748              - `"invalid_target_model"`1274912750              - `"not_enabled"`1275112752              - `"reprice_unavailable"`1275312754              - `"temporarily_unavailable"`1275512756              - `"variant_fields_present"`1275712758              - `"wrong_organization"`1275912760              - `"wrong_platform"`1276112762              - `"wrong_workspace"`1276312764            - `remove_to_redeem: optional array of string or null`1276512766              Request fields to remove before retrying, so the retry can redeem this12767              token.1276812769              Present exactly when `reason` is `variant_fields_present` — never null,12770              never an empty array; absent otherwise. Fields are named only from your own request, and only after12771              the sealed variant hash matched. A served best-effort retry has already12772              been billed at normal price; nothing redeems retroactively, but a corrected12773              re-send inside the token's five-minute window can still redeem.1277412775      - `inference_geo: string or null`1277612777        The geographic region where inference was performed for this request.1277812779      - `input_tokens: number`1278012781        The number of input tokens which were used.1278212783        minimum: 01278412785      - `iterations: BetaIterationsUsage or null`1278612787        Per-iteration token usage breakdown.1278812789        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:1279012791        - Determine which iterations exceeded long context thresholds (>=200k tokens)12792        - Calculate the context window size from the last `message` entry12793        - Understand token accumulation across server-side tool use loops1279412795        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.1279612797        - `BetaMessageIterationUsage object`1279812799          Token usage for a sampling iteration.1280012801          - `type: "message"`1280212803            Usage for a sampling iteration1280412805            default: message1280612807          - `cache_creation: BetaCacheCreation or null`1280812809            Breakdown of cached tokens by TTL1281012811          - `cache_creation_input_tokens: number`1281212813            The number of input tokens used to create the cache entry.1281412815            default: 0, minimum: 01281612817          - `cache_read_input_tokens: number`1281812819            The number of input tokens read from the cache.1282012821            default: 0, minimum: 01282212823          - `input_tokens: number`1282412825            The number of input tokens which were used.1282612827            minimum: 01282812829          - `model: Model or null`1283012831            The model that will complete your prompt.1283212833            See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1283412835          - `output_tokens: number`1283612837            The number of output tokens which were used.1283812839            minimum: 01284012841        - `BetaCompactionIterationUsage object`1284212843          Token usage for a compaction iteration.1284412845          - `type: "compaction"`1284612847            Usage for a compaction iteration1284812849            default: compaction1285012851          - `cache_creation: BetaCacheCreation or null`1285212853            Breakdown of cached tokens by TTL1285412855          - `cache_creation_input_tokens: number`1285612857            The number of input tokens used to create the cache entry.1285812859            default: 0, minimum: 01286012861          - `cache_read_input_tokens: number`1286212863            The number of input tokens read from the cache.1286412865            default: 0, minimum: 01286612867          - `input_tokens: number`1286812869            The number of input tokens which were used.1287012871            minimum: 01287212873          - `output_tokens: number`1287412875            The number of output tokens which were used.1287612877            minimum: 01287812879        - `BetaAdvisorMessageIterationUsage object`1288012881          Token usage for an advisor sub-inference iteration.1288212883          - `type: "advisor_message"`1288412885            Usage for an advisor sub-inference iteration1288612887            default: advisor_message1288812889          - `cache_creation: BetaCacheCreation or null`1289012891            Breakdown of cached tokens by TTL1289212893          - `cache_creation_input_tokens: number`1289412895            The number of input tokens used to create the cache entry.1289612897            default: 0, minimum: 01289812899          - `cache_read_input_tokens: number`1290012901            The number of input tokens read from the cache.1290212903            default: 0, minimum: 01290412905          - `input_tokens: number`1290612907            The number of input tokens which were used.1290812909            minimum: 01291012911          - `model: Model`1291212913            The model that will complete your prompt.1291412915            See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1291612917          - `output_tokens: number`1291812919            The number of output tokens which were used.1292012921            minimum: 01292212923        - `BetaFallbackMessageIterationUsage object`1292412925          Token usage for the fallback-model attempt of a server-side fallback request.1292612927          The terminal entry of a fallback-served turn: when a fallback hop's12928          output is the returned message, the entry for the iteration that12929          completed it carries this type in place of `message`. A declined hop12930          and the serving hop's earlier tool-loop iterations produce `message`12931          entries. Whether a fallback model served the response is signalled by12932          the presence of this entry in `usage.iterations`.1293312934          - `type: "fallback_message"`1293512936            Usage for the fallback-model attempt that served the response1293712938            default: fallback_message1293912940          - `cache_creation: BetaCacheCreation or null`1294112942            Breakdown of cached tokens by TTL1294312944          - `cache_creation_input_tokens: number`1294512946            The number of input tokens used to create the cache entry.1294712948            default: 0, minimum: 01294912950          - `cache_read_input_tokens: number`1295112952            The number of input tokens read from the cache.1295312954            default: 0, minimum: 01295512956          - `input_tokens: number`1295712958            The number of input tokens which were used.1295912960            minimum: 01296112962          - `model: Model`1296312964            The model that will complete your prompt.1296512966            See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.1296712968          - `output_tokens: number`1296912970            The number of output tokens which were used.1297112972            minimum: 01297312974      - `output_tokens: number`1297512976        The number of output tokens which were used.1297712978        minimum: 01297912980      - `output_tokens_details: BetaOutputTokensDetails or null`1298112982        Breakdown of output tokens by category.1298312984        `output_tokens` remains the inclusive, authoritative total used for billing.12985        This object provides a read-only decomposition for observability — for example,12986        how many of the billed output tokens were spent on internal reasoning that may12987        have been summarized before being returned to you.1298812989        - `thinking_tokens: number`1299012991          Number of output tokens the model generated as internal reasoning, including12992          the thinking-block delimiter tokens.1299312994          Reflects the raw reasoning the model produced, not the (possibly shorter)12995          summarized thinking text returned in the response body. Computed by12996          re-tokenizing the raw reasoning text, so it may differ from the model's exact12997          generation count by a small number of tokens. Always ≤ `output_tokens`;12998          `output_tokens - thinking_tokens` approximates the non-reasoning output.1299913000          default: 0, minimum: 01300113002      - `server_tool_use: BetaServerToolUsage or null`1300313004        The number of server tool requests.1300513006        - `web_fetch_requests: number`1300713008          The number of web fetch tool requests.1300913010          default: 0, minimum: 01301113012        - `web_search_requests: number`1301313014          The number of web search tool requests.1301513016          default: 0, minimum: 01301713018      - `service_tier: "standard" or "priority" or "batch" or null`1301913020        If the request used the priority, standard, or batch tier.1302113022        - `"standard"`1302313024        - `"priority"`1302513026        - `"batch"`1302713028      - `speed: "standard" or "fast" or null`1302913030        Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.1303113032        - `"standard"`1303313034        - `"fast"`1303513036    - `input_transformations: optional array of BetaInputTransformation or null`1303713038      Changes the API made to the request's input before showing it to the model,13039      and blocks that failed a binding check but were left unchanged: one entry per13040      block, in request order. Two entry types today. `thinking_dropped` — a13041      `thinking`, `redacted_thinking` or `connector_text` block from the request's13042      `messages` that was removed from the prompt instead of being shown to the13043      model because it failed a binding check. `thinking_mismatch_allowed` — a13044      `thinking` or `redacted_thinking` block that failed the conversation check13045      (the conversation before it differs from the one it was created in, or it13046      carries no record of one on a model that requires it) and was shown to the13047      model all the same, because that check is not enforced for this request.13048      More entry types may be added over time; ignore types you do not recognize.1304913050      Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on13051      every such response from a model that supports extended thinking, as `[]`13052      when there is no entry to report; without the beta, blocks are removed or13053      left in place all the same but nothing is reported. Removed blocks contribute13054      nothing to `usage.input_tokens`; blocks left in place count as sent. When13055      streaming, the array is final in `message_start`; the final `message_delta`13056      event carries it only when a server-side model fallback happened mid-stream,13057      in which case it holds the serving model's entries and replaces the one in13058      `message_start`.1305913060      - `BetaThinkingDroppedInputTransformation object`1306113062        - `type: "thinking_dropped"`1306313064          Always `thinking_dropped` for this entry type.1306513066          default: thinking_dropped1306713068        - `path: string`1306913070          Where the removed block was in your request, as `messages.{i}.content.{j}`:13071          `i` indexes the `messages` array you sent and `j` that message's `content`13072          array — the same form error messages use.1307313074        - `reason: "model_binding_mismatch" or "prefix_binding_mismatch" or "organization_binding_mismatch" or "end_user_binding_mismatch"`1307513076          Which binding check removed the block: `model_binding_mismatch` — it was13077          created by a model whose reasoning the requested model may not read;13078          `prefix_binding_mismatch` — the conversation before it differs from the13079          conversation it was created in (the rest of that turn's consecutive thinking13080          blocks are removed with it, each with this reason);13081          `organization_binding_mismatch` — it was created under a different13082          organization (an Anthropic organization, AWS account or Google Cloud project)13083          and this organization is not one of its additional organizations;13084          `end_user_binding_mismatch` — it was created for a different end user, or13085          was removed by the consumer-organization binding. A block that would fail13086          several checks reports one reason, in this order of precedence:13087          `organization_binding_mismatch`, `end_user_binding_mismatch`,13088          `model_binding_mismatch`, `prefix_binding_mismatch`.1308913090          - `"model_binding_mismatch"`1309113092          - `"prefix_binding_mismatch"`1309313094          - `"organization_binding_mismatch"`1309513096          - `"end_user_binding_mismatch"`1309713098      - `BetaThinkingMismatchAllowedInputTransformation object`1309913100        - `type: "thinking_mismatch_allowed"`1310113102          Always `thinking_mismatch_allowed` for this entry type.1310313104          default: thinking_mismatch_allowed1310513106        - `path: string`1310713108          Where the block is in your request, as `messages.{i}.content.{j}`:13109          `i` indexes the `messages` array you sent and `j` that message's `content`13110          array — the same form error messages use.1311113112        - `reason: "model_binding_mismatch" or "prefix_binding_mismatch" or "organization_binding_mismatch" or "end_user_binding_mismatch"`1311313114          Which binding check the block failed; the block was shown to the model all13115          the same. Always `prefix_binding_mismatch` today — the conversation before13116          the block differs from the conversation it was created in, or the block13117          carries no record of one on a model that requires it. Were the check13118          enforced for this request, the block would have been removed or the request13119          rejected (`thinking.block_binding.prefix_mismatch_behavior`). A removal also13120          takes the rest of that turn's consecutive thinking blocks, whereas here each13121          block is checked on its own, so `thinking_mismatch_allowed` entries are a13122          lower bound on what enforcement would remove.1312313124          - `"model_binding_mismatch"`1312513126          - `"prefix_binding_mismatch"`1312713128          - `"organization_binding_mismatch"`1312913130          - `"end_user_binding_mismatch"`13131
Files main
Menu

Theme