SPB Git

Repository Public

create.md 109.9 KB 3,262 lines markdown

1---2title: Create a Message Batch3url: https://platform.claude.com/docs/en/api/messages/batches/create4---56# Create a Message Batch78**POST** `/v1/messages/batches`910Send a batch of Message creation requests.1112The 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.1314Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)1516## Headers1718- `"anthropic-user-profile-id": optional string`1920  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.2122- `"anthropic-workspace-id": optional string`2324## Body parameters2526- `requests: array of object`2728  List of requests for prompt completion. Each is an individual request to create a Message.2930  maxItems: 100000, minItems: 13132  - `custom_id: string`3334    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.3536    Must be unique for each request within the Message Batch.3738    maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,64}$3940  - `params: object`4142    Messages API creation parameters for the individual request.4344    See the [Messages API reference](https://platform.claude.com/docs/en/api/messages) for full documentation on available parameters.4546    - `max_tokens: number`4748      The maximum number of tokens to generate before stopping.4950      Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.5152      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.5354      Different models have different maximum values for this parameter.  See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.5556      minimum: 05758    - `messages: array of MessageParam`5960      Input messages.6162      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.6364      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.6566      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.6768      Example with a single `user` message:6970      ```json71      [{"role": "user", "content": "Hello, Claude"}]72      ```7374      Example with multiple conversational turns:7576      ```json77      [78        {"role": "user", "content": "Hello there."},79        {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},80        {"role": "user", "content": "Can you explain LLMs in plain English?"},81      ]82      ```8384      Example with a partially-filled response from Claude:8586      ```json87      [88        {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},89        {"role": "assistant", "content": "The best answer is ("},90      ]91      ```9293      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:9495      ```json96      {"role": "user", "content": "Hello, Claude"}97      ```9899      ```json100      {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}101      ```102103      See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).104105      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.106107      There is a limit of 100,000 messages in a single request.108109      - `content: string or array of ContentBlockParam`110111        - `string`112113        - `array of ContentBlockParam`114115          - `TextBlockParam object`116117            - `type: "text"`118119            - `text: string`120121              minLength: 1122123            - `cache_control: optional CacheControlEphemeral or null`124125              Create a cache control breakpoint at this content block.126127              - `type: "ephemeral"`128129              - `ttl: optional "5m" or "1h"`130131                The time-to-live for the cache control breakpoint.132133                This may be one the following values:134135                - `5m`: 5 minutes136                - `1h`: 1 hour137138                Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.139140                - `"5m"`141142                - `"1h"`143144            - `citations: optional array of TextCitationParam or null`145146              - `CitationCharLocationParam object`147148                - `type: "char_location"`149150                - `cited_text: string`151152                - `document_index: number`153154                  minimum: 0155156                - `document_title: string or null`157158                  maxLength: 500, minLength: 1159160                - `end_char_index: number`161162                - `start_char_index: number`163164                  minimum: 0165166              - `CitationPageLocationParam object`167168                - `type: "page_location"`169170                - `cited_text: string`171172                - `document_index: number`173174                  minimum: 0175176                - `document_title: string or null`177178                  maxLength: 500, minLength: 1179180                - `end_page_number: number`181182                - `start_page_number: number`183184                  minimum: 1185186              - `CitationContentBlockLocationParam object`187188                - `type: "content_block_location"`189190                - `cited_text: string`191192                  The full text of the cited block range, concatenated.193194                  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.195196                - `document_index: number`197198                  minimum: 0199200                - `document_title: string or null`201202                  maxLength: 500, minLength: 1203204                - `end_block_index: number`205206                  Exclusive 0-based end index of the cited block range in the source's `content` array.207208                  Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.209210                - `start_block_index: number`211212                  0-based index of the first cited block in the source's `content` array.213214                  minimum: 0215216              - `CitationWebSearchResultLocationParam object`217218                - `type: "web_search_result_location"`219220                - `cited_text: string`221222                - `encrypted_index: string`223224                - `title: string or null`225226                  maxLength: 512, minLength: 1227228                - `url: string`229230                  minLength: 1231232              - `CitationSearchResultLocationParam object`233234                - `type: "search_result_location"`235236                - `cited_text: string`237238                  The full text of the cited block range, concatenated.239240                  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.241242                - `end_block_index: number`243244                  Exclusive 0-based end index of the cited block range in the source's `content` array.245246                  Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.247248                - `search_result_index: number`249250                  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.251252                  Counted separately from `document_index`; server-side web search results are not included in this count.253254                  minimum: 0255256                - `source: string`257258                - `start_block_index: number`259260                  0-based index of the first cited block in the source's `content` array.261262                  minimum: 0263264                - `title: string or null`265266          - `ImageBlockParam object`267268            - `type: "image"`269270            - `source: Base64ImageSource or URLImageSource or FileImageSource`271272              - `Base64ImageSource object`273274                - `type: "base64"`275276                - `data: string`277278                  format: byte279280                - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`281282                  - `"image/jpeg"`283284                  - `"image/png"`285286                  - `"image/gif"`287288                  - `"image/webp"`289290              - `URLImageSource object`291292                - `type: "url"`293294                - `url: string`295296              - `FileImageSource object`297298                - `type: "file"`299300                - `file_id: string`301302            - `cache_control: optional CacheControlEphemeral or null`303304              Create a cache control breakpoint at this content block.305306            - `transformations: optional ImageTransformationsParam or null`307308              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.309310              - `oversized_image: optional "downsize" or "error"`311312                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.313314                - `"downsize"`315316                - `"error"`317318          - `DocumentBlockParam object`319320            - `type: "document"`321322            - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`323324              - `Base64PDFSource object`325326                - `type: "base64"`327328                - `data: string`329330                  format: byte331332                - `media_type: "application/pdf"`333334              - `PlainTextSource object`335336                - `type: "text"`337338                - `data: string`339340                - `media_type: "text/plain"`341342              - `ContentBlockSource object`343344                - `type: "content"`345346                - `content: string or array of ContentBlockSourceContent`347348                  - `string`349350                  - `ContentBlockSourceContent = array of ContentBlockSourceContent`351352                    - `TextBlockParam object`353354                    - `ImageBlockParam object`355356              - `URLPDFSource object`357358                - `type: "url"`359360                - `url: string`361362              - `FileDocumentSource object`363364                - `type: "file"`365366                - `file_id: string`367368            - `cache_control: optional CacheControlEphemeral or null`369370              Create a cache control breakpoint at this content block.371372            - `citations: optional CitationsConfigParam or null`373374              - `enabled: optional boolean`375376            - `context: optional string or null`377378              minLength: 1379380            - `title: optional string or null`381382              maxLength: 500, minLength: 1383384          - `SearchResultBlockParam object`385386            - `type: "search_result"`387388            - `content: array of TextBlockParam`389390              - `type: "text"`391392              - `text: string`393394                minLength: 1395396              - `cache_control: optional CacheControlEphemeral or null`397398                Create a cache control breakpoint at this content block.399400              - `citations: optional array of TextCitationParam or null`401402            - `source: string`403404            - `title: string`405406            - `cache_control: optional CacheControlEphemeral or null`407408              Create a cache control breakpoint at this content block.409410            - `citations: optional CitationsConfigParam`411412          - `ThinkingBlockParam object`413414            - `type: "thinking"`415416            - `signature: string`417418              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.419420              Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.421422            - `thinking: string`423424              The `thinking` text of this block as returned by the API.425426          - `RedactedThinkingBlockParam object`427428            - `type: "redacted_thinking"`429430            - `data: string`431432              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.433434          - `ToolUseBlockParam object`435436            - `type: "tool_use"`437438            - `id: string`439440              pattern: ^[a-zA-Z0-9_-]+$441442            - `input: map[unknown]`443444            - `name: string`445446              maxLength: 200, minLength: 1447448            - `cache_control: optional CacheControlEphemeral or null`449450              Create a cache control breakpoint at this content block.451452            - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`453454              - `DirectCaller object`455456                Tool invocation directly from the model.457458                - `type: "direct"`459460              - `ServerToolCaller object`461462                Tool invocation generated by a server-side tool.463464                - `type: "code_execution_20250825"`465466                - `tool_id: string`467468                  pattern: ^srvtoolu_[a-zA-Z0-9_]+$469470              - `ServerToolCaller20260120 object`471472                - `type: "code_execution_20260120"`473474                - `tool_id: string`475476                  pattern: ^srvtoolu_[a-zA-Z0-9_]+$477478            - `toolset_name: optional string or null`479480              For a toolset member tool_use, the toolset family this member belongs to.481482              maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$483484          - `ToolResultBlockParam object`485486            - `type: "tool_result"`487488            - `tool_use_id: string`489490              pattern: ^[a-zA-Z0-9_-]+$491492            - `cache_control: optional CacheControlEphemeral or null`493494              Create a cache control breakpoint at this content block.495496            - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`497498              - `string`499500              - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`501502                - `TextBlockParam object`503504                - `ImageBlockParam object`505506                - `SearchResultBlockParam object`507508                - `DocumentBlockParam object`509510                - `ToolReferenceBlockParam object`511512                  Tool reference block that can be included in tool_result content.513514                  - `type: "tool_reference"`515516                  - `tool_name: string`517518                    maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$519520                  - `cache_control: optional CacheControlEphemeral or null`521522                    Create a cache control breakpoint at this content block.523524                - `BrowserStateBlockParam object`525526                  The caller's browser state after a browser toolset member call —527                  the full inventory of open tabs, which tab is active, and any side528                  effects (tabs opened, download state changes) the call produced.529530                  At most one per `tool_result`, only on a non-error result answering a531                  browser toolset member `tool_use`. The server renders the532                  model-visible text from it; the model never sees the raw fields.533534                  - `type: "browser_state"`535536                  - `tabs: array of BrowserStateTabEntry`537538                    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`.539540                    maxItems: 100541542                    - `tab_id: string`543544                      The caller-assigned identifier for this tab, unique within the inventory.545546                      maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$547548                    - `title: string`549550                      The title of the page the tab is showing. May be empty.551552                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$553554                    - `url: string`555556                      The URL of the page the tab is showing. May be empty.557558                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$559560                    - `active: optional boolean`561562                      Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.563564                  - `cache_control: optional CacheControlEphemeral or null`565566                    Create a cache control breakpoint at this content block.567568                  - `state_changes: optional array of BrowserStateChange or null`569570                    Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.571572                    maxItems: 200, minItems: 1573574                    - `BrowserStateChangeTabOpened object`575576                      A tab this call's execution opened that remains open at its end —577                      the creation delta of the `tabs` inventory, not an event log.578579                      Carries only the `tab_id`; the tab's `title` and `url` live on its580                      `tabs` entry, which must include the same `tab_id`. A tab opened581                      during a failed call gets no deferred `tab_opened`; it simply appears582                      in the next result's `tabs` inventory.583584                      - `type: "tab_opened"`585586                      - `tab_id: string`587588                        The `tab_id` of the opened tab, present in `tabs`.589590                        maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$591592                    - `BrowserStateChangeDownloadStarted object`593594                      A file download that started during this call.595596                      - `type: "download_started"`597598                      - `download_id: string`599600                        The caller-assigned identifier for this download, stable across the state changes reporting it.601602                        maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$603604                      - `url: string`605606                        The final post-redirect URL the download was served from.607608                        maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$609610                    - `BrowserStateChangeDownloadCompleted object`611612                      A file download that finished during this call, reported with the613                      same `download_id` as its `download_started` — or without a prior614                      `download_started`, when the download finished during the call that615                      started it (at most one state change per `download_id` per result).616617                      - `type: "download_completed"`618619                      - `download_id: string`620621                        The caller-assigned identifier for this download, stable across the state changes reporting it.622623                        maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$624625                      - `url: string`626627                        The final post-redirect URL the download was served from.628629                        maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$630631                      - `path: optional string or null`632633                        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.634635                        pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096636637                      - `size_bytes: optional number or null`638639                        The completed download's size.640641                        minimum: 0642643                    - `BrowserStateChangeDownloadFailed object`644645                      A file download that failed — or was cancelled — during this call.646647                      - `type: "download_failed"`648649                      - `download_id: string`650651                        The caller-assigned identifier for this download, stable across the state changes reporting it.652653                        maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$654655                      - `url: string`656657                        The final post-redirect URL the download was served from.658659                        maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$660661                      - `error: optional string or null`662663                        The failure or cancellation detail, when known.664665                        pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096666667            - `is_error: optional boolean`668669            - `toolset_name: optional string or null`670671              For a toolset member tool_result, the toolset family of the paired tool_use.672673              maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$674675          - `ServerToolUseBlockParam object`676677            - `type: "server_tool_use"`678679            - `id: string`680681              pattern: ^srvtoolu_[a-zA-Z0-9_]+$682683            - `input: map[unknown]`684685            - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`686687              - `"web_search"`688689              - `"web_fetch"`690691              - `"code_execution"`692693              - `"bash_code_execution"`694695              - `"text_editor_code_execution"`696697              - `"tool_search_tool_regex"`698699              - `"tool_search_tool_bm25"`700701            - `cache_control: optional CacheControlEphemeral or null`702703              Create a cache control breakpoint at this content block.704705            - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`706707              - `DirectCaller object`708709                Tool invocation directly from the model.710711              - `ServerToolCaller object`712713                Tool invocation generated by a server-side tool.714715              - `ServerToolCaller20260120 object`716717          - `WebSearchToolResultBlockParam object`718719            - `type: "web_search_tool_result"`720721            - `content: WebSearchToolResultBlockParamContent`722723              - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`724725                - `type: "web_search_result"`726727                - `encrypted_content: string`728729                - `title: string`730731                - `url: string`732733                - `page_age: optional string or null`734735              - `WebSearchToolRequestError object`736737                - `type: "web_search_tool_result_error"`738739                - `error_code: WebSearchToolResultErrorCode`740741                  - `"invalid_tool_input"`742743                  - `"unavailable"`744745                  - `"max_uses_exceeded"`746747                  - `"too_many_requests"`748749                  - `"query_too_long"`750751                  - `"request_too_large"`752753            - `tool_use_id: string`754755              pattern: ^srvtoolu_[a-zA-Z0-9_]+$756757            - `cache_control: optional CacheControlEphemeral or null`758759              Create a cache control breakpoint at this content block.760761            - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`762763              - `DirectCaller object`764765                Tool invocation directly from the model.766767              - `ServerToolCaller object`768769                Tool invocation generated by a server-side tool.770771              - `ServerToolCaller20260120 object`772773          - `WebFetchToolResultBlockParam object`774775            - `type: "web_fetch_tool_result"`776777            - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`778779              - `WebFetchToolResultErrorBlockParam object`780781                - `type: "web_fetch_tool_result_error"`782783                - `error_code: WebFetchToolResultErrorCode`784785                  - `"invalid_tool_input"`786787                  - `"url_too_long"`788789                  - `"url_not_allowed"`790791                  - `"url_not_in_prior_context"`792793                  - `"url_not_accessible"`794795                  - `"unsupported_content_type"`796797                  - `"too_many_requests"`798799                  - `"max_uses_exceeded"`800801                  - `"unavailable"`802803                  - `"content_too_large"`804805              - `WebFetchBlockParam object`806807                - `type: "web_fetch_result"`808809                - `content: DocumentBlockParam`810811                - `url: string`812813                  Fetched content URL814815                - `retrieved_at: optional string or null`816817                  ISO 8601 timestamp when the content was retrieved818819            - `tool_use_id: string`820821              pattern: ^srvtoolu_[a-zA-Z0-9_]+$822823            - `cache_control: optional CacheControlEphemeral or null`824825              Create a cache control breakpoint at this content block.826827            - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`828829              - `DirectCaller object`830831                Tool invocation directly from the model.832833              - `ServerToolCaller object`834835                Tool invocation generated by a server-side tool.836837              - `ServerToolCaller20260120 object`838839          - `CodeExecutionToolResultBlockParam object`840841            - `type: "code_execution_tool_result"`842843            - `content: CodeExecutionToolResultBlockParamContent`844845              - `CodeExecutionToolResultErrorParam object`846847                - `type: "code_execution_tool_result_error"`848849                - `error_code: CodeExecutionToolResultErrorCode`850851                  - `"invalid_tool_input"`852853                  - `"unavailable"`854855                  - `"too_many_requests"`856857                  - `"execution_time_exceeded"`858859              - `CodeExecutionResultBlockParam object`860861                - `type: "code_execution_result"`862863                - `content: array of CodeExecutionOutputBlockParam`864865                  - `type: "code_execution_output"`866867                  - `file_id: string`868869                - `return_code: number`870871                - `stderr: string`872873                - `stdout: string`874875              - `EncryptedCodeExecutionResultBlockParam object`876877                Code execution result with encrypted stdout for PFC + web_search results.878879                - `type: "encrypted_code_execution_result"`880881                - `content: array of CodeExecutionOutputBlockParam`882883                  - `type: "code_execution_output"`884885                  - `file_id: string`886887                - `encrypted_stdout: string`888889                - `return_code: number`890891                - `stderr: string`892893            - `tool_use_id: string`894895              pattern: ^srvtoolu_[a-zA-Z0-9_]+$896897            - `cache_control: optional CacheControlEphemeral or null`898899              Create a cache control breakpoint at this content block.900901          - `BashCodeExecutionToolResultBlockParam object`902903            - `type: "bash_code_execution_tool_result"`904905            - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`906907              - `BashCodeExecutionToolResultErrorParam object`908909                - `type: "bash_code_execution_tool_result_error"`910911                - `error_code: BashCodeExecutionToolResultErrorCode`912913                  - `"invalid_tool_input"`914915                  - `"unavailable"`916917                  - `"too_many_requests"`918919                  - `"execution_time_exceeded"`920921                  - `"output_file_too_large"`922923              - `BashCodeExecutionResultBlockParam object`924925                - `type: "bash_code_execution_result"`926927                - `content: array of BashCodeExecutionOutputBlockParam`928929                  - `type: "bash_code_execution_output"`930931                  - `file_id: string`932933                - `return_code: number`934935                - `stderr: string`936937                - `stdout: string`938939            - `tool_use_id: string`940941              pattern: ^srvtoolu_[a-zA-Z0-9_]+$942943            - `cache_control: optional CacheControlEphemeral or null`944945              Create a cache control breakpoint at this content block.946947          - `TextEditorCodeExecutionToolResultBlockParam object`948949            - `type: "text_editor_code_execution_tool_result"`950951            - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`952953              - `TextEditorCodeExecutionToolResultErrorParam object`954955                - `type: "text_editor_code_execution_tool_result_error"`956957                - `error_code: TextEditorCodeExecutionToolResultErrorCode`958959                  - `"invalid_tool_input"`960961                  - `"unavailable"`962963                  - `"too_many_requests"`964965                  - `"execution_time_exceeded"`966967                  - `"file_not_found"`968969                - `error_message: optional string or null`970971              - `TextEditorCodeExecutionViewResultBlockParam object`972973                - `type: "text_editor_code_execution_view_result"`974975                - `content: string`976977                - `file_type: "text" or "image" or "pdf"`978979                  - `"text"`980981                  - `"image"`982983                  - `"pdf"`984985                - `num_lines: optional number or null`986987                - `start_line: optional number or null`988989                - `total_lines: optional number or null`990991              - `TextEditorCodeExecutionCreateResultBlockParam object`992993                - `type: "text_editor_code_execution_create_result"`994995                - `is_file_update: boolean`996997              - `TextEditorCodeExecutionStrReplaceResultBlockParam object`998999                - `type: "text_editor_code_execution_str_replace_result"`10001001                - `lines: optional array of string or null`10021003                - `new_lines: optional number or null`10041005                - `new_start: optional number or null`10061007                - `old_lines: optional number or null`10081009                - `old_start: optional number or null`10101011            - `tool_use_id: string`10121013              pattern: ^srvtoolu_[a-zA-Z0-9_]+$10141015            - `cache_control: optional CacheControlEphemeral or null`10161017              Create a cache control breakpoint at this content block.10181019          - `ToolSearchToolResultBlockParam object`10201021            - `type: "tool_search_tool_result"`10221023            - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`10241025              - `ToolSearchToolResultErrorParam object`10261027                - `type: "tool_search_tool_result_error"`10281029                - `error_code: ToolSearchToolResultErrorCode`10301031                  - `"invalid_tool_input"`10321033                  - `"unavailable"`10341035                  - `"too_many_requests"`10361037                  - `"execution_time_exceeded"`10381039                - `error_message: optional string or null`10401041              - `ToolSearchToolSearchResultBlockParam object`10421043                - `type: "tool_search_tool_search_result"`10441045                - `tool_references: array of ToolReferenceBlockParam`10461047                  - `type: "tool_reference"`10481049                  - `tool_name: string`10501051                    maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$10521053                  - `cache_control: optional CacheControlEphemeral or null`10541055                    Create a cache control breakpoint at this content block.10561057            - `tool_use_id: string`10581059              pattern: ^srvtoolu_[a-zA-Z0-9_]+$10601061            - `cache_control: optional CacheControlEphemeral or null`10621063              Create a cache control breakpoint at this content block.10641065          - `ContainerUploadBlockParam object`10661067            A content block that represents a file to be uploaded to the container1068            Files uploaded via this block will be available in the container's input directory.10691070            - `type: "container_upload"`10711072            - `file_id: string`10731074            - `cache_control: optional CacheControlEphemeral or null`10751076              Create a cache control breakpoint at this content block.10771078      - `role: "user" or "assistant" or "system"`10791080        - `"user"`10811082        - `"assistant"`10831084        - `"system"`10851086    - `model: Model`10871088      The model that will complete your prompt.10891090      See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.10911092      - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`10931094        The model that will complete your prompt.10951096        See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.10971098        - `"claude-fable-5-1"`10991100          Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows11011102        - `"claude-mythos-5-1"`11031104          Our most capable model for cybersecurity and biology research, available through trusted access programs11051106        - `"claude-sonnet-5"`11071108          High-performance model for coding and agents11091110        - `"claude-fable-5"`11111112          Next generation of intelligence for the hardest knowledge work and coding problems11131114        - `"claude-mythos-5"`11151116          Most capable model for cybersecurity and biology research11171118        - `"claude-opus-5"`11191120          Powerful intelligence for long-running agents and coding11211122        - `"claude-opus-4-8"`11231124          Powerful intelligence for long-running agents and coding11251126        - `"claude-opus-4-7"`11271128          Powerful intelligence for long-running agents and coding11291130        - `"claude-mythos-preview"`11311132          New class of intelligence, strongest in coding and cybersecurity11331134        - `"claude-opus-4-6"`11351136          Powerful intelligence for long-running agents and coding11371138        - `"claude-sonnet-4-6"`11391140          Best combination of speed and intelligence11411142        - `"claude-haiku-4-5"`11431144          Fastest model with near-frontier intelligence11451146        - `"claude-haiku-4-5-20251001"`11471148          Fastest model with near-frontier intelligence11491150        - `"claude-opus-4-5"`11511152          Powerful intelligence for long-running agents and coding11531154        - `"claude-opus-4-5-20251101"`11551156          Powerful intelligence for long-running agents and coding11571158        - `"claude-sonnet-4-5"`11591160          High-performance model for agents and coding11611162        - `"claude-sonnet-4-5-20250929"`11631164          High-performance model for agents and coding11651166      - `string`11671168    - `cache_control: optional CacheControlEphemeral or null`11691170      Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.11711172    - `container: optional MessageCreateParamsContainer or null`11731174      Container identifier for reuse across requests.11751176      - `ContainerParams object`11771178        Container parameters with skills to be loaded.11791180        - `id: optional string or null`11811182          Container id11831184        - `skills: optional array of SkillParams or null`11851186          List of skills to load in the container11871188          maxItems: 2011891190          - `type: "anthropic" or "custom"`11911192            Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)11931194            - `"anthropic"`11951196            - `"custom"`11971198          - `skill_id: string`11991200            Skill ID12011202            maxLength: 64, minLength: 112031204          - `version: optional string`12051206            Skill version or 'latest' for most recent version12071208            maxLength: 64, minLength: 112091210      - `string`12111212    - `inference_geo: optional string or null`12131214      Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.12151216    - `metadata: optional Metadata`12171218      An object describing metadata about the request.12191220      - `user_id: optional string or null`12211222        An external identifier for the user who is associated with the request.12231224        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.12251226        maxLength: 51212271228    - `output_config: optional OutputConfig`12291230      Configuration options for the model's output, such as the output format.12311232      - `effort: optional "low" or "medium" or "high" or 2 more or null`12331234        All possible effort levels.12351236        - `"low"`12371238        - `"medium"`12391240        - `"high"`12411242        - `"xhigh"`12431244        - `"max"`12451246      - `format: optional JSONOutputFormat or null`12471248        A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)12491250        - `type: "json_schema"`12511252        - `schema: map[unknown]`12531254          The JSON schema of the format12551256    - `service_tier: optional "auto" or "standard_only"`12571258      Determines whether to use priority capacity (if available) or standard capacity for this request.12591260      Anthropic offers different levels of service for your API requests. See [service-tiers](https://platform.claude.com/docs/en/api/service-tiers) for details.12611262      - `"auto"`12631264      - `"standard_only"`12651266    - `stop_sequences: optional array of string`12671268      Custom text sequences that will cause the model to stop generating.12691270      Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.12711272      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.12731274    - `stream: optional boolean`12751276      Whether to incrementally stream the response using server-sent events.12771278      See [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming) for details.12791280    - `system: optional string or array of TextBlockParam`12811282      System prompt.12831284      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).12851286      - `string`12871288      - `array of TextBlockParam`12891290        - `type: "text"`12911292        - `text: string`12931294          minLength: 112951296        - `cache_control: optional CacheControlEphemeral or null`12971298          Create a cache control breakpoint at this content block.12991300        - `citations: optional array of TextCitationParam or null`13011302    - `thinking: optional ThinkingConfigParam`13031304      Configuration for enabling Claude's extended thinking.13051306      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.13071308      See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.13091310      - `ThinkingConfigEnabled object`13111312        - `type: "enabled"`13131314        - `budget_tokens: number`13151316          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.13171318          Must be ≥1024 and less than `max_tokens`.13191320          See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.13211322          minimum: 102413231324        - `display: optional "summarized" or "omitted" or null`13251326          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`.13271328          - `"summarized"`13291330          - `"omitted"`13311332      - `ThinkingConfigDisabled object`13331334        - `type: "disabled"`13351336      - `ThinkingConfigAdaptive object`13371338        - `type: "adaptive"`13391340        - `display: optional "summarized" or "omitted" or null`13411342          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`.13431344          - `"summarized"`13451346          - `"omitted"`13471348    - `tool_choice: optional ToolChoice`13491350      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.13511352      - `ToolChoiceAuto object`13531354        The model will automatically decide whether to use tools.13551356        - `type: "auto"`13571358        - `disable_parallel_tool_use: optional boolean`13591360          Whether to disable parallel tool use.13611362          Defaults to `false`. If set to `true`, the model will output at most one tool use.13631364      - `ToolChoiceAny object`13651366        The model will use any available tools.13671368        - `type: "any"`13691370        - `disable_parallel_tool_use: optional boolean`13711372          Whether to disable parallel tool use.13731374          Defaults to `false`. If set to `true`, the model will output exactly one tool use.13751376      - `ToolChoiceTool object`13771378        The model will use the specified tool with `tool_choice.name`.13791380        - `type: "tool"`13811382        - `name: string`13831384          The name of the tool to use.13851386        - `disable_parallel_tool_use: optional boolean`13871388          Whether to disable parallel tool use.13891390          Defaults to `false`. If set to `true`, the model will output exactly one tool use.13911392      - `ToolChoiceNone object`13931394        The model will not be allowed to use tools.13951396        - `type: "none"`13971398    - `tools: optional array of ToolUnion`13991400      Definitions of tools that the model may use.14011402      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.14031404      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)).14051406      Each tool definition includes:14071408      * `name`: Name of the tool.1409      * `description`: Optional, but strongly-recommended description of the tool.1410      * `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.14111412      For example, if you defined `tools` as:14131414      ```json1415      [1416        {1417          "name": "get_stock_price",1418          "description": "Get the current stock price for a given ticker symbol.",1419          "input_schema": {1420            "type": "object",1421            "properties": {1422              "ticker": {1423                "type": "string",1424                "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."1425              }1426            },1427            "required": ["ticker"]1428          }1429        }1430      ]1431      ```14321433      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:14341435      ```json1436      [1437        {1438          "type": "tool_use",1439          "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",1440          "name": "get_stock_price",1441          "input": { "ticker": "^GSPC" }1442        }1443      ]1444      ```14451446      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:14471448      ```json1449      [1450        {1451          "type": "tool_result",1452          "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",1453          "content": "259.75 USD"1454        }1455      ]1456      ```14571458      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.14591460      See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.14611462      - `Tool object`14631464        - `type: optional "custom" or null`14651466        - `input_schema: object`14671468          [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.14691470          This defines the shape of the `input` that your tool accepts and that the model will produce.14711472          - `type: "object"`14731474          - `properties: optional map[unknown] or null`14751476          - `required: optional array of string or null`14771478        - `name: string`14791480          Name of the tool.14811482          This is how the tool will be called by the model and in `tool_use` blocks.14831484          maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$14851486        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`14871488          - `"direct"`14891490          - `"code_execution_20250825"`14911492          - `"code_execution_20260120"`14931494          - `"code_execution_20260521"`14951496        - `cache_control: optional CacheControlEphemeral or null`14971498          Create a cache control breakpoint at this content block.14991500        - `defer_loading: optional boolean`15011502          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15031504        - `description: optional string`15051506          Description of what this tool does.15071508          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.15091510        - `eager_input_streaming: optional boolean or null`15111512          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.15131514        - `input_examples: optional array of map[unknown]`15151516        - `strict: optional boolean`15171518          When true, guarantees schema validation on tool names and inputs15191520      - `ToolBash20250124 object`15211522        - `type: "bash_20250124"`15231524        - `name: "bash"`15251526          Name of the tool.15271528          This is how the tool will be called by the model and in `tool_use` blocks.15291530        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15311532          - `"direct"`15331534          - `"code_execution_20250825"`15351536          - `"code_execution_20260120"`15371538          - `"code_execution_20260521"`15391540        - `cache_control: optional CacheControlEphemeral or null`15411542          Create a cache control breakpoint at this content block.15431544        - `defer_loading: optional boolean`15451546          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15471548        - `input_examples: optional array of map[unknown]`15491550        - `strict: optional boolean`15511552          When true, guarantees schema validation on tool names and inputs15531554      - `CodeExecutionTool20250522 object`15551556        - `type: "code_execution_20250522"`15571558        - `name: "code_execution"`15591560          Name of the tool.15611562          This is how the tool will be called by the model and in `tool_use` blocks.15631564        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15651566          - `"direct"`15671568          - `"code_execution_20250825"`15691570          - `"code_execution_20260120"`15711572          - `"code_execution_20260521"`15731574        - `cache_control: optional CacheControlEphemeral or null`15751576          Create a cache control breakpoint at this content block.15771578        - `defer_loading: optional boolean`15791580          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15811582        - `strict: optional boolean`15831584          When true, guarantees schema validation on tool names and inputs15851586      - `CodeExecutionTool20250825 object`15871588        - `type: "code_execution_20250825"`15891590        - `name: "code_execution"`15911592          Name of the tool.15931594          This is how the tool will be called by the model and in `tool_use` blocks.15951596        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15971598          - `"direct"`15991600          - `"code_execution_20250825"`16011602          - `"code_execution_20260120"`16031604          - `"code_execution_20260521"`16051606        - `cache_control: optional CacheControlEphemeral or null`16071608          Create a cache control breakpoint at this content block.16091610        - `defer_loading: optional boolean`16111612          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.16131614        - `strict: optional boolean`16151616          When true, guarantees schema validation on tool names and inputs16171618      - `CodeExecutionTool20260120 object`16191620        Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).16211622        - `type: "code_execution_20260120"`16231624        - `name: "code_execution"`16251626          Name of the tool.16271628          This is how the tool will be called by the model and in `tool_use` blocks.16291630        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`16311632          - `"direct"`16331634          - `"code_execution_20250825"`16351636          - `"code_execution_20260120"`16371638          - `"code_execution_20260521"`16391640        - `cache_control: optional CacheControlEphemeral or null`16411642          Create a cache control breakpoint at this content block.16431644        - `defer_loading: optional boolean`16451646          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.16471648        - `strict: optional boolean`16491650          When true, guarantees schema validation on tool names and inputs16511652      - `CodeExecutionTool20260521 object`16531654        Code execution tool with REPL state persistence.16551656        - `type: "code_execution_20260521"`16571658        - `name: "code_execution"`16591660          Name of the tool.16611662          This is how the tool will be called by the model and in `tool_use` blocks.16631664        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`16651666          - `"direct"`16671668          - `"code_execution_20250825"`16691670          - `"code_execution_20260120"`16711672          - `"code_execution_20260521"`16731674        - `cache_control: optional CacheControlEphemeral or null`16751676          Create a cache control breakpoint at this content block.16771678        - `defer_loading: optional boolean`16791680          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.16811682        - `strict: optional boolean`16831684          When true, guarantees schema validation on tool names and inputs16851686      - `BrowserToolset20260801 object`16871688        The browser toolset: a single `tools[]` entry (carrying no1689        `name`) that declares the browser tool family. The model is served1690        the family's tool with any members disabled via `configs` removed1691        from its schema.16921693        - `type: "browser_toolset_20260801"`16941695        - `cache_control: optional CacheControlEphemeral or null`16961697          Create a cache control breakpoint at this content block.16981699        - `configs: optional BrowserToolsetConfigs or null`17001701          Per-member configuration for `browser_toolset_20260801`: one1702          optional field per member tool, keyed by the member name — the same1703          name the member's `tool_use` blocks carry. Every member is an1704          accepted key, and a member's defaults apply wherever its key is1705          absent. Unknown keys are rejected: the field set is this toolset1706          version's complete member set.17071708          - `type: optional BrowserTypeConfig or null`17091710            `type`'s config overrides.17111712            - `defer_loading: optional boolean or null`17131714              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17151716            - `enabled: optional boolean or null`17171718              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.17191720          - `close_tab: optional BrowserCloseTabConfig or null`17211722            `close_tab`'s config overrides.17231724            - `defer_loading: optional boolean or null`17251726              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17271728            - `enabled: optional boolean or null`17291730              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.17311732          - `double_click: optional BrowserDoubleClickConfig or null`17331734            `double_click`'s config overrides.17351736            - `defer_loading: optional boolean or null`17371738              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17391740            - `enabled: optional boolean or null`17411742              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.17431744          - `file_upload: optional BrowserFileUploadConfig or null`17451746            `file_upload`'s config overrides.17471748            - `defer_loading: optional boolean or null`17491750              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17511752            - `enabled: optional boolean or null`17531754              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.17551756          - `find: optional BrowserFindConfig or null`17571758            `find`'s config overrides.17591760            - `defer_loading: optional boolean or null`17611762              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17631764            - `enabled: optional boolean or null`17651766              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.17671768          - `form_input: optional BrowserFormInputConfig or null`17691770            `form_input`'s config overrides.17711772            - `defer_loading: optional boolean or null`17731774              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17751776            - `enabled: optional boolean or null`17771778              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.17791780          - `get_page_text: optional BrowserGetPageTextConfig or null`17811782            `get_page_text`'s config overrides.17831784            - `defer_loading: optional boolean or null`17851786              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17871788            - `enabled: optional boolean or null`17891790              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.17911792          - `hold_key: optional BrowserHoldKeyConfig or null`17931794            `hold_key`'s config overrides.17951796            - `defer_loading: optional boolean or null`17971798              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17991800            - `enabled: optional boolean or null`18011802              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.18031804          - `hover: optional BrowserHoverConfig or null`18051806            `hover`'s config overrides.18071808            - `defer_loading: optional boolean or null`18091810              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18111812            - `enabled: optional boolean or null`18131814              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.18151816          - `javascript_exec: optional BrowserJavascriptExecConfig or null`18171818            `javascript_exec`'s config overrides.18191820            - `defer_loading: optional boolean or null`18211822              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18231824            - `enabled: optional boolean or null`18251826              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.18271828          - `key: optional BrowserKeyConfig or null`18291830            `key`'s config overrides.18311832            - `defer_loading: optional boolean or null`18331834              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18351836            - `enabled: optional boolean or null`18371838              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.18391840          - `left_click: optional BrowserLeftClickConfig or null`18411842            `left_click`'s config overrides.18431844            - `defer_loading: optional boolean or null`18451846              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18471848            - `enabled: optional boolean or null`18491850              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.18511852          - `left_click_drag: optional BrowserLeftClickDragConfig or null`18531854            `left_click_drag`'s config overrides.18551856            - `defer_loading: optional boolean or null`18571858              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18591860            - `enabled: optional boolean or null`18611862              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.18631864          - `left_mouse_down: optional BrowserLeftMouseDownConfig or null`18651866            `left_mouse_down`'s config overrides.18671868            - `defer_loading: optional boolean or null`18691870              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18711872            - `enabled: optional boolean or null`18731874              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.18751876          - `left_mouse_up: optional BrowserLeftMouseUpConfig or null`18771878            `left_mouse_up`'s config overrides.18791880            - `defer_loading: optional boolean or null`18811882              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18831884            - `enabled: optional boolean or null`18851886              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.18871888          - `list_tabs: optional BrowserListTabsConfig or null`18891890            `list_tabs`'s config overrides.18911892            - `defer_loading: optional boolean or null`18931894              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18951896            - `enabled: optional boolean or null`18971898              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.18991900          - `middle_click: optional BrowserMiddleClickConfig or null`19011902            `middle_click`'s config overrides.19031904            - `defer_loading: optional boolean or null`19051906              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19071908            - `enabled: optional boolean or null`19091910              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.19111912          - `mouse_move: optional BrowserMouseMoveConfig or null`19131914            `mouse_move`'s config overrides.19151916            - `defer_loading: optional boolean or null`19171918              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19191920            - `enabled: optional boolean or null`19211922              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.19231924          - `navigate: optional BrowserNavigateConfig or null`19251926            `navigate`'s config overrides.19271928            - `defer_loading: optional boolean or null`19291930              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19311932            - `enabled: optional boolean or null`19331934              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.19351936          - `new_tab: optional BrowserNewTabConfig or null`19371938            `new_tab`'s config overrides.19391940            - `defer_loading: optional boolean or null`19411942              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19431944            - `enabled: optional boolean or null`19451946              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.19471948          - `read_console: optional BrowserReadConsoleConfig or null`19491950            `read_console`'s config overrides.19511952            - `defer_loading: optional boolean or null`19531954              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19551956            - `enabled: optional boolean or null`19571958              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.19591960          - `read_network: optional BrowserReadNetworkConfig or null`19611962            `read_network`'s config overrides.19631964            - `defer_loading: optional boolean or null`19651966              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19671968            - `enabled: optional boolean or null`19691970              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.19711972          - `read_page: optional BrowserReadPageConfig or null`19731974            `read_page`'s config overrides.19751976            - `defer_loading: optional boolean or null`19771978              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19791980            - `enabled: optional boolean or null`19811982              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.19831984          - `right_click: optional BrowserRightClickConfig or null`19851986            `right_click`'s config overrides.19871988            - `defer_loading: optional boolean or null`19891990              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19911992            - `enabled: optional boolean or null`19931994              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.19951996          - `screenshot: optional BrowserScreenshotConfig or null`19971998            `screenshot`'s config overrides.19992000            - `defer_loading: optional boolean or null`20012002              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20032004            - `enabled: optional boolean or null`20052006              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.20072008          - `scroll: optional BrowserScrollConfig or null`20092010            `scroll`'s config overrides.20112012            - `defer_loading: optional boolean or null`20132014              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20152016            - `enabled: optional boolean or null`20172018              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.20192020          - `scroll_to: optional BrowserScrollToConfig or null`20212022            `scroll_to`'s config overrides.20232024            - `defer_loading: optional boolean or null`20252026              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20272028            - `enabled: optional boolean or null`20292030              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.20312032          - `switch_tab: optional BrowserSwitchTabConfig or null`20332034            `switch_tab`'s config overrides.20352036            - `defer_loading: optional boolean or null`20372038              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20392040            - `enabled: optional boolean or null`20412042              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.20432044          - `triple_click: optional BrowserTripleClickConfig or null`20452046            `triple_click`'s config overrides.20472048            - `defer_loading: optional boolean or null`20492050              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20512052            - `enabled: optional boolean or null`20532054              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.20552056          - `wait: optional BrowserWaitConfig or null`20572058            `wait`'s config overrides.20592060            - `defer_loading: optional boolean or null`20612062              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20632064            - `enabled: optional boolean or null`20652066              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.20672068          - `zoom: optional BrowserZoomConfig or null`20692070            `zoom`'s config overrides.20712072            - `defer_loading: optional boolean or null`20732074              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20752076            - `enabled: optional boolean or null`20772078              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.20792080      - `MemoryTool20250818 object`20812082        - `type: "memory_20250818"`20832084        - `name: "memory"`20852086          Name of the tool.20872088          This is how the tool will be called by the model and in `tool_use` blocks.20892090        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`20912092          - `"direct"`20932094          - `"code_execution_20250825"`20952096          - `"code_execution_20260120"`20972098          - `"code_execution_20260521"`20992100        - `cache_control: optional CacheControlEphemeral or null`21012102          Create a cache control breakpoint at this content block.21032104        - `defer_loading: optional boolean`21052106          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.21072108        - `input_examples: optional array of map[unknown]`21092110        - `strict: optional boolean`21112112          When true, guarantees schema validation on tool names and inputs21132114      - `ComputerToolset20260801 object`21152116        The computer toolset: a single `tools[]` entry (carrying no2117        `name`) that declares the computer tool family. The model is2118        served the family's tool with any members disabled via `configs`2119        removed from its schema. Every member is enabled by default, zoom2120        included. The single-tool options `display_number` and2121        `enable_zoom` are not fields of a toolset entry — it carries only2122        `type`, `configs`, and `cache_control`; zoom is controlled2123        via `configs.zoom.enabled`.21242125        - `type: "computer_toolset_20260801"`21262127        - `cache_control: optional CacheControlEphemeral or null`21282129          Create a cache control breakpoint at this content block.21302131        - `configs: optional ComputerToolsetConfigs or null`21322133          Per-member configuration for `computer_toolset_20260801`: one2134          optional field per member tool, keyed by the member name — the same2135          name the member's `tool_use` blocks carry. Every member is an2136          accepted key, and a member's defaults apply wherever its key is2137          absent. Unknown keys are rejected: the field set is this toolset2138          version's complete member set.21392140          - `type: optional ComputerTypeConfig or null`21412142            `type`'s config overrides.21432144            - `defer_loading: optional boolean or null`21452146              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21472148            - `enabled: optional boolean or null`21492150              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.21512152          - `cursor_position: optional ComputerCursorPositionConfig or null`21532154            `cursor_position`'s config overrides.21552156            - `defer_loading: optional boolean or null`21572158              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21592160            - `enabled: optional boolean or null`21612162              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.21632164          - `double_click: optional ComputerDoubleClickConfig or null`21652166            `double_click`'s config overrides.21672168            - `defer_loading: optional boolean or null`21692170              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21712172            - `enabled: optional boolean or null`21732174              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.21752176          - `hold_key: optional ComputerHoldKeyConfig or null`21772178            `hold_key`'s config overrides.21792180            - `defer_loading: optional boolean or null`21812182              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21832184            - `enabled: optional boolean or null`21852186              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.21872188          - `key: optional ComputerKeyConfig or null`21892190            `key`'s config overrides.21912192            - `defer_loading: optional boolean or null`21932194              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21952196            - `enabled: optional boolean or null`21972198              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.21992200          - `left_click: optional ComputerLeftClickConfig or null`22012202            `left_click`'s config overrides.22032204            - `defer_loading: optional boolean or null`22052206              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22072208            - `enabled: optional boolean or null`22092210              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.22112212          - `left_click_drag: optional ComputerLeftClickDragConfig or null`22132214            `left_click_drag`'s config overrides.22152216            - `defer_loading: optional boolean or null`22172218              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22192220            - `enabled: optional boolean or null`22212222              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.22232224          - `left_mouse_down: optional ComputerLeftMouseDownConfig or null`22252226            `left_mouse_down`'s config overrides.22272228            - `defer_loading: optional boolean or null`22292230              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22312232            - `enabled: optional boolean or null`22332234              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.22352236          - `left_mouse_up: optional ComputerLeftMouseUpConfig or null`22372238            `left_mouse_up`'s config overrides.22392240            - `defer_loading: optional boolean or null`22412242              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22432244            - `enabled: optional boolean or null`22452246              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.22472248          - `middle_click: optional ComputerMiddleClickConfig or null`22492250            `middle_click`'s config overrides.22512252            - `defer_loading: optional boolean or null`22532254              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22552256            - `enabled: optional boolean or null`22572258              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.22592260          - `mouse_move: optional ComputerMouseMoveConfig or null`22612262            `mouse_move`'s config overrides.22632264            - `defer_loading: optional boolean or null`22652266              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22672268            - `enabled: optional boolean or null`22692270              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.22712272          - `right_click: optional ComputerRightClickConfig or null`22732274            `right_click`'s config overrides.22752276            - `defer_loading: optional boolean or null`22772278              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22792280            - `enabled: optional boolean or null`22812282              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.22832284          - `screenshot: optional ComputerScreenshotConfig or null`22852286            `screenshot`'s config overrides.22872288            - `defer_loading: optional boolean or null`22892290              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22912292            - `enabled: optional boolean or null`22932294              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.22952296          - `scroll: optional ComputerScrollConfig or null`22972298            `scroll`'s config overrides.22992300            - `defer_loading: optional boolean or null`23012302              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23032304            - `enabled: optional boolean or null`23052306              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.23072308          - `triple_click: optional ComputerTripleClickConfig or null`23092310            `triple_click`'s config overrides.23112312            - `defer_loading: optional boolean or null`23132314              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23152316            - `enabled: optional boolean or null`23172318              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.23192320          - `wait: optional ComputerWaitConfig or null`23212322            `wait`'s config overrides.23232324            - `defer_loading: optional boolean or null`23252326              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23272328            - `enabled: optional boolean or null`23292330              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.23312332          - `zoom: optional ComputerZoomConfig or null`23332334            `zoom`'s config overrides.23352336            - `defer_loading: optional boolean or null`23372338              Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23392340            - `enabled: optional boolean or null`23412342              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.23432344      - `ToolTextEditor20250124 object`23452346        - `type: "text_editor_20250124"`23472348        - `name: "str_replace_editor"`23492350          Name of the tool.23512352          This is how the tool will be called by the model and in `tool_use` blocks.23532354        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23552356          - `"direct"`23572358          - `"code_execution_20250825"`23592360          - `"code_execution_20260120"`23612362          - `"code_execution_20260521"`23632364        - `cache_control: optional CacheControlEphemeral or null`23652366          Create a cache control breakpoint at this content block.23672368        - `defer_loading: optional boolean`23692370          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.23712372        - `input_examples: optional array of map[unknown]`23732374        - `strict: optional boolean`23752376          When true, guarantees schema validation on tool names and inputs23772378      - `ToolTextEditor20250429 object`23792380        - `type: "text_editor_20250429"`23812382        - `name: "str_replace_based_edit_tool"`23832384          Name of the tool.23852386          This is how the tool will be called by the model and in `tool_use` blocks.23872388        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23892390          - `"direct"`23912392          - `"code_execution_20250825"`23932394          - `"code_execution_20260120"`23952396          - `"code_execution_20260521"`23972398        - `cache_control: optional CacheControlEphemeral or null`23992400          Create a cache control breakpoint at this content block.24012402        - `defer_loading: optional boolean`24032404          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.24052406        - `input_examples: optional array of map[unknown]`24072408        - `strict: optional boolean`24092410          When true, guarantees schema validation on tool names and inputs24112412      - `ToolTextEditor20250728 object`24132414        - `type: "text_editor_20250728"`24152416        - `name: "str_replace_based_edit_tool"`24172418          Name of the tool.24192420          This is how the tool will be called by the model and in `tool_use` blocks.24212422        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`24232424          - `"direct"`24252426          - `"code_execution_20250825"`24272428          - `"code_execution_20260120"`24292430          - `"code_execution_20260521"`24312432        - `cache_control: optional CacheControlEphemeral or null`24332434          Create a cache control breakpoint at this content block.24352436        - `defer_loading: optional boolean`24372438          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.24392440        - `input_examples: optional array of map[unknown]`24412442        - `max_characters: optional number or null`24432444          Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.24452446          minimum: 124472448        - `strict: optional boolean`24492450          When true, guarantees schema validation on tool names and inputs24512452      - `WebSearchTool20250305 object`24532454        - `type: "web_search_20250305"`24552456        - `name: "web_search"`24572458          Name of the tool.24592460          This is how the tool will be called by the model and in `tool_use` blocks.24612462        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`24632464          - `"direct"`24652466          - `"code_execution_20250825"`24672468          - `"code_execution_20260120"`24692470          - `"code_execution_20260521"`24712472        - `allowed_domains: optional array of string or null`24732474          If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.24752476        - `blocked_domains: optional array of string or null`24772478          If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.24792480        - `cache_control: optional CacheControlEphemeral or null`24812482          Create a cache control breakpoint at this content block.24832484        - `defer_loading: optional boolean`24852486          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.24872488        - `max_uses: optional number or null`24892490          Maximum number of times the tool can be used in the API request.24912492          exclusiveMinimum: 024932494        - `strict: optional boolean`24952496          When true, guarantees schema validation on tool names and inputs24972498        - `user_location: optional UserLocation or null`24992500          Parameters for the user's location. Used to provide more relevant search results.25012502          - `type: "approximate"`25032504          - `city: optional string or null`25052506            The city of the user.25072508            maxLength: 255, minLength: 125092510          - `country: optional string or null`25112512            The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.25132514            maxLength: 2, minLength: 225152516          - `region: optional string or null`25172518            The region of the user.25192520            maxLength: 255, minLength: 125212522          - `timezone: optional string or null`25232524            The [IANA timezone](https://nodatime.org/TimeZones) of the user.25252526            maxLength: 255, minLength: 125272528      - `WebFetchTool20250910 object`25292530        - `type: "web_fetch_20250910"`25312532        - `name: "web_fetch"`25332534          Name of the tool.25352536          This is how the tool will be called by the model and in `tool_use` blocks.25372538        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`25392540          - `"direct"`25412542          - `"code_execution_20250825"`25432544          - `"code_execution_20260120"`25452546          - `"code_execution_20260521"`25472548        - `allowed_domains: optional array of string or null`25492550          List of domains to allow fetching from25512552        - `blocked_domains: optional array of string or null`25532554          List of domains to block fetching from25552556        - `cache_control: optional CacheControlEphemeral or null`25572558          Create a cache control breakpoint at this content block.25592560        - `citations: optional CitationsConfigParam or null`25612562          Citations configuration for fetched documents. Citations are disabled by default.25632564        - `defer_loading: optional boolean`25652566          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.25672568        - `max_content_tokens: optional number or null`25692570          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.25712572          exclusiveMinimum: 025732574        - `max_uses: optional number or null`25752576          Maximum number of times the tool can be used in the API request.25772578          exclusiveMinimum: 025792580        - `strict: optional boolean`25812582          When true, guarantees schema validation on tool names and inputs25832584        - `url_sources: optional WebFetchURLSources or null`25852586          Which sources contribute to the set of URLs web fetch may fetch.25872588          Each key is a tagged variant: `user_input` is `all` or `none`; the2589          two tool filters are `all`, `none`, `only` (only the named tools'2590          results) or `except` (every result but the named tools'). A named tool2591          must be declared in this request's `tools[]`.25922593          - `client_tool_results: optional WebFetchURLSourceAll or WebFetchURLSourceNone or WebFetchURLSourceOnly or WebFetchURLSourceExcept`25942595            Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].25962597            - `WebFetchURLSourceAll object`25982599              The `url_sources` variant under which a source contributes in2600              full: every result of the tool filter's source, or all user input.26012602              - `type: "all"`26032604            - `WebFetchURLSourceNone object`26052606              The `url_sources` variant under which a source contributes nothing:2607              no result of the tool filter's source, or no user input.26082609              - `type: "none"`26102611            - `WebFetchURLSourceOnly object`26122613              The tool filter variant under which only the named tools' results2614              contribute.26152616              - `type: "only"`26172618              - `tools: array of WebFetchURLSourceToolReference`26192620                - `type: "tool_reference"`26212622                - `name: string`26232624            - `WebFetchURLSourceExcept object`26252626              The tool filter variant under which every result but the named2627              tools' contributes.26282629              - `type: "except"`26302631              - `tools: array of WebFetchURLSourceToolReference`26322633                - `type: "tool_reference"`26342635                - `name: string`26362637          - `server_tool_results: optional WebFetchURLSourceAll or WebFetchURLSourceNone or WebFetchURLSourceOnly or WebFetchURLSourceExcept`26382639            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.26402641            - `WebFetchURLSourceAll object`26422643              The `url_sources` variant under which a source contributes in2644              full: every result of the tool filter's source, or all user input.26452646            - `WebFetchURLSourceNone object`26472648              The `url_sources` variant under which a source contributes nothing:2649              no result of the tool filter's source, or no user input.26502651            - `WebFetchURLSourceOnly object`26522653              The tool filter variant under which only the named tools' results2654              contribute.26552656            - `WebFetchURLSourceExcept object`26572658              The tool filter variant under which every result but the named2659              tools' contributes.26602661          - `user_input: optional WebFetchURLSourceAll or WebFetchURLSourceNone`26622663            Whether URLs in user messages are fetchable: "all" or "none".26642665            - `WebFetchURLSourceAll object`26662667              The `url_sources` variant under which a source contributes in2668              full: every result of the tool filter's source, or all user input.26692670            - `WebFetchURLSourceNone object`26712672              The `url_sources` variant under which a source contributes nothing:2673              no result of the tool filter's source, or no user input.26742675      - `WebSearchTool20260209 object`26762677        - `type: "web_search_20260209"`26782679        - `name: "web_search"`26802681          Name of the tool.26822683          This is how the tool will be called by the model and in `tool_use` blocks.26842685        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`26862687          - `"direct"`26882689          - `"code_execution_20250825"`26902691          - `"code_execution_20260120"`26922693          - `"code_execution_20260521"`26942695        - `allowed_domains: optional array of string or null`26962697          If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.26982699        - `blocked_domains: optional array of string or null`27002701          If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.27022703        - `cache_control: optional CacheControlEphemeral or null`27042705          Create a cache control breakpoint at this content block.27062707        - `defer_loading: optional boolean`27082709          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.27102711        - `max_uses: optional number or null`27122713          Maximum number of times the tool can be used in the API request.27142715          exclusiveMinimum: 027162717        - `strict: optional boolean`27182719          When true, guarantees schema validation on tool names and inputs27202721        - `user_location: optional UserLocation or null`27222723          Parameters for the user's location. Used to provide more relevant search results.27242725      - `WebFetchTool20260209 object`27262727        - `type: "web_fetch_20260209"`27282729        - `name: "web_fetch"`27302731          Name of the tool.27322733          This is how the tool will be called by the model and in `tool_use` blocks.27342735        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`27362737          - `"direct"`27382739          - `"code_execution_20250825"`27402741          - `"code_execution_20260120"`27422743          - `"code_execution_20260521"`27442745        - `allowed_domains: optional array of string or null`27462747          List of domains to allow fetching from27482749        - `blocked_domains: optional array of string or null`27502751          List of domains to block fetching from27522753        - `cache_control: optional CacheControlEphemeral or null`27542755          Create a cache control breakpoint at this content block.27562757        - `citations: optional CitationsConfigParam or null`27582759          Citations configuration for fetched documents. Citations are disabled by default.27602761        - `defer_loading: optional boolean`27622763          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.27642765        - `max_content_tokens: optional number or null`27662767          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.27682769          exclusiveMinimum: 027702771        - `max_uses: optional number or null`27722773          Maximum number of times the tool can be used in the API request.27742775          exclusiveMinimum: 027762777        - `strict: optional boolean`27782779          When true, guarantees schema validation on tool names and inputs27802781        - `url_sources: optional WebFetchURLSources or null`27822783          Which sources contribute to the set of URLs web fetch may fetch.27842785          Each key is a tagged variant: `user_input` is `all` or `none`; the2786          two tool filters are `all`, `none`, `only` (only the named tools'2787          results) or `except` (every result but the named tools'). A named tool2788          must be declared in this request's `tools[]`.27892790      - `WebFetchTool20260309 object`27912792        Web fetch tool with use_cache parameter for bypassing cached content.27932794        - `type: "web_fetch_20260309"`27952796        - `name: "web_fetch"`27972798          Name of the tool.27992800          This is how the tool will be called by the model and in `tool_use` blocks.28012802        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`28032804          - `"direct"`28052806          - `"code_execution_20250825"`28072808          - `"code_execution_20260120"`28092810          - `"code_execution_20260521"`28112812        - `allowed_domains: optional array of string or null`28132814          List of domains to allow fetching from28152816        - `blocked_domains: optional array of string or null`28172818          List of domains to block fetching from28192820        - `cache_control: optional CacheControlEphemeral or null`28212822          Create a cache control breakpoint at this content block.28232824        - `citations: optional CitationsConfigParam or null`28252826          Citations configuration for fetched documents. Citations are disabled by default.28272828        - `defer_loading: optional boolean`28292830          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.28312832        - `max_content_tokens: optional number or null`28332834          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.28352836          exclusiveMinimum: 028372838        - `max_uses: optional number or null`28392840          Maximum number of times the tool can be used in the API request.28412842          exclusiveMinimum: 028432844        - `strict: optional boolean`28452846          When true, guarantees schema validation on tool names and inputs28472848        - `url_sources: optional WebFetchURLSources or null`28492850          Which sources contribute to the set of URLs web fetch may fetch.28512852          Each key is a tagged variant: `user_input` is `all` or `none`; the2853          two tool filters are `all`, `none`, `only` (only the named tools'2854          results) or `except` (every result but the named tools'). A named tool2855          must be declared in this request's `tools[]`.28562857        - `use_cache: optional boolean`28582859          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.28602861      - `WebSearchTool20260318 object`28622863        - `type: "web_search_20260318"`28642865        - `name: "web_search"`28662867          Name of the tool.28682869          This is how the tool will be called by the model and in `tool_use` blocks.28702871        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`28722873          - `"direct"`28742875          - `"code_execution_20250825"`28762877          - `"code_execution_20260120"`28782879          - `"code_execution_20260521"`28802881        - `allowed_domains: optional array of string or null`28822883          If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.28842885        - `blocked_domains: optional array of string or null`28862887          If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.28882889        - `cache_control: optional CacheControlEphemeral or null`28902891          Create a cache control breakpoint at this content block.28922893        - `defer_loading: optional boolean`28942895          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.28962897        - `max_uses: optional number or null`28982899          Maximum number of times the tool can be used in the API request.29002901          exclusiveMinimum: 029022903        - `response_inclusion: optional "full" or "excluded"`29042905          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.29062907          - `"full"`29082909          - `"excluded"`29102911        - `strict: optional boolean`29122913          When true, guarantees schema validation on tool names and inputs29142915        - `user_location: optional UserLocation or null`29162917          Parameters for the user's location. Used to provide more relevant search results.29182919      - `WebFetchTool20260318 object`29202921        - `type: "web_fetch_20260318"`29222923        - `name: "web_fetch"`29242925          Name of the tool.29262927          This is how the tool will be called by the model and in `tool_use` blocks.29282929        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`29302931          - `"direct"`29322933          - `"code_execution_20250825"`29342935          - `"code_execution_20260120"`29362937          - `"code_execution_20260521"`29382939        - `allowed_domains: optional array of string or null`29402941          List of domains to allow fetching from29422943        - `blocked_domains: optional array of string or null`29442945          List of domains to block fetching from29462947        - `cache_control: optional CacheControlEphemeral or null`29482949          Create a cache control breakpoint at this content block.29502951        - `citations: optional CitationsConfigParam or null`29522953          Citations configuration for fetched documents. Citations are disabled by default.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        - `max_content_tokens: optional number or null`29602961          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.29622963          exclusiveMinimum: 029642965        - `max_uses: optional number or null`29662967          Maximum number of times the tool can be used in the API request.29682969          exclusiveMinimum: 029702971        - `response_inclusion: optional "full" or "excluded"`29722973          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.29742975          - `"full"`29762977          - `"excluded"`29782979        - `strict: optional boolean`29802981          When true, guarantees schema validation on tool names and inputs29822983        - `url_sources: optional WebFetchURLSources or null`29842985          Which sources contribute to the set of URLs web fetch may fetch.29862987          Each key is a tagged variant: `user_input` is `all` or `none`; the2988          two tool filters are `all`, `none`, `only` (only the named tools'2989          results) or `except` (every result but the named tools'). A named tool2990          must be declared in this request's `tools[]`.29912992        - `use_cache: optional boolean`29932994          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.29952996      - `ToolSearchToolBm25_20251119 object`29972998        - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`29993000          - `"tool_search_tool_bm25_20251119"`30013002          - `"tool_search_tool_bm25"`30033004        - `name: "tool_search_tool_bm25"`30053006          Name of the tool.30073008          This is how the tool will be called by the model and in `tool_use` blocks.30093010        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`30113012          - `"direct"`30133014          - `"code_execution_20250825"`30153016          - `"code_execution_20260120"`30173018          - `"code_execution_20260521"`30193020        - `cache_control: optional CacheControlEphemeral or null`30213022          Create a cache control breakpoint at this content block.30233024        - `defer_loading: optional boolean`30253026          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.30273028        - `strict: optional boolean`30293030          When true, guarantees schema validation on tool names and inputs30313032      - `ToolSearchToolRegex20251119 object`30333034        - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`30353036          - `"tool_search_tool_regex_20251119"`30373038          - `"tool_search_tool_regex"`30393040        - `name: "tool_search_tool_regex"`30413042          Name of the tool.30433044          This is how the tool will be called by the model and in `tool_use` blocks.30453046        - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`30473048          - `"direct"`30493050          - `"code_execution_20250825"`30513052          - `"code_execution_20260120"`30533054          - `"code_execution_20260521"`30553056        - `cache_control: optional CacheControlEphemeral or null`30573058          Create a cache control breakpoint at this content block.30593060        - `defer_loading: optional boolean`30613062          If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.30633064        - `strict: optional boolean`30653066          When true, guarantees schema validation on tool names and inputs30673068    - `temperature: optional number`30693070      **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.30713072      Amount of randomness injected into the response.30733074      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.30753076      Note that even with `temperature` of `0.0`, the results will not be fully deterministic.30773078      maximum: 1, minimum: 030793080    - `top_k: optional number`30813082      **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.30833084      Only sample from the top K options for each subsequent token.30853086      Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).30873088      Recommended for advanced use cases only.30893090      minimum: 030913092    - `top_p: optional number`30933094      **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.30953096      Use nucleus sampling.30973098      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`.30993100      Recommended for advanced use cases only.31013102      maximum: 1, minimum: 031033104## Returns31053106- `MessageBatch object`31073108  - `type: "message_batch"`31093110    Object type.31113112    For Message Batches, this is always `"message_batch"`.31133114    default: message_batch31153116  - `id: string`31173118    Unique object identifier.31193120    The format and length of IDs may change over time.31213122  - `archived_at: string or null`31233124    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.31253126    format: date-time31273128  - `cancel_initiated_at: string or null`31293130    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.31313132    format: date-time31333134  - `created_at: string`31353136    RFC 3339 datetime string representing the time at which the Message Batch was created.31373138    format: date-time31393140  - `ended_at: string or null`31413142    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.31433144    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.31453146    format: date-time31473148  - `expires_at: string`31493150    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.31513152    format: date-time31533154  - `processing_status: "in_progress" or "canceling" or "ended"`31553156    Processing status of the Message Batch.31573158    - `"in_progress"`31593160    - `"canceling"`31613162    - `"ended"`31633164  - `request_counts: MessageBatchRequestCounts`31653166    Tallies requests within the Message Batch, categorized by their status.31673168    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.31693170    - `canceled: number`31713172      Number of requests in the Message Batch that have been canceled.31733174      This is zero until processing of the entire Message Batch has ended.31753176      default: 031773178    - `errored: number`31793180      Number of requests in the Message Batch that encountered an error.31813182      This is zero until processing of the entire Message Batch has ended.31833184      default: 031853186    - `expired: number`31873188      Number of requests in the Message Batch that have expired.31893190      This is zero until processing of the entire Message Batch has ended.31913192      default: 031933194    - `processing: number`31953196      Number of requests in the Message Batch that are processing.31973198      default: 031993200    - `succeeded: number`32013202      Number of requests in the Message Batch that have completed successfully.32033204      This is zero until processing of the entire Message Batch has ended.32053206      default: 032073208  - `results_url: string or null`32093210    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.32113212    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.32133214## Example32153216```bash3217curl https://api.anthropic.com/v1/messages/batches \3218    -H 'Content-Type: application/json' \3219    -H 'anthropic-version: 2023-06-01' \3220    -H "X-Api-Key: $ANTHROPIC_API_KEY" \3221    -d '{3222          "requests": [3223            {3224              "custom_id": "my-custom-id-1",3225              "params": {3226                "max_tokens": 1024,3227                "messages": [3228                  {3229                    "content": "Hello, world",3230                    "role": "user"3231                  }3232                ],3233                "model": "claude-opus-5"3234              }3235            }3236          ]3237        }'3238```32393240### Response (200)32413242```json3243{3244  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",3245  "archived_at": "2024-08-20T18:37:24.100435Z",3246  "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",3247  "created_at": "2024-08-20T18:37:24.100435Z",3248  "ended_at": "2024-08-20T18:37:24.100435Z",3249  "expires_at": "2024-08-20T18:37:24.100435Z",3250  "processing_status": "in_progress",3251  "request_counts": {3252    "canceled": 10,3253    "errored": 30,3254    "expired": 10,3255    "processing": 100,3256    "succeeded": 503257  },3258  "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",3259  "type": "message_batch"3260}3261```3262
Files main
Menu

Theme