Repository Public
1---2title: Batches3url: https://platform.claude.com/docs/en/api/messages/batches4---56# Batches78## Create a Message Batch910**POST** `/v1/messages/batches`1112Send a batch of Message creation requests.1314The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.1516Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)1718### Headers1920- `"anthropic-user-profile-id": optional string`2122 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.2324- `"anthropic-workspace-id": optional string`2526### Body parameters2728- `requests: array of object`2930 List of requests for prompt completion. Each is an individual request to create a Message.3132 maxItems: 100000, minItems: 13334 - `custom_id: string`3536 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.3738 Must be unique for each request within the Message Batch.3940 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,64}$4142 - `params: object`4344 Messages API creation parameters for the individual request.4546 See the [Messages API reference](https://platform.claude.com/docs/en/api/messages) for full documentation on available parameters.4748 - `max_tokens: number`4950 The maximum number of tokens to generate before stopping.5152 Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.5354 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.5556 Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.5758 minimum: 05960 - `messages: array of MessageParam`6162 Input messages.6364 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.6566 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.6768 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.6970 Example with a single `user` message:7172 ```json73 [{"role": "user", "content": "Hello, Claude"}]74 ```7576 Example with multiple conversational turns:7778 ```json79 [80 {"role": "user", "content": "Hello there."},81 {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},82 {"role": "user", "content": "Can you explain LLMs in plain English?"},83 ]84 ```8586 Example with a partially-filled response from Claude:8788 ```json89 [90 {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},91 {"role": "assistant", "content": "The best answer is ("},92 ]93 ```9495 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:9697 ```json98 {"role": "user", "content": "Hello, Claude"}99 ```100101 ```json102 {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}103 ```104105 See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).106107 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.108109 There is a limit of 100,000 messages in a single request.110111 - `content: string or array of ContentBlockParam`112113 - `string`114115 - `array of ContentBlockParam`116117 - `TextBlockParam object`118119 - `type: "text"`120121 - `text: string`122123 minLength: 1124125 - `cache_control: optional CacheControlEphemeral or null`126127 Create a cache control breakpoint at this content block.128129 - `type: "ephemeral"`130131 - `ttl: optional "5m" or "1h"`132133 The time-to-live for the cache control breakpoint.134135 This may be one the following values:136137 - `5m`: 5 minutes138 - `1h`: 1 hour139140 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.141142 - `"5m"`143144 - `"1h"`145146 - `citations: optional array of TextCitationParam or null`147148 - `CitationCharLocationParam object`149150 - `type: "char_location"`151152 - `cited_text: string`153154 - `document_index: number`155156 minimum: 0157158 - `document_title: string or null`159160 maxLength: 500, minLength: 1161162 - `end_char_index: number`163164 - `start_char_index: number`165166 minimum: 0167168 - `CitationPageLocationParam object`169170 - `type: "page_location"`171172 - `cited_text: string`173174 - `document_index: number`175176 minimum: 0177178 - `document_title: string or null`179180 maxLength: 500, minLength: 1181182 - `end_page_number: number`183184 - `start_page_number: number`185186 minimum: 1187188 - `CitationContentBlockLocationParam object`189190 - `type: "content_block_location"`191192 - `cited_text: string`193194 The full text of the cited block range, concatenated.195196 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.197198 - `document_index: number`199200 minimum: 0201202 - `document_title: string or null`203204 maxLength: 500, minLength: 1205206 - `end_block_index: number`207208 Exclusive 0-based end index of the cited block range in the source's `content` array.209210 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.211212 - `start_block_index: number`213214 0-based index of the first cited block in the source's `content` array.215216 minimum: 0217218 - `CitationWebSearchResultLocationParam object`219220 - `type: "web_search_result_location"`221222 - `cited_text: string`223224 - `encrypted_index: string`225226 - `title: string or null`227228 maxLength: 512, minLength: 1229230 - `url: string`231232 minLength: 1233234 - `CitationSearchResultLocationParam object`235236 - `type: "search_result_location"`237238 - `cited_text: string`239240 The full text of the cited block range, concatenated.241242 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.243244 - `end_block_index: number`245246 Exclusive 0-based end index of the cited block range in the source's `content` array.247248 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.249250 - `search_result_index: number`251252 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.253254 Counted separately from `document_index`; server-side web search results are not included in this count.255256 minimum: 0257258 - `source: string`259260 - `start_block_index: number`261262 0-based index of the first cited block in the source's `content` array.263264 minimum: 0265266 - `title: string or null`267268 - `ImageBlockParam object`269270 - `type: "image"`271272 - `source: Base64ImageSource or URLImageSource or FileImageSource`273274 - `Base64ImageSource object`275276 - `type: "base64"`277278 - `data: string`279280 format: byte281282 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`283284 - `"image/jpeg"`285286 - `"image/png"`287288 - `"image/gif"`289290 - `"image/webp"`291292 - `URLImageSource object`293294 - `type: "url"`295296 - `url: string`297298 - `FileImageSource object`299300 - `type: "file"`301302 - `file_id: string`303304 - `cache_control: optional CacheControlEphemeral or null`305306 Create a cache control breakpoint at this content block.307308 - `transformations: optional ImageTransformationsParam or null`309310 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.311312 - `oversized_image: optional "downsize" or "error"`313314 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.315316 - `"downsize"`317318 - `"error"`319320 - `DocumentBlockParam object`321322 - `type: "document"`323324 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`325326 - `Base64PDFSource object`327328 - `type: "base64"`329330 - `data: string`331332 format: byte333334 - `media_type: "application/pdf"`335336 - `PlainTextSource object`337338 - `type: "text"`339340 - `data: string`341342 - `media_type: "text/plain"`343344 - `ContentBlockSource object`345346 - `type: "content"`347348 - `content: string or array of ContentBlockSourceContent`349350 - `string`351352 - `ContentBlockSourceContent = array of ContentBlockSourceContent`353354 - `TextBlockParam object`355356 - `ImageBlockParam object`357358 - `URLPDFSource object`359360 - `type: "url"`361362 - `url: string`363364 - `FileDocumentSource object`365366 - `type: "file"`367368 - `file_id: string`369370 - `cache_control: optional CacheControlEphemeral or null`371372 Create a cache control breakpoint at this content block.373374 - `citations: optional CitationsConfigParam or null`375376 - `enabled: optional boolean`377378 - `context: optional string or null`379380 minLength: 1381382 - `title: optional string or null`383384 maxLength: 500, minLength: 1385386 - `SearchResultBlockParam object`387388 - `type: "search_result"`389390 - `content: array of TextBlockParam`391392 - `type: "text"`393394 - `text: string`395396 minLength: 1397398 - `cache_control: optional CacheControlEphemeral or null`399400 Create a cache control breakpoint at this content block.401402 - `citations: optional array of TextCitationParam or null`403404 - `source: string`405406 - `title: string`407408 - `cache_control: optional CacheControlEphemeral or null`409410 Create a cache control breakpoint at this content block.411412 - `citations: optional CitationsConfigParam`413414 - `ThinkingBlockParam object`415416 - `type: "thinking"`417418 - `signature: string`419420 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.421422 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.423424 - `thinking: string`425426 The `thinking` text of this block as returned by the API.427428 - `RedactedThinkingBlockParam object`429430 - `type: "redacted_thinking"`431432 - `data: string`433434 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.435436 - `ToolUseBlockParam object`437438 - `type: "tool_use"`439440 - `id: string`441442 pattern: ^[a-zA-Z0-9_-]+$443444 - `input: map[unknown]`445446 - `name: string`447448 maxLength: 200, minLength: 1449450 - `cache_control: optional CacheControlEphemeral or null`451452 Create a cache control breakpoint at this content block.453454 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`455456 - `DirectCaller object`457458 Tool invocation directly from the model.459460 - `type: "direct"`461462 - `ServerToolCaller object`463464 Tool invocation generated by a server-side tool.465466 - `type: "code_execution_20250825"`467468 - `tool_id: string`469470 pattern: ^srvtoolu_[a-zA-Z0-9_]+$471472 - `ServerToolCaller20260120 object`473474 - `type: "code_execution_20260120"`475476 - `tool_id: string`477478 pattern: ^srvtoolu_[a-zA-Z0-9_]+$479480 - `toolset_name: optional string or null`481482 For a toolset member tool_use, the toolset family this member belongs to.483484 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$485486 - `ToolResultBlockParam object`487488 - `type: "tool_result"`489490 - `tool_use_id: string`491492 pattern: ^[a-zA-Z0-9_-]+$493494 - `cache_control: optional CacheControlEphemeral or null`495496 Create a cache control breakpoint at this content block.497498 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`499500 - `string`501502 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`503504 - `TextBlockParam object`505506 - `ImageBlockParam object`507508 - `SearchResultBlockParam object`509510 - `DocumentBlockParam object`511512 - `ToolReferenceBlockParam object`513514 Tool reference block that can be included in tool_result content.515516 - `type: "tool_reference"`517518 - `tool_name: string`519520 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$521522 - `cache_control: optional CacheControlEphemeral or null`523524 Create a cache control breakpoint at this content block.525526 - `BrowserStateBlockParam object`527528 The caller's browser state after a browser toolset member call —529 the full inventory of open tabs, which tab is active, and any side530 effects (tabs opened, download state changes) the call produced.531532 At most one per `tool_result`, only on a non-error result answering a533 browser toolset member `tool_use`. The server renders the534 model-visible text from it; the model never sees the raw fields.535536 - `type: "browser_state"`537538 - `tabs: array of BrowserStateTabEntry`539540 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`.541542 maxItems: 100543544 - `tab_id: string`545546 The caller-assigned identifier for this tab, unique within the inventory.547548 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$549550 - `title: string`551552 The title of the page the tab is showing. May be empty.553554 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$555556 - `url: string`557558 The URL of the page the tab is showing. May be empty.559560 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$561562 - `active: optional boolean`563564 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.565566 - `cache_control: optional CacheControlEphemeral or null`567568 Create a cache control breakpoint at this content block.569570 - `state_changes: optional array of BrowserStateChange or null`571572 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.573574 maxItems: 200, minItems: 1575576 - `BrowserStateChangeTabOpened object`577578 A tab this call's execution opened that remains open at its end —579 the creation delta of the `tabs` inventory, not an event log.580581 Carries only the `tab_id`; the tab's `title` and `url` live on its582 `tabs` entry, which must include the same `tab_id`. A tab opened583 during a failed call gets no deferred `tab_opened`; it simply appears584 in the next result's `tabs` inventory.585586 - `type: "tab_opened"`587588 - `tab_id: string`589590 The `tab_id` of the opened tab, present in `tabs`.591592 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$593594 - `BrowserStateChangeDownloadStarted object`595596 A file download that started during this call.597598 - `type: "download_started"`599600 - `download_id: string`601602 The caller-assigned identifier for this download, stable across the state changes reporting it.603604 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$605606 - `url: string`607608 The final post-redirect URL the download was served from.609610 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$611612 - `BrowserStateChangeDownloadCompleted object`613614 A file download that finished during this call, reported with the615 same `download_id` as its `download_started` — or without a prior616 `download_started`, when the download finished during the call that617 started it (at most one state change per `download_id` per result).618619 - `type: "download_completed"`620621 - `download_id: string`622623 The caller-assigned identifier for this download, stable across the state changes reporting it.624625 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$626627 - `url: string`628629 The final post-redirect URL the download was served from.630631 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$632633 - `path: optional string or null`634635 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.636637 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096638639 - `size_bytes: optional number or null`640641 The completed download's size.642643 minimum: 0644645 - `BrowserStateChangeDownloadFailed object`646647 A file download that failed — or was cancelled — during this call.648649 - `type: "download_failed"`650651 - `download_id: string`652653 The caller-assigned identifier for this download, stable across the state changes reporting it.654655 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$656657 - `url: string`658659 The final post-redirect URL the download was served from.660661 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$662663 - `error: optional string or null`664665 The failure or cancellation detail, when known.666667 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096668669 - `is_error: optional boolean`670671 - `toolset_name: optional string or null`672673 For a toolset member tool_result, the toolset family of the paired tool_use.674675 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$676677 - `ServerToolUseBlockParam object`678679 - `type: "server_tool_use"`680681 - `id: string`682683 pattern: ^srvtoolu_[a-zA-Z0-9_]+$684685 - `input: map[unknown]`686687 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`688689 - `"web_search"`690691 - `"web_fetch"`692693 - `"code_execution"`694695 - `"bash_code_execution"`696697 - `"text_editor_code_execution"`698699 - `"tool_search_tool_regex"`700701 - `"tool_search_tool_bm25"`702703 - `cache_control: optional CacheControlEphemeral or null`704705 Create a cache control breakpoint at this content block.706707 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`708709 - `DirectCaller object`710711 Tool invocation directly from the model.712713 - `ServerToolCaller object`714715 Tool invocation generated by a server-side tool.716717 - `ServerToolCaller20260120 object`718719 - `WebSearchToolResultBlockParam object`720721 - `type: "web_search_tool_result"`722723 - `content: WebSearchToolResultBlockParamContent`724725 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`726727 - `type: "web_search_result"`728729 - `encrypted_content: string`730731 - `title: string`732733 - `url: string`734735 - `page_age: optional string or null`736737 - `WebSearchToolRequestError object`738739 - `type: "web_search_tool_result_error"`740741 - `error_code: WebSearchToolResultErrorCode`742743 - `"invalid_tool_input"`744745 - `"unavailable"`746747 - `"max_uses_exceeded"`748749 - `"too_many_requests"`750751 - `"query_too_long"`752753 - `"request_too_large"`754755 - `tool_use_id: string`756757 pattern: ^srvtoolu_[a-zA-Z0-9_]+$758759 - `cache_control: optional CacheControlEphemeral or null`760761 Create a cache control breakpoint at this content block.762763 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`764765 - `DirectCaller object`766767 Tool invocation directly from the model.768769 - `ServerToolCaller object`770771 Tool invocation generated by a server-side tool.772773 - `ServerToolCaller20260120 object`774775 - `WebFetchToolResultBlockParam object`776777 - `type: "web_fetch_tool_result"`778779 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`780781 - `WebFetchToolResultErrorBlockParam object`782783 - `type: "web_fetch_tool_result_error"`784785 - `error_code: WebFetchToolResultErrorCode`786787 - `"invalid_tool_input"`788789 - `"url_too_long"`790791 - `"url_not_allowed"`792793 - `"url_not_in_prior_context"`794795 - `"url_not_accessible"`796797 - `"unsupported_content_type"`798799 - `"too_many_requests"`800801 - `"max_uses_exceeded"`802803 - `"unavailable"`804805 - `"content_too_large"`806807 - `WebFetchBlockParam object`808809 - `type: "web_fetch_result"`810811 - `content: DocumentBlockParam`812813 - `url: string`814815 Fetched content URL816817 - `retrieved_at: optional string or null`818819 ISO 8601 timestamp when the content was retrieved820821 - `tool_use_id: string`822823 pattern: ^srvtoolu_[a-zA-Z0-9_]+$824825 - `cache_control: optional CacheControlEphemeral or null`826827 Create a cache control breakpoint at this content block.828829 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`830831 - `DirectCaller object`832833 Tool invocation directly from the model.834835 - `ServerToolCaller object`836837 Tool invocation generated by a server-side tool.838839 - `ServerToolCaller20260120 object`840841 - `CodeExecutionToolResultBlockParam object`842843 - `type: "code_execution_tool_result"`844845 - `content: CodeExecutionToolResultBlockParamContent`846847 - `CodeExecutionToolResultErrorParam object`848849 - `type: "code_execution_tool_result_error"`850851 - `error_code: CodeExecutionToolResultErrorCode`852853 - `"invalid_tool_input"`854855 - `"unavailable"`856857 - `"too_many_requests"`858859 - `"execution_time_exceeded"`860861 - `CodeExecutionResultBlockParam object`862863 - `type: "code_execution_result"`864865 - `content: array of CodeExecutionOutputBlockParam`866867 - `type: "code_execution_output"`868869 - `file_id: string`870871 - `return_code: number`872873 - `stderr: string`874875 - `stdout: string`876877 - `EncryptedCodeExecutionResultBlockParam object`878879 Code execution result with encrypted stdout for PFC + web_search results.880881 - `type: "encrypted_code_execution_result"`882883 - `content: array of CodeExecutionOutputBlockParam`884885 - `type: "code_execution_output"`886887 - `file_id: string`888889 - `encrypted_stdout: string`890891 - `return_code: number`892893 - `stderr: string`894895 - `tool_use_id: string`896897 pattern: ^srvtoolu_[a-zA-Z0-9_]+$898899 - `cache_control: optional CacheControlEphemeral or null`900901 Create a cache control breakpoint at this content block.902903 - `BashCodeExecutionToolResultBlockParam object`904905 - `type: "bash_code_execution_tool_result"`906907 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`908909 - `BashCodeExecutionToolResultErrorParam object`910911 - `type: "bash_code_execution_tool_result_error"`912913 - `error_code: BashCodeExecutionToolResultErrorCode`914915 - `"invalid_tool_input"`916917 - `"unavailable"`918919 - `"too_many_requests"`920921 - `"execution_time_exceeded"`922923 - `"output_file_too_large"`924925 - `BashCodeExecutionResultBlockParam object`926927 - `type: "bash_code_execution_result"`928929 - `content: array of BashCodeExecutionOutputBlockParam`930931 - `type: "bash_code_execution_output"`932933 - `file_id: string`934935 - `return_code: number`936937 - `stderr: string`938939 - `stdout: string`940941 - `tool_use_id: string`942943 pattern: ^srvtoolu_[a-zA-Z0-9_]+$944945 - `cache_control: optional CacheControlEphemeral or null`946947 Create a cache control breakpoint at this content block.948949 - `TextEditorCodeExecutionToolResultBlockParam object`950951 - `type: "text_editor_code_execution_tool_result"`952953 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`954955 - `TextEditorCodeExecutionToolResultErrorParam object`956957 - `type: "text_editor_code_execution_tool_result_error"`958959 - `error_code: TextEditorCodeExecutionToolResultErrorCode`960961 - `"invalid_tool_input"`962963 - `"unavailable"`964965 - `"too_many_requests"`966967 - `"execution_time_exceeded"`968969 - `"file_not_found"`970971 - `error_message: optional string or null`972973 - `TextEditorCodeExecutionViewResultBlockParam object`974975 - `type: "text_editor_code_execution_view_result"`976977 - `content: string`978979 - `file_type: "text" or "image" or "pdf"`980981 - `"text"`982983 - `"image"`984985 - `"pdf"`986987 - `num_lines: optional number or null`988989 - `start_line: optional number or null`990991 - `total_lines: optional number or null`992993 - `TextEditorCodeExecutionCreateResultBlockParam object`994995 - `type: "text_editor_code_execution_create_result"`996997 - `is_file_update: boolean`998999 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`10001001 - `type: "text_editor_code_execution_str_replace_result"`10021003 - `lines: optional array of string or null`10041005 - `new_lines: optional number or null`10061007 - `new_start: optional number or null`10081009 - `old_lines: optional number or null`10101011 - `old_start: optional number or null`10121013 - `tool_use_id: string`10141015 pattern: ^srvtoolu_[a-zA-Z0-9_]+$10161017 - `cache_control: optional CacheControlEphemeral or null`10181019 Create a cache control breakpoint at this content block.10201021 - `ToolSearchToolResultBlockParam object`10221023 - `type: "tool_search_tool_result"`10241025 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`10261027 - `ToolSearchToolResultErrorParam object`10281029 - `type: "tool_search_tool_result_error"`10301031 - `error_code: ToolSearchToolResultErrorCode`10321033 - `"invalid_tool_input"`10341035 - `"unavailable"`10361037 - `"too_many_requests"`10381039 - `"execution_time_exceeded"`10401041 - `error_message: optional string or null`10421043 - `ToolSearchToolSearchResultBlockParam object`10441045 - `type: "tool_search_tool_search_result"`10461047 - `tool_references: array of ToolReferenceBlockParam`10481049 - `type: "tool_reference"`10501051 - `tool_name: string`10521053 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$10541055 - `cache_control: optional CacheControlEphemeral or null`10561057 Create a cache control breakpoint at this content block.10581059 - `tool_use_id: string`10601061 pattern: ^srvtoolu_[a-zA-Z0-9_]+$10621063 - `cache_control: optional CacheControlEphemeral or null`10641065 Create a cache control breakpoint at this content block.10661067 - `ContainerUploadBlockParam object`10681069 A content block that represents a file to be uploaded to the container1070 Files uploaded via this block will be available in the container's input directory.10711072 - `type: "container_upload"`10731074 - `file_id: string`10751076 - `cache_control: optional CacheControlEphemeral or null`10771078 Create a cache control breakpoint at this content block.10791080 - `role: "user" or "assistant" or "system"`10811082 - `"user"`10831084 - `"assistant"`10851086 - `"system"`10871088 - `model: Model`10891090 The model that will complete your prompt.10911092 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.10931094 - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`10951096 The model that will complete your prompt.10971098 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.10991100 - `"claude-fable-5-1"`11011102 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows11031104 - `"claude-mythos-5-1"`11051106 Our most capable model for cybersecurity and biology research, available through trusted access programs11071108 - `"claude-sonnet-5"`11091110 High-performance model for coding and agents11111112 - `"claude-fable-5"`11131114 Next generation of intelligence for the hardest knowledge work and coding problems11151116 - `"claude-mythos-5"`11171118 Most capable model for cybersecurity and biology research11191120 - `"claude-opus-5"`11211122 Powerful intelligence for long-running agents and coding11231124 - `"claude-opus-4-8"`11251126 Powerful intelligence for long-running agents and coding11271128 - `"claude-opus-4-7"`11291130 Powerful intelligence for long-running agents and coding11311132 - `"claude-mythos-preview"`11331134 New class of intelligence, strongest in coding and cybersecurity11351136 - `"claude-opus-4-6"`11371138 Powerful intelligence for long-running agents and coding11391140 - `"claude-sonnet-4-6"`11411142 Best combination of speed and intelligence11431144 - `"claude-haiku-4-5"`11451146 Fastest model with near-frontier intelligence11471148 - `"claude-haiku-4-5-20251001"`11491150 Fastest model with near-frontier intelligence11511152 - `"claude-opus-4-5"`11531154 Powerful intelligence for long-running agents and coding11551156 - `"claude-opus-4-5-20251101"`11571158 Powerful intelligence for long-running agents and coding11591160 - `"claude-sonnet-4-5"`11611162 High-performance model for agents and coding11631164 - `"claude-sonnet-4-5-20250929"`11651166 High-performance model for agents and coding11671168 - `string`11691170 - `cache_control: optional CacheControlEphemeral or null`11711172 Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.11731174 - `container: optional MessageCreateParamsContainer or null`11751176 Container identifier for reuse across requests.11771178 - `ContainerParams object`11791180 Container parameters with skills to be loaded.11811182 - `id: optional string or null`11831184 Container id11851186 - `skills: optional array of SkillParams or null`11871188 List of skills to load in the container11891190 maxItems: 2011911192 - `type: "anthropic" or "custom"`11931194 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)11951196 - `"anthropic"`11971198 - `"custom"`11991200 - `skill_id: string`12011202 Skill ID12031204 maxLength: 64, minLength: 112051206 - `version: optional string`12071208 Skill version or 'latest' for most recent version12091210 maxLength: 64, minLength: 112111212 - `string`12131214 - `inference_geo: optional string or null`12151216 Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.12171218 - `metadata: optional Metadata`12191220 An object describing metadata about the request.12211222 - `user_id: optional string or null`12231224 An external identifier for the user who is associated with the request.12251226 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.12271228 maxLength: 51212291230 - `output_config: optional OutputConfig`12311232 Configuration options for the model's output, such as the output format.12331234 - `effort: optional "low" or "medium" or "high" or 2 more or null`12351236 All possible effort levels.12371238 - `"low"`12391240 - `"medium"`12411242 - `"high"`12431244 - `"xhigh"`12451246 - `"max"`12471248 - `format: optional JSONOutputFormat or null`12491250 A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)12511252 - `type: "json_schema"`12531254 - `schema: map[unknown]`12551256 The JSON schema of the format12571258 - `service_tier: optional "auto" or "standard_only"`12591260 Determines whether to use priority capacity (if available) or standard capacity for this request.12611262 Anthropic offers different levels of service for your API requests. See [service-tiers](https://platform.claude.com/docs/en/api/service-tiers) for details.12631264 - `"auto"`12651266 - `"standard_only"`12671268 - `stop_sequences: optional array of string`12691270 Custom text sequences that will cause the model to stop generating.12711272 Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.12731274 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.12751276 - `stream: optional boolean`12771278 Whether to incrementally stream the response using server-sent events.12791280 See [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming) for details.12811282 - `system: optional string or array of TextBlockParam`12831284 System prompt.12851286 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).12871288 - `string`12891290 - `array of TextBlockParam`12911292 - `type: "text"`12931294 - `text: string`12951296 minLength: 112971298 - `cache_control: optional CacheControlEphemeral or null`12991300 Create a cache control breakpoint at this content block.13011302 - `citations: optional array of TextCitationParam or null`13031304 - `thinking: optional ThinkingConfigParam`13051306 Configuration for enabling Claude's extended thinking.13071308 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.13091310 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.13111312 - `ThinkingConfigEnabled object`13131314 - `type: "enabled"`13151316 - `budget_tokens: number`13171318 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.13191320 Must be ≥1024 and less than `max_tokens`.13211322 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.13231324 minimum: 102413251326 - `display: optional "summarized" or "omitted" or null`13271328 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`.13291330 - `"summarized"`13311332 - `"omitted"`13331334 - `ThinkingConfigDisabled object`13351336 - `type: "disabled"`13371338 - `ThinkingConfigAdaptive object`13391340 - `type: "adaptive"`13411342 - `display: optional "summarized" or "omitted" or null`13431344 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`.13451346 - `"summarized"`13471348 - `"omitted"`13491350 - `tool_choice: optional ToolChoice`13511352 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.13531354 - `ToolChoiceAuto object`13551356 The model will automatically decide whether to use tools.13571358 - `type: "auto"`13591360 - `disable_parallel_tool_use: optional boolean`13611362 Whether to disable parallel tool use.13631364 Defaults to `false`. If set to `true`, the model will output at most one tool use.13651366 - `ToolChoiceAny object`13671368 The model will use any available tools.13691370 - `type: "any"`13711372 - `disable_parallel_tool_use: optional boolean`13731374 Whether to disable parallel tool use.13751376 Defaults to `false`. If set to `true`, the model will output exactly one tool use.13771378 - `ToolChoiceTool object`13791380 The model will use the specified tool with `tool_choice.name`.13811382 - `type: "tool"`13831384 - `name: string`13851386 The name of the tool to use.13871388 - `disable_parallel_tool_use: optional boolean`13891390 Whether to disable parallel tool use.13911392 Defaults to `false`. If set to `true`, the model will output exactly one tool use.13931394 - `ToolChoiceNone object`13951396 The model will not be allowed to use tools.13971398 - `type: "none"`13991400 - `tools: optional array of ToolUnion`14011402 Definitions of tools that the model may use.14031404 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.14051406 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)).14071408 Each tool definition includes:14091410 * `name`: Name of the tool.1411 * `description`: Optional, but strongly-recommended description of the tool.1412 * `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.14131414 For example, if you defined `tools` as:14151416 ```json1417 [1418 {1419 "name": "get_stock_price",1420 "description": "Get the current stock price for a given ticker symbol.",1421 "input_schema": {1422 "type": "object",1423 "properties": {1424 "ticker": {1425 "type": "string",1426 "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."1427 }1428 },1429 "required": ["ticker"]1430 }1431 }1432 ]1433 ```14341435 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:14361437 ```json1438 [1439 {1440 "type": "tool_use",1441 "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",1442 "name": "get_stock_price",1443 "input": { "ticker": "^GSPC" }1444 }1445 ]1446 ```14471448 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:14491450 ```json1451 [1452 {1453 "type": "tool_result",1454 "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",1455 "content": "259.75 USD"1456 }1457 ]1458 ```14591460 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.14611462 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.14631464 - `Tool object`14651466 - `type: optional "custom" or null`14671468 - `input_schema: object`14691470 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.14711472 This defines the shape of the `input` that your tool accepts and that the model will produce.14731474 - `type: "object"`14751476 - `properties: optional map[unknown] or null`14771478 - `required: optional array of string or null`14791480 - `name: string`14811482 Name of the tool.14831484 This is how the tool will be called by the model and in `tool_use` blocks.14851486 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$14871488 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`14891490 - `"direct"`14911492 - `"code_execution_20250825"`14931494 - `"code_execution_20260120"`14951496 - `"code_execution_20260521"`14971498 - `cache_control: optional CacheControlEphemeral or null`14991500 Create a cache control breakpoint at this content block.15011502 - `defer_loading: optional boolean`15031504 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15051506 - `description: optional string`15071508 Description of what this tool does.15091510 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.15111512 - `eager_input_streaming: optional boolean or null`15131514 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.15151516 - `input_examples: optional array of map[unknown]`15171518 - `strict: optional boolean`15191520 When true, guarantees schema validation on tool names and inputs15211522 - `ToolBash20250124 object`15231524 - `type: "bash_20250124"`15251526 - `name: "bash"`15271528 Name of the tool.15291530 This is how the tool will be called by the model and in `tool_use` blocks.15311532 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15331534 - `"direct"`15351536 - `"code_execution_20250825"`15371538 - `"code_execution_20260120"`15391540 - `"code_execution_20260521"`15411542 - `cache_control: optional CacheControlEphemeral or null`15431544 Create a cache control breakpoint at this content block.15451546 - `defer_loading: optional boolean`15471548 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15491550 - `input_examples: optional array of map[unknown]`15511552 - `strict: optional boolean`15531554 When true, guarantees schema validation on tool names and inputs15551556 - `CodeExecutionTool20250522 object`15571558 - `type: "code_execution_20250522"`15591560 - `name: "code_execution"`15611562 Name of the tool.15631564 This is how the tool will be called by the model and in `tool_use` blocks.15651566 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15671568 - `"direct"`15691570 - `"code_execution_20250825"`15711572 - `"code_execution_20260120"`15731574 - `"code_execution_20260521"`15751576 - `cache_control: optional CacheControlEphemeral or null`15771578 Create a cache control breakpoint at this content block.15791580 - `defer_loading: optional boolean`15811582 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15831584 - `strict: optional boolean`15851586 When true, guarantees schema validation on tool names and inputs15871588 - `CodeExecutionTool20250825 object`15891590 - `type: "code_execution_20250825"`15911592 - `name: "code_execution"`15931594 Name of the tool.15951596 This is how the tool will be called by the model and in `tool_use` blocks.15971598 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15991600 - `"direct"`16011602 - `"code_execution_20250825"`16031604 - `"code_execution_20260120"`16051606 - `"code_execution_20260521"`16071608 - `cache_control: optional CacheControlEphemeral or null`16091610 Create a cache control breakpoint at this content block.16111612 - `defer_loading: optional boolean`16131614 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.16151616 - `strict: optional boolean`16171618 When true, guarantees schema validation on tool names and inputs16191620 - `CodeExecutionTool20260120 object`16211622 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).16231624 - `type: "code_execution_20260120"`16251626 - `name: "code_execution"`16271628 Name of the tool.16291630 This is how the tool will be called by the model and in `tool_use` blocks.16311632 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`16331634 - `"direct"`16351636 - `"code_execution_20250825"`16371638 - `"code_execution_20260120"`16391640 - `"code_execution_20260521"`16411642 - `cache_control: optional CacheControlEphemeral or null`16431644 Create a cache control breakpoint at this content block.16451646 - `defer_loading: optional boolean`16471648 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.16491650 - `strict: optional boolean`16511652 When true, guarantees schema validation on tool names and inputs16531654 - `CodeExecutionTool20260521 object`16551656 Code execution tool with REPL state persistence.16571658 - `type: "code_execution_20260521"`16591660 - `name: "code_execution"`16611662 Name of the tool.16631664 This is how the tool will be called by the model and in `tool_use` blocks.16651666 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`16671668 - `"direct"`16691670 - `"code_execution_20250825"`16711672 - `"code_execution_20260120"`16731674 - `"code_execution_20260521"`16751676 - `cache_control: optional CacheControlEphemeral or null`16771678 Create a cache control breakpoint at this content block.16791680 - `defer_loading: optional boolean`16811682 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.16831684 - `strict: optional boolean`16851686 When true, guarantees schema validation on tool names and inputs16871688 - `BrowserToolset20260801 object`16891690 The browser toolset: a single `tools[]` entry (carrying no1691 `name`) that declares the browser tool family. The model is served1692 the family's tool with any members disabled via `configs` removed1693 from its schema.16941695 - `type: "browser_toolset_20260801"`16961697 - `cache_control: optional CacheControlEphemeral or null`16981699 Create a cache control breakpoint at this content block.17001701 - `configs: optional BrowserToolsetConfigs or null`17021703 Per-member configuration for `browser_toolset_20260801`: one1704 optional field per member tool, keyed by the member name — the same1705 name the member's `tool_use` blocks carry. Every member is an1706 accepted key, and a member's defaults apply wherever its key is1707 absent. Unknown keys are rejected: the field set is this toolset1708 version's complete member set.17091710 - `type: optional BrowserTypeConfig or null`17111712 `type`'s config overrides.17131714 - `defer_loading: optional boolean or null`17151716 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17171718 - `enabled: optional boolean or null`17191720 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.17211722 - `close_tab: optional BrowserCloseTabConfig or null`17231724 `close_tab`'s config overrides.17251726 - `defer_loading: optional boolean or null`17271728 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17291730 - `enabled: optional boolean or null`17311732 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.17331734 - `double_click: optional BrowserDoubleClickConfig or null`17351736 `double_click`'s config overrides.17371738 - `defer_loading: optional boolean or null`17391740 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17411742 - `enabled: optional boolean or null`17431744 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.17451746 - `file_upload: optional BrowserFileUploadConfig or null`17471748 `file_upload`'s config overrides.17491750 - `defer_loading: optional boolean or null`17511752 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17531754 - `enabled: optional boolean or null`17551756 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.17571758 - `find: optional BrowserFindConfig or null`17591760 `find`'s config overrides.17611762 - `defer_loading: optional boolean or null`17631764 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17651766 - `enabled: optional boolean or null`17671768 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.17691770 - `form_input: optional BrowserFormInputConfig or null`17711772 `form_input`'s config overrides.17731774 - `defer_loading: optional boolean or null`17751776 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17771778 - `enabled: optional boolean or null`17791780 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.17811782 - `get_page_text: optional BrowserGetPageTextConfig or null`17831784 `get_page_text`'s config overrides.17851786 - `defer_loading: optional boolean or null`17871788 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17891790 - `enabled: optional boolean or null`17911792 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.17931794 - `hold_key: optional BrowserHoldKeyConfig or null`17951796 `hold_key`'s config overrides.17971798 - `defer_loading: optional boolean or null`17991800 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18011802 - `enabled: optional boolean or null`18031804 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.18051806 - `hover: optional BrowserHoverConfig or null`18071808 `hover`'s config overrides.18091810 - `defer_loading: optional boolean or null`18111812 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18131814 - `enabled: optional boolean or null`18151816 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.18171818 - `javascript_exec: optional BrowserJavascriptExecConfig or null`18191820 `javascript_exec`'s config overrides.18211822 - `defer_loading: optional boolean or null`18231824 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18251826 - `enabled: optional boolean or null`18271828 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.18291830 - `key: optional BrowserKeyConfig or null`18311832 `key`'s config overrides.18331834 - `defer_loading: optional boolean or null`18351836 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18371838 - `enabled: optional boolean or null`18391840 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.18411842 - `left_click: optional BrowserLeftClickConfig or null`18431844 `left_click`'s config overrides.18451846 - `defer_loading: optional boolean or null`18471848 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18491850 - `enabled: optional boolean or null`18511852 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.18531854 - `left_click_drag: optional BrowserLeftClickDragConfig or null`18551856 `left_click_drag`'s config overrides.18571858 - `defer_loading: optional boolean or null`18591860 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18611862 - `enabled: optional boolean or null`18631864 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.18651866 - `left_mouse_down: optional BrowserLeftMouseDownConfig or null`18671868 `left_mouse_down`'s config overrides.18691870 - `defer_loading: optional boolean or null`18711872 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18731874 - `enabled: optional boolean or null`18751876 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.18771878 - `left_mouse_up: optional BrowserLeftMouseUpConfig or null`18791880 `left_mouse_up`'s config overrides.18811882 - `defer_loading: optional boolean or null`18831884 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18851886 - `enabled: optional boolean or null`18871888 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.18891890 - `list_tabs: optional BrowserListTabsConfig or null`18911892 `list_tabs`'s config overrides.18931894 - `defer_loading: optional boolean or null`18951896 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18971898 - `enabled: optional boolean or null`18991900 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.19011902 - `middle_click: optional BrowserMiddleClickConfig or null`19031904 `middle_click`'s config overrides.19051906 - `defer_loading: optional boolean or null`19071908 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19091910 - `enabled: optional boolean or null`19111912 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.19131914 - `mouse_move: optional BrowserMouseMoveConfig or null`19151916 `mouse_move`'s config overrides.19171918 - `defer_loading: optional boolean or null`19191920 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19211922 - `enabled: optional boolean or null`19231924 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.19251926 - `navigate: optional BrowserNavigateConfig or null`19271928 `navigate`'s config overrides.19291930 - `defer_loading: optional boolean or null`19311932 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19331934 - `enabled: optional boolean or null`19351936 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.19371938 - `new_tab: optional BrowserNewTabConfig or null`19391940 `new_tab`'s config overrides.19411942 - `defer_loading: optional boolean or null`19431944 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19451946 - `enabled: optional boolean or null`19471948 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.19491950 - `read_console: optional BrowserReadConsoleConfig or null`19511952 `read_console`'s config overrides.19531954 - `defer_loading: optional boolean or null`19551956 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19571958 - `enabled: optional boolean or null`19591960 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.19611962 - `read_network: optional BrowserReadNetworkConfig or null`19631964 `read_network`'s config overrides.19651966 - `defer_loading: optional boolean or null`19671968 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19691970 - `enabled: optional boolean or null`19711972 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.19731974 - `read_page: optional BrowserReadPageConfig or null`19751976 `read_page`'s config overrides.19771978 - `defer_loading: optional boolean or null`19791980 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19811982 - `enabled: optional boolean or null`19831984 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.19851986 - `right_click: optional BrowserRightClickConfig or null`19871988 `right_click`'s config overrides.19891990 - `defer_loading: optional boolean or null`19911992 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19931994 - `enabled: optional boolean or null`19951996 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.19971998 - `screenshot: optional BrowserScreenshotConfig or null`19992000 `screenshot`'s config overrides.20012002 - `defer_loading: optional boolean or null`20032004 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20052006 - `enabled: optional boolean or null`20072008 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.20092010 - `scroll: optional BrowserScrollConfig or null`20112012 `scroll`'s config overrides.20132014 - `defer_loading: optional boolean or null`20152016 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20172018 - `enabled: optional boolean or null`20192020 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.20212022 - `scroll_to: optional BrowserScrollToConfig or null`20232024 `scroll_to`'s config overrides.20252026 - `defer_loading: optional boolean or null`20272028 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20292030 - `enabled: optional boolean or null`20312032 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.20332034 - `switch_tab: optional BrowserSwitchTabConfig or null`20352036 `switch_tab`'s config overrides.20372038 - `defer_loading: optional boolean or null`20392040 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20412042 - `enabled: optional boolean or null`20432044 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.20452046 - `triple_click: optional BrowserTripleClickConfig or null`20472048 `triple_click`'s config overrides.20492050 - `defer_loading: optional boolean or null`20512052 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20532054 - `enabled: optional boolean or null`20552056 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.20572058 - `wait: optional BrowserWaitConfig or null`20592060 `wait`'s config overrides.20612062 - `defer_loading: optional boolean or null`20632064 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20652066 - `enabled: optional boolean or null`20672068 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.20692070 - `zoom: optional BrowserZoomConfig or null`20712072 `zoom`'s config overrides.20732074 - `defer_loading: optional boolean or null`20752076 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20772078 - `enabled: optional boolean or null`20792080 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.20812082 - `MemoryTool20250818 object`20832084 - `type: "memory_20250818"`20852086 - `name: "memory"`20872088 Name of the tool.20892090 This is how the tool will be called by the model and in `tool_use` blocks.20912092 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`20932094 - `"direct"`20952096 - `"code_execution_20250825"`20972098 - `"code_execution_20260120"`20992100 - `"code_execution_20260521"`21012102 - `cache_control: optional CacheControlEphemeral or null`21032104 Create a cache control breakpoint at this content block.21052106 - `defer_loading: optional boolean`21072108 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.21092110 - `input_examples: optional array of map[unknown]`21112112 - `strict: optional boolean`21132114 When true, guarantees schema validation on tool names and inputs21152116 - `ComputerToolset20260801 object`21172118 The computer toolset: a single `tools[]` entry (carrying no2119 `name`) that declares the computer tool family. The model is2120 served the family's tool with any members disabled via `configs`2121 removed from its schema. Every member is enabled by default, zoom2122 included. The single-tool options `display_number` and2123 `enable_zoom` are not fields of a toolset entry — it carries only2124 `type`, `configs`, and `cache_control`; zoom is controlled2125 via `configs.zoom.enabled`.21262127 - `type: "computer_toolset_20260801"`21282129 - `cache_control: optional CacheControlEphemeral or null`21302131 Create a cache control breakpoint at this content block.21322133 - `configs: optional ComputerToolsetConfigs or null`21342135 Per-member configuration for `computer_toolset_20260801`: one2136 optional field per member tool, keyed by the member name — the same2137 name the member's `tool_use` blocks carry. Every member is an2138 accepted key, and a member's defaults apply wherever its key is2139 absent. Unknown keys are rejected: the field set is this toolset2140 version's complete member set.21412142 - `type: optional ComputerTypeConfig or null`21432144 `type`'s config overrides.21452146 - `defer_loading: optional boolean or null`21472148 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21492150 - `enabled: optional boolean or null`21512152 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.21532154 - `cursor_position: optional ComputerCursorPositionConfig or null`21552156 `cursor_position`'s config overrides.21572158 - `defer_loading: optional boolean or null`21592160 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21612162 - `enabled: optional boolean or null`21632164 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.21652166 - `double_click: optional ComputerDoubleClickConfig or null`21672168 `double_click`'s config overrides.21692170 - `defer_loading: optional boolean or null`21712172 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21732174 - `enabled: optional boolean or null`21752176 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.21772178 - `hold_key: optional ComputerHoldKeyConfig or null`21792180 `hold_key`'s config overrides.21812182 - `defer_loading: optional boolean or null`21832184 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21852186 - `enabled: optional boolean or null`21872188 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.21892190 - `key: optional ComputerKeyConfig or null`21912192 `key`'s config overrides.21932194 - `defer_loading: optional boolean or null`21952196 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21972198 - `enabled: optional boolean or null`21992200 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.22012202 - `left_click: optional ComputerLeftClickConfig or null`22032204 `left_click`'s config overrides.22052206 - `defer_loading: optional boolean or null`22072208 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22092210 - `enabled: optional boolean or null`22112212 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.22132214 - `left_click_drag: optional ComputerLeftClickDragConfig or null`22152216 `left_click_drag`'s config overrides.22172218 - `defer_loading: optional boolean or null`22192220 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22212222 - `enabled: optional boolean or null`22232224 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.22252226 - `left_mouse_down: optional ComputerLeftMouseDownConfig or null`22272228 `left_mouse_down`'s config overrides.22292230 - `defer_loading: optional boolean or null`22312232 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22332234 - `enabled: optional boolean or null`22352236 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.22372238 - `left_mouse_up: optional ComputerLeftMouseUpConfig or null`22392240 `left_mouse_up`'s config overrides.22412242 - `defer_loading: optional boolean or null`22432244 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22452246 - `enabled: optional boolean or null`22472248 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.22492250 - `middle_click: optional ComputerMiddleClickConfig or null`22512252 `middle_click`'s config overrides.22532254 - `defer_loading: optional boolean or null`22552256 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22572258 - `enabled: optional boolean or null`22592260 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.22612262 - `mouse_move: optional ComputerMouseMoveConfig or null`22632264 `mouse_move`'s config overrides.22652266 - `defer_loading: optional boolean or null`22672268 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22692270 - `enabled: optional boolean or null`22712272 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.22732274 - `right_click: optional ComputerRightClickConfig or null`22752276 `right_click`'s config overrides.22772278 - `defer_loading: optional boolean or null`22792280 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22812282 - `enabled: optional boolean or null`22832284 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.22852286 - `screenshot: optional ComputerScreenshotConfig or null`22872288 `screenshot`'s config overrides.22892290 - `defer_loading: optional boolean or null`22912292 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22932294 - `enabled: optional boolean or null`22952296 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.22972298 - `scroll: optional ComputerScrollConfig or null`22992300 `scroll`'s config overrides.23012302 - `defer_loading: optional boolean or null`23032304 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23052306 - `enabled: optional boolean or null`23072308 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.23092310 - `triple_click: optional ComputerTripleClickConfig or null`23112312 `triple_click`'s config overrides.23132314 - `defer_loading: optional boolean or null`23152316 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23172318 - `enabled: optional boolean or null`23192320 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.23212322 - `wait: optional ComputerWaitConfig or null`23232324 `wait`'s config overrides.23252326 - `defer_loading: optional boolean or null`23272328 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23292330 - `enabled: optional boolean or null`23312332 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.23332334 - `zoom: optional ComputerZoomConfig or null`23352336 `zoom`'s config overrides.23372338 - `defer_loading: optional boolean or null`23392340 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23412342 - `enabled: optional boolean or null`23432344 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.23452346 - `ToolTextEditor20250124 object`23472348 - `type: "text_editor_20250124"`23492350 - `name: "str_replace_editor"`23512352 Name of the tool.23532354 This is how the tool will be called by the model and in `tool_use` blocks.23552356 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23572358 - `"direct"`23592360 - `"code_execution_20250825"`23612362 - `"code_execution_20260120"`23632364 - `"code_execution_20260521"`23652366 - `cache_control: optional CacheControlEphemeral or null`23672368 Create a cache control breakpoint at this content block.23692370 - `defer_loading: optional boolean`23712372 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.23732374 - `input_examples: optional array of map[unknown]`23752376 - `strict: optional boolean`23772378 When true, guarantees schema validation on tool names and inputs23792380 - `ToolTextEditor20250429 object`23812382 - `type: "text_editor_20250429"`23832384 - `name: "str_replace_based_edit_tool"`23852386 Name of the tool.23872388 This is how the tool will be called by the model and in `tool_use` blocks.23892390 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23912392 - `"direct"`23932394 - `"code_execution_20250825"`23952396 - `"code_execution_20260120"`23972398 - `"code_execution_20260521"`23992400 - `cache_control: optional CacheControlEphemeral or null`24012402 Create a cache control breakpoint at this content block.24032404 - `defer_loading: optional boolean`24052406 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.24072408 - `input_examples: optional array of map[unknown]`24092410 - `strict: optional boolean`24112412 When true, guarantees schema validation on tool names and inputs24132414 - `ToolTextEditor20250728 object`24152416 - `type: "text_editor_20250728"`24172418 - `name: "str_replace_based_edit_tool"`24192420 Name of the tool.24212422 This is how the tool will be called by the model and in `tool_use` blocks.24232424 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`24252426 - `"direct"`24272428 - `"code_execution_20250825"`24292430 - `"code_execution_20260120"`24312432 - `"code_execution_20260521"`24332434 - `cache_control: optional CacheControlEphemeral or null`24352436 Create a cache control breakpoint at this content block.24372438 - `defer_loading: optional boolean`24392440 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.24412442 - `input_examples: optional array of map[unknown]`24432444 - `max_characters: optional number or null`24452446 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.24472448 minimum: 124492450 - `strict: optional boolean`24512452 When true, guarantees schema validation on tool names and inputs24532454 - `WebSearchTool20250305 object`24552456 - `type: "web_search_20250305"`24572458 - `name: "web_search"`24592460 Name of the tool.24612462 This is how the tool will be called by the model and in `tool_use` blocks.24632464 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`24652466 - `"direct"`24672468 - `"code_execution_20250825"`24692470 - `"code_execution_20260120"`24712472 - `"code_execution_20260521"`24732474 - `allowed_domains: optional array of string or null`24752476 If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.24772478 - `blocked_domains: optional array of string or null`24792480 If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.24812482 - `cache_control: optional CacheControlEphemeral or null`24832484 Create a cache control breakpoint at this content block.24852486 - `defer_loading: optional boolean`24872488 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.24892490 - `max_uses: optional number or null`24912492 Maximum number of times the tool can be used in the API request.24932494 exclusiveMinimum: 024952496 - `strict: optional boolean`24972498 When true, guarantees schema validation on tool names and inputs24992500 - `user_location: optional UserLocation or null`25012502 Parameters for the user's location. Used to provide more relevant search results.25032504 - `type: "approximate"`25052506 - `city: optional string or null`25072508 The city of the user.25092510 maxLength: 255, minLength: 125112512 - `country: optional string or null`25132514 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.25152516 maxLength: 2, minLength: 225172518 - `region: optional string or null`25192520 The region of the user.25212522 maxLength: 255, minLength: 125232524 - `timezone: optional string or null`25252526 The [IANA timezone](https://nodatime.org/TimeZones) of the user.25272528 maxLength: 255, minLength: 125292530 - `WebFetchTool20250910 object`25312532 - `type: "web_fetch_20250910"`25332534 - `name: "web_fetch"`25352536 Name of the tool.25372538 This is how the tool will be called by the model and in `tool_use` blocks.25392540 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`25412542 - `"direct"`25432544 - `"code_execution_20250825"`25452546 - `"code_execution_20260120"`25472548 - `"code_execution_20260521"`25492550 - `allowed_domains: optional array of string or null`25512552 List of domains to allow fetching from25532554 - `blocked_domains: optional array of string or null`25552556 List of domains to block fetching from25572558 - `cache_control: optional CacheControlEphemeral or null`25592560 Create a cache control breakpoint at this content block.25612562 - `citations: optional CitationsConfigParam or null`25632564 Citations configuration for fetched documents. Citations are disabled by default.25652566 - `defer_loading: optional boolean`25672568 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.25692570 - `max_content_tokens: optional number or null`25712572 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.25732574 exclusiveMinimum: 025752576 - `max_uses: optional number or null`25772578 Maximum number of times the tool can be used in the API request.25792580 exclusiveMinimum: 025812582 - `strict: optional boolean`25832584 When true, guarantees schema validation on tool names and inputs25852586 - `url_sources: optional WebFetchURLSources or null`25872588 Which sources contribute to the set of URLs web fetch may fetch.25892590 Each key is a tagged variant: `user_input` is `all` or `none`; the2591 two tool filters are `all`, `none`, `only` (only the named tools'2592 results) or `except` (every result but the named tools'). A named tool2593 must be declared in this request's `tools[]`.25942595 - `client_tool_results: optional WebFetchURLSourceAll or WebFetchURLSourceNone or WebFetchURLSourceOnly or WebFetchURLSourceExcept`25962597 Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].25982599 - `WebFetchURLSourceAll object`26002601 The `url_sources` variant under which a source contributes in2602 full: every result of the tool filter's source, or all user input.26032604 - `type: "all"`26052606 - `WebFetchURLSourceNone object`26072608 The `url_sources` variant under which a source contributes nothing:2609 no result of the tool filter's source, or no user input.26102611 - `type: "none"`26122613 - `WebFetchURLSourceOnly object`26142615 The tool filter variant under which only the named tools' results2616 contribute.26172618 - `type: "only"`26192620 - `tools: array of WebFetchURLSourceToolReference`26212622 - `type: "tool_reference"`26232624 - `name: string`26252626 - `WebFetchURLSourceExcept object`26272628 The tool filter variant under which every result but the named2629 tools' contributes.26302631 - `type: "except"`26322633 - `tools: array of WebFetchURLSourceToolReference`26342635 - `type: "tool_reference"`26362637 - `name: string`26382639 - `server_tool_results: optional WebFetchURLSourceAll or WebFetchURLSourceNone or WebFetchURLSourceOnly or WebFetchURLSourceExcept`26402641 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.26422643 - `WebFetchURLSourceAll object`26442645 The `url_sources` variant under which a source contributes in2646 full: every result of the tool filter's source, or all user input.26472648 - `WebFetchURLSourceNone object`26492650 The `url_sources` variant under which a source contributes nothing:2651 no result of the tool filter's source, or no user input.26522653 - `WebFetchURLSourceOnly object`26542655 The tool filter variant under which only the named tools' results2656 contribute.26572658 - `WebFetchURLSourceExcept object`26592660 The tool filter variant under which every result but the named2661 tools' contributes.26622663 - `user_input: optional WebFetchURLSourceAll or WebFetchURLSourceNone`26642665 Whether URLs in user messages are fetchable: "all" or "none".26662667 - `WebFetchURLSourceAll object`26682669 The `url_sources` variant under which a source contributes in2670 full: every result of the tool filter's source, or all user input.26712672 - `WebFetchURLSourceNone object`26732674 The `url_sources` variant under which a source contributes nothing:2675 no result of the tool filter's source, or no user input.26762677 - `WebSearchTool20260209 object`26782679 - `type: "web_search_20260209"`26802681 - `name: "web_search"`26822683 Name of the tool.26842685 This is how the tool will be called by the model and in `tool_use` blocks.26862687 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`26882689 - `"direct"`26902691 - `"code_execution_20250825"`26922693 - `"code_execution_20260120"`26942695 - `"code_execution_20260521"`26962697 - `allowed_domains: optional array of string or null`26982699 If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.27002701 - `blocked_domains: optional array of string or null`27022703 If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.27042705 - `cache_control: optional CacheControlEphemeral or null`27062707 Create a cache control breakpoint at this content block.27082709 - `defer_loading: optional boolean`27102711 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.27122713 - `max_uses: optional number or null`27142715 Maximum number of times the tool can be used in the API request.27162717 exclusiveMinimum: 027182719 - `strict: optional boolean`27202721 When true, guarantees schema validation on tool names and inputs27222723 - `user_location: optional UserLocation or null`27242725 Parameters for the user's location. Used to provide more relevant search results.27262727 - `WebFetchTool20260209 object`27282729 - `type: "web_fetch_20260209"`27302731 - `name: "web_fetch"`27322733 Name of the tool.27342735 This is how the tool will be called by the model and in `tool_use` blocks.27362737 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`27382739 - `"direct"`27402741 - `"code_execution_20250825"`27422743 - `"code_execution_20260120"`27442745 - `"code_execution_20260521"`27462747 - `allowed_domains: optional array of string or null`27482749 List of domains to allow fetching from27502751 - `blocked_domains: optional array of string or null`27522753 List of domains to block fetching from27542755 - `cache_control: optional CacheControlEphemeral or null`27562757 Create a cache control breakpoint at this content block.27582759 - `citations: optional CitationsConfigParam or null`27602761 Citations configuration for fetched documents. Citations are disabled by default.27622763 - `defer_loading: optional boolean`27642765 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.27662767 - `max_content_tokens: optional number or null`27682769 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.27702771 exclusiveMinimum: 027722773 - `max_uses: optional number or null`27742775 Maximum number of times the tool can be used in the API request.27762777 exclusiveMinimum: 027782779 - `strict: optional boolean`27802781 When true, guarantees schema validation on tool names and inputs27822783 - `url_sources: optional WebFetchURLSources or null`27842785 Which sources contribute to the set of URLs web fetch may fetch.27862787 Each key is a tagged variant: `user_input` is `all` or `none`; the2788 two tool filters are `all`, `none`, `only` (only the named tools'2789 results) or `except` (every result but the named tools'). A named tool2790 must be declared in this request's `tools[]`.27912792 - `WebFetchTool20260309 object`27932794 Web fetch tool with use_cache parameter for bypassing cached content.27952796 - `type: "web_fetch_20260309"`27972798 - `name: "web_fetch"`27992800 Name of the tool.28012802 This is how the tool will be called by the model and in `tool_use` blocks.28032804 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`28052806 - `"direct"`28072808 - `"code_execution_20250825"`28092810 - `"code_execution_20260120"`28112812 - `"code_execution_20260521"`28132814 - `allowed_domains: optional array of string or null`28152816 List of domains to allow fetching from28172818 - `blocked_domains: optional array of string or null`28192820 List of domains to block fetching from28212822 - `cache_control: optional CacheControlEphemeral or null`28232824 Create a cache control breakpoint at this content block.28252826 - `citations: optional CitationsConfigParam or null`28272828 Citations configuration for fetched documents. Citations are disabled by default.28292830 - `defer_loading: optional boolean`28312832 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.28332834 - `max_content_tokens: optional number or null`28352836 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.28372838 exclusiveMinimum: 028392840 - `max_uses: optional number or null`28412842 Maximum number of times the tool can be used in the API request.28432844 exclusiveMinimum: 028452846 - `strict: optional boolean`28472848 When true, guarantees schema validation on tool names and inputs28492850 - `url_sources: optional WebFetchURLSources or null`28512852 Which sources contribute to the set of URLs web fetch may fetch.28532854 Each key is a tagged variant: `user_input` is `all` or `none`; the2855 two tool filters are `all`, `none`, `only` (only the named tools'2856 results) or `except` (every result but the named tools'). A named tool2857 must be declared in this request's `tools[]`.28582859 - `use_cache: optional boolean`28602861 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.28622863 - `WebSearchTool20260318 object`28642865 - `type: "web_search_20260318"`28662867 - `name: "web_search"`28682869 Name of the tool.28702871 This is how the tool will be called by the model and in `tool_use` blocks.28722873 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`28742875 - `"direct"`28762877 - `"code_execution_20250825"`28782879 - `"code_execution_20260120"`28802881 - `"code_execution_20260521"`28822883 - `allowed_domains: optional array of string or null`28842885 If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.28862887 - `blocked_domains: optional array of string or null`28882889 If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.28902891 - `cache_control: optional CacheControlEphemeral or null`28922893 Create a cache control breakpoint at this content block.28942895 - `defer_loading: optional boolean`28962897 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.28982899 - `max_uses: optional number or null`29002901 Maximum number of times the tool can be used in the API request.29022903 exclusiveMinimum: 029042905 - `response_inclusion: optional "full" or "excluded"`29062907 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.29082909 - `"full"`29102911 - `"excluded"`29122913 - `strict: optional boolean`29142915 When true, guarantees schema validation on tool names and inputs29162917 - `user_location: optional UserLocation or null`29182919 Parameters for the user's location. Used to provide more relevant search results.29202921 - `WebFetchTool20260318 object`29222923 - `type: "web_fetch_20260318"`29242925 - `name: "web_fetch"`29262927 Name of the tool.29282929 This is how the tool will be called by the model and in `tool_use` blocks.29302931 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`29322933 - `"direct"`29342935 - `"code_execution_20250825"`29362937 - `"code_execution_20260120"`29382939 - `"code_execution_20260521"`29402941 - `allowed_domains: optional array of string or null`29422943 List of domains to allow fetching from29442945 - `blocked_domains: optional array of string or null`29462947 List of domains to block fetching from29482949 - `cache_control: optional CacheControlEphemeral or null`29502951 Create a cache control breakpoint at this content block.29522953 - `citations: optional CitationsConfigParam or null`29542955 Citations configuration for fetched documents. Citations are disabled by default.29562957 - `defer_loading: optional boolean`29582959 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.29602961 - `max_content_tokens: optional number or null`29622963 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.29642965 exclusiveMinimum: 029662967 - `max_uses: optional number or null`29682969 Maximum number of times the tool can be used in the API request.29702971 exclusiveMinimum: 029722973 - `response_inclusion: optional "full" or "excluded"`29742975 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.29762977 - `"full"`29782979 - `"excluded"`29802981 - `strict: optional boolean`29822983 When true, guarantees schema validation on tool names and inputs29842985 - `url_sources: optional WebFetchURLSources or null`29862987 Which sources contribute to the set of URLs web fetch may fetch.29882989 Each key is a tagged variant: `user_input` is `all` or `none`; the2990 two tool filters are `all`, `none`, `only` (only the named tools'2991 results) or `except` (every result but the named tools'). A named tool2992 must be declared in this request's `tools[]`.29932994 - `use_cache: optional boolean`29952996 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.29972998 - `ToolSearchToolBm25_20251119 object`29993000 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`30013002 - `"tool_search_tool_bm25_20251119"`30033004 - `"tool_search_tool_bm25"`30053006 - `name: "tool_search_tool_bm25"`30073008 Name of the tool.30093010 This is how the tool will be called by the model and in `tool_use` blocks.30113012 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`30133014 - `"direct"`30153016 - `"code_execution_20250825"`30173018 - `"code_execution_20260120"`30193020 - `"code_execution_20260521"`30213022 - `cache_control: optional CacheControlEphemeral or null`30233024 Create a cache control breakpoint at this content block.30253026 - `defer_loading: optional boolean`30273028 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.30293030 - `strict: optional boolean`30313032 When true, guarantees schema validation on tool names and inputs30333034 - `ToolSearchToolRegex20251119 object`30353036 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`30373038 - `"tool_search_tool_regex_20251119"`30393040 - `"tool_search_tool_regex"`30413042 - `name: "tool_search_tool_regex"`30433044 Name of the tool.30453046 This is how the tool will be called by the model and in `tool_use` blocks.30473048 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`30493050 - `"direct"`30513052 - `"code_execution_20250825"`30533054 - `"code_execution_20260120"`30553056 - `"code_execution_20260521"`30573058 - `cache_control: optional CacheControlEphemeral or null`30593060 Create a cache control breakpoint at this content block.30613062 - `defer_loading: optional boolean`30633064 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.30653066 - `strict: optional boolean`30673068 When true, guarantees schema validation on tool names and inputs30693070 - `temperature: optional number`30713072 **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.30733074 Amount of randomness injected into the response.30753076 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.30773078 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.30793080 maximum: 1, minimum: 030813082 - `top_k: optional number`30833084 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.30853086 Only sample from the top K options for each subsequent token.30873088 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).30893090 Recommended for advanced use cases only.30913092 minimum: 030933094 - `top_p: optional number`30953096 **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.30973098 Use nucleus sampling.30993100 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`.31013102 Recommended for advanced use cases only.31033104 maximum: 1, minimum: 031053106### Returns31073108- `MessageBatch object`31093110 - `type: "message_batch"`31113112 Object type.31133114 For Message Batches, this is always `"message_batch"`.31153116 default: message_batch31173118 - `id: string`31193120 Unique object identifier.31213122 The format and length of IDs may change over time.31233124 - `archived_at: string or null`31253126 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.31273128 format: date-time31293130 - `cancel_initiated_at: string or null`31313132 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.31333134 format: date-time31353136 - `created_at: string`31373138 RFC 3339 datetime string representing the time at which the Message Batch was created.31393140 format: date-time31413142 - `ended_at: string or null`31433144 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.31453146 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.31473148 format: date-time31493150 - `expires_at: string`31513152 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.31533154 format: date-time31553156 - `processing_status: "in_progress" or "canceling" or "ended"`31573158 Processing status of the Message Batch.31593160 - `"in_progress"`31613162 - `"canceling"`31633164 - `"ended"`31653166 - `request_counts: MessageBatchRequestCounts`31673168 Tallies requests within the Message Batch, categorized by their status.31693170 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.31713172 - `canceled: number`31733174 Number of requests in the Message Batch that have been canceled.31753176 This is zero until processing of the entire Message Batch has ended.31773178 default: 031793180 - `errored: number`31813182 Number of requests in the Message Batch that encountered an error.31833184 This is zero until processing of the entire Message Batch has ended.31853186 default: 031873188 - `expired: number`31893190 Number of requests in the Message Batch that have expired.31913192 This is zero until processing of the entire Message Batch has ended.31933194 default: 031953196 - `processing: number`31973198 Number of requests in the Message Batch that are processing.31993200 default: 032013202 - `succeeded: number`32033204 Number of requests in the Message Batch that have completed successfully.32053206 This is zero until processing of the entire Message Batch has ended.32073208 default: 032093210 - `results_url: string or null`32113212 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.32133214 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.32153216### Example32173218```bash3219curl https://api.anthropic.com/v1/messages/batches \3220 -H 'Content-Type: application/json' \3221 -H 'anthropic-version: 2023-06-01' \3222 -H "X-Api-Key: $ANTHROPIC_API_KEY" \3223 -d '{3224 "requests": [3225 {3226 "custom_id": "my-custom-id-1",3227 "params": {3228 "max_tokens": 1024,3229 "messages": [3230 {3231 "content": "Hello, world",3232 "role": "user"3233 }3234 ],3235 "model": "claude-opus-5"3236 }3237 }3238 ]3239 }'3240```32413242#### Response (200)32433244```json3245{3246 "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",3247 "archived_at": "2024-08-20T18:37:24.100435Z",3248 "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",3249 "created_at": "2024-08-20T18:37:24.100435Z",3250 "ended_at": "2024-08-20T18:37:24.100435Z",3251 "expires_at": "2024-08-20T18:37:24.100435Z",3252 "processing_status": "in_progress",3253 "request_counts": {3254 "canceled": 10,3255 "errored": 30,3256 "expired": 10,3257 "processing": 100,3258 "succeeded": 503259 },3260 "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",3261 "type": "message_batch"3262}3263```32643265## Retrieve a Message Batch32663267**GET** `/v1/messages/batches/{message_batch_id}`32683269This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.32703271Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)32723273### Path parameters32743275- `message_batch_id: string`32763277 ID of the Message Batch.32783279### Headers32803281- `"anthropic-workspace-id": optional string`32823283### Returns32843285- `MessageBatch object`32863287 - `type: "message_batch"`32883289 Object type.32903291 For Message Batches, this is always `"message_batch"`.32923293 default: message_batch32943295 - `id: string`32963297 Unique object identifier.32983299 The format and length of IDs may change over time.33003301 - `archived_at: string or null`33023303 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.33043305 format: date-time33063307 - `cancel_initiated_at: string or null`33083309 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.33103311 format: date-time33123313 - `created_at: string`33143315 RFC 3339 datetime string representing the time at which the Message Batch was created.33163317 format: date-time33183319 - `ended_at: string or null`33203321 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.33223323 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.33243325 format: date-time33263327 - `expires_at: string`33283329 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.33303331 format: date-time33323333 - `processing_status: "in_progress" or "canceling" or "ended"`33343335 Processing status of the Message Batch.33363337 - `"in_progress"`33383339 - `"canceling"`33403341 - `"ended"`33423343 - `request_counts: MessageBatchRequestCounts`33443345 Tallies requests within the Message Batch, categorized by their status.33463347 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.33483349 - `canceled: number`33503351 Number of requests in the Message Batch that have been canceled.33523353 This is zero until processing of the entire Message Batch has ended.33543355 default: 033563357 - `errored: number`33583359 Number of requests in the Message Batch that encountered an error.33603361 This is zero until processing of the entire Message Batch has ended.33623363 default: 033643365 - `expired: number`33663367 Number of requests in the Message Batch that have expired.33683369 This is zero until processing of the entire Message Batch has ended.33703371 default: 033723373 - `processing: number`33743375 Number of requests in the Message Batch that are processing.33763377 default: 033783379 - `succeeded: number`33803381 Number of requests in the Message Batch that have completed successfully.33823383 This is zero until processing of the entire Message Batch has ended.33843385 default: 033863387 - `results_url: string or null`33883389 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.33903391 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.33923393### Example33943395```bash3396curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \3397 -H 'anthropic-version: 2023-06-01' \3398 -H "X-Api-Key: $ANTHROPIC_API_KEY"3399```34003401#### Response (200)34023403```json3404{3405 "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",3406 "archived_at": "2024-08-20T18:37:24.100435Z",3407 "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",3408 "created_at": "2024-08-20T18:37:24.100435Z",3409 "ended_at": "2024-08-20T18:37:24.100435Z",3410 "expires_at": "2024-08-20T18:37:24.100435Z",3411 "processing_status": "in_progress",3412 "request_counts": {3413 "canceled": 10,3414 "errored": 30,3415 "expired": 10,3416 "processing": 100,3417 "succeeded": 503418 },3419 "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",3420 "type": "message_batch"3421}3422```34233424## List Message Batches34253426**GET** `/v1/messages/batches`34273428List all Message Batches within a Workspace. Most recently created batches are returned first.34293430Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)34313432### Query parameters34333434- `after_id: optional string`34353436 ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.34373438- `before_id: optional string`34393440 ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.34413442- `limit: optional number`34433444 Number of items to return per page.34453446 Defaults to `20`. Ranges from `1` to `1000`.34473448 default: 20, maximum: 1000, minimum: 134493450### Headers34513452- `"anthropic-workspace-id": optional string`34533454### Returns34553456- `data: array of MessageBatch`34573458 - `type: "message_batch"`34593460 Object type.34613462 For Message Batches, this is always `"message_batch"`.34633464 default: message_batch34653466 - `id: string`34673468 Unique object identifier.34693470 The format and length of IDs may change over time.34713472 - `archived_at: string or null`34733474 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.34753476 format: date-time34773478 - `cancel_initiated_at: string or null`34793480 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.34813482 format: date-time34833484 - `created_at: string`34853486 RFC 3339 datetime string representing the time at which the Message Batch was created.34873488 format: date-time34893490 - `ended_at: string or null`34913492 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.34933494 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.34953496 format: date-time34973498 - `expires_at: string`34993500 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.35013502 format: date-time35033504 - `processing_status: "in_progress" or "canceling" or "ended"`35053506 Processing status of the Message Batch.35073508 - `"in_progress"`35093510 - `"canceling"`35113512 - `"ended"`35133514 - `request_counts: MessageBatchRequestCounts`35153516 Tallies requests within the Message Batch, categorized by their status.35173518 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.35193520 - `canceled: number`35213522 Number of requests in the Message Batch that have been canceled.35233524 This is zero until processing of the entire Message Batch has ended.35253526 default: 035273528 - `errored: number`35293530 Number of requests in the Message Batch that encountered an error.35313532 This is zero until processing of the entire Message Batch has ended.35333534 default: 035353536 - `expired: number`35373538 Number of requests in the Message Batch that have expired.35393540 This is zero until processing of the entire Message Batch has ended.35413542 default: 035433544 - `processing: number`35453546 Number of requests in the Message Batch that are processing.35473548 default: 035493550 - `succeeded: number`35513552 Number of requests in the Message Batch that have completed successfully.35533554 This is zero until processing of the entire Message Batch has ended.35553556 default: 035573558 - `results_url: string or null`35593560 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.35613562 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.35633564- `first_id: string or null`35653566 First ID in the `data` list. Can be used as the `before_id` for the previous page.35673568- `has_more: boolean`35693570 Indicates if there are more results in the requested page direction.35713572- `last_id: string or null`35733574 Last ID in the `data` list. Can be used as the `after_id` for the next page.35753576### Example35773578```bash3579curl https://api.anthropic.com/v1/messages/batches \3580 -H 'anthropic-version: 2023-06-01' \3581 -H "X-Api-Key: $ANTHROPIC_API_KEY"3582```35833584#### Response (200)35853586```json3587{3588 "data": [3589 {3590 "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",3591 "archived_at": "2024-08-20T18:37:24.100435Z",3592 "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",3593 "created_at": "2024-08-20T18:37:24.100435Z",3594 "ended_at": "2024-08-20T18:37:24.100435Z",3595 "expires_at": "2024-08-20T18:37:24.100435Z",3596 "processing_status": "in_progress",3597 "request_counts": {3598 "canceled": 10,3599 "errored": 30,3600 "expired": 10,3601 "processing": 100,3602 "succeeded": 503603 },3604 "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",3605 "type": "message_batch"3606 }3607 ],3608 "first_id": "first_id",3609 "has_more": true,3610 "last_id": "last_id"3611}3612```36133614## Cancel a Message Batch36153616**POST** `/v1/messages/batches/{message_batch_id}/cancel`36173618Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.36193620The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.36213622Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)36233624### Path parameters36253626- `message_batch_id: string`36273628 ID of the Message Batch.36293630### Headers36313632- `"anthropic-workspace-id": optional string`36333634### Returns36353636- `MessageBatch object`36373638 - `type: "message_batch"`36393640 Object type.36413642 For Message Batches, this is always `"message_batch"`.36433644 default: message_batch36453646 - `id: string`36473648 Unique object identifier.36493650 The format and length of IDs may change over time.36513652 - `archived_at: string or null`36533654 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.36553656 format: date-time36573658 - `cancel_initiated_at: string or null`36593660 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.36613662 format: date-time36633664 - `created_at: string`36653666 RFC 3339 datetime string representing the time at which the Message Batch was created.36673668 format: date-time36693670 - `ended_at: string or null`36713672 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.36733674 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.36753676 format: date-time36773678 - `expires_at: string`36793680 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.36813682 format: date-time36833684 - `processing_status: "in_progress" or "canceling" or "ended"`36853686 Processing status of the Message Batch.36873688 - `"in_progress"`36893690 - `"canceling"`36913692 - `"ended"`36933694 - `request_counts: MessageBatchRequestCounts`36953696 Tallies requests within the Message Batch, categorized by their status.36973698 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.36993700 - `canceled: number`37013702 Number of requests in the Message Batch that have been canceled.37033704 This is zero until processing of the entire Message Batch has ended.37053706 default: 037073708 - `errored: number`37093710 Number of requests in the Message Batch that encountered an error.37113712 This is zero until processing of the entire Message Batch has ended.37133714 default: 037153716 - `expired: number`37173718 Number of requests in the Message Batch that have expired.37193720 This is zero until processing of the entire Message Batch has ended.37213722 default: 037233724 - `processing: number`37253726 Number of requests in the Message Batch that are processing.37273728 default: 037293730 - `succeeded: number`37313732 Number of requests in the Message Batch that have completed successfully.37333734 This is zero until processing of the entire Message Batch has ended.37353736 default: 037373738 - `results_url: string or null`37393740 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.37413742 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.37433744### Example37453746```bash3747curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \3748 -X POST \3749 -H 'anthropic-version: 2023-06-01' \3750 -H "X-Api-Key: $ANTHROPIC_API_KEY"3751```37523753#### Response (200)37543755```json3756{3757 "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",3758 "archived_at": "2024-08-20T18:37:24.100435Z",3759 "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",3760 "created_at": "2024-08-20T18:37:24.100435Z",3761 "ended_at": "2024-08-20T18:37:24.100435Z",3762 "expires_at": "2024-08-20T18:37:24.100435Z",3763 "processing_status": "in_progress",3764 "request_counts": {3765 "canceled": 10,3766 "errored": 30,3767 "expired": 10,3768 "processing": 100,3769 "succeeded": 503770 },3771 "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",3772 "type": "message_batch"3773}3774```37753776## Delete a Message Batch37773778**DELETE** `/v1/messages/batches/{message_batch_id}`37793780Delete a Message Batch.37813782Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.37833784Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)37853786### Path parameters37873788- `message_batch_id: string`37893790 ID of the Message Batch.37913792### Headers37933794- `"anthropic-workspace-id": optional string`37953796### Returns37973798- `DeletedMessageBatch object`37993800 - `type: "message_batch_deleted"`38013802 Deleted object type.38033804 For Message Batches, this is always `"message_batch_deleted"`.38053806 default: message_batch_deleted38073808 - `id: string`38093810 ID of the Message Batch.38113812### Example38133814```bash3815curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \3816 -X DELETE \3817 -H 'anthropic-version: 2023-06-01' \3818 -H "X-Api-Key: $ANTHROPIC_API_KEY"3819```38203821#### Response (200)38223823```json3824{3825 "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",3826 "type": "message_batch_deleted"3827}3828```38293830## Retrieve Message Batch results38313832**GET** `/v1/messages/batches/{message_batch_id}/results`38333834Streams the results of a Message Batch as a `.jsonl` file.38353836Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.38373838Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)38393840### Path parameters38413842- `message_batch_id: string`38433844 ID of the Message Batch.38453846### Headers38473848- `"anthropic-workspace-id": optional string`38493850### Returns38513852- `MessageBatchIndividualResponse object`38533854 This is a single line in the response `.jsonl` file and does not represent the response as a whole.38553856 - `custom_id: string`38573858 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.38593860 Must be unique for each request within the Message Batch.38613862 - `result: MessageBatchResult`38633864 Processing result for this request.38653866 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.38673868 - `MessageBatchSucceededResult object`38693870 - `type: "succeeded"`38713872 default: succeeded38733874 - `message: Message`38753876 - `type: "message"`38773878 Object type.38793880 For Messages, this is always `"message"`.38813882 default: message38833884 - `id: string`38853886 Unique object identifier.38873888 The format and length of IDs may change over time.38893890 - `container: Container or null`38913892 Information about the container used in the request (for the code execution tool)38933894 - `id: string`38953896 Identifier for the container used in this request38973898 - `expires_at: string`38993900 The time at which the container will expire.39013902 format: date-time39033904 - `skills: array of ContainerSkill or null`39053906 Skills loaded in the container39073908 - `type: "anthropic" or "custom"`39093910 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)39113912 - `"anthropic"`39133914 - `"custom"`39153916 - `skill_id: string`39173918 Skill ID39193920 maxLength: 64, minLength: 139213922 - `version: string`39233924 The resolved version: a skill version ID for custom skills.39253926 maxLength: 64, minLength: 139273928 - `content: array of ContentBlock`39293930 Content generated by the model.39313932 This is an array of content blocks, each of which has a `type` that determines its shape.39333934 Example:39353936 ```json3937 [{"type": "text", "text": "Hi, I'm Claude."}]3938 ```39393940 If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.39413942 For example, if the input `messages` were:39433944 ```json3945 [3946 {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},3947 {"role": "assistant", "content": "The best answer is ("}3948 ]3949 ```39503951 Then the response `content` might be:39523953 ```json3954 [{"type": "text", "text": "B)"}]3955 ```39563957 - `TextBlock object`39583959 - `type: "text"`39603961 default: text39623963 - `citations: array of TextCitation or null`39643965 Citations supporting the text block.39663967 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.39683969 - `CitationCharLocation object`39703971 - `type: "char_location"`39723973 default: char_location39743975 - `cited_text: string`39763977 - `document_index: number`39783979 minimum: 039803981 - `document_title: string or null`39823983 - `end_char_index: number`39843985 - `file_id: string or null`39863987 - `start_char_index: number`39883989 minimum: 039903991 - `CitationPageLocation object`39923993 - `type: "page_location"`39943995 default: page_location39963997 - `cited_text: string`39983999 - `document_index: number`40004001 minimum: 040024003 - `document_title: string or null`40044005 - `end_page_number: number`40064007 - `file_id: string or null`40084009 - `start_page_number: number`40104011 minimum: 140124013 - `CitationContentBlockLocation object`40144015 - `type: "content_block_location"`40164017 default: content_block_location40184019 - `cited_text: string`40204021 The full text of the cited block range, concatenated.40224023 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.40244025 - `document_index: number`40264027 minimum: 040284029 - `document_title: string or null`40304031 - `end_block_index: number`40324033 Exclusive 0-based end index of the cited block range in the source's `content` array.40344035 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.40364037 - `file_id: string or null`40384039 - `start_block_index: number`40404041 0-based index of the first cited block in the source's `content` array.40424043 minimum: 040444045 - `CitationsWebSearchResultLocation object`40464047 - `type: "web_search_result_location"`40484049 default: web_search_result_location40504051 - `cited_text: string`40524053 - `encrypted_index: string`40544055 - `title: string or null`40564057 maxLength: 51240584059 - `url: string`40604061 - `CitationsSearchResultLocation object`40624063 - `type: "search_result_location"`40644065 default: search_result_location40664067 - `cited_text: string`40684069 The full text of the cited block range, concatenated.40704071 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.40724073 - `end_block_index: number`40744075 Exclusive 0-based end index of the cited block range in the source's `content` array.40764077 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.40784079 - `search_result_index: number`40804081 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.40824083 Counted separately from `document_index`; server-side web search results are not included in this count.40844085 minimum: 040864087 - `source: string`40884089 - `start_block_index: number`40904091 0-based index of the first cited block in the source's `content` array.40924093 minimum: 040944095 - `title: string or null`40964097 - `text: string`40984099 minLength: 041004101 - `ThinkingBlock object`41024103 - `type: "thinking"`41044105 default: thinking41064107 - `signature: string`41084109 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.41104111 This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.41124113 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.41144115 - `thinking: string`41164117 The text of Claude's thinking process for this block.41184119 - `RedactedThinkingBlock object`41204121 - `type: "redacted_thinking"`41224123 default: redacted_thinking41244125 - `data: string`41264127 The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.41284129 Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.41304131 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.41324133 - `ToolUseBlock object`41344135 - `type: "tool_use"`41364137 default: tool_use41384139 - `id: string`41404141 pattern: ^[a-zA-Z0-9_-]+$41424143 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`41444145 default: {"type":"direct"}41464147 - `DirectCaller object`41484149 Tool invocation directly from the model.41504151 - `type: "direct"`41524153 - `ServerToolCaller object`41544155 Tool invocation generated by a server-side tool.41564157 - `type: "code_execution_20250825"`41584159 - `tool_id: string`41604161 pattern: ^srvtoolu_[a-zA-Z0-9_]+$41624163 - `ServerToolCaller20260120 object`41644165 - `type: "code_execution_20260120"`41664167 - `tool_id: string`41684169 pattern: ^srvtoolu_[a-zA-Z0-9_]+$41704171 - `input: map[unknown]`41724173 - `name: string`41744175 minLength: 141764177 - `toolset_name: optional string or null`41784179 For a toolset member tool_use, the toolset family.41804181 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$41824183 - `ServerToolUseBlock object`41844185 - `type: "server_tool_use"`41864187 default: server_tool_use41884189 - `id: string`41904191 pattern: ^srvtoolu_[a-zA-Z0-9_]+$41924193 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`41944195 default: {"type":"direct"}41964197 - `DirectCaller object`41984199 Tool invocation directly from the model.42004201 - `ServerToolCaller object`42024203 Tool invocation generated by a server-side tool.42044205 - `ServerToolCaller20260120 object`42064207 - `input: map[unknown]`42084209 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`42104211 - `"web_search"`42124213 - `"web_fetch"`42144215 - `"code_execution"`42164217 - `"bash_code_execution"`42184219 - `"text_editor_code_execution"`42204221 - `"tool_search_tool_regex"`42224223 - `"tool_search_tool_bm25"`42244225 - `WebSearchToolResultBlock object`42264227 - `type: "web_search_tool_result"`42284229 default: web_search_tool_result42304231 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`42324233 default: {"type":"direct"}42344235 - `DirectCaller object`42364237 Tool invocation directly from the model.42384239 - `ServerToolCaller object`42404241 Tool invocation generated by a server-side tool.42424243 - `ServerToolCaller20260120 object`42444245 - `content: WebSearchToolResultBlockContent`42464247 - `WebSearchToolResultError object`42484249 - `type: "web_search_tool_result_error"`42504251 default: web_search_tool_result_error42524253 - `error_code: WebSearchToolResultErrorCode`42544255 - `"invalid_tool_input"`42564257 - `"unavailable"`42584259 - `"max_uses_exceeded"`42604261 - `"too_many_requests"`42624263 - `"query_too_long"`42644265 - `"request_too_large"`42664267 - `array of WebSearchResultBlock`42684269 - `type: "web_search_result"`42704271 default: web_search_result42724273 - `encrypted_content: string`42744275 - `page_age: string or null`42764277 - `title: string`42784279 - `url: string`42804281 - `tool_use_id: string`42824283 pattern: ^srvtoolu_[a-zA-Z0-9_]+$42844285 - `WebFetchToolResultBlock object`42864287 - `type: "web_fetch_tool_result"`42884289 default: web_fetch_tool_result42904291 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`42924293 default: {"type":"direct"}42944295 - `DirectCaller object`42964297 Tool invocation directly from the model.42984299 - `ServerToolCaller object`43004301 Tool invocation generated by a server-side tool.43024303 - `ServerToolCaller20260120 object`43044305 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`43064307 - `WebFetchToolResultErrorBlock object`43084309 - `type: "web_fetch_tool_result_error"`43104311 default: web_fetch_tool_result_error43124313 - `error_code: WebFetchToolResultErrorCode`43144315 - `"invalid_tool_input"`43164317 - `"url_too_long"`43184319 - `"url_not_allowed"`43204321 - `"url_not_in_prior_context"`43224323 - `"url_not_accessible"`43244325 - `"unsupported_content_type"`43264327 - `"too_many_requests"`43284329 - `"max_uses_exceeded"`43304331 - `"unavailable"`43324333 - `"content_too_large"`43344335 - `WebFetchBlock object`43364337 - `type: "web_fetch_result"`43384339 default: web_fetch_result43404341 - `content: DocumentBlock`43424343 - `type: "document"`43444345 default: document43464347 - `citations: CitationsConfig or null`43484349 Citation configuration for the document43504351 - `enabled: boolean`43524353 default: false43544355 - `source: Base64PDFSource or PlainTextSource`43564357 - `Base64PDFSource object`43584359 - `type: "base64"`43604361 - `data: string`43624363 format: byte43644365 - `media_type: "application/pdf"`43664367 - `PlainTextSource object`43684369 - `type: "text"`43704371 - `data: string`43724373 - `media_type: "text/plain"`43744375 - `title: string or null`43764377 The title of the document43784379 - `retrieved_at: string or null`43804381 ISO 8601 timestamp when the content was retrieved43824383 - `url: string`43844385 Fetched content URL43864387 - `tool_use_id: string`43884389 pattern: ^srvtoolu_[a-zA-Z0-9_]+$43904391 - `CodeExecutionToolResultBlock object`43924393 - `type: "code_execution_tool_result"`43944395 default: code_execution_tool_result43964397 - `content: CodeExecutionToolResultBlockContent`43984399 - `CodeExecutionToolResultError object`44004401 - `type: "code_execution_tool_result_error"`44024403 default: code_execution_tool_result_error44044405 - `error_code: CodeExecutionToolResultErrorCode`44064407 - `"invalid_tool_input"`44084409 - `"unavailable"`44104411 - `"too_many_requests"`44124413 - `"execution_time_exceeded"`44144415 - `CodeExecutionResultBlock object`44164417 - `type: "code_execution_result"`44184419 default: code_execution_result44204421 - `content: array of CodeExecutionOutputBlock`44224423 - `type: "code_execution_output"`44244425 default: code_execution_output44264427 - `file_id: string`44284429 - `return_code: number`44304431 - `stderr: string`44324433 - `stdout: string`44344435 - `EncryptedCodeExecutionResultBlock object`44364437 Code execution result with encrypted stdout for PFC + web_search results.44384439 - `type: "encrypted_code_execution_result"`44404441 default: encrypted_code_execution_result44424443 - `content: array of CodeExecutionOutputBlock`44444445 - `type: "code_execution_output"`44464447 default: code_execution_output44484449 - `file_id: string`44504451 - `encrypted_stdout: string`44524453 - `return_code: number`44544455 - `stderr: string`44564457 - `tool_use_id: string`44584459 pattern: ^srvtoolu_[a-zA-Z0-9_]+$44604461 - `BashCodeExecutionToolResultBlock object`44624463 - `type: "bash_code_execution_tool_result"`44644465 default: bash_code_execution_tool_result44664467 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`44684469 - `BashCodeExecutionToolResultError object`44704471 - `type: "bash_code_execution_tool_result_error"`44724473 default: bash_code_execution_tool_result_error44744475 - `error_code: BashCodeExecutionToolResultErrorCode`44764477 - `"invalid_tool_input"`44784479 - `"unavailable"`44804481 - `"too_many_requests"`44824483 - `"execution_time_exceeded"`44844485 - `"output_file_too_large"`44864487 - `BashCodeExecutionResultBlock object`44884489 - `type: "bash_code_execution_result"`44904491 default: bash_code_execution_result44924493 - `content: array of BashCodeExecutionOutputBlock`44944495 - `type: "bash_code_execution_output"`44964497 default: bash_code_execution_output44984499 - `file_id: string`45004501 - `return_code: number`45024503 - `stderr: string`45044505 - `stdout: string`45064507 - `tool_use_id: string`45084509 pattern: ^srvtoolu_[a-zA-Z0-9_]+$45104511 - `TextEditorCodeExecutionToolResultBlock object`45124513 - `type: "text_editor_code_execution_tool_result"`45144515 default: text_editor_code_execution_tool_result45164517 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`45184519 - `TextEditorCodeExecutionToolResultError object`45204521 - `type: "text_editor_code_execution_tool_result_error"`45224523 default: text_editor_code_execution_tool_result_error45244525 - `error_code: TextEditorCodeExecutionToolResultErrorCode`45264527 - `"invalid_tool_input"`45284529 - `"unavailable"`45304531 - `"too_many_requests"`45324533 - `"execution_time_exceeded"`45344535 - `"file_not_found"`45364537 - `error_message: string or null`45384539 - `TextEditorCodeExecutionViewResultBlock object`45404541 - `type: "text_editor_code_execution_view_result"`45424543 default: text_editor_code_execution_view_result45444545 - `content: string`45464547 - `file_type: "text" or "image" or "pdf"`45484549 - `"text"`45504551 - `"image"`45524553 - `"pdf"`45544555 - `num_lines: number or null`45564557 - `start_line: number or null`45584559 - `total_lines: number or null`45604561 - `TextEditorCodeExecutionCreateResultBlock object`45624563 - `type: "text_editor_code_execution_create_result"`45644565 default: text_editor_code_execution_create_result45664567 - `is_file_update: boolean`45684569 - `TextEditorCodeExecutionStrReplaceResultBlock object`45704571 - `type: "text_editor_code_execution_str_replace_result"`45724573 default: text_editor_code_execution_str_replace_result45744575 - `lines: array of string or null`45764577 - `new_lines: number or null`45784579 - `new_start: number or null`45804581 - `old_lines: number or null`45824583 - `old_start: number or null`45844585 - `tool_use_id: string`45864587 pattern: ^srvtoolu_[a-zA-Z0-9_]+$45884589 - `ToolSearchToolResultBlock object`45904591 - `type: "tool_search_tool_result"`45924593 default: tool_search_tool_result45944595 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`45964597 - `ToolSearchToolResultError object`45984599 - `type: "tool_search_tool_result_error"`46004601 default: tool_search_tool_result_error46024603 - `error_code: ToolSearchToolResultErrorCode`46044605 - `"invalid_tool_input"`46064607 - `"unavailable"`46084609 - `"too_many_requests"`46104611 - `"execution_time_exceeded"`46124613 - `error_message: string or null`46144615 - `ToolSearchToolSearchResultBlock object`46164617 - `type: "tool_search_tool_search_result"`46184619 default: tool_search_tool_search_result46204621 - `tool_references: array of ToolReferenceBlock`46224623 - `type: "tool_reference"`46244625 default: tool_reference46264627 - `tool_name: string`46284629 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$46304631 - `tool_use_id: string`46324633 pattern: ^srvtoolu_[a-zA-Z0-9_]+$46344635 - `ContainerUploadBlock object`46364637 Response model for a file uploaded to the container.46384639 - `type: "container_upload"`46404641 default: container_upload46424643 - `file_id: string`46444645 - `model: Model`46464647 The model that will complete your prompt.46484649 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.46504651 - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`46524653 The model that will complete your prompt.46544655 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.46564657 - `"claude-fable-5-1"`46584659 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows46604661 - `"claude-mythos-5-1"`46624663 Our most capable model for cybersecurity and biology research, available through trusted access programs46644665 - `"claude-sonnet-5"`46664667 High-performance model for coding and agents46684669 - `"claude-fable-5"`46704671 Next generation of intelligence for the hardest knowledge work and coding problems46724673 - `"claude-mythos-5"`46744675 Most capable model for cybersecurity and biology research46764677 - `"claude-opus-5"`46784679 Powerful intelligence for long-running agents and coding46804681 - `"claude-opus-4-8"`46824683 Powerful intelligence for long-running agents and coding46844685 - `"claude-opus-4-7"`46864687 Powerful intelligence for long-running agents and coding46884689 - `"claude-mythos-preview"`46904691 New class of intelligence, strongest in coding and cybersecurity46924693 - `"claude-opus-4-6"`46944695 Powerful intelligence for long-running agents and coding46964697 - `"claude-sonnet-4-6"`46984699 Best combination of speed and intelligence47004701 - `"claude-haiku-4-5"`47024703 Fastest model with near-frontier intelligence47044705 - `"claude-haiku-4-5-20251001"`47064707 Fastest model with near-frontier intelligence47084709 - `"claude-opus-4-5"`47104711 Powerful intelligence for long-running agents and coding47124713 - `"claude-opus-4-5-20251101"`47144715 Powerful intelligence for long-running agents and coding47164717 - `"claude-sonnet-4-5"`47184719 High-performance model for agents and coding47204721 - `"claude-sonnet-4-5-20250929"`47224723 High-performance model for agents and coding47244725 - `string`47264727 - `role: "assistant"`47284729 Conversational role of the generated message.47304731 This will always be `"assistant"`.47324733 default: assistant47344735 - `stop_details: RefusalStopDetails or null`47364737 Structured information about a refusal.47384739 - `type: "refusal"`47404741 default: refusal47424743 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`47444745 The policy category that triggered a refusal.47464747 - `"cyber"`47484749 The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.47504751 - `"bio"`47524753 The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.47544755 - `"frontier_llm"`47564757 The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.47584759 - `"reasoning_extraction"`47604761 The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).47624763 - `"general_harms"`47644765 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.47664767 - `explanation: string or null`47684769 Human-readable explanation of the refusal.47704771 This text is not guaranteed to be stable. `null` when no explanation is available for the category.47724773 - `stop_reason: StopReason or null`47744775 The reason that we stopped.47764777 This may be one the following values:47784779 * `"end_turn"`: the model reached a natural stopping point4780 * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum4781 * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated4782 * `"tool_use"`: the model invoked one or more tools4783 * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.4784 * `"refusal"`: when streaming classifiers intervene to handle potential policy violations4785 * `"model_context_window_exceeded"`: we exceeded the model's context window47864787 In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.47884789 - `"end_turn"`47904791 - `"max_tokens"`47924793 - `"stop_sequence"`47944795 - `"tool_use"`47964797 - `"pause_turn"`47984799 - `"refusal"`48004801 - `"model_context_window_exceeded"`48024803 - `stop_sequence: string or null`48044805 Which custom stop sequence was generated, if any.48064807 This value will be a non-null string if one of your custom stop sequences was generated.48084809 - `usage: Usage`48104811 Billing and rate-limit usage.48124813 Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.48144815 Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.48164817 For example, `output_tokens` will be non-zero, even for an empty string response from Claude.48184819 Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.48204821 - `cache_creation: CacheCreation or null`48224823 Breakdown of cached tokens by TTL48244825 - `ephemeral_1h_input_tokens: number`48264827 The number of input tokens used to create the 1 hour cache entry.48284829 default: 0, minimum: 048304831 - `ephemeral_5m_input_tokens: number`48324833 The number of input tokens used to create the 5 minute cache entry.48344835 default: 0, minimum: 048364837 - `cache_creation_input_tokens: number or null`48384839 The number of input tokens used to create the cache entry.48404841 minimum: 048424843 - `cache_read_input_tokens: number or null`48444845 The number of input tokens read from the cache.48464847 minimum: 048484849 - `inference_geo: string or null`48504851 The geographic region where inference was performed for this request.48524853 - `input_tokens: number`48544855 The number of input tokens which were used.48564857 minimum: 048584859 - `output_tokens: number`48604861 The number of output tokens which were used.48624863 minimum: 048644865 - `output_tokens_details: OutputTokensDetails or null`48664867 Breakdown of output tokens by category.48684869 `output_tokens` remains the inclusive, authoritative total used for billing.4870 This object provides a read-only decomposition for observability — for example,4871 how many of the billed output tokens were spent on internal reasoning that may4872 have been summarized before being returned to you.48734874 - `thinking_tokens: number`48754876 Number of output tokens the model generated as internal reasoning, including4877 the thinking-block delimiter tokens.48784879 Reflects the raw reasoning the model produced, not the (possibly shorter)4880 summarized thinking text returned in the response body. Computed by4881 re-tokenizing the raw reasoning text, so it may differ from the model's exact4882 generation count by a small number of tokens. Always ≤ `output_tokens`;4883 `output_tokens - thinking_tokens` approximates the non-reasoning output.48844885 default: 0, minimum: 048864887 - `server_tool_use: ServerToolUsage or null`48884889 The number of server tool requests.48904891 - `web_fetch_requests: number`48924893 The number of web fetch tool requests.48944895 default: 0, minimum: 048964897 - `web_search_requests: number`48984899 The number of web search tool requests.49004901 default: 0, minimum: 049024903 - `service_tier: "standard" or "priority" or "batch" or null`49044905 If the request used the priority, standard, or batch tier.49064907 - `"standard"`49084909 - `"priority"`49104911 - `"batch"`49124913 - `MessageBatchErroredResult object`49144915 - `type: "errored"`49164917 default: errored49184919 - `error: ErrorResponse`49204921 - `type: "error"`49224923 default: error49244925 - `error: ErrorObject`49264927 - `InvalidRequestError object`49284929 - `type: "invalid_request_error"`49304931 default: invalid_request_error49324933 - `message: string`49344935 default: Invalid request49364937 - `AuthenticationError object`49384939 - `type: "authentication_error"`49404941 default: authentication_error49424943 - `message: string`49444945 default: Authentication error49464947 - `BillingError object`49484949 - `type: "billing_error"`49504951 default: billing_error49524953 - `message: string`49544955 default: Billing error49564957 - `PermissionError object`49584959 - `type: "permission_error"`49604961 default: permission_error49624963 - `message: string`49644965 default: Permission denied49664967 - `NotFoundError object`49684969 - `type: "not_found_error"`49704971 default: not_found_error49724973 - `message: string`49744975 default: Not found49764977 - `RateLimitError object`49784979 - `type: "rate_limit_error"`49804981 default: rate_limit_error49824983 - `message: string`49844985 default: Rate limited49864987 - `GatewayTimeoutError object`49884989 - `type: "timeout_error"`49904991 default: timeout_error49924993 - `message: string`49944995 default: Request timeout49964997 - `APIErrorObject object`49984999 - `type: "api_error"`50005001 default: api_error50025003 - `message: string`50045005 default: Internal server error50065007 - `OverloadedError object`50085009 - `type: "overloaded_error"`50105011 default: overloaded_error50125013 - `message: string`50145015 default: Overloaded50165017 - `request_id: string or null`50185019 - `MessageBatchCanceledResult object`50205021 - `type: "canceled"`50225023 default: canceled50245025 - `MessageBatchExpiredResult object`50265027 - `type: "expired"`50285029 default: expired50305031### Example50325033```bash5034curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/results \5035 -H 'anthropic-version: 2023-06-01' \5036 -H "X-Api-Key: $ANTHROPIC_API_KEY"5037```50385039## Domain types50405041### Deleted Message Batch50425043- `DeletedMessageBatch object`50445045 - `type: "message_batch_deleted"`50465047 Deleted object type.50485049 For Message Batches, this is always `"message_batch_deleted"`.50505051 default: message_batch_deleted50525053 - `id: string`50545055 ID of the Message Batch.50565057### Message Batch50585059- `MessageBatch object`50605061 - `type: "message_batch"`50625063 Object type.50645065 For Message Batches, this is always `"message_batch"`.50665067 default: message_batch50685069 - `id: string`50705071 Unique object identifier.50725073 The format and length of IDs may change over time.50745075 - `archived_at: string or null`50765077 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.50785079 format: date-time50805081 - `cancel_initiated_at: string or null`50825083 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.50845085 format: date-time50865087 - `created_at: string`50885089 RFC 3339 datetime string representing the time at which the Message Batch was created.50905091 format: date-time50925093 - `ended_at: string or null`50945095 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.50965097 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.50985099 format: date-time51005101 - `expires_at: string`51025103 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.51045105 format: date-time51065107 - `processing_status: "in_progress" or "canceling" or "ended"`51085109 Processing status of the Message Batch.51105111 - `"in_progress"`51125113 - `"canceling"`51145115 - `"ended"`51165117 - `request_counts: MessageBatchRequestCounts`51185119 Tallies requests within the Message Batch, categorized by their status.51205121 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.51225123 - `canceled: number`51245125 Number of requests in the Message Batch that have been canceled.51265127 This is zero until processing of the entire Message Batch has ended.51285129 default: 051305131 - `errored: number`51325133 Number of requests in the Message Batch that encountered an error.51345135 This is zero until processing of the entire Message Batch has ended.51365137 default: 051385139 - `expired: number`51405141 Number of requests in the Message Batch that have expired.51425143 This is zero until processing of the entire Message Batch has ended.51445145 default: 051465147 - `processing: number`51485149 Number of requests in the Message Batch that are processing.51505151 default: 051525153 - `succeeded: number`51545155 Number of requests in the Message Batch that have completed successfully.51565157 This is zero until processing of the entire Message Batch has ended.51585159 default: 051605161 - `results_url: string or null`51625163 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.51645165 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.51665167### Message Batch Canceled Result51685169- `MessageBatchCanceledResult object`51705171 - `type: "canceled"`51725173 default: canceled51745175### Message Batch Errored Result51765177- `MessageBatchErroredResult object`51785179 - `type: "errored"`51805181 default: errored51825183 - `error: ErrorResponse`51845185 - `type: "error"`51865187 default: error51885189 - `error: ErrorObject`51905191 - `InvalidRequestError object`51925193 - `type: "invalid_request_error"`51945195 default: invalid_request_error51965197 - `message: string`51985199 default: Invalid request52005201 - `AuthenticationError object`52025203 - `type: "authentication_error"`52045205 default: authentication_error52065207 - `message: string`52085209 default: Authentication error52105211 - `BillingError object`52125213 - `type: "billing_error"`52145215 default: billing_error52165217 - `message: string`52185219 default: Billing error52205221 - `PermissionError object`52225223 - `type: "permission_error"`52245225 default: permission_error52265227 - `message: string`52285229 default: Permission denied52305231 - `NotFoundError object`52325233 - `type: "not_found_error"`52345235 default: not_found_error52365237 - `message: string`52385239 default: Not found52405241 - `RateLimitError object`52425243 - `type: "rate_limit_error"`52445245 default: rate_limit_error52465247 - `message: string`52485249 default: Rate limited52505251 - `GatewayTimeoutError object`52525253 - `type: "timeout_error"`52545255 default: timeout_error52565257 - `message: string`52585259 default: Request timeout52605261 - `APIErrorObject object`52625263 - `type: "api_error"`52645265 default: api_error52665267 - `message: string`52685269 default: Internal server error52705271 - `OverloadedError object`52725273 - `type: "overloaded_error"`52745275 default: overloaded_error52765277 - `message: string`52785279 default: Overloaded52805281 - `request_id: string or null`52825283### Message Batch Expired Result52845285- `MessageBatchExpiredResult object`52865287 - `type: "expired"`52885289 default: expired52905291### Message Batch Individual Response52925293- `MessageBatchIndividualResponse object`52945295 This is a single line in the response `.jsonl` file and does not represent the response as a whole.52965297 - `custom_id: string`52985299 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.53005301 Must be unique for each request within the Message Batch.53025303 - `result: MessageBatchResult`53045305 Processing result for this request.53065307 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.53085309 - `MessageBatchSucceededResult object`53105311 - `type: "succeeded"`53125313 default: succeeded53145315 - `message: Message`53165317 - `type: "message"`53185319 Object type.53205321 For Messages, this is always `"message"`.53225323 default: message53245325 - `id: string`53265327 Unique object identifier.53285329 The format and length of IDs may change over time.53305331 - `container: Container or null`53325333 Information about the container used in the request (for the code execution tool)53345335 - `id: string`53365337 Identifier for the container used in this request53385339 - `expires_at: string`53405341 The time at which the container will expire.53425343 format: date-time53445345 - `skills: array of ContainerSkill or null`53465347 Skills loaded in the container53485349 - `type: "anthropic" or "custom"`53505351 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)53525353 - `"anthropic"`53545355 - `"custom"`53565357 - `skill_id: string`53585359 Skill ID53605361 maxLength: 64, minLength: 153625363 - `version: string`53645365 The resolved version: a skill version ID for custom skills.53665367 maxLength: 64, minLength: 153685369 - `content: array of ContentBlock`53705371 Content generated by the model.53725373 This is an array of content blocks, each of which has a `type` that determines its shape.53745375 Example:53765377 ```json5378 [{"type": "text", "text": "Hi, I'm Claude."}]5379 ```53805381 If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.53825383 For example, if the input `messages` were:53845385 ```json5386 [5387 {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},5388 {"role": "assistant", "content": "The best answer is ("}5389 ]5390 ```53915392 Then the response `content` might be:53935394 ```json5395 [{"type": "text", "text": "B)"}]5396 ```53975398 - `TextBlock object`53995400 - `type: "text"`54015402 default: text54035404 - `citations: array of TextCitation or null`54055406 Citations supporting the text block.54075408 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.54095410 - `CitationCharLocation object`54115412 - `type: "char_location"`54135414 default: char_location54155416 - `cited_text: string`54175418 - `document_index: number`54195420 minimum: 054215422 - `document_title: string or null`54235424 - `end_char_index: number`54255426 - `file_id: string or null`54275428 - `start_char_index: number`54295430 minimum: 054315432 - `CitationPageLocation object`54335434 - `type: "page_location"`54355436 default: page_location54375438 - `cited_text: string`54395440 - `document_index: number`54415442 minimum: 054435444 - `document_title: string or null`54455446 - `end_page_number: number`54475448 - `file_id: string or null`54495450 - `start_page_number: number`54515452 minimum: 154535454 - `CitationContentBlockLocation object`54555456 - `type: "content_block_location"`54575458 default: content_block_location54595460 - `cited_text: string`54615462 The full text of the cited block range, concatenated.54635464 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.54655466 - `document_index: number`54675468 minimum: 054695470 - `document_title: string or null`54715472 - `end_block_index: number`54735474 Exclusive 0-based end index of the cited block range in the source's `content` array.54755476 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.54775478 - `file_id: string or null`54795480 - `start_block_index: number`54815482 0-based index of the first cited block in the source's `content` array.54835484 minimum: 054855486 - `CitationsWebSearchResultLocation object`54875488 - `type: "web_search_result_location"`54895490 default: web_search_result_location54915492 - `cited_text: string`54935494 - `encrypted_index: string`54955496 - `title: string or null`54975498 maxLength: 51254995500 - `url: string`55015502 - `CitationsSearchResultLocation object`55035504 - `type: "search_result_location"`55055506 default: search_result_location55075508 - `cited_text: string`55095510 The full text of the cited block range, concatenated.55115512 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.55135514 - `end_block_index: number`55155516 Exclusive 0-based end index of the cited block range in the source's `content` array.55175518 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.55195520 - `search_result_index: number`55215522 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.55235524 Counted separately from `document_index`; server-side web search results are not included in this count.55255526 minimum: 055275528 - `source: string`55295530 - `start_block_index: number`55315532 0-based index of the first cited block in the source's `content` array.55335534 minimum: 055355536 - `title: string or null`55375538 - `text: string`55395540 minLength: 055415542 - `ThinkingBlock object`55435544 - `type: "thinking"`55455546 default: thinking55475548 - `signature: string`55495550 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.55515552 This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.55535554 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.55555556 - `thinking: string`55575558 The text of Claude's thinking process for this block.55595560 - `RedactedThinkingBlock object`55615562 - `type: "redacted_thinking"`55635564 default: redacted_thinking55655566 - `data: string`55675568 The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.55695570 Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.55715572 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.55735574 - `ToolUseBlock object`55755576 - `type: "tool_use"`55775578 default: tool_use55795580 - `id: string`55815582 pattern: ^[a-zA-Z0-9_-]+$55835584 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`55855586 default: {"type":"direct"}55875588 - `DirectCaller object`55895590 Tool invocation directly from the model.55915592 - `type: "direct"`55935594 - `ServerToolCaller object`55955596 Tool invocation generated by a server-side tool.55975598 - `type: "code_execution_20250825"`55995600 - `tool_id: string`56015602 pattern: ^srvtoolu_[a-zA-Z0-9_]+$56035604 - `ServerToolCaller20260120 object`56055606 - `type: "code_execution_20260120"`56075608 - `tool_id: string`56095610 pattern: ^srvtoolu_[a-zA-Z0-9_]+$56115612 - `input: map[unknown]`56135614 - `name: string`56155616 minLength: 156175618 - `toolset_name: optional string or null`56195620 For a toolset member tool_use, the toolset family.56215622 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$56235624 - `ServerToolUseBlock object`56255626 - `type: "server_tool_use"`56275628 default: server_tool_use56295630 - `id: string`56315632 pattern: ^srvtoolu_[a-zA-Z0-9_]+$56335634 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`56355636 default: {"type":"direct"}56375638 - `DirectCaller object`56395640 Tool invocation directly from the model.56415642 - `ServerToolCaller object`56435644 Tool invocation generated by a server-side tool.56455646 - `ServerToolCaller20260120 object`56475648 - `input: map[unknown]`56495650 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`56515652 - `"web_search"`56535654 - `"web_fetch"`56555656 - `"code_execution"`56575658 - `"bash_code_execution"`56595660 - `"text_editor_code_execution"`56615662 - `"tool_search_tool_regex"`56635664 - `"tool_search_tool_bm25"`56655666 - `WebSearchToolResultBlock object`56675668 - `type: "web_search_tool_result"`56695670 default: web_search_tool_result56715672 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`56735674 default: {"type":"direct"}56755676 - `DirectCaller object`56775678 Tool invocation directly from the model.56795680 - `ServerToolCaller object`56815682 Tool invocation generated by a server-side tool.56835684 - `ServerToolCaller20260120 object`56855686 - `content: WebSearchToolResultBlockContent`56875688 - `WebSearchToolResultError object`56895690 - `type: "web_search_tool_result_error"`56915692 default: web_search_tool_result_error56935694 - `error_code: WebSearchToolResultErrorCode`56955696 - `"invalid_tool_input"`56975698 - `"unavailable"`56995700 - `"max_uses_exceeded"`57015702 - `"too_many_requests"`57035704 - `"query_too_long"`57055706 - `"request_too_large"`57075708 - `array of WebSearchResultBlock`57095710 - `type: "web_search_result"`57115712 default: web_search_result57135714 - `encrypted_content: string`57155716 - `page_age: string or null`57175718 - `title: string`57195720 - `url: string`57215722 - `tool_use_id: string`57235724 pattern: ^srvtoolu_[a-zA-Z0-9_]+$57255726 - `WebFetchToolResultBlock object`57275728 - `type: "web_fetch_tool_result"`57295730 default: web_fetch_tool_result57315732 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`57335734 default: {"type":"direct"}57355736 - `DirectCaller object`57375738 Tool invocation directly from the model.57395740 - `ServerToolCaller object`57415742 Tool invocation generated by a server-side tool.57435744 - `ServerToolCaller20260120 object`57455746 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`57475748 - `WebFetchToolResultErrorBlock object`57495750 - `type: "web_fetch_tool_result_error"`57515752 default: web_fetch_tool_result_error57535754 - `error_code: WebFetchToolResultErrorCode`57555756 - `"invalid_tool_input"`57575758 - `"url_too_long"`57595760 - `"url_not_allowed"`57615762 - `"url_not_in_prior_context"`57635764 - `"url_not_accessible"`57655766 - `"unsupported_content_type"`57675768 - `"too_many_requests"`57695770 - `"max_uses_exceeded"`57715772 - `"unavailable"`57735774 - `"content_too_large"`57755776 - `WebFetchBlock object`57775778 - `type: "web_fetch_result"`57795780 default: web_fetch_result57815782 - `content: DocumentBlock`57835784 - `type: "document"`57855786 default: document57875788 - `citations: CitationsConfig or null`57895790 Citation configuration for the document57915792 - `enabled: boolean`57935794 default: false57955796 - `source: Base64PDFSource or PlainTextSource`57975798 - `Base64PDFSource object`57995800 - `type: "base64"`58015802 - `data: string`58035804 format: byte58055806 - `media_type: "application/pdf"`58075808 - `PlainTextSource object`58095810 - `type: "text"`58115812 - `data: string`58135814 - `media_type: "text/plain"`58155816 - `title: string or null`58175818 The title of the document58195820 - `retrieved_at: string or null`58215822 ISO 8601 timestamp when the content was retrieved58235824 - `url: string`58255826 Fetched content URL58275828 - `tool_use_id: string`58295830 pattern: ^srvtoolu_[a-zA-Z0-9_]+$58315832 - `CodeExecutionToolResultBlock object`58335834 - `type: "code_execution_tool_result"`58355836 default: code_execution_tool_result58375838 - `content: CodeExecutionToolResultBlockContent`58395840 - `CodeExecutionToolResultError object`58415842 - `type: "code_execution_tool_result_error"`58435844 default: code_execution_tool_result_error58455846 - `error_code: CodeExecutionToolResultErrorCode`58475848 - `"invalid_tool_input"`58495850 - `"unavailable"`58515852 - `"too_many_requests"`58535854 - `"execution_time_exceeded"`58555856 - `CodeExecutionResultBlock object`58575858 - `type: "code_execution_result"`58595860 default: code_execution_result58615862 - `content: array of CodeExecutionOutputBlock`58635864 - `type: "code_execution_output"`58655866 default: code_execution_output58675868 - `file_id: string`58695870 - `return_code: number`58715872 - `stderr: string`58735874 - `stdout: string`58755876 - `EncryptedCodeExecutionResultBlock object`58775878 Code execution result with encrypted stdout for PFC + web_search results.58795880 - `type: "encrypted_code_execution_result"`58815882 default: encrypted_code_execution_result58835884 - `content: array of CodeExecutionOutputBlock`58855886 - `type: "code_execution_output"`58875888 default: code_execution_output58895890 - `file_id: string`58915892 - `encrypted_stdout: string`58935894 - `return_code: number`58955896 - `stderr: string`58975898 - `tool_use_id: string`58995900 pattern: ^srvtoolu_[a-zA-Z0-9_]+$59015902 - `BashCodeExecutionToolResultBlock object`59035904 - `type: "bash_code_execution_tool_result"`59055906 default: bash_code_execution_tool_result59075908 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`59095910 - `BashCodeExecutionToolResultError object`59115912 - `type: "bash_code_execution_tool_result_error"`59135914 default: bash_code_execution_tool_result_error59155916 - `error_code: BashCodeExecutionToolResultErrorCode`59175918 - `"invalid_tool_input"`59195920 - `"unavailable"`59215922 - `"too_many_requests"`59235924 - `"execution_time_exceeded"`59255926 - `"output_file_too_large"`59275928 - `BashCodeExecutionResultBlock object`59295930 - `type: "bash_code_execution_result"`59315932 default: bash_code_execution_result59335934 - `content: array of BashCodeExecutionOutputBlock`59355936 - `type: "bash_code_execution_output"`59375938 default: bash_code_execution_output59395940 - `file_id: string`59415942 - `return_code: number`59435944 - `stderr: string`59455946 - `stdout: string`59475948 - `tool_use_id: string`59495950 pattern: ^srvtoolu_[a-zA-Z0-9_]+$59515952 - `TextEditorCodeExecutionToolResultBlock object`59535954 - `type: "text_editor_code_execution_tool_result"`59555956 default: text_editor_code_execution_tool_result59575958 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`59595960 - `TextEditorCodeExecutionToolResultError object`59615962 - `type: "text_editor_code_execution_tool_result_error"`59635964 default: text_editor_code_execution_tool_result_error59655966 - `error_code: TextEditorCodeExecutionToolResultErrorCode`59675968 - `"invalid_tool_input"`59695970 - `"unavailable"`59715972 - `"too_many_requests"`59735974 - `"execution_time_exceeded"`59755976 - `"file_not_found"`59775978 - `error_message: string or null`59795980 - `TextEditorCodeExecutionViewResultBlock object`59815982 - `type: "text_editor_code_execution_view_result"`59835984 default: text_editor_code_execution_view_result59855986 - `content: string`59875988 - `file_type: "text" or "image" or "pdf"`59895990 - `"text"`59915992 - `"image"`59935994 - `"pdf"`59955996 - `num_lines: number or null`59975998 - `start_line: number or null`59996000 - `total_lines: number or null`60016002 - `TextEditorCodeExecutionCreateResultBlock object`60036004 - `type: "text_editor_code_execution_create_result"`60056006 default: text_editor_code_execution_create_result60076008 - `is_file_update: boolean`60096010 - `TextEditorCodeExecutionStrReplaceResultBlock object`60116012 - `type: "text_editor_code_execution_str_replace_result"`60136014 default: text_editor_code_execution_str_replace_result60156016 - `lines: array of string or null`60176018 - `new_lines: number or null`60196020 - `new_start: number or null`60216022 - `old_lines: number or null`60236024 - `old_start: number or null`60256026 - `tool_use_id: string`60276028 pattern: ^srvtoolu_[a-zA-Z0-9_]+$60296030 - `ToolSearchToolResultBlock object`60316032 - `type: "tool_search_tool_result"`60336034 default: tool_search_tool_result60356036 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`60376038 - `ToolSearchToolResultError object`60396040 - `type: "tool_search_tool_result_error"`60416042 default: tool_search_tool_result_error60436044 - `error_code: ToolSearchToolResultErrorCode`60456046 - `"invalid_tool_input"`60476048 - `"unavailable"`60496050 - `"too_many_requests"`60516052 - `"execution_time_exceeded"`60536054 - `error_message: string or null`60556056 - `ToolSearchToolSearchResultBlock object`60576058 - `type: "tool_search_tool_search_result"`60596060 default: tool_search_tool_search_result60616062 - `tool_references: array of ToolReferenceBlock`60636064 - `type: "tool_reference"`60656066 default: tool_reference60676068 - `tool_name: string`60696070 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$60716072 - `tool_use_id: string`60736074 pattern: ^srvtoolu_[a-zA-Z0-9_]+$60756076 - `ContainerUploadBlock object`60776078 Response model for a file uploaded to the container.60796080 - `type: "container_upload"`60816082 default: container_upload60836084 - `file_id: string`60856086 - `model: Model`60876088 The model that will complete your prompt.60896090 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.60916092 - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`60936094 The model that will complete your prompt.60956096 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.60976098 - `"claude-fable-5-1"`60996100 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows61016102 - `"claude-mythos-5-1"`61036104 Our most capable model for cybersecurity and biology research, available through trusted access programs61056106 - `"claude-sonnet-5"`61076108 High-performance model for coding and agents61096110 - `"claude-fable-5"`61116112 Next generation of intelligence for the hardest knowledge work and coding problems61136114 - `"claude-mythos-5"`61156116 Most capable model for cybersecurity and biology research61176118 - `"claude-opus-5"`61196120 Powerful intelligence for long-running agents and coding61216122 - `"claude-opus-4-8"`61236124 Powerful intelligence for long-running agents and coding61256126 - `"claude-opus-4-7"`61276128 Powerful intelligence for long-running agents and coding61296130 - `"claude-mythos-preview"`61316132 New class of intelligence, strongest in coding and cybersecurity61336134 - `"claude-opus-4-6"`61356136 Powerful intelligence for long-running agents and coding61376138 - `"claude-sonnet-4-6"`61396140 Best combination of speed and intelligence61416142 - `"claude-haiku-4-5"`61436144 Fastest model with near-frontier intelligence61456146 - `"claude-haiku-4-5-20251001"`61476148 Fastest model with near-frontier intelligence61496150 - `"claude-opus-4-5"`61516152 Powerful intelligence for long-running agents and coding61536154 - `"claude-opus-4-5-20251101"`61556156 Powerful intelligence for long-running agents and coding61576158 - `"claude-sonnet-4-5"`61596160 High-performance model for agents and coding61616162 - `"claude-sonnet-4-5-20250929"`61636164 High-performance model for agents and coding61656166 - `string`61676168 - `role: "assistant"`61696170 Conversational role of the generated message.61716172 This will always be `"assistant"`.61736174 default: assistant61756176 - `stop_details: RefusalStopDetails or null`61776178 Structured information about a refusal.61796180 - `type: "refusal"`61816182 default: refusal61836184 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`61856186 The policy category that triggered a refusal.61876188 - `"cyber"`61896190 The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.61916192 - `"bio"`61936194 The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.61956196 - `"frontier_llm"`61976198 The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.61996200 - `"reasoning_extraction"`62016202 The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).62036204 - `"general_harms"`62056206 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.62076208 - `explanation: string or null`62096210 Human-readable explanation of the refusal.62116212 This text is not guaranteed to be stable. `null` when no explanation is available for the category.62136214 - `stop_reason: StopReason or null`62156216 The reason that we stopped.62176218 This may be one the following values:62196220 * `"end_turn"`: the model reached a natural stopping point6221 * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum6222 * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated6223 * `"tool_use"`: the model invoked one or more tools6224 * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.6225 * `"refusal"`: when streaming classifiers intervene to handle potential policy violations6226 * `"model_context_window_exceeded"`: we exceeded the model's context window62276228 In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.62296230 - `"end_turn"`62316232 - `"max_tokens"`62336234 - `"stop_sequence"`62356236 - `"tool_use"`62376238 - `"pause_turn"`62396240 - `"refusal"`62416242 - `"model_context_window_exceeded"`62436244 - `stop_sequence: string or null`62456246 Which custom stop sequence was generated, if any.62476248 This value will be a non-null string if one of your custom stop sequences was generated.62496250 - `usage: Usage`62516252 Billing and rate-limit usage.62536254 Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.62556256 Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.62576258 For example, `output_tokens` will be non-zero, even for an empty string response from Claude.62596260 Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.62616262 - `cache_creation: CacheCreation or null`62636264 Breakdown of cached tokens by TTL62656266 - `ephemeral_1h_input_tokens: number`62676268 The number of input tokens used to create the 1 hour cache entry.62696270 default: 0, minimum: 062716272 - `ephemeral_5m_input_tokens: number`62736274 The number of input tokens used to create the 5 minute cache entry.62756276 default: 0, minimum: 062776278 - `cache_creation_input_tokens: number or null`62796280 The number of input tokens used to create the cache entry.62816282 minimum: 062836284 - `cache_read_input_tokens: number or null`62856286 The number of input tokens read from the cache.62876288 minimum: 062896290 - `inference_geo: string or null`62916292 The geographic region where inference was performed for this request.62936294 - `input_tokens: number`62956296 The number of input tokens which were used.62976298 minimum: 062996300 - `output_tokens: number`63016302 The number of output tokens which were used.63036304 minimum: 063056306 - `output_tokens_details: OutputTokensDetails or null`63076308 Breakdown of output tokens by category.63096310 `output_tokens` remains the inclusive, authoritative total used for billing.6311 This object provides a read-only decomposition for observability — for example,6312 how many of the billed output tokens were spent on internal reasoning that may6313 have been summarized before being returned to you.63146315 - `thinking_tokens: number`63166317 Number of output tokens the model generated as internal reasoning, including6318 the thinking-block delimiter tokens.63196320 Reflects the raw reasoning the model produced, not the (possibly shorter)6321 summarized thinking text returned in the response body. Computed by6322 re-tokenizing the raw reasoning text, so it may differ from the model's exact6323 generation count by a small number of tokens. Always ≤ `output_tokens`;6324 `output_tokens - thinking_tokens` approximates the non-reasoning output.63256326 default: 0, minimum: 063276328 - `server_tool_use: ServerToolUsage or null`63296330 The number of server tool requests.63316332 - `web_fetch_requests: number`63336334 The number of web fetch tool requests.63356336 default: 0, minimum: 063376338 - `web_search_requests: number`63396340 The number of web search tool requests.63416342 default: 0, minimum: 063436344 - `service_tier: "standard" or "priority" or "batch" or null`63456346 If the request used the priority, standard, or batch tier.63476348 - `"standard"`63496350 - `"priority"`63516352 - `"batch"`63536354 - `MessageBatchErroredResult object`63556356 - `type: "errored"`63576358 default: errored63596360 - `error: ErrorResponse`63616362 - `type: "error"`63636364 default: error63656366 - `error: ErrorObject`63676368 - `InvalidRequestError object`63696370 - `type: "invalid_request_error"`63716372 default: invalid_request_error63736374 - `message: string`63756376 default: Invalid request63776378 - `AuthenticationError object`63796380 - `type: "authentication_error"`63816382 default: authentication_error63836384 - `message: string`63856386 default: Authentication error63876388 - `BillingError object`63896390 - `type: "billing_error"`63916392 default: billing_error63936394 - `message: string`63956396 default: Billing error63976398 - `PermissionError object`63996400 - `type: "permission_error"`64016402 default: permission_error64036404 - `message: string`64056406 default: Permission denied64076408 - `NotFoundError object`64096410 - `type: "not_found_error"`64116412 default: not_found_error64136414 - `message: string`64156416 default: Not found64176418 - `RateLimitError object`64196420 - `type: "rate_limit_error"`64216422 default: rate_limit_error64236424 - `message: string`64256426 default: Rate limited64276428 - `GatewayTimeoutError object`64296430 - `type: "timeout_error"`64316432 default: timeout_error64336434 - `message: string`64356436 default: Request timeout64376438 - `APIErrorObject object`64396440 - `type: "api_error"`64416442 default: api_error64436444 - `message: string`64456446 default: Internal server error64476448 - `OverloadedError object`64496450 - `type: "overloaded_error"`64516452 default: overloaded_error64536454 - `message: string`64556456 default: Overloaded64576458 - `request_id: string or null`64596460 - `MessageBatchCanceledResult object`64616462 - `type: "canceled"`64636464 default: canceled64656466 - `MessageBatchExpiredResult object`64676468 - `type: "expired"`64696470 default: expired64716472### Message Batch Request Counts64736474- `MessageBatchRequestCounts object`64756476 - `canceled: number`64776478 Number of requests in the Message Batch that have been canceled.64796480 This is zero until processing of the entire Message Batch has ended.64816482 default: 064836484 - `errored: number`64856486 Number of requests in the Message Batch that encountered an error.64876488 This is zero until processing of the entire Message Batch has ended.64896490 default: 064916492 - `expired: number`64936494 Number of requests in the Message Batch that have expired.64956496 This is zero until processing of the entire Message Batch has ended.64976498 default: 064996500 - `processing: number`65016502 Number of requests in the Message Batch that are processing.65036504 default: 065056506 - `succeeded: number`65076508 Number of requests in the Message Batch that have completed successfully.65096510 This is zero until processing of the entire Message Batch has ended.65116512 default: 065136514### Message Batch Result65156516- `MessageBatchResult = MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`65176518 Processing result for this request.65196520 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.65216522 - `MessageBatchSucceededResult object`65236524 - `type: "succeeded"`65256526 default: succeeded65276528 - `message: Message`65296530 - `type: "message"`65316532 Object type.65336534 For Messages, this is always `"message"`.65356536 default: message65376538 - `id: string`65396540 Unique object identifier.65416542 The format and length of IDs may change over time.65436544 - `container: Container or null`65456546 Information about the container used in the request (for the code execution tool)65476548 - `id: string`65496550 Identifier for the container used in this request65516552 - `expires_at: string`65536554 The time at which the container will expire.65556556 format: date-time65576558 - `skills: array of ContainerSkill or null`65596560 Skills loaded in the container65616562 - `type: "anthropic" or "custom"`65636564 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)65656566 - `"anthropic"`65676568 - `"custom"`65696570 - `skill_id: string`65716572 Skill ID65736574 maxLength: 64, minLength: 165756576 - `version: string`65776578 The resolved version: a skill version ID for custom skills.65796580 maxLength: 64, minLength: 165816582 - `content: array of ContentBlock`65836584 Content generated by the model.65856586 This is an array of content blocks, each of which has a `type` that determines its shape.65876588 Example:65896590 ```json6591 [{"type": "text", "text": "Hi, I'm Claude."}]6592 ```65936594 If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.65956596 For example, if the input `messages` were:65976598 ```json6599 [6600 {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},6601 {"role": "assistant", "content": "The best answer is ("}6602 ]6603 ```66046605 Then the response `content` might be:66066607 ```json6608 [{"type": "text", "text": "B)"}]6609 ```66106611 - `TextBlock object`66126613 - `type: "text"`66146615 default: text66166617 - `citations: array of TextCitation or null`66186619 Citations supporting the text block.66206621 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.66226623 - `CitationCharLocation object`66246625 - `type: "char_location"`66266627 default: char_location66286629 - `cited_text: string`66306631 - `document_index: number`66326633 minimum: 066346635 - `document_title: string or null`66366637 - `end_char_index: number`66386639 - `file_id: string or null`66406641 - `start_char_index: number`66426643 minimum: 066446645 - `CitationPageLocation object`66466647 - `type: "page_location"`66486649 default: page_location66506651 - `cited_text: string`66526653 - `document_index: number`66546655 minimum: 066566657 - `document_title: string or null`66586659 - `end_page_number: number`66606661 - `file_id: string or null`66626663 - `start_page_number: number`66646665 minimum: 166666667 - `CitationContentBlockLocation object`66686669 - `type: "content_block_location"`66706671 default: content_block_location66726673 - `cited_text: string`66746675 The full text of the cited block range, concatenated.66766677 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.66786679 - `document_index: number`66806681 minimum: 066826683 - `document_title: string or null`66846685 - `end_block_index: number`66866687 Exclusive 0-based end index of the cited block range in the source's `content` array.66886689 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.66906691 - `file_id: string or null`66926693 - `start_block_index: number`66946695 0-based index of the first cited block in the source's `content` array.66966697 minimum: 066986699 - `CitationsWebSearchResultLocation object`67006701 - `type: "web_search_result_location"`67026703 default: web_search_result_location67046705 - `cited_text: string`67066707 - `encrypted_index: string`67086709 - `title: string or null`67106711 maxLength: 51267126713 - `url: string`67146715 - `CitationsSearchResultLocation object`67166717 - `type: "search_result_location"`67186719 default: search_result_location67206721 - `cited_text: string`67226723 The full text of the cited block range, concatenated.67246725 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.67266727 - `end_block_index: number`67286729 Exclusive 0-based end index of the cited block range in the source's `content` array.67306731 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.67326733 - `search_result_index: number`67346735 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.67366737 Counted separately from `document_index`; server-side web search results are not included in this count.67386739 minimum: 067406741 - `source: string`67426743 - `start_block_index: number`67446745 0-based index of the first cited block in the source's `content` array.67466747 minimum: 067486749 - `title: string or null`67506751 - `text: string`67526753 minLength: 067546755 - `ThinkingBlock object`67566757 - `type: "thinking"`67586759 default: thinking67606761 - `signature: string`67626763 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.67646765 This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.67666767 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.67686769 - `thinking: string`67706771 The text of Claude's thinking process for this block.67726773 - `RedactedThinkingBlock object`67746775 - `type: "redacted_thinking"`67766777 default: redacted_thinking67786779 - `data: string`67806781 The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.67826783 Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.67846785 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.67866787 - `ToolUseBlock object`67886789 - `type: "tool_use"`67906791 default: tool_use67926793 - `id: string`67946795 pattern: ^[a-zA-Z0-9_-]+$67966797 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`67986799 default: {"type":"direct"}68006801 - `DirectCaller object`68026803 Tool invocation directly from the model.68046805 - `type: "direct"`68066807 - `ServerToolCaller object`68086809 Tool invocation generated by a server-side tool.68106811 - `type: "code_execution_20250825"`68126813 - `tool_id: string`68146815 pattern: ^srvtoolu_[a-zA-Z0-9_]+$68166817 - `ServerToolCaller20260120 object`68186819 - `type: "code_execution_20260120"`68206821 - `tool_id: string`68226823 pattern: ^srvtoolu_[a-zA-Z0-9_]+$68246825 - `input: map[unknown]`68266827 - `name: string`68286829 minLength: 168306831 - `toolset_name: optional string or null`68326833 For a toolset member tool_use, the toolset family.68346835 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$68366837 - `ServerToolUseBlock object`68386839 - `type: "server_tool_use"`68406841 default: server_tool_use68426843 - `id: string`68446845 pattern: ^srvtoolu_[a-zA-Z0-9_]+$68466847 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`68486849 default: {"type":"direct"}68506851 - `DirectCaller object`68526853 Tool invocation directly from the model.68546855 - `ServerToolCaller object`68566857 Tool invocation generated by a server-side tool.68586859 - `ServerToolCaller20260120 object`68606861 - `input: map[unknown]`68626863 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`68646865 - `"web_search"`68666867 - `"web_fetch"`68686869 - `"code_execution"`68706871 - `"bash_code_execution"`68726873 - `"text_editor_code_execution"`68746875 - `"tool_search_tool_regex"`68766877 - `"tool_search_tool_bm25"`68786879 - `WebSearchToolResultBlock object`68806881 - `type: "web_search_tool_result"`68826883 default: web_search_tool_result68846885 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`68866887 default: {"type":"direct"}68886889 - `DirectCaller object`68906891 Tool invocation directly from the model.68926893 - `ServerToolCaller object`68946895 Tool invocation generated by a server-side tool.68966897 - `ServerToolCaller20260120 object`68986899 - `content: WebSearchToolResultBlockContent`69006901 - `WebSearchToolResultError object`69026903 - `type: "web_search_tool_result_error"`69046905 default: web_search_tool_result_error69066907 - `error_code: WebSearchToolResultErrorCode`69086909 - `"invalid_tool_input"`69106911 - `"unavailable"`69126913 - `"max_uses_exceeded"`69146915 - `"too_many_requests"`69166917 - `"query_too_long"`69186919 - `"request_too_large"`69206921 - `array of WebSearchResultBlock`69226923 - `type: "web_search_result"`69246925 default: web_search_result69266927 - `encrypted_content: string`69286929 - `page_age: string or null`69306931 - `title: string`69326933 - `url: string`69346935 - `tool_use_id: string`69366937 pattern: ^srvtoolu_[a-zA-Z0-9_]+$69386939 - `WebFetchToolResultBlock object`69406941 - `type: "web_fetch_tool_result"`69426943 default: web_fetch_tool_result69446945 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`69466947 default: {"type":"direct"}69486949 - `DirectCaller object`69506951 Tool invocation directly from the model.69526953 - `ServerToolCaller object`69546955 Tool invocation generated by a server-side tool.69566957 - `ServerToolCaller20260120 object`69586959 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`69606961 - `WebFetchToolResultErrorBlock object`69626963 - `type: "web_fetch_tool_result_error"`69646965 default: web_fetch_tool_result_error69666967 - `error_code: WebFetchToolResultErrorCode`69686969 - `"invalid_tool_input"`69706971 - `"url_too_long"`69726973 - `"url_not_allowed"`69746975 - `"url_not_in_prior_context"`69766977 - `"url_not_accessible"`69786979 - `"unsupported_content_type"`69806981 - `"too_many_requests"`69826983 - `"max_uses_exceeded"`69846985 - `"unavailable"`69866987 - `"content_too_large"`69886989 - `WebFetchBlock object`69906991 - `type: "web_fetch_result"`69926993 default: web_fetch_result69946995 - `content: DocumentBlock`69966997 - `type: "document"`69986999 default: document70007001 - `citations: CitationsConfig or null`70027003 Citation configuration for the document70047005 - `enabled: boolean`70067007 default: false70087009 - `source: Base64PDFSource or PlainTextSource`70107011 - `Base64PDFSource object`70127013 - `type: "base64"`70147015 - `data: string`70167017 format: byte70187019 - `media_type: "application/pdf"`70207021 - `PlainTextSource object`70227023 - `type: "text"`70247025 - `data: string`70267027 - `media_type: "text/plain"`70287029 - `title: string or null`70307031 The title of the document70327033 - `retrieved_at: string or null`70347035 ISO 8601 timestamp when the content was retrieved70367037 - `url: string`70387039 Fetched content URL70407041 - `tool_use_id: string`70427043 pattern: ^srvtoolu_[a-zA-Z0-9_]+$70447045 - `CodeExecutionToolResultBlock object`70467047 - `type: "code_execution_tool_result"`70487049 default: code_execution_tool_result70507051 - `content: CodeExecutionToolResultBlockContent`70527053 - `CodeExecutionToolResultError object`70547055 - `type: "code_execution_tool_result_error"`70567057 default: code_execution_tool_result_error70587059 - `error_code: CodeExecutionToolResultErrorCode`70607061 - `"invalid_tool_input"`70627063 - `"unavailable"`70647065 - `"too_many_requests"`70667067 - `"execution_time_exceeded"`70687069 - `CodeExecutionResultBlock object`70707071 - `type: "code_execution_result"`70727073 default: code_execution_result70747075 - `content: array of CodeExecutionOutputBlock`70767077 - `type: "code_execution_output"`70787079 default: code_execution_output70807081 - `file_id: string`70827083 - `return_code: number`70847085 - `stderr: string`70867087 - `stdout: string`70887089 - `EncryptedCodeExecutionResultBlock object`70907091 Code execution result with encrypted stdout for PFC + web_search results.70927093 - `type: "encrypted_code_execution_result"`70947095 default: encrypted_code_execution_result70967097 - `content: array of CodeExecutionOutputBlock`70987099 - `type: "code_execution_output"`71007101 default: code_execution_output71027103 - `file_id: string`71047105 - `encrypted_stdout: string`71067107 - `return_code: number`71087109 - `stderr: string`71107111 - `tool_use_id: string`71127113 pattern: ^srvtoolu_[a-zA-Z0-9_]+$71147115 - `BashCodeExecutionToolResultBlock object`71167117 - `type: "bash_code_execution_tool_result"`71187119 default: bash_code_execution_tool_result71207121 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`71227123 - `BashCodeExecutionToolResultError object`71247125 - `type: "bash_code_execution_tool_result_error"`71267127 default: bash_code_execution_tool_result_error71287129 - `error_code: BashCodeExecutionToolResultErrorCode`71307131 - `"invalid_tool_input"`71327133 - `"unavailable"`71347135 - `"too_many_requests"`71367137 - `"execution_time_exceeded"`71387139 - `"output_file_too_large"`71407141 - `BashCodeExecutionResultBlock object`71427143 - `type: "bash_code_execution_result"`71447145 default: bash_code_execution_result71467147 - `content: array of BashCodeExecutionOutputBlock`71487149 - `type: "bash_code_execution_output"`71507151 default: bash_code_execution_output71527153 - `file_id: string`71547155 - `return_code: number`71567157 - `stderr: string`71587159 - `stdout: string`71607161 - `tool_use_id: string`71627163 pattern: ^srvtoolu_[a-zA-Z0-9_]+$71647165 - `TextEditorCodeExecutionToolResultBlock object`71667167 - `type: "text_editor_code_execution_tool_result"`71687169 default: text_editor_code_execution_tool_result71707171 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`71727173 - `TextEditorCodeExecutionToolResultError object`71747175 - `type: "text_editor_code_execution_tool_result_error"`71767177 default: text_editor_code_execution_tool_result_error71787179 - `error_code: TextEditorCodeExecutionToolResultErrorCode`71807181 - `"invalid_tool_input"`71827183 - `"unavailable"`71847185 - `"too_many_requests"`71867187 - `"execution_time_exceeded"`71887189 - `"file_not_found"`71907191 - `error_message: string or null`71927193 - `TextEditorCodeExecutionViewResultBlock object`71947195 - `type: "text_editor_code_execution_view_result"`71967197 default: text_editor_code_execution_view_result71987199 - `content: string`72007201 - `file_type: "text" or "image" or "pdf"`72027203 - `"text"`72047205 - `"image"`72067207 - `"pdf"`72087209 - `num_lines: number or null`72107211 - `start_line: number or null`72127213 - `total_lines: number or null`72147215 - `TextEditorCodeExecutionCreateResultBlock object`72167217 - `type: "text_editor_code_execution_create_result"`72187219 default: text_editor_code_execution_create_result72207221 - `is_file_update: boolean`72227223 - `TextEditorCodeExecutionStrReplaceResultBlock object`72247225 - `type: "text_editor_code_execution_str_replace_result"`72267227 default: text_editor_code_execution_str_replace_result72287229 - `lines: array of string or null`72307231 - `new_lines: number or null`72327233 - `new_start: number or null`72347235 - `old_lines: number or null`72367237 - `old_start: number or null`72387239 - `tool_use_id: string`72407241 pattern: ^srvtoolu_[a-zA-Z0-9_]+$72427243 - `ToolSearchToolResultBlock object`72447245 - `type: "tool_search_tool_result"`72467247 default: tool_search_tool_result72487249 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`72507251 - `ToolSearchToolResultError object`72527253 - `type: "tool_search_tool_result_error"`72547255 default: tool_search_tool_result_error72567257 - `error_code: ToolSearchToolResultErrorCode`72587259 - `"invalid_tool_input"`72607261 - `"unavailable"`72627263 - `"too_many_requests"`72647265 - `"execution_time_exceeded"`72667267 - `error_message: string or null`72687269 - `ToolSearchToolSearchResultBlock object`72707271 - `type: "tool_search_tool_search_result"`72727273 default: tool_search_tool_search_result72747275 - `tool_references: array of ToolReferenceBlock`72767277 - `type: "tool_reference"`72787279 default: tool_reference72807281 - `tool_name: string`72827283 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$72847285 - `tool_use_id: string`72867287 pattern: ^srvtoolu_[a-zA-Z0-9_]+$72887289 - `ContainerUploadBlock object`72907291 Response model for a file uploaded to the container.72927293 - `type: "container_upload"`72947295 default: container_upload72967297 - `file_id: string`72987299 - `model: Model`73007301 The model that will complete your prompt.73027303 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.73047305 - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`73067307 The model that will complete your prompt.73087309 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.73107311 - `"claude-fable-5-1"`73127313 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows73147315 - `"claude-mythos-5-1"`73167317 Our most capable model for cybersecurity and biology research, available through trusted access programs73187319 - `"claude-sonnet-5"`73207321 High-performance model for coding and agents73227323 - `"claude-fable-5"`73247325 Next generation of intelligence for the hardest knowledge work and coding problems73267327 - `"claude-mythos-5"`73287329 Most capable model for cybersecurity and biology research73307331 - `"claude-opus-5"`73327333 Powerful intelligence for long-running agents and coding73347335 - `"claude-opus-4-8"`73367337 Powerful intelligence for long-running agents and coding73387339 - `"claude-opus-4-7"`73407341 Powerful intelligence for long-running agents and coding73427343 - `"claude-mythos-preview"`73447345 New class of intelligence, strongest in coding and cybersecurity73467347 - `"claude-opus-4-6"`73487349 Powerful intelligence for long-running agents and coding73507351 - `"claude-sonnet-4-6"`73527353 Best combination of speed and intelligence73547355 - `"claude-haiku-4-5"`73567357 Fastest model with near-frontier intelligence73587359 - `"claude-haiku-4-5-20251001"`73607361 Fastest model with near-frontier intelligence73627363 - `"claude-opus-4-5"`73647365 Powerful intelligence for long-running agents and coding73667367 - `"claude-opus-4-5-20251101"`73687369 Powerful intelligence for long-running agents and coding73707371 - `"claude-sonnet-4-5"`73727373 High-performance model for agents and coding73747375 - `"claude-sonnet-4-5-20250929"`73767377 High-performance model for agents and coding73787379 - `string`73807381 - `role: "assistant"`73827383 Conversational role of the generated message.73847385 This will always be `"assistant"`.73867387 default: assistant73887389 - `stop_details: RefusalStopDetails or null`73907391 Structured information about a refusal.73927393 - `type: "refusal"`73947395 default: refusal73967397 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`73987399 The policy category that triggered a refusal.74007401 - `"cyber"`74027403 The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.74047405 - `"bio"`74067407 The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.74087409 - `"frontier_llm"`74107411 The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.74127413 - `"reasoning_extraction"`74147415 The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).74167417 - `"general_harms"`74187419 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.74207421 - `explanation: string or null`74227423 Human-readable explanation of the refusal.74247425 This text is not guaranteed to be stable. `null` when no explanation is available for the category.74267427 - `stop_reason: StopReason or null`74287429 The reason that we stopped.74307431 This may be one the following values:74327433 * `"end_turn"`: the model reached a natural stopping point7434 * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum7435 * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated7436 * `"tool_use"`: the model invoked one or more tools7437 * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.7438 * `"refusal"`: when streaming classifiers intervene to handle potential policy violations7439 * `"model_context_window_exceeded"`: we exceeded the model's context window74407441 In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.74427443 - `"end_turn"`74447445 - `"max_tokens"`74467447 - `"stop_sequence"`74487449 - `"tool_use"`74507451 - `"pause_turn"`74527453 - `"refusal"`74547455 - `"model_context_window_exceeded"`74567457 - `stop_sequence: string or null`74587459 Which custom stop sequence was generated, if any.74607461 This value will be a non-null string if one of your custom stop sequences was generated.74627463 - `usage: Usage`74647465 Billing and rate-limit usage.74667467 Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.74687469 Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.74707471 For example, `output_tokens` will be non-zero, even for an empty string response from Claude.74727473 Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.74747475 - `cache_creation: CacheCreation or null`74767477 Breakdown of cached tokens by TTL74787479 - `ephemeral_1h_input_tokens: number`74807481 The number of input tokens used to create the 1 hour cache entry.74827483 default: 0, minimum: 074847485 - `ephemeral_5m_input_tokens: number`74867487 The number of input tokens used to create the 5 minute cache entry.74887489 default: 0, minimum: 074907491 - `cache_creation_input_tokens: number or null`74927493 The number of input tokens used to create the cache entry.74947495 minimum: 074967497 - `cache_read_input_tokens: number or null`74987499 The number of input tokens read from the cache.75007501 minimum: 075027503 - `inference_geo: string or null`75047505 The geographic region where inference was performed for this request.75067507 - `input_tokens: number`75087509 The number of input tokens which were used.75107511 minimum: 075127513 - `output_tokens: number`75147515 The number of output tokens which were used.75167517 minimum: 075187519 - `output_tokens_details: OutputTokensDetails or null`75207521 Breakdown of output tokens by category.75227523 `output_tokens` remains the inclusive, authoritative total used for billing.7524 This object provides a read-only decomposition for observability — for example,7525 how many of the billed output tokens were spent on internal reasoning that may7526 have been summarized before being returned to you.75277528 - `thinking_tokens: number`75297530 Number of output tokens the model generated as internal reasoning, including7531 the thinking-block delimiter tokens.75327533 Reflects the raw reasoning the model produced, not the (possibly shorter)7534 summarized thinking text returned in the response body. Computed by7535 re-tokenizing the raw reasoning text, so it may differ from the model's exact7536 generation count by a small number of tokens. Always ≤ `output_tokens`;7537 `output_tokens - thinking_tokens` approximates the non-reasoning output.75387539 default: 0, minimum: 075407541 - `server_tool_use: ServerToolUsage or null`75427543 The number of server tool requests.75447545 - `web_fetch_requests: number`75467547 The number of web fetch tool requests.75487549 default: 0, minimum: 075507551 - `web_search_requests: number`75527553 The number of web search tool requests.75547555 default: 0, minimum: 075567557 - `service_tier: "standard" or "priority" or "batch" or null`75587559 If the request used the priority, standard, or batch tier.75607561 - `"standard"`75627563 - `"priority"`75647565 - `"batch"`75667567 - `MessageBatchErroredResult object`75687569 - `type: "errored"`75707571 default: errored75727573 - `error: ErrorResponse`75747575 - `type: "error"`75767577 default: error75787579 - `error: ErrorObject`75807581 - `InvalidRequestError object`75827583 - `type: "invalid_request_error"`75847585 default: invalid_request_error75867587 - `message: string`75887589 default: Invalid request75907591 - `AuthenticationError object`75927593 - `type: "authentication_error"`75947595 default: authentication_error75967597 - `message: string`75987599 default: Authentication error76007601 - `BillingError object`76027603 - `type: "billing_error"`76047605 default: billing_error76067607 - `message: string`76087609 default: Billing error76107611 - `PermissionError object`76127613 - `type: "permission_error"`76147615 default: permission_error76167617 - `message: string`76187619 default: Permission denied76207621 - `NotFoundError object`76227623 - `type: "not_found_error"`76247625 default: not_found_error76267627 - `message: string`76287629 default: Not found76307631 - `RateLimitError object`76327633 - `type: "rate_limit_error"`76347635 default: rate_limit_error76367637 - `message: string`76387639 default: Rate limited76407641 - `GatewayTimeoutError object`76427643 - `type: "timeout_error"`76447645 default: timeout_error76467647 - `message: string`76487649 default: Request timeout76507651 - `APIErrorObject object`76527653 - `type: "api_error"`76547655 default: api_error76567657 - `message: string`76587659 default: Internal server error76607661 - `OverloadedError object`76627663 - `type: "overloaded_error"`76647665 default: overloaded_error76667667 - `message: string`76687669 default: Overloaded76707671 - `request_id: string or null`76727673 - `MessageBatchCanceledResult object`76747675 - `type: "canceled"`76767677 default: canceled76787679 - `MessageBatchExpiredResult object`76807681 - `type: "expired"`76827683 default: expired76847685### Message Batch Succeeded Result76867687- `MessageBatchSucceededResult object`76887689 - `type: "succeeded"`76907691 default: succeeded76927693 - `message: Message`76947695 - `type: "message"`76967697 Object type.76987699 For Messages, this is always `"message"`.77007701 default: message77027703 - `id: string`77047705 Unique object identifier.77067707 The format and length of IDs may change over time.77087709 - `container: Container or null`77107711 Information about the container used in the request (for the code execution tool)77127713 - `id: string`77147715 Identifier for the container used in this request77167717 - `expires_at: string`77187719 The time at which the container will expire.77207721 format: date-time77227723 - `skills: array of ContainerSkill or null`77247725 Skills loaded in the container77267727 - `type: "anthropic" or "custom"`77287729 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)77307731 - `"anthropic"`77327733 - `"custom"`77347735 - `skill_id: string`77367737 Skill ID77387739 maxLength: 64, minLength: 177407741 - `version: string`77427743 The resolved version: a skill version ID for custom skills.77447745 maxLength: 64, minLength: 177467747 - `content: array of ContentBlock`77487749 Content generated by the model.77507751 This is an array of content blocks, each of which has a `type` that determines its shape.77527753 Example:77547755 ```json7756 [{"type": "text", "text": "Hi, I'm Claude."}]7757 ```77587759 If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.77607761 For example, if the input `messages` were:77627763 ```json7764 [7765 {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},7766 {"role": "assistant", "content": "The best answer is ("}7767 ]7768 ```77697770 Then the response `content` might be:77717772 ```json7773 [{"type": "text", "text": "B)"}]7774 ```77757776 - `TextBlock object`77777778 - `type: "text"`77797780 default: text77817782 - `citations: array of TextCitation or null`77837784 Citations supporting the text block.77857786 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.77877788 - `CitationCharLocation object`77897790 - `type: "char_location"`77917792 default: char_location77937794 - `cited_text: string`77957796 - `document_index: number`77977798 minimum: 077997800 - `document_title: string or null`78017802 - `end_char_index: number`78037804 - `file_id: string or null`78057806 - `start_char_index: number`78077808 minimum: 078097810 - `CitationPageLocation object`78117812 - `type: "page_location"`78137814 default: page_location78157816 - `cited_text: string`78177818 - `document_index: number`78197820 minimum: 078217822 - `document_title: string or null`78237824 - `end_page_number: number`78257826 - `file_id: string or null`78277828 - `start_page_number: number`78297830 minimum: 178317832 - `CitationContentBlockLocation object`78337834 - `type: "content_block_location"`78357836 default: content_block_location78377838 - `cited_text: string`78397840 The full text of the cited block range, concatenated.78417842 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.78437844 - `document_index: number`78457846 minimum: 078477848 - `document_title: string or null`78497850 - `end_block_index: number`78517852 Exclusive 0-based end index of the cited block range in the source's `content` array.78537854 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.78557856 - `file_id: string or null`78577858 - `start_block_index: number`78597860 0-based index of the first cited block in the source's `content` array.78617862 minimum: 078637864 - `CitationsWebSearchResultLocation object`78657866 - `type: "web_search_result_location"`78677868 default: web_search_result_location78697870 - `cited_text: string`78717872 - `encrypted_index: string`78737874 - `title: string or null`78757876 maxLength: 51278777878 - `url: string`78797880 - `CitationsSearchResultLocation object`78817882 - `type: "search_result_location"`78837884 default: search_result_location78857886 - `cited_text: string`78877888 The full text of the cited block range, concatenated.78897890 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.78917892 - `end_block_index: number`78937894 Exclusive 0-based end index of the cited block range in the source's `content` array.78957896 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.78977898 - `search_result_index: number`78997900 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.79017902 Counted separately from `document_index`; server-side web search results are not included in this count.79037904 minimum: 079057906 - `source: string`79077908 - `start_block_index: number`79097910 0-based index of the first cited block in the source's `content` array.79117912 minimum: 079137914 - `title: string or null`79157916 - `text: string`79177918 minLength: 079197920 - `ThinkingBlock object`79217922 - `type: "thinking"`79237924 default: thinking79257926 - `signature: string`79277928 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.79297930 This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.79317932 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.79337934 - `thinking: string`79357936 The text of Claude's thinking process for this block.79377938 - `RedactedThinkingBlock object`79397940 - `type: "redacted_thinking"`79417942 default: redacted_thinking79437944 - `data: string`79457946 The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.79477948 Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.79497950 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.79517952 - `ToolUseBlock object`79537954 - `type: "tool_use"`79557956 default: tool_use79577958 - `id: string`79597960 pattern: ^[a-zA-Z0-9_-]+$79617962 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`79637964 default: {"type":"direct"}79657966 - `DirectCaller object`79677968 Tool invocation directly from the model.79697970 - `type: "direct"`79717972 - `ServerToolCaller object`79737974 Tool invocation generated by a server-side tool.79757976 - `type: "code_execution_20250825"`79777978 - `tool_id: string`79797980 pattern: ^srvtoolu_[a-zA-Z0-9_]+$79817982 - `ServerToolCaller20260120 object`79837984 - `type: "code_execution_20260120"`79857986 - `tool_id: string`79877988 pattern: ^srvtoolu_[a-zA-Z0-9_]+$79897990 - `input: map[unknown]`79917992 - `name: string`79937994 minLength: 179957996 - `toolset_name: optional string or null`79977998 For a toolset member tool_use, the toolset family.79998000 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$80018002 - `ServerToolUseBlock object`80038004 - `type: "server_tool_use"`80058006 default: server_tool_use80078008 - `id: string`80098010 pattern: ^srvtoolu_[a-zA-Z0-9_]+$80118012 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`80138014 default: {"type":"direct"}80158016 - `DirectCaller object`80178018 Tool invocation directly from the model.80198020 - `ServerToolCaller object`80218022 Tool invocation generated by a server-side tool.80238024 - `ServerToolCaller20260120 object`80258026 - `input: map[unknown]`80278028 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`80298030 - `"web_search"`80318032 - `"web_fetch"`80338034 - `"code_execution"`80358036 - `"bash_code_execution"`80378038 - `"text_editor_code_execution"`80398040 - `"tool_search_tool_regex"`80418042 - `"tool_search_tool_bm25"`80438044 - `WebSearchToolResultBlock object`80458046 - `type: "web_search_tool_result"`80478048 default: web_search_tool_result80498050 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`80518052 default: {"type":"direct"}80538054 - `DirectCaller object`80558056 Tool invocation directly from the model.80578058 - `ServerToolCaller object`80598060 Tool invocation generated by a server-side tool.80618062 - `ServerToolCaller20260120 object`80638064 - `content: WebSearchToolResultBlockContent`80658066 - `WebSearchToolResultError object`80678068 - `type: "web_search_tool_result_error"`80698070 default: web_search_tool_result_error80718072 - `error_code: WebSearchToolResultErrorCode`80738074 - `"invalid_tool_input"`80758076 - `"unavailable"`80778078 - `"max_uses_exceeded"`80798080 - `"too_many_requests"`80818082 - `"query_too_long"`80838084 - `"request_too_large"`80858086 - `array of WebSearchResultBlock`80878088 - `type: "web_search_result"`80898090 default: web_search_result80918092 - `encrypted_content: string`80938094 - `page_age: string or null`80958096 - `title: string`80978098 - `url: string`80998100 - `tool_use_id: string`81018102 pattern: ^srvtoolu_[a-zA-Z0-9_]+$81038104 - `WebFetchToolResultBlock object`81058106 - `type: "web_fetch_tool_result"`81078108 default: web_fetch_tool_result81098110 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`81118112 default: {"type":"direct"}81138114 - `DirectCaller object`81158116 Tool invocation directly from the model.81178118 - `ServerToolCaller object`81198120 Tool invocation generated by a server-side tool.81218122 - `ServerToolCaller20260120 object`81238124 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`81258126 - `WebFetchToolResultErrorBlock object`81278128 - `type: "web_fetch_tool_result_error"`81298130 default: web_fetch_tool_result_error81318132 - `error_code: WebFetchToolResultErrorCode`81338134 - `"invalid_tool_input"`81358136 - `"url_too_long"`81378138 - `"url_not_allowed"`81398140 - `"url_not_in_prior_context"`81418142 - `"url_not_accessible"`81438144 - `"unsupported_content_type"`81458146 - `"too_many_requests"`81478148 - `"max_uses_exceeded"`81498150 - `"unavailable"`81518152 - `"content_too_large"`81538154 - `WebFetchBlock object`81558156 - `type: "web_fetch_result"`81578158 default: web_fetch_result81598160 - `content: DocumentBlock`81618162 - `type: "document"`81638164 default: document81658166 - `citations: CitationsConfig or null`81678168 Citation configuration for the document81698170 - `enabled: boolean`81718172 default: false81738174 - `source: Base64PDFSource or PlainTextSource`81758176 - `Base64PDFSource object`81778178 - `type: "base64"`81798180 - `data: string`81818182 format: byte81838184 - `media_type: "application/pdf"`81858186 - `PlainTextSource object`81878188 - `type: "text"`81898190 - `data: string`81918192 - `media_type: "text/plain"`81938194 - `title: string or null`81958196 The title of the document81978198 - `retrieved_at: string or null`81998200 ISO 8601 timestamp when the content was retrieved82018202 - `url: string`82038204 Fetched content URL82058206 - `tool_use_id: string`82078208 pattern: ^srvtoolu_[a-zA-Z0-9_]+$82098210 - `CodeExecutionToolResultBlock object`82118212 - `type: "code_execution_tool_result"`82138214 default: code_execution_tool_result82158216 - `content: CodeExecutionToolResultBlockContent`82178218 - `CodeExecutionToolResultError object`82198220 - `type: "code_execution_tool_result_error"`82218222 default: code_execution_tool_result_error82238224 - `error_code: CodeExecutionToolResultErrorCode`82258226 - `"invalid_tool_input"`82278228 - `"unavailable"`82298230 - `"too_many_requests"`82318232 - `"execution_time_exceeded"`82338234 - `CodeExecutionResultBlock object`82358236 - `type: "code_execution_result"`82378238 default: code_execution_result82398240 - `content: array of CodeExecutionOutputBlock`82418242 - `type: "code_execution_output"`82438244 default: code_execution_output82458246 - `file_id: string`82478248 - `return_code: number`82498250 - `stderr: string`82518252 - `stdout: string`82538254 - `EncryptedCodeExecutionResultBlock object`82558256 Code execution result with encrypted stdout for PFC + web_search results.82578258 - `type: "encrypted_code_execution_result"`82598260 default: encrypted_code_execution_result82618262 - `content: array of CodeExecutionOutputBlock`82638264 - `type: "code_execution_output"`82658266 default: code_execution_output82678268 - `file_id: string`82698270 - `encrypted_stdout: string`82718272 - `return_code: number`82738274 - `stderr: string`82758276 - `tool_use_id: string`82778278 pattern: ^srvtoolu_[a-zA-Z0-9_]+$82798280 - `BashCodeExecutionToolResultBlock object`82818282 - `type: "bash_code_execution_tool_result"`82838284 default: bash_code_execution_tool_result82858286 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`82878288 - `BashCodeExecutionToolResultError object`82898290 - `type: "bash_code_execution_tool_result_error"`82918292 default: bash_code_execution_tool_result_error82938294 - `error_code: BashCodeExecutionToolResultErrorCode`82958296 - `"invalid_tool_input"`82978298 - `"unavailable"`82998300 - `"too_many_requests"`83018302 - `"execution_time_exceeded"`83038304 - `"output_file_too_large"`83058306 - `BashCodeExecutionResultBlock object`83078308 - `type: "bash_code_execution_result"`83098310 default: bash_code_execution_result83118312 - `content: array of BashCodeExecutionOutputBlock`83138314 - `type: "bash_code_execution_output"`83158316 default: bash_code_execution_output83178318 - `file_id: string`83198320 - `return_code: number`83218322 - `stderr: string`83238324 - `stdout: string`83258326 - `tool_use_id: string`83278328 pattern: ^srvtoolu_[a-zA-Z0-9_]+$83298330 - `TextEditorCodeExecutionToolResultBlock object`83318332 - `type: "text_editor_code_execution_tool_result"`83338334 default: text_editor_code_execution_tool_result83358336 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`83378338 - `TextEditorCodeExecutionToolResultError object`83398340 - `type: "text_editor_code_execution_tool_result_error"`83418342 default: text_editor_code_execution_tool_result_error83438344 - `error_code: TextEditorCodeExecutionToolResultErrorCode`83458346 - `"invalid_tool_input"`83478348 - `"unavailable"`83498350 - `"too_many_requests"`83518352 - `"execution_time_exceeded"`83538354 - `"file_not_found"`83558356 - `error_message: string or null`83578358 - `TextEditorCodeExecutionViewResultBlock object`83598360 - `type: "text_editor_code_execution_view_result"`83618362 default: text_editor_code_execution_view_result83638364 - `content: string`83658366 - `file_type: "text" or "image" or "pdf"`83678368 - `"text"`83698370 - `"image"`83718372 - `"pdf"`83738374 - `num_lines: number or null`83758376 - `start_line: number or null`83778378 - `total_lines: number or null`83798380 - `TextEditorCodeExecutionCreateResultBlock object`83818382 - `type: "text_editor_code_execution_create_result"`83838384 default: text_editor_code_execution_create_result83858386 - `is_file_update: boolean`83878388 - `TextEditorCodeExecutionStrReplaceResultBlock object`83898390 - `type: "text_editor_code_execution_str_replace_result"`83918392 default: text_editor_code_execution_str_replace_result83938394 - `lines: array of string or null`83958396 - `new_lines: number or null`83978398 - `new_start: number or null`83998400 - `old_lines: number or null`84018402 - `old_start: number or null`84038404 - `tool_use_id: string`84058406 pattern: ^srvtoolu_[a-zA-Z0-9_]+$84078408 - `ToolSearchToolResultBlock object`84098410 - `type: "tool_search_tool_result"`84118412 default: tool_search_tool_result84138414 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`84158416 - `ToolSearchToolResultError object`84178418 - `type: "tool_search_tool_result_error"`84198420 default: tool_search_tool_result_error84218422 - `error_code: ToolSearchToolResultErrorCode`84238424 - `"invalid_tool_input"`84258426 - `"unavailable"`84278428 - `"too_many_requests"`84298430 - `"execution_time_exceeded"`84318432 - `error_message: string or null`84338434 - `ToolSearchToolSearchResultBlock object`84358436 - `type: "tool_search_tool_search_result"`84378438 default: tool_search_tool_search_result84398440 - `tool_references: array of ToolReferenceBlock`84418442 - `type: "tool_reference"`84438444 default: tool_reference84458446 - `tool_name: string`84478448 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$84498450 - `tool_use_id: string`84518452 pattern: ^srvtoolu_[a-zA-Z0-9_]+$84538454 - `ContainerUploadBlock object`84558456 Response model for a file uploaded to the container.84578458 - `type: "container_upload"`84598460 default: container_upload84618462 - `file_id: string`84638464 - `model: Model`84658466 The model that will complete your prompt.84678468 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.84698470 - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`84718472 The model that will complete your prompt.84738474 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.84758476 - `"claude-fable-5-1"`84778478 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows84798480 - `"claude-mythos-5-1"`84818482 Our most capable model for cybersecurity and biology research, available through trusted access programs84838484 - `"claude-sonnet-5"`84858486 High-performance model for coding and agents84878488 - `"claude-fable-5"`84898490 Next generation of intelligence for the hardest knowledge work and coding problems84918492 - `"claude-mythos-5"`84938494 Most capable model for cybersecurity and biology research84958496 - `"claude-opus-5"`84978498 Powerful intelligence for long-running agents and coding84998500 - `"claude-opus-4-8"`85018502 Powerful intelligence for long-running agents and coding85038504 - `"claude-opus-4-7"`85058506 Powerful intelligence for long-running agents and coding85078508 - `"claude-mythos-preview"`85098510 New class of intelligence, strongest in coding and cybersecurity85118512 - `"claude-opus-4-6"`85138514 Powerful intelligence for long-running agents and coding85158516 - `"claude-sonnet-4-6"`85178518 Best combination of speed and intelligence85198520 - `"claude-haiku-4-5"`85218522 Fastest model with near-frontier intelligence85238524 - `"claude-haiku-4-5-20251001"`85258526 Fastest model with near-frontier intelligence85278528 - `"claude-opus-4-5"`85298530 Powerful intelligence for long-running agents and coding85318532 - `"claude-opus-4-5-20251101"`85338534 Powerful intelligence for long-running agents and coding85358536 - `"claude-sonnet-4-5"`85378538 High-performance model for agents and coding85398540 - `"claude-sonnet-4-5-20250929"`85418542 High-performance model for agents and coding85438544 - `string`85458546 - `role: "assistant"`85478548 Conversational role of the generated message.85498550 This will always be `"assistant"`.85518552 default: assistant85538554 - `stop_details: RefusalStopDetails or null`85558556 Structured information about a refusal.85578558 - `type: "refusal"`85598560 default: refusal85618562 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`85638564 The policy category that triggered a refusal.85658566 - `"cyber"`85678568 The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.85698570 - `"bio"`85718572 The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.85738574 - `"frontier_llm"`85758576 The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.85778578 - `"reasoning_extraction"`85798580 The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking).85818582 - `"general_harms"`85838584 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.85858586 - `explanation: string or null`85878588 Human-readable explanation of the refusal.85898590 This text is not guaranteed to be stable. `null` when no explanation is available for the category.85918592 - `stop_reason: StopReason or null`85938594 The reason that we stopped.85958596 This may be one the following values:85978598 * `"end_turn"`: the model reached a natural stopping point8599 * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum8600 * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated8601 * `"tool_use"`: the model invoked one or more tools8602 * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.8603 * `"refusal"`: when streaming classifiers intervene to handle potential policy violations8604 * `"model_context_window_exceeded"`: we exceeded the model's context window86058606 In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.86078608 - `"end_turn"`86098610 - `"max_tokens"`86118612 - `"stop_sequence"`86138614 - `"tool_use"`86158616 - `"pause_turn"`86178618 - `"refusal"`86198620 - `"model_context_window_exceeded"`86218622 - `stop_sequence: string or null`86238624 Which custom stop sequence was generated, if any.86258626 This value will be a non-null string if one of your custom stop sequences was generated.86278628 - `usage: Usage`86298630 Billing and rate-limit usage.86318632 Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.86338634 Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.86358636 For example, `output_tokens` will be non-zero, even for an empty string response from Claude.86378638 Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.86398640 - `cache_creation: CacheCreation or null`86418642 Breakdown of cached tokens by TTL86438644 - `ephemeral_1h_input_tokens: number`86458646 The number of input tokens used to create the 1 hour cache entry.86478648 default: 0, minimum: 086498650 - `ephemeral_5m_input_tokens: number`86518652 The number of input tokens used to create the 5 minute cache entry.86538654 default: 0, minimum: 086558656 - `cache_creation_input_tokens: number or null`86578658 The number of input tokens used to create the cache entry.86598660 minimum: 086618662 - `cache_read_input_tokens: number or null`86638664 The number of input tokens read from the cache.86658666 minimum: 086678668 - `inference_geo: string or null`86698670 The geographic region where inference was performed for this request.86718672 - `input_tokens: number`86738674 The number of input tokens which were used.86758676 minimum: 086778678 - `output_tokens: number`86798680 The number of output tokens which were used.86818682 minimum: 086838684 - `output_tokens_details: OutputTokensDetails or null`86858686 Breakdown of output tokens by category.86878688 `output_tokens` remains the inclusive, authoritative total used for billing.8689 This object provides a read-only decomposition for observability — for example,8690 how many of the billed output tokens were spent on internal reasoning that may8691 have been summarized before being returned to you.86928693 - `thinking_tokens: number`86948695 Number of output tokens the model generated as internal reasoning, including8696 the thinking-block delimiter tokens.86978698 Reflects the raw reasoning the model produced, not the (possibly shorter)8699 summarized thinking text returned in the response body. Computed by8700 re-tokenizing the raw reasoning text, so it may differ from the model's exact8701 generation count by a small number of tokens. Always ≤ `output_tokens`;8702 `output_tokens - thinking_tokens` approximates the non-reasoning output.87038704 default: 0, minimum: 087058706 - `server_tool_use: ServerToolUsage or null`87078708 The number of server tool requests.87098710 - `web_fetch_requests: number`87118712 The number of web fetch tool requests.87138714 default: 0, minimum: 087158716 - `web_search_requests: number`87178718 The number of web search tool requests.87198720 default: 0, minimum: 087218722 - `service_tier: "standard" or "priority" or "batch" or null`87238724 If the request used the priority, standard, or batch tier.87258726 - `"standard"`87278728 - `"priority"`87298730 - `"batch"`8731