Repository Public
1---2title: Create a Message3url: https://platform.claude.com/docs/en/api/messages/create4---56# Create a Message78**POST** `/v1/messages`910Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.1112The Messages API can be used for either single queries or stateless multi-turn conversations.1314Learn more about the Messages API in our [user guide](https://platform.claude.com/docs/en/get-started)1516## Headers1718- `"anthropic-user-profile-id": optional string`1920 The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.2122- `"anthropic-workspace-id": optional string`2324## Body parameters2526- `max_tokens: number`2728 The maximum number of tokens to generate before stopping.2930 Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.3132 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.3334 Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.3536 minimum: 03738- `messages: array of MessageParam`3940 Input messages.4142 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.4344 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.4546 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.4748 Example with a single `user` message:4950 ```json51 [{"role": "user", "content": "Hello, Claude"}]52 ```5354 Example with multiple conversational turns:5556 ```json57 [58 {"role": "user", "content": "Hello there."},59 {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},60 {"role": "user", "content": "Can you explain LLMs in plain English?"},61 ]62 ```6364 Example with a partially-filled response from Claude:6566 ```json67 [68 {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},69 {"role": "assistant", "content": "The best answer is ("},70 ]71 ```7273 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:7475 ```json76 {"role": "user", "content": "Hello, Claude"}77 ```7879 ```json80 {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}81 ```8283 See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).8485 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.8687 There is a limit of 100,000 messages in a single request.8889 - `content: string or array of ContentBlockParam`9091 - `string`9293 - `array of ContentBlockParam`9495 - `TextBlockParam object`9697 - `type: "text"`9899 - `text: string`100101 minLength: 1102103 - `cache_control: optional CacheControlEphemeral or null`104105 Create a cache control breakpoint at this content block.106107 - `type: "ephemeral"`108109 - `ttl: optional "5m" or "1h"`110111 The time-to-live for the cache control breakpoint.112113 This may be one the following values:114115 - `5m`: 5 minutes116 - `1h`: 1 hour117118 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.119120 - `"5m"`121122 - `"1h"`123124 - `citations: optional array of TextCitationParam or null`125126 - `CitationCharLocationParam object`127128 - `type: "char_location"`129130 - `cited_text: string`131132 - `document_index: number`133134 minimum: 0135136 - `document_title: string or null`137138 maxLength: 500, minLength: 1139140 - `end_char_index: number`141142 - `start_char_index: number`143144 minimum: 0145146 - `CitationPageLocationParam object`147148 - `type: "page_location"`149150 - `cited_text: string`151152 - `document_index: number`153154 minimum: 0155156 - `document_title: string or null`157158 maxLength: 500, minLength: 1159160 - `end_page_number: number`161162 - `start_page_number: number`163164 minimum: 1165166 - `CitationContentBlockLocationParam object`167168 - `type: "content_block_location"`169170 - `cited_text: string`171172 The full text of the cited block range, concatenated.173174 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.175176 - `document_index: number`177178 minimum: 0179180 - `document_title: string or null`181182 maxLength: 500, minLength: 1183184 - `end_block_index: number`185186 Exclusive 0-based end index of the cited block range in the source's `content` array.187188 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.189190 - `start_block_index: number`191192 0-based index of the first cited block in the source's `content` array.193194 minimum: 0195196 - `CitationWebSearchResultLocationParam object`197198 - `type: "web_search_result_location"`199200 - `cited_text: string`201202 - `encrypted_index: string`203204 - `title: string or null`205206 maxLength: 512, minLength: 1207208 - `url: string`209210 minLength: 1211212 - `CitationSearchResultLocationParam object`213214 - `type: "search_result_location"`215216 - `cited_text: string`217218 The full text of the cited block range, concatenated.219220 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.221222 - `end_block_index: number`223224 Exclusive 0-based end index of the cited block range in the source's `content` array.225226 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.227228 - `search_result_index: number`229230 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.231232 Counted separately from `document_index`; server-side web search results are not included in this count.233234 minimum: 0235236 - `source: string`237238 - `start_block_index: number`239240 0-based index of the first cited block in the source's `content` array.241242 minimum: 0243244 - `title: string or null`245246 - `ImageBlockParam object`247248 - `type: "image"`249250 - `source: Base64ImageSource or URLImageSource or FileImageSource`251252 - `Base64ImageSource object`253254 - `type: "base64"`255256 - `data: string`257258 format: byte259260 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`261262 - `"image/jpeg"`263264 - `"image/png"`265266 - `"image/gif"`267268 - `"image/webp"`269270 - `URLImageSource object`271272 - `type: "url"`273274 - `url: string`275276 - `FileImageSource object`277278 - `type: "file"`279280 - `file_id: string`281282 - `cache_control: optional CacheControlEphemeral or null`283284 Create a cache control breakpoint at this content block.285286 - `transformations: optional ImageTransformationsParam or null`287288 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.289290 - `oversized_image: optional "downsize" or "error"`291292 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.293294 - `"downsize"`295296 - `"error"`297298 - `DocumentBlockParam object`299300 - `type: "document"`301302 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`303304 - `Base64PDFSource object`305306 - `type: "base64"`307308 - `data: string`309310 format: byte311312 - `media_type: "application/pdf"`313314 - `PlainTextSource object`315316 - `type: "text"`317318 - `data: string`319320 - `media_type: "text/plain"`321322 - `ContentBlockSource object`323324 - `type: "content"`325326 - `content: string or array of ContentBlockSourceContent`327328 - `string`329330 - `ContentBlockSourceContent = array of ContentBlockSourceContent`331332 - `TextBlockParam object`333334 - `ImageBlockParam object`335336 - `URLPDFSource object`337338 - `type: "url"`339340 - `url: string`341342 - `FileDocumentSource object`343344 - `type: "file"`345346 - `file_id: string`347348 - `cache_control: optional CacheControlEphemeral or null`349350 Create a cache control breakpoint at this content block.351352 - `citations: optional CitationsConfigParam or null`353354 - `enabled: optional boolean`355356 - `context: optional string or null`357358 minLength: 1359360 - `title: optional string or null`361362 maxLength: 500, minLength: 1363364 - `SearchResultBlockParam object`365366 - `type: "search_result"`367368 - `content: array of TextBlockParam`369370 - `type: "text"`371372 - `text: string`373374 minLength: 1375376 - `cache_control: optional CacheControlEphemeral or null`377378 Create a cache control breakpoint at this content block.379380 - `citations: optional array of TextCitationParam or null`381382 - `source: string`383384 - `title: string`385386 - `cache_control: optional CacheControlEphemeral or null`387388 Create a cache control breakpoint at this content block.389390 - `citations: optional CitationsConfigParam`391392 - `ThinkingBlockParam object`393394 - `type: "thinking"`395396 - `signature: string`397398 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.399400 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.401402 - `thinking: string`403404 The `thinking` text of this block as returned by the API.405406 - `RedactedThinkingBlockParam object`407408 - `type: "redacted_thinking"`409410 - `data: string`411412 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.413414 - `ToolUseBlockParam object`415416 - `type: "tool_use"`417418 - `id: string`419420 pattern: ^[a-zA-Z0-9_-]+$421422 - `input: map[unknown]`423424 - `name: string`425426 maxLength: 200, minLength: 1427428 - `cache_control: optional CacheControlEphemeral or null`429430 Create a cache control breakpoint at this content block.431432 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`433434 - `DirectCaller object`435436 Tool invocation directly from the model.437438 - `type: "direct"`439440 - `ServerToolCaller object`441442 Tool invocation generated by a server-side tool.443444 - `type: "code_execution_20250825"`445446 - `tool_id: string`447448 pattern: ^srvtoolu_[a-zA-Z0-9_]+$449450 - `ServerToolCaller20260120 object`451452 - `type: "code_execution_20260120"`453454 - `tool_id: string`455456 pattern: ^srvtoolu_[a-zA-Z0-9_]+$457458 - `toolset_name: optional string or null`459460 For a toolset member tool_use, the toolset family this member belongs to.461462 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$463464 - `ToolResultBlockParam object`465466 - `type: "tool_result"`467468 - `tool_use_id: string`469470 pattern: ^[a-zA-Z0-9_-]+$471472 - `cache_control: optional CacheControlEphemeral or null`473474 Create a cache control breakpoint at this content block.475476 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`477478 - `string`479480 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`481482 - `TextBlockParam object`483484 - `ImageBlockParam object`485486 - `SearchResultBlockParam object`487488 - `DocumentBlockParam object`489490 - `ToolReferenceBlockParam object`491492 Tool reference block that can be included in tool_result content.493494 - `type: "tool_reference"`495496 - `tool_name: string`497498 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$499500 - `cache_control: optional CacheControlEphemeral or null`501502 Create a cache control breakpoint at this content block.503504 - `BrowserStateBlockParam object`505506 The caller's browser state after a browser toolset member call —507 the full inventory of open tabs, which tab is active, and any side508 effects (tabs opened, download state changes) the call produced.509510 At most one per `tool_result`, only on a non-error result answering a511 browser toolset member `tool_use`. The server renders the512 model-visible text from it; the model never sees the raw fields.513514 - `type: "browser_state"`515516 - `tabs: array of BrowserStateTabEntry`517518 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`.519520 maxItems: 100521522 - `tab_id: string`523524 The caller-assigned identifier for this tab, unique within the inventory.525526 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$527528 - `title: string`529530 The title of the page the tab is showing. May be empty.531532 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$533534 - `url: string`535536 The URL of the page the tab is showing. May be empty.537538 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$539540 - `active: optional boolean`541542 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.543544 - `cache_control: optional CacheControlEphemeral or null`545546 Create a cache control breakpoint at this content block.547548 - `state_changes: optional array of BrowserStateChange or null`549550 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.551552 maxItems: 200, minItems: 1553554 - `BrowserStateChangeTabOpened object`555556 A tab this call's execution opened that remains open at its end —557 the creation delta of the `tabs` inventory, not an event log.558559 Carries only the `tab_id`; the tab's `title` and `url` live on its560 `tabs` entry, which must include the same `tab_id`. A tab opened561 during a failed call gets no deferred `tab_opened`; it simply appears562 in the next result's `tabs` inventory.563564 - `type: "tab_opened"`565566 - `tab_id: string`567568 The `tab_id` of the opened tab, present in `tabs`.569570 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$571572 - `BrowserStateChangeDownloadStarted object`573574 A file download that started during this call.575576 - `type: "download_started"`577578 - `download_id: string`579580 The caller-assigned identifier for this download, stable across the state changes reporting it.581582 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$583584 - `url: string`585586 The final post-redirect URL the download was served from.587588 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$589590 - `BrowserStateChangeDownloadCompleted object`591592 A file download that finished during this call, reported with the593 same `download_id` as its `download_started` — or without a prior594 `download_started`, when the download finished during the call that595 started it (at most one state change per `download_id` per result).596597 - `type: "download_completed"`598599 - `download_id: string`600601 The caller-assigned identifier for this download, stable across the state changes reporting it.602603 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$604605 - `url: string`606607 The final post-redirect URL the download was served from.608609 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$610611 - `path: optional string or null`612613 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.614615 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096616617 - `size_bytes: optional number or null`618619 The completed download's size.620621 minimum: 0622623 - `BrowserStateChangeDownloadFailed object`624625 A file download that failed — or was cancelled — during this call.626627 - `type: "download_failed"`628629 - `download_id: string`630631 The caller-assigned identifier for this download, stable across the state changes reporting it.632633 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$634635 - `url: string`636637 The final post-redirect URL the download was served from.638639 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$640641 - `error: optional string or null`642643 The failure or cancellation detail, when known.644645 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096646647 - `is_error: optional boolean`648649 - `toolset_name: optional string or null`650651 For a toolset member tool_result, the toolset family of the paired tool_use.652653 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$654655 - `ServerToolUseBlockParam object`656657 - `type: "server_tool_use"`658659 - `id: string`660661 pattern: ^srvtoolu_[a-zA-Z0-9_]+$662663 - `input: map[unknown]`664665 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`666667 - `"web_search"`668669 - `"web_fetch"`670671 - `"code_execution"`672673 - `"bash_code_execution"`674675 - `"text_editor_code_execution"`676677 - `"tool_search_tool_regex"`678679 - `"tool_search_tool_bm25"`680681 - `cache_control: optional CacheControlEphemeral or null`682683 Create a cache control breakpoint at this content block.684685 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`686687 - `DirectCaller object`688689 Tool invocation directly from the model.690691 - `ServerToolCaller object`692693 Tool invocation generated by a server-side tool.694695 - `ServerToolCaller20260120 object`696697 - `WebSearchToolResultBlockParam object`698699 - `type: "web_search_tool_result"`700701 - `content: WebSearchToolResultBlockParamContent`702703 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`704705 - `type: "web_search_result"`706707 - `encrypted_content: string`708709 - `title: string`710711 - `url: string`712713 - `page_age: optional string or null`714715 - `WebSearchToolRequestError object`716717 - `type: "web_search_tool_result_error"`718719 - `error_code: WebSearchToolResultErrorCode`720721 - `"invalid_tool_input"`722723 - `"unavailable"`724725 - `"max_uses_exceeded"`726727 - `"too_many_requests"`728729 - `"query_too_long"`730731 - `"request_too_large"`732733 - `tool_use_id: string`734735 pattern: ^srvtoolu_[a-zA-Z0-9_]+$736737 - `cache_control: optional CacheControlEphemeral or null`738739 Create a cache control breakpoint at this content block.740741 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`742743 - `DirectCaller object`744745 Tool invocation directly from the model.746747 - `ServerToolCaller object`748749 Tool invocation generated by a server-side tool.750751 - `ServerToolCaller20260120 object`752753 - `WebFetchToolResultBlockParam object`754755 - `type: "web_fetch_tool_result"`756757 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`758759 - `WebFetchToolResultErrorBlockParam object`760761 - `type: "web_fetch_tool_result_error"`762763 - `error_code: WebFetchToolResultErrorCode`764765 - `"invalid_tool_input"`766767 - `"url_too_long"`768769 - `"url_not_allowed"`770771 - `"url_not_in_prior_context"`772773 - `"url_not_accessible"`774775 - `"unsupported_content_type"`776777 - `"too_many_requests"`778779 - `"max_uses_exceeded"`780781 - `"unavailable"`782783 - `"content_too_large"`784785 - `WebFetchBlockParam object`786787 - `type: "web_fetch_result"`788789 - `content: DocumentBlockParam`790791 - `url: string`792793 Fetched content URL794795 - `retrieved_at: optional string or null`796797 ISO 8601 timestamp when the content was retrieved798799 - `tool_use_id: string`800801 pattern: ^srvtoolu_[a-zA-Z0-9_]+$802803 - `cache_control: optional CacheControlEphemeral or null`804805 Create a cache control breakpoint at this content block.806807 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`808809 - `DirectCaller object`810811 Tool invocation directly from the model.812813 - `ServerToolCaller object`814815 Tool invocation generated by a server-side tool.816817 - `ServerToolCaller20260120 object`818819 - `CodeExecutionToolResultBlockParam object`820821 - `type: "code_execution_tool_result"`822823 - `content: CodeExecutionToolResultBlockParamContent`824825 - `CodeExecutionToolResultErrorParam object`826827 - `type: "code_execution_tool_result_error"`828829 - `error_code: CodeExecutionToolResultErrorCode`830831 - `"invalid_tool_input"`832833 - `"unavailable"`834835 - `"too_many_requests"`836837 - `"execution_time_exceeded"`838839 - `CodeExecutionResultBlockParam object`840841 - `type: "code_execution_result"`842843 - `content: array of CodeExecutionOutputBlockParam`844845 - `type: "code_execution_output"`846847 - `file_id: string`848849 - `return_code: number`850851 - `stderr: string`852853 - `stdout: string`854855 - `EncryptedCodeExecutionResultBlockParam object`856857 Code execution result with encrypted stdout for PFC + web_search results.858859 - `type: "encrypted_code_execution_result"`860861 - `content: array of CodeExecutionOutputBlockParam`862863 - `type: "code_execution_output"`864865 - `file_id: string`866867 - `encrypted_stdout: string`868869 - `return_code: number`870871 - `stderr: string`872873 - `tool_use_id: string`874875 pattern: ^srvtoolu_[a-zA-Z0-9_]+$876877 - `cache_control: optional CacheControlEphemeral or null`878879 Create a cache control breakpoint at this content block.880881 - `BashCodeExecutionToolResultBlockParam object`882883 - `type: "bash_code_execution_tool_result"`884885 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`886887 - `BashCodeExecutionToolResultErrorParam object`888889 - `type: "bash_code_execution_tool_result_error"`890891 - `error_code: BashCodeExecutionToolResultErrorCode`892893 - `"invalid_tool_input"`894895 - `"unavailable"`896897 - `"too_many_requests"`898899 - `"execution_time_exceeded"`900901 - `"output_file_too_large"`902903 - `BashCodeExecutionResultBlockParam object`904905 - `type: "bash_code_execution_result"`906907 - `content: array of BashCodeExecutionOutputBlockParam`908909 - `type: "bash_code_execution_output"`910911 - `file_id: string`912913 - `return_code: number`914915 - `stderr: string`916917 - `stdout: string`918919 - `tool_use_id: string`920921 pattern: ^srvtoolu_[a-zA-Z0-9_]+$922923 - `cache_control: optional CacheControlEphemeral or null`924925 Create a cache control breakpoint at this content block.926927 - `TextEditorCodeExecutionToolResultBlockParam object`928929 - `type: "text_editor_code_execution_tool_result"`930931 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`932933 - `TextEditorCodeExecutionToolResultErrorParam object`934935 - `type: "text_editor_code_execution_tool_result_error"`936937 - `error_code: TextEditorCodeExecutionToolResultErrorCode`938939 - `"invalid_tool_input"`940941 - `"unavailable"`942943 - `"too_many_requests"`944945 - `"execution_time_exceeded"`946947 - `"file_not_found"`948949 - `error_message: optional string or null`950951 - `TextEditorCodeExecutionViewResultBlockParam object`952953 - `type: "text_editor_code_execution_view_result"`954955 - `content: string`956957 - `file_type: "text" or "image" or "pdf"`958959 - `"text"`960961 - `"image"`962963 - `"pdf"`964965 - `num_lines: optional number or null`966967 - `start_line: optional number or null`968969 - `total_lines: optional number or null`970971 - `TextEditorCodeExecutionCreateResultBlockParam object`972973 - `type: "text_editor_code_execution_create_result"`974975 - `is_file_update: boolean`976977 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`978979 - `type: "text_editor_code_execution_str_replace_result"`980981 - `lines: optional array of string or null`982983 - `new_lines: optional number or null`984985 - `new_start: optional number or null`986987 - `old_lines: optional number or null`988989 - `old_start: optional number or null`990991 - `tool_use_id: string`992993 pattern: ^srvtoolu_[a-zA-Z0-9_]+$994995 - `cache_control: optional CacheControlEphemeral or null`996997 Create a cache control breakpoint at this content block.998999 - `ToolSearchToolResultBlockParam object`10001001 - `type: "tool_search_tool_result"`10021003 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`10041005 - `ToolSearchToolResultErrorParam object`10061007 - `type: "tool_search_tool_result_error"`10081009 - `error_code: ToolSearchToolResultErrorCode`10101011 - `"invalid_tool_input"`10121013 - `"unavailable"`10141015 - `"too_many_requests"`10161017 - `"execution_time_exceeded"`10181019 - `error_message: optional string or null`10201021 - `ToolSearchToolSearchResultBlockParam object`10221023 - `type: "tool_search_tool_search_result"`10241025 - `tool_references: array of ToolReferenceBlockParam`10261027 - `type: "tool_reference"`10281029 - `tool_name: string`10301031 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$10321033 - `cache_control: optional CacheControlEphemeral or null`10341035 Create a cache control breakpoint at this content block.10361037 - `tool_use_id: string`10381039 pattern: ^srvtoolu_[a-zA-Z0-9_]+$10401041 - `cache_control: optional CacheControlEphemeral or null`10421043 Create a cache control breakpoint at this content block.10441045 - `ContainerUploadBlockParam object`10461047 A content block that represents a file to be uploaded to the container1048 Files uploaded via this block will be available in the container's input directory.10491050 - `type: "container_upload"`10511052 - `file_id: string`10531054 - `cache_control: optional CacheControlEphemeral or null`10551056 Create a cache control breakpoint at this content block.10571058 - `role: "user" or "assistant" or "system"`10591060 - `"user"`10611062 - `"assistant"`10631064 - `"system"`10651066- `model: Model`10671068 The model that will complete your prompt.10691070 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.10711072 - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`10731074 The model that will complete your prompt.10751076 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.10771078 - `"claude-fable-5-1"`10791080 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows10811082 - `"claude-mythos-5-1"`10831084 Our most capable model for cybersecurity and biology research, available through trusted access programs10851086 - `"claude-sonnet-5"`10871088 High-performance model for coding and agents10891090 - `"claude-fable-5"`10911092 Next generation of intelligence for the hardest knowledge work and coding problems10931094 - `"claude-mythos-5"`10951096 Most capable model for cybersecurity and biology research10971098 - `"claude-opus-5"`10991100 Powerful intelligence for long-running agents and coding11011102 - `"claude-opus-4-8"`11031104 Powerful intelligence for long-running agents and coding11051106 - `"claude-opus-4-7"`11071108 Powerful intelligence for long-running agents and coding11091110 - `"claude-mythos-preview"`11111112 New class of intelligence, strongest in coding and cybersecurity11131114 - `"claude-opus-4-6"`11151116 Powerful intelligence for long-running agents and coding11171118 - `"claude-sonnet-4-6"`11191120 Best combination of speed and intelligence11211122 - `"claude-haiku-4-5"`11231124 Fastest model with near-frontier intelligence11251126 - `"claude-haiku-4-5-20251001"`11271128 Fastest model with near-frontier intelligence11291130 - `"claude-opus-4-5"`11311132 Powerful intelligence for long-running agents and coding11331134 - `"claude-opus-4-5-20251101"`11351136 Powerful intelligence for long-running agents and coding11371138 - `"claude-sonnet-4-5"`11391140 High-performance model for agents and coding11411142 - `"claude-sonnet-4-5-20250929"`11431144 High-performance model for agents and coding11451146 - `string`11471148- `cache_control: optional CacheControlEphemeral or null`11491150 Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.11511152- `container: optional MessageCreateParamsContainer or null`11531154 Container identifier for reuse across requests.11551156 - `ContainerParams object`11571158 Container parameters with skills to be loaded.11591160 - `id: optional string or null`11611162 Container id11631164 - `skills: optional array of SkillParams or null`11651166 List of skills to load in the container11671168 maxItems: 2011691170 - `type: "anthropic" or "custom"`11711172 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)11731174 - `"anthropic"`11751176 - `"custom"`11771178 - `skill_id: string`11791180 Skill ID11811182 maxLength: 64, minLength: 111831184 - `version: optional string`11851186 Skill version or 'latest' for most recent version11871188 maxLength: 64, minLength: 111891190 - `string`11911192- `inference_geo: optional string or null`11931194 Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.11951196- `metadata: optional Metadata`11971198 An object describing metadata about the request.11991200 - `user_id: optional string or null`12011202 An external identifier for the user who is associated with the request.12031204 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.12051206 maxLength: 51212071208- `output_config: optional OutputConfig`12091210 Configuration options for the model's output, such as the output format.12111212 - `effort: optional "low" or "medium" or "high" or 2 more or null`12131214 All possible effort levels.12151216 - `"low"`12171218 - `"medium"`12191220 - `"high"`12211222 - `"xhigh"`12231224 - `"max"`12251226 - `format: optional JSONOutputFormat or null`12271228 A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)12291230 - `type: "json_schema"`12311232 - `schema: map[unknown]`12331234 The JSON schema of the format12351236- `service_tier: optional "auto" or "standard_only"`12371238 Determines whether to use priority capacity (if available) or standard capacity for this request.12391240 Anthropic offers different levels of service for your API requests. See [service-tiers](https://platform.claude.com/docs/en/api/service-tiers) for details.12411242 - `"auto"`12431244 - `"standard_only"`12451246- `stop_sequences: optional array of string`12471248 Custom text sequences that will cause the model to stop generating.12491250 Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.12511252 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.12531254- `stream: optional boolean`12551256 Whether to incrementally stream the response using server-sent events.12571258 See [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming) for details.12591260- `system: optional string or array of TextBlockParam`12611262 System prompt.12631264 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).12651266 - `string`12671268 - `array of TextBlockParam`12691270 - `type: "text"`12711272 - `text: string`12731274 minLength: 112751276 - `cache_control: optional CacheControlEphemeral or null`12771278 Create a cache control breakpoint at this content block.12791280 - `citations: optional array of TextCitationParam or null`12811282- `thinking: optional ThinkingConfigParam`12831284 Configuration for enabling Claude's extended thinking.12851286 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.12871288 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.12891290 - `ThinkingConfigEnabled object`12911292 - `type: "enabled"`12931294 - `budget_tokens: number`12951296 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.12971298 Must be ≥1024 and less than `max_tokens`.12991300 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.13011302 minimum: 102413031304 - `display: optional "summarized" or "omitted" or null`13051306 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`.13071308 - `"summarized"`13091310 - `"omitted"`13111312 - `ThinkingConfigDisabled object`13131314 - `type: "disabled"`13151316 - `ThinkingConfigAdaptive object`13171318 - `type: "adaptive"`13191320 - `display: optional "summarized" or "omitted" or null`13211322 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`.13231324 - `"summarized"`13251326 - `"omitted"`13271328- `tool_choice: optional ToolChoice`13291330 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.13311332 - `ToolChoiceAuto object`13331334 The model will automatically decide whether to use tools.13351336 - `type: "auto"`13371338 - `disable_parallel_tool_use: optional boolean`13391340 Whether to disable parallel tool use.13411342 Defaults to `false`. If set to `true`, the model will output at most one tool use.13431344 - `ToolChoiceAny object`13451346 The model will use any available tools.13471348 - `type: "any"`13491350 - `disable_parallel_tool_use: optional boolean`13511352 Whether to disable parallel tool use.13531354 Defaults to `false`. If set to `true`, the model will output exactly one tool use.13551356 - `ToolChoiceTool object`13571358 The model will use the specified tool with `tool_choice.name`.13591360 - `type: "tool"`13611362 - `name: string`13631364 The name of the tool to use.13651366 - `disable_parallel_tool_use: optional boolean`13671368 Whether to disable parallel tool use.13691370 Defaults to `false`. If set to `true`, the model will output exactly one tool use.13711372 - `ToolChoiceNone object`13731374 The model will not be allowed to use tools.13751376 - `type: "none"`13771378- `tools: optional array of ToolUnion`13791380 Definitions of tools that the model may use.13811382 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.13831384 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)).13851386 Each tool definition includes:13871388 * `name`: Name of the tool.1389 * `description`: Optional, but strongly-recommended description of the tool.1390 * `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.13911392 For example, if you defined `tools` as:13931394 ```json1395 [1396 {1397 "name": "get_stock_price",1398 "description": "Get the current stock price for a given ticker symbol.",1399 "input_schema": {1400 "type": "object",1401 "properties": {1402 "ticker": {1403 "type": "string",1404 "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."1405 }1406 },1407 "required": ["ticker"]1408 }1409 }1410 ]1411 ```14121413 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:14141415 ```json1416 [1417 {1418 "type": "tool_use",1419 "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",1420 "name": "get_stock_price",1421 "input": { "ticker": "^GSPC" }1422 }1423 ]1424 ```14251426 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:14271428 ```json1429 [1430 {1431 "type": "tool_result",1432 "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",1433 "content": "259.75 USD"1434 }1435 ]1436 ```14371438 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.14391440 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.14411442 - `Tool object`14431444 - `type: optional "custom" or null`14451446 - `input_schema: object`14471448 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.14491450 This defines the shape of the `input` that your tool accepts and that the model will produce.14511452 - `type: "object"`14531454 - `properties: optional map[unknown] or null`14551456 - `required: optional array of string or null`14571458 - `name: string`14591460 Name of the tool.14611462 This is how the tool will be called by the model and in `tool_use` blocks.14631464 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$14651466 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`14671468 - `"direct"`14691470 - `"code_execution_20250825"`14711472 - `"code_execution_20260120"`14731474 - `"code_execution_20260521"`14751476 - `cache_control: optional CacheControlEphemeral or null`14771478 Create a cache control breakpoint at this content block.14791480 - `defer_loading: optional boolean`14811482 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.14831484 - `description: optional string`14851486 Description of what this tool does.14871488 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.14891490 - `eager_input_streaming: optional boolean or null`14911492 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.14931494 - `input_examples: optional array of map[unknown]`14951496 - `strict: optional boolean`14971498 When true, guarantees schema validation on tool names and inputs14991500 - `ToolBash20250124 object`15011502 - `type: "bash_20250124"`15031504 - `name: "bash"`15051506 Name of the tool.15071508 This is how the tool will be called by the model and in `tool_use` blocks.15091510 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15111512 - `"direct"`15131514 - `"code_execution_20250825"`15151516 - `"code_execution_20260120"`15171518 - `"code_execution_20260521"`15191520 - `cache_control: optional CacheControlEphemeral or null`15211522 Create a cache control breakpoint at this content block.15231524 - `defer_loading: optional boolean`15251526 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15271528 - `input_examples: optional array of map[unknown]`15291530 - `strict: optional boolean`15311532 When true, guarantees schema validation on tool names and inputs15331534 - `CodeExecutionTool20250522 object`15351536 - `type: "code_execution_20250522"`15371538 - `name: "code_execution"`15391540 Name of the tool.15411542 This is how the tool will be called by the model and in `tool_use` blocks.15431544 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15451546 - `"direct"`15471548 - `"code_execution_20250825"`15491550 - `"code_execution_20260120"`15511552 - `"code_execution_20260521"`15531554 - `cache_control: optional CacheControlEphemeral or null`15551556 Create a cache control breakpoint at this content block.15571558 - `defer_loading: optional boolean`15591560 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15611562 - `strict: optional boolean`15631564 When true, guarantees schema validation on tool names and inputs15651566 - `CodeExecutionTool20250825 object`15671568 - `type: "code_execution_20250825"`15691570 - `name: "code_execution"`15711572 Name of the tool.15731574 This is how the tool will be called by the model and in `tool_use` blocks.15751576 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`15771578 - `"direct"`15791580 - `"code_execution_20250825"`15811582 - `"code_execution_20260120"`15831584 - `"code_execution_20260521"`15851586 - `cache_control: optional CacheControlEphemeral or null`15871588 Create a cache control breakpoint at this content block.15891590 - `defer_loading: optional boolean`15911592 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.15931594 - `strict: optional boolean`15951596 When true, guarantees schema validation on tool names and inputs15971598 - `CodeExecutionTool20260120 object`15991600 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).16011602 - `type: "code_execution_20260120"`16031604 - `name: "code_execution"`16051606 Name of the tool.16071608 This is how the tool will be called by the model and in `tool_use` blocks.16091610 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`16111612 - `"direct"`16131614 - `"code_execution_20250825"`16151616 - `"code_execution_20260120"`16171618 - `"code_execution_20260521"`16191620 - `cache_control: optional CacheControlEphemeral or null`16211622 Create a cache control breakpoint at this content block.16231624 - `defer_loading: optional boolean`16251626 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.16271628 - `strict: optional boolean`16291630 When true, guarantees schema validation on tool names and inputs16311632 - `CodeExecutionTool20260521 object`16331634 Code execution tool with REPL state persistence.16351636 - `type: "code_execution_20260521"`16371638 - `name: "code_execution"`16391640 Name of the tool.16411642 This is how the tool will be called by the model and in `tool_use` blocks.16431644 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`16451646 - `"direct"`16471648 - `"code_execution_20250825"`16491650 - `"code_execution_20260120"`16511652 - `"code_execution_20260521"`16531654 - `cache_control: optional CacheControlEphemeral or null`16551656 Create a cache control breakpoint at this content block.16571658 - `defer_loading: optional boolean`16591660 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.16611662 - `strict: optional boolean`16631664 When true, guarantees schema validation on tool names and inputs16651666 - `BrowserToolset20260801 object`16671668 The browser toolset: a single `tools[]` entry (carrying no1669 `name`) that declares the browser tool family. The model is served1670 the family's tool with any members disabled via `configs` removed1671 from its schema.16721673 - `type: "browser_toolset_20260801"`16741675 - `cache_control: optional CacheControlEphemeral or null`16761677 Create a cache control breakpoint at this content block.16781679 - `configs: optional BrowserToolsetConfigs or null`16801681 Per-member configuration for `browser_toolset_20260801`: one1682 optional field per member tool, keyed by the member name — the same1683 name the member's `tool_use` blocks carry. Every member is an1684 accepted key, and a member's defaults apply wherever its key is1685 absent. Unknown keys are rejected: the field set is this toolset1686 version's complete member set.16871688 - `type: optional BrowserTypeConfig or null`16891690 `type`'s config overrides.16911692 - `defer_loading: optional boolean or null`16931694 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.16951696 - `enabled: optional boolean or null`16971698 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.16991700 - `close_tab: optional BrowserCloseTabConfig or null`17011702 `close_tab`'s config overrides.17031704 - `defer_loading: optional boolean or null`17051706 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17071708 - `enabled: optional boolean or null`17091710 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.17111712 - `double_click: optional BrowserDoubleClickConfig or null`17131714 `double_click`'s config overrides.17151716 - `defer_loading: optional boolean or null`17171718 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17191720 - `enabled: optional boolean or null`17211722 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.17231724 - `file_upload: optional BrowserFileUploadConfig or null`17251726 `file_upload`'s config overrides.17271728 - `defer_loading: optional boolean or null`17291730 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17311732 - `enabled: optional boolean or null`17331734 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.17351736 - `find: optional BrowserFindConfig or null`17371738 `find`'s config overrides.17391740 - `defer_loading: optional boolean or null`17411742 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17431744 - `enabled: optional boolean or null`17451746 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.17471748 - `form_input: optional BrowserFormInputConfig or null`17491750 `form_input`'s config overrides.17511752 - `defer_loading: optional boolean or null`17531754 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17551756 - `enabled: optional boolean or null`17571758 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.17591760 - `get_page_text: optional BrowserGetPageTextConfig or null`17611762 `get_page_text`'s config overrides.17631764 - `defer_loading: optional boolean or null`17651766 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17671768 - `enabled: optional boolean or null`17691770 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.17711772 - `hold_key: optional BrowserHoldKeyConfig or null`17731774 `hold_key`'s config overrides.17751776 - `defer_loading: optional boolean or null`17771778 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17791780 - `enabled: optional boolean or null`17811782 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.17831784 - `hover: optional BrowserHoverConfig or null`17851786 `hover`'s config overrides.17871788 - `defer_loading: optional boolean or null`17891790 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.17911792 - `enabled: optional boolean or null`17931794 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.17951796 - `javascript_exec: optional BrowserJavascriptExecConfig or null`17971798 `javascript_exec`'s config overrides.17991800 - `defer_loading: optional boolean or null`18011802 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18031804 - `enabled: optional boolean or null`18051806 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.18071808 - `key: optional BrowserKeyConfig or null`18091810 `key`'s config overrides.18111812 - `defer_loading: optional boolean or null`18131814 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18151816 - `enabled: optional boolean or null`18171818 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.18191820 - `left_click: optional BrowserLeftClickConfig or null`18211822 `left_click`'s config overrides.18231824 - `defer_loading: optional boolean or null`18251826 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18271828 - `enabled: optional boolean or null`18291830 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.18311832 - `left_click_drag: optional BrowserLeftClickDragConfig or null`18331834 `left_click_drag`'s config overrides.18351836 - `defer_loading: optional boolean or null`18371838 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18391840 - `enabled: optional boolean or null`18411842 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.18431844 - `left_mouse_down: optional BrowserLeftMouseDownConfig or null`18451846 `left_mouse_down`'s config overrides.18471848 - `defer_loading: optional boolean or null`18491850 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18511852 - `enabled: optional boolean or null`18531854 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.18551856 - `left_mouse_up: optional BrowserLeftMouseUpConfig or null`18571858 `left_mouse_up`'s config overrides.18591860 - `defer_loading: optional boolean or null`18611862 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18631864 - `enabled: optional boolean or null`18651866 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.18671868 - `list_tabs: optional BrowserListTabsConfig or null`18691870 `list_tabs`'s config overrides.18711872 - `defer_loading: optional boolean or null`18731874 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18751876 - `enabled: optional boolean or null`18771878 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.18791880 - `middle_click: optional BrowserMiddleClickConfig or null`18811882 `middle_click`'s config overrides.18831884 - `defer_loading: optional boolean or null`18851886 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18871888 - `enabled: optional boolean or null`18891890 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.18911892 - `mouse_move: optional BrowserMouseMoveConfig or null`18931894 `mouse_move`'s config overrides.18951896 - `defer_loading: optional boolean or null`18971898 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.18991900 - `enabled: optional boolean or null`19011902 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.19031904 - `navigate: optional BrowserNavigateConfig or null`19051906 `navigate`'s config overrides.19071908 - `defer_loading: optional boolean or null`19091910 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19111912 - `enabled: optional boolean or null`19131914 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.19151916 - `new_tab: optional BrowserNewTabConfig or null`19171918 `new_tab`'s config overrides.19191920 - `defer_loading: optional boolean or null`19211922 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19231924 - `enabled: optional boolean or null`19251926 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.19271928 - `read_console: optional BrowserReadConsoleConfig or null`19291930 `read_console`'s config overrides.19311932 - `defer_loading: optional boolean or null`19331934 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19351936 - `enabled: optional boolean or null`19371938 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.19391940 - `read_network: optional BrowserReadNetworkConfig or null`19411942 `read_network`'s config overrides.19431944 - `defer_loading: optional boolean or null`19451946 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19471948 - `enabled: optional boolean or null`19491950 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.19511952 - `read_page: optional BrowserReadPageConfig or null`19531954 `read_page`'s config overrides.19551956 - `defer_loading: optional boolean or null`19571958 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19591960 - `enabled: optional boolean or null`19611962 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.19631964 - `right_click: optional BrowserRightClickConfig or null`19651966 `right_click`'s config overrides.19671968 - `defer_loading: optional boolean or null`19691970 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19711972 - `enabled: optional boolean or null`19731974 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.19751976 - `screenshot: optional BrowserScreenshotConfig or null`19771978 `screenshot`'s config overrides.19791980 - `defer_loading: optional boolean or null`19811982 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19831984 - `enabled: optional boolean or null`19851986 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.19871988 - `scroll: optional BrowserScrollConfig or null`19891990 `scroll`'s config overrides.19911992 - `defer_loading: optional boolean or null`19931994 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.19951996 - `enabled: optional boolean or null`19971998 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.19992000 - `scroll_to: optional BrowserScrollToConfig or null`20012002 `scroll_to`'s config overrides.20032004 - `defer_loading: optional boolean or null`20052006 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20072008 - `enabled: optional boolean or null`20092010 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.20112012 - `switch_tab: optional BrowserSwitchTabConfig or null`20132014 `switch_tab`'s config overrides.20152016 - `defer_loading: optional boolean or null`20172018 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20192020 - `enabled: optional boolean or null`20212022 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.20232024 - `triple_click: optional BrowserTripleClickConfig or null`20252026 `triple_click`'s config overrides.20272028 - `defer_loading: optional boolean or null`20292030 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20312032 - `enabled: optional boolean or null`20332034 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.20352036 - `wait: optional BrowserWaitConfig or null`20372038 `wait`'s config overrides.20392040 - `defer_loading: optional boolean or null`20412042 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20432044 - `enabled: optional boolean or null`20452046 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.20472048 - `zoom: optional BrowserZoomConfig or null`20492050 `zoom`'s config overrides.20512052 - `defer_loading: optional boolean or null`20532054 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.20552056 - `enabled: optional boolean or null`20572058 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.20592060 - `MemoryTool20250818 object`20612062 - `type: "memory_20250818"`20632064 - `name: "memory"`20652066 Name of the tool.20672068 This is how the tool will be called by the model and in `tool_use` blocks.20692070 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`20712072 - `"direct"`20732074 - `"code_execution_20250825"`20752076 - `"code_execution_20260120"`20772078 - `"code_execution_20260521"`20792080 - `cache_control: optional CacheControlEphemeral or null`20812082 Create a cache control breakpoint at this content block.20832084 - `defer_loading: optional boolean`20852086 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.20872088 - `input_examples: optional array of map[unknown]`20892090 - `strict: optional boolean`20912092 When true, guarantees schema validation on tool names and inputs20932094 - `ComputerToolset20260801 object`20952096 The computer toolset: a single `tools[]` entry (carrying no2097 `name`) that declares the computer tool family. The model is2098 served the family's tool with any members disabled via `configs`2099 removed from its schema. Every member is enabled by default, zoom2100 included. The single-tool options `display_number` and2101 `enable_zoom` are not fields of a toolset entry — it carries only2102 `type`, `configs`, and `cache_control`; zoom is controlled2103 via `configs.zoom.enabled`.21042105 - `type: "computer_toolset_20260801"`21062107 - `cache_control: optional CacheControlEphemeral or null`21082109 Create a cache control breakpoint at this content block.21102111 - `configs: optional ComputerToolsetConfigs or null`21122113 Per-member configuration for `computer_toolset_20260801`: one2114 optional field per member tool, keyed by the member name — the same2115 name the member's `tool_use` blocks carry. Every member is an2116 accepted key, and a member's defaults apply wherever its key is2117 absent. Unknown keys are rejected: the field set is this toolset2118 version's complete member set.21192120 - `type: optional ComputerTypeConfig or null`21212122 `type`'s config overrides.21232124 - `defer_loading: optional boolean or null`21252126 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21272128 - `enabled: optional boolean or null`21292130 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.21312132 - `cursor_position: optional ComputerCursorPositionConfig or null`21332134 `cursor_position`'s config overrides.21352136 - `defer_loading: optional boolean or null`21372138 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21392140 - `enabled: optional boolean or null`21412142 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.21432144 - `double_click: optional ComputerDoubleClickConfig or null`21452146 `double_click`'s config overrides.21472148 - `defer_loading: optional boolean or null`21492150 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21512152 - `enabled: optional boolean or null`21532154 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.21552156 - `hold_key: optional ComputerHoldKeyConfig or null`21572158 `hold_key`'s config overrides.21592160 - `defer_loading: optional boolean or null`21612162 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21632164 - `enabled: optional boolean or null`21652166 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.21672168 - `key: optional ComputerKeyConfig or null`21692170 `key`'s config overrides.21712172 - `defer_loading: optional boolean or null`21732174 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21752176 - `enabled: optional boolean or null`21772178 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.21792180 - `left_click: optional ComputerLeftClickConfig or null`21812182 `left_click`'s config overrides.21832184 - `defer_loading: optional boolean or null`21852186 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21872188 - `enabled: optional boolean or null`21892190 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.21912192 - `left_click_drag: optional ComputerLeftClickDragConfig or null`21932194 `left_click_drag`'s config overrides.21952196 - `defer_loading: optional boolean or null`21972198 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.21992200 - `enabled: optional boolean or null`22012202 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.22032204 - `left_mouse_down: optional ComputerLeftMouseDownConfig or null`22052206 `left_mouse_down`'s config overrides.22072208 - `defer_loading: optional boolean or null`22092210 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22112212 - `enabled: optional boolean or null`22132214 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.22152216 - `left_mouse_up: optional ComputerLeftMouseUpConfig or null`22172218 `left_mouse_up`'s config overrides.22192220 - `defer_loading: optional boolean or null`22212222 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22232224 - `enabled: optional boolean or null`22252226 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.22272228 - `middle_click: optional ComputerMiddleClickConfig or null`22292230 `middle_click`'s config overrides.22312232 - `defer_loading: optional boolean or null`22332234 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22352236 - `enabled: optional boolean or null`22372238 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.22392240 - `mouse_move: optional ComputerMouseMoveConfig or null`22412242 `mouse_move`'s config overrides.22432244 - `defer_loading: optional boolean or null`22452246 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22472248 - `enabled: optional boolean or null`22492250 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.22512252 - `right_click: optional ComputerRightClickConfig or null`22532254 `right_click`'s config overrides.22552256 - `defer_loading: optional boolean or null`22572258 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22592260 - `enabled: optional boolean or null`22612262 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.22632264 - `screenshot: optional ComputerScreenshotConfig or null`22652266 `screenshot`'s config overrides.22672268 - `defer_loading: optional boolean or null`22692270 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22712272 - `enabled: optional boolean or null`22732274 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.22752276 - `scroll: optional ComputerScrollConfig or null`22772278 `scroll`'s config overrides.22792280 - `defer_loading: optional boolean or null`22812282 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22832284 - `enabled: optional boolean or null`22852286 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.22872288 - `triple_click: optional ComputerTripleClickConfig or null`22892290 `triple_click`'s config overrides.22912292 - `defer_loading: optional boolean or null`22932294 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.22952296 - `enabled: optional boolean or null`22972298 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.22992300 - `wait: optional ComputerWaitConfig or null`23012302 `wait`'s config overrides.23032304 - `defer_loading: optional boolean or null`23052306 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23072308 - `enabled: optional boolean or null`23092310 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.23112312 - `zoom: optional ComputerZoomConfig or null`23132314 `zoom`'s config overrides.23152316 - `defer_loading: optional boolean or null`23172318 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.23192320 - `enabled: optional boolean or null`23212322 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.23232324 - `ToolTextEditor20250124 object`23252326 - `type: "text_editor_20250124"`23272328 - `name: "str_replace_editor"`23292330 Name of the tool.23312332 This is how the tool will be called by the model and in `tool_use` blocks.23332334 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23352336 - `"direct"`23372338 - `"code_execution_20250825"`23392340 - `"code_execution_20260120"`23412342 - `"code_execution_20260521"`23432344 - `cache_control: optional CacheControlEphemeral or null`23452346 Create a cache control breakpoint at this content block.23472348 - `defer_loading: optional boolean`23492350 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.23512352 - `input_examples: optional array of map[unknown]`23532354 - `strict: optional boolean`23552356 When true, guarantees schema validation on tool names and inputs23572358 - `ToolTextEditor20250429 object`23592360 - `type: "text_editor_20250429"`23612362 - `name: "str_replace_based_edit_tool"`23632364 Name of the tool.23652366 This is how the tool will be called by the model and in `tool_use` blocks.23672368 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`23692370 - `"direct"`23712372 - `"code_execution_20250825"`23732374 - `"code_execution_20260120"`23752376 - `"code_execution_20260521"`23772378 - `cache_control: optional CacheControlEphemeral or null`23792380 Create a cache control breakpoint at this content block.23812382 - `defer_loading: optional boolean`23832384 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.23852386 - `input_examples: optional array of map[unknown]`23872388 - `strict: optional boolean`23892390 When true, guarantees schema validation on tool names and inputs23912392 - `ToolTextEditor20250728 object`23932394 - `type: "text_editor_20250728"`23952396 - `name: "str_replace_based_edit_tool"`23972398 Name of the tool.23992400 This is how the tool will be called by the model and in `tool_use` blocks.24012402 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`24032404 - `"direct"`24052406 - `"code_execution_20250825"`24072408 - `"code_execution_20260120"`24092410 - `"code_execution_20260521"`24112412 - `cache_control: optional CacheControlEphemeral or null`24132414 Create a cache control breakpoint at this content block.24152416 - `defer_loading: optional boolean`24172418 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.24192420 - `input_examples: optional array of map[unknown]`24212422 - `max_characters: optional number or null`24232424 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.24252426 minimum: 124272428 - `strict: optional boolean`24292430 When true, guarantees schema validation on tool names and inputs24312432 - `WebSearchTool20250305 object`24332434 - `type: "web_search_20250305"`24352436 - `name: "web_search"`24372438 Name of the tool.24392440 This is how the tool will be called by the model and in `tool_use` blocks.24412442 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`24432444 - `"direct"`24452446 - `"code_execution_20250825"`24472448 - `"code_execution_20260120"`24492450 - `"code_execution_20260521"`24512452 - `allowed_domains: optional array of string or null`24532454 If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.24552456 - `blocked_domains: optional array of string or null`24572458 If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.24592460 - `cache_control: optional CacheControlEphemeral or null`24612462 Create a cache control breakpoint at this content block.24632464 - `defer_loading: optional boolean`24652466 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.24672468 - `max_uses: optional number or null`24692470 Maximum number of times the tool can be used in the API request.24712472 exclusiveMinimum: 024732474 - `strict: optional boolean`24752476 When true, guarantees schema validation on tool names and inputs24772478 - `user_location: optional UserLocation or null`24792480 Parameters for the user's location. Used to provide more relevant search results.24812482 - `type: "approximate"`24832484 - `city: optional string or null`24852486 The city of the user.24872488 maxLength: 255, minLength: 124892490 - `country: optional string or null`24912492 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.24932494 maxLength: 2, minLength: 224952496 - `region: optional string or null`24972498 The region of the user.24992500 maxLength: 255, minLength: 125012502 - `timezone: optional string or null`25032504 The [IANA timezone](https://nodatime.org/TimeZones) of the user.25052506 maxLength: 255, minLength: 125072508 - `WebFetchTool20250910 object`25092510 - `type: "web_fetch_20250910"`25112512 - `name: "web_fetch"`25132514 Name of the tool.25152516 This is how the tool will be called by the model and in `tool_use` blocks.25172518 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`25192520 - `"direct"`25212522 - `"code_execution_20250825"`25232524 - `"code_execution_20260120"`25252526 - `"code_execution_20260521"`25272528 - `allowed_domains: optional array of string or null`25292530 List of domains to allow fetching from25312532 - `blocked_domains: optional array of string or null`25332534 List of domains to block fetching from25352536 - `cache_control: optional CacheControlEphemeral or null`25372538 Create a cache control breakpoint at this content block.25392540 - `citations: optional CitationsConfigParam or null`25412542 Citations configuration for fetched documents. Citations are disabled by default.25432544 - `defer_loading: optional boolean`25452546 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.25472548 - `max_content_tokens: optional number or null`25492550 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.25512552 exclusiveMinimum: 025532554 - `max_uses: optional number or null`25552556 Maximum number of times the tool can be used in the API request.25572558 exclusiveMinimum: 025592560 - `strict: optional boolean`25612562 When true, guarantees schema validation on tool names and inputs25632564 - `url_sources: optional WebFetchURLSources or null`25652566 Which sources contribute to the set of URLs web fetch may fetch.25672568 Each key is a tagged variant: `user_input` is `all` or `none`; the2569 two tool filters are `all`, `none`, `only` (only the named tools'2570 results) or `except` (every result but the named tools'). A named tool2571 must be declared in this request's `tools[]`.25722573 - `client_tool_results: optional WebFetchURLSourceAll or WebFetchURLSourceNone or WebFetchURLSourceOnly or WebFetchURLSourceExcept`25742575 Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].25762577 - `WebFetchURLSourceAll object`25782579 The `url_sources` variant under which a source contributes in2580 full: every result of the tool filter's source, or all user input.25812582 - `type: "all"`25832584 - `WebFetchURLSourceNone object`25852586 The `url_sources` variant under which a source contributes nothing:2587 no result of the tool filter's source, or no user input.25882589 - `type: "none"`25902591 - `WebFetchURLSourceOnly object`25922593 The tool filter variant under which only the named tools' results2594 contribute.25952596 - `type: "only"`25972598 - `tools: array of WebFetchURLSourceToolReference`25992600 - `type: "tool_reference"`26012602 - `name: string`26032604 - `WebFetchURLSourceExcept object`26052606 The tool filter variant under which every result but the named2607 tools' contributes.26082609 - `type: "except"`26102611 - `tools: array of WebFetchURLSourceToolReference`26122613 - `type: "tool_reference"`26142615 - `name: string`26162617 - `server_tool_results: optional WebFetchURLSourceAll or WebFetchURLSourceNone or WebFetchURLSourceOnly or WebFetchURLSourceExcept`26182619 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.26202621 - `WebFetchURLSourceAll object`26222623 The `url_sources` variant under which a source contributes in2624 full: every result of the tool filter's source, or all user input.26252626 - `WebFetchURLSourceNone object`26272628 The `url_sources` variant under which a source contributes nothing:2629 no result of the tool filter's source, or no user input.26302631 - `WebFetchURLSourceOnly object`26322633 The tool filter variant under which only the named tools' results2634 contribute.26352636 - `WebFetchURLSourceExcept object`26372638 The tool filter variant under which every result but the named2639 tools' contributes.26402641 - `user_input: optional WebFetchURLSourceAll or WebFetchURLSourceNone`26422643 Whether URLs in user messages are fetchable: "all" or "none".26442645 - `WebFetchURLSourceAll object`26462647 The `url_sources` variant under which a source contributes in2648 full: every result of the tool filter's source, or all user input.26492650 - `WebFetchURLSourceNone object`26512652 The `url_sources` variant under which a source contributes nothing:2653 no result of the tool filter's source, or no user input.26542655 - `WebSearchTool20260209 object`26562657 - `type: "web_search_20260209"`26582659 - `name: "web_search"`26602661 Name of the tool.26622663 This is how the tool will be called by the model and in `tool_use` blocks.26642665 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`26662667 - `"direct"`26682669 - `"code_execution_20250825"`26702671 - `"code_execution_20260120"`26722673 - `"code_execution_20260521"`26742675 - `allowed_domains: optional array of string or null`26762677 If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.26782679 - `blocked_domains: optional array of string or null`26802681 If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.26822683 - `cache_control: optional CacheControlEphemeral or null`26842685 Create a cache control breakpoint at this content block.26862687 - `defer_loading: optional boolean`26882689 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.26902691 - `max_uses: optional number or null`26922693 Maximum number of times the tool can be used in the API request.26942695 exclusiveMinimum: 026962697 - `strict: optional boolean`26982699 When true, guarantees schema validation on tool names and inputs27002701 - `user_location: optional UserLocation or null`27022703 Parameters for the user's location. Used to provide more relevant search results.27042705 - `WebFetchTool20260209 object`27062707 - `type: "web_fetch_20260209"`27082709 - `name: "web_fetch"`27102711 Name of the tool.27122713 This is how the tool will be called by the model and in `tool_use` blocks.27142715 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`27162717 - `"direct"`27182719 - `"code_execution_20250825"`27202721 - `"code_execution_20260120"`27222723 - `"code_execution_20260521"`27242725 - `allowed_domains: optional array of string or null`27262727 List of domains to allow fetching from27282729 - `blocked_domains: optional array of string or null`27302731 List of domains to block fetching from27322733 - `cache_control: optional CacheControlEphemeral or null`27342735 Create a cache control breakpoint at this content block.27362737 - `citations: optional CitationsConfigParam or null`27382739 Citations configuration for fetched documents. Citations are disabled by default.27402741 - `defer_loading: optional boolean`27422743 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.27442745 - `max_content_tokens: optional number or null`27462747 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.27482749 exclusiveMinimum: 027502751 - `max_uses: optional number or null`27522753 Maximum number of times the tool can be used in the API request.27542755 exclusiveMinimum: 027562757 - `strict: optional boolean`27582759 When true, guarantees schema validation on tool names and inputs27602761 - `url_sources: optional WebFetchURLSources or null`27622763 Which sources contribute to the set of URLs web fetch may fetch.27642765 Each key is a tagged variant: `user_input` is `all` or `none`; the2766 two tool filters are `all`, `none`, `only` (only the named tools'2767 results) or `except` (every result but the named tools'). A named tool2768 must be declared in this request's `tools[]`.27692770 - `WebFetchTool20260309 object`27712772 Web fetch tool with use_cache parameter for bypassing cached content.27732774 - `type: "web_fetch_20260309"`27752776 - `name: "web_fetch"`27772778 Name of the tool.27792780 This is how the tool will be called by the model and in `tool_use` blocks.27812782 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`27832784 - `"direct"`27852786 - `"code_execution_20250825"`27872788 - `"code_execution_20260120"`27892790 - `"code_execution_20260521"`27912792 - `allowed_domains: optional array of string or null`27932794 List of domains to allow fetching from27952796 - `blocked_domains: optional array of string or null`27972798 List of domains to block fetching from27992800 - `cache_control: optional CacheControlEphemeral or null`28012802 Create a cache control breakpoint at this content block.28032804 - `citations: optional CitationsConfigParam or null`28052806 Citations configuration for fetched documents. Citations are disabled by default.28072808 - `defer_loading: optional boolean`28092810 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.28112812 - `max_content_tokens: optional number or null`28132814 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.28152816 exclusiveMinimum: 028172818 - `max_uses: optional number or null`28192820 Maximum number of times the tool can be used in the API request.28212822 exclusiveMinimum: 028232824 - `strict: optional boolean`28252826 When true, guarantees schema validation on tool names and inputs28272828 - `url_sources: optional WebFetchURLSources or null`28292830 Which sources contribute to the set of URLs web fetch may fetch.28312832 Each key is a tagged variant: `user_input` is `all` or `none`; the2833 two tool filters are `all`, `none`, `only` (only the named tools'2834 results) or `except` (every result but the named tools'). A named tool2835 must be declared in this request's `tools[]`.28362837 - `use_cache: optional boolean`28382839 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.28402841 - `WebSearchTool20260318 object`28422843 - `type: "web_search_20260318"`28442845 - `name: "web_search"`28462847 Name of the tool.28482849 This is how the tool will be called by the model and in `tool_use` blocks.28502851 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`28522853 - `"direct"`28542855 - `"code_execution_20250825"`28562857 - `"code_execution_20260120"`28582859 - `"code_execution_20260521"`28602861 - `allowed_domains: optional array of string or null`28622863 If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.28642865 - `blocked_domains: optional array of string or null`28662867 If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.28682869 - `cache_control: optional CacheControlEphemeral or null`28702871 Create a cache control breakpoint at this content block.28722873 - `defer_loading: optional boolean`28742875 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.28762877 - `max_uses: optional number or null`28782879 Maximum number of times the tool can be used in the API request.28802881 exclusiveMinimum: 028822883 - `response_inclusion: optional "full" or "excluded"`28842885 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.28862887 - `"full"`28882889 - `"excluded"`28902891 - `strict: optional boolean`28922893 When true, guarantees schema validation on tool names and inputs28942895 - `user_location: optional UserLocation or null`28962897 Parameters for the user's location. Used to provide more relevant search results.28982899 - `WebFetchTool20260318 object`29002901 - `type: "web_fetch_20260318"`29022903 - `name: "web_fetch"`29042905 Name of the tool.29062907 This is how the tool will be called by the model and in `tool_use` blocks.29082909 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`29102911 - `"direct"`29122913 - `"code_execution_20250825"`29142915 - `"code_execution_20260120"`29162917 - `"code_execution_20260521"`29182919 - `allowed_domains: optional array of string or null`29202921 List of domains to allow fetching from29222923 - `blocked_domains: optional array of string or null`29242925 List of domains to block fetching from29262927 - `cache_control: optional CacheControlEphemeral or null`29282929 Create a cache control breakpoint at this content block.29302931 - `citations: optional CitationsConfigParam or null`29322933 Citations configuration for fetched documents. Citations are disabled by default.29342935 - `defer_loading: optional boolean`29362937 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.29382939 - `max_content_tokens: optional number or null`29402941 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.29422943 exclusiveMinimum: 029442945 - `max_uses: optional number or null`29462947 Maximum number of times the tool can be used in the API request.29482949 exclusiveMinimum: 029502951 - `response_inclusion: optional "full" or "excluded"`29522953 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.29542955 - `"full"`29562957 - `"excluded"`29582959 - `strict: optional boolean`29602961 When true, guarantees schema validation on tool names and inputs29622963 - `url_sources: optional WebFetchURLSources or null`29642965 Which sources contribute to the set of URLs web fetch may fetch.29662967 Each key is a tagged variant: `user_input` is `all` or `none`; the2968 two tool filters are `all`, `none`, `only` (only the named tools'2969 results) or `except` (every result but the named tools'). A named tool2970 must be declared in this request's `tools[]`.29712972 - `use_cache: optional boolean`29732974 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.29752976 - `ToolSearchToolBm25_20251119 object`29772978 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`29792980 - `"tool_search_tool_bm25_20251119"`29812982 - `"tool_search_tool_bm25"`29832984 - `name: "tool_search_tool_bm25"`29852986 Name of the tool.29872988 This is how the tool will be called by the model and in `tool_use` blocks.29892990 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`29912992 - `"direct"`29932994 - `"code_execution_20250825"`29952996 - `"code_execution_20260120"`29972998 - `"code_execution_20260521"`29993000 - `cache_control: optional CacheControlEphemeral or null`30013002 Create a cache control breakpoint at this content block.30033004 - `defer_loading: optional boolean`30053006 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.30073008 - `strict: optional boolean`30093010 When true, guarantees schema validation on tool names and inputs30113012 - `ToolSearchToolRegex20251119 object`30133014 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`30153016 - `"tool_search_tool_regex_20251119"`30173018 - `"tool_search_tool_regex"`30193020 - `name: "tool_search_tool_regex"`30213022 Name of the tool.30233024 This is how the tool will be called by the model and in `tool_use` blocks.30253026 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`30273028 - `"direct"`30293030 - `"code_execution_20250825"`30313032 - `"code_execution_20260120"`30333034 - `"code_execution_20260521"`30353036 - `cache_control: optional CacheControlEphemeral or null`30373038 Create a cache control breakpoint at this content block.30393040 - `defer_loading: optional boolean`30413042 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.30433044 - `strict: optional boolean`30453046 When true, guarantees schema validation on tool names and inputs30473048- `temperature: optional number`30493050 **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.30513052 Amount of randomness injected into the response.30533054 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.30553056 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.30573058 maximum: 1, minimum: 030593060- `top_k: optional number`30613062 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.30633064 Only sample from the top K options for each subsequent token.30653066 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).30673068 Recommended for advanced use cases only.30693070 minimum: 030713072- `top_p: optional number`30733074 **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.30753076 Use nucleus sampling.30773078 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`.30793080 Recommended for advanced use cases only.30813082 maximum: 1, minimum: 030833084## Returns30853086- `Message object`30873088 - `type: "message"`30893090 Object type.30913092 For Messages, this is always `"message"`.30933094 default: message30953096 - `id: string`30973098 Unique object identifier.30993100 The format and length of IDs may change over time.31013102 - `container: Container or null`31033104 Information about the container used in the request (for the code execution tool)31053106 - `id: string`31073108 Identifier for the container used in this request31093110 - `expires_at: string`31113112 The time at which the container will expire.31133114 format: date-time31153116 - `skills: array of ContainerSkill or null`31173118 Skills loaded in the container31193120 - `type: "anthropic" or "custom"`31213122 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)31233124 - `"anthropic"`31253126 - `"custom"`31273128 - `skill_id: string`31293130 Skill ID31313132 maxLength: 64, minLength: 131333134 - `version: string`31353136 The resolved version: a skill version ID for custom skills.31373138 maxLength: 64, minLength: 131393140 - `content: array of ContentBlock`31413142 Content generated by the model.31433144 This is an array of content blocks, each of which has a `type` that determines its shape.31453146 Example:31473148 ```json3149 [{"type": "text", "text": "Hi, I'm Claude."}]3150 ```31513152 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.31533154 For example, if the input `messages` were:31553156 ```json3157 [3158 {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},3159 {"role": "assistant", "content": "The best answer is ("}3160 ]3161 ```31623163 Then the response `content` might be:31643165 ```json3166 [{"type": "text", "text": "B)"}]3167 ```31683169 - `TextBlock object`31703171 - `type: "text"`31723173 default: text31743175 - `citations: array of TextCitation or null`31763177 Citations supporting the text block.31783179 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`.31803181 - `CitationCharLocation object`31823183 - `type: "char_location"`31843185 default: char_location31863187 - `cited_text: string`31883189 - `document_index: number`31903191 minimum: 031923193 - `document_title: string or null`31943195 - `end_char_index: number`31963197 - `file_id: string or null`31983199 - `start_char_index: number`32003201 minimum: 032023203 - `CitationPageLocation object`32043205 - `type: "page_location"`32063207 default: page_location32083209 - `cited_text: string`32103211 - `document_index: number`32123213 minimum: 032143215 - `document_title: string or null`32163217 - `end_page_number: number`32183219 - `file_id: string or null`32203221 - `start_page_number: number`32223223 minimum: 132243225 - `CitationContentBlockLocation object`32263227 - `type: "content_block_location"`32283229 default: content_block_location32303231 - `cited_text: string`32323233 The full text of the cited block range, concatenated.32343235 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.32363237 - `document_index: number`32383239 minimum: 032403241 - `document_title: string or null`32423243 - `end_block_index: number`32443245 Exclusive 0-based end index of the cited block range in the source's `content` array.32463247 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.32483249 - `file_id: string or null`32503251 - `start_block_index: number`32523253 0-based index of the first cited block in the source's `content` array.32543255 minimum: 032563257 - `CitationsWebSearchResultLocation object`32583259 - `type: "web_search_result_location"`32603261 default: web_search_result_location32623263 - `cited_text: string`32643265 - `encrypted_index: string`32663267 - `title: string or null`32683269 maxLength: 51232703271 - `url: string`32723273 - `CitationsSearchResultLocation object`32743275 - `type: "search_result_location"`32763277 default: search_result_location32783279 - `cited_text: string`32803281 The full text of the cited block range, concatenated.32823283 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.32843285 - `end_block_index: number`32863287 Exclusive 0-based end index of the cited block range in the source's `content` array.32883289 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.32903291 - `search_result_index: number`32923293 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.32943295 Counted separately from `document_index`; server-side web search results are not included in this count.32963297 minimum: 032983299 - `source: string`33003301 - `start_block_index: number`33023303 0-based index of the first cited block in the source's `content` array.33043305 minimum: 033063307 - `title: string or null`33083309 - `text: string`33103311 minLength: 033123313 - `ThinkingBlock object`33143315 - `type: "thinking"`33163317 default: thinking33183319 - `signature: string`33203321 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.33223323 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.33243325 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.33263327 - `thinking: string`33283329 The text of Claude's thinking process for this block.33303331 - `RedactedThinkingBlock object`33323333 - `type: "redacted_thinking"`33343335 default: redacted_thinking33363337 - `data: string`33383339 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.33403341 Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.33423343 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.33443345 - `ToolUseBlock object`33463347 - `type: "tool_use"`33483349 default: tool_use33503351 - `id: string`33523353 pattern: ^[a-zA-Z0-9_-]+$33543355 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`33563357 default: {"type":"direct"}33583359 - `DirectCaller object`33603361 Tool invocation directly from the model.33623363 - `type: "direct"`33643365 - `ServerToolCaller object`33663367 Tool invocation generated by a server-side tool.33683369 - `type: "code_execution_20250825"`33703371 - `tool_id: string`33723373 pattern: ^srvtoolu_[a-zA-Z0-9_]+$33743375 - `ServerToolCaller20260120 object`33763377 - `type: "code_execution_20260120"`33783379 - `tool_id: string`33803381 pattern: ^srvtoolu_[a-zA-Z0-9_]+$33823383 - `input: map[unknown]`33843385 - `name: string`33863387 minLength: 133883389 - `toolset_name: optional string or null`33903391 For a toolset member tool_use, the toolset family.33923393 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$33943395 - `ServerToolUseBlock object`33963397 - `type: "server_tool_use"`33983399 default: server_tool_use34003401 - `id: string`34023403 pattern: ^srvtoolu_[a-zA-Z0-9_]+$34043405 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`34063407 default: {"type":"direct"}34083409 - `DirectCaller object`34103411 Tool invocation directly from the model.34123413 - `ServerToolCaller object`34143415 Tool invocation generated by a server-side tool.34163417 - `ServerToolCaller20260120 object`34183419 - `input: map[unknown]`34203421 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`34223423 - `"web_search"`34243425 - `"web_fetch"`34263427 - `"code_execution"`34283429 - `"bash_code_execution"`34303431 - `"text_editor_code_execution"`34323433 - `"tool_search_tool_regex"`34343435 - `"tool_search_tool_bm25"`34363437 - `WebSearchToolResultBlock object`34383439 - `type: "web_search_tool_result"`34403441 default: web_search_tool_result34423443 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`34443445 default: {"type":"direct"}34463447 - `DirectCaller object`34483449 Tool invocation directly from the model.34503451 - `ServerToolCaller object`34523453 Tool invocation generated by a server-side tool.34543455 - `ServerToolCaller20260120 object`34563457 - `content: WebSearchToolResultBlockContent`34583459 - `WebSearchToolResultError object`34603461 - `type: "web_search_tool_result_error"`34623463 default: web_search_tool_result_error34643465 - `error_code: WebSearchToolResultErrorCode`34663467 - `"invalid_tool_input"`34683469 - `"unavailable"`34703471 - `"max_uses_exceeded"`34723473 - `"too_many_requests"`34743475 - `"query_too_long"`34763477 - `"request_too_large"`34783479 - `array of WebSearchResultBlock`34803481 - `type: "web_search_result"`34823483 default: web_search_result34843485 - `encrypted_content: string`34863487 - `page_age: string or null`34883489 - `title: string`34903491 - `url: string`34923493 - `tool_use_id: string`34943495 pattern: ^srvtoolu_[a-zA-Z0-9_]+$34963497 - `WebFetchToolResultBlock object`34983499 - `type: "web_fetch_tool_result"`35003501 default: web_fetch_tool_result35023503 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`35043505 default: {"type":"direct"}35063507 - `DirectCaller object`35083509 Tool invocation directly from the model.35103511 - `ServerToolCaller object`35123513 Tool invocation generated by a server-side tool.35143515 - `ServerToolCaller20260120 object`35163517 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`35183519 - `WebFetchToolResultErrorBlock object`35203521 - `type: "web_fetch_tool_result_error"`35223523 default: web_fetch_tool_result_error35243525 - `error_code: WebFetchToolResultErrorCode`35263527 - `"invalid_tool_input"`35283529 - `"url_too_long"`35303531 - `"url_not_allowed"`35323533 - `"url_not_in_prior_context"`35343535 - `"url_not_accessible"`35363537 - `"unsupported_content_type"`35383539 - `"too_many_requests"`35403541 - `"max_uses_exceeded"`35423543 - `"unavailable"`35443545 - `"content_too_large"`35463547 - `WebFetchBlock object`35483549 - `type: "web_fetch_result"`35503551 default: web_fetch_result35523553 - `content: DocumentBlock`35543555 - `type: "document"`35563557 default: document35583559 - `citations: CitationsConfig or null`35603561 Citation configuration for the document35623563 - `enabled: boolean`35643565 default: false35663567 - `source: Base64PDFSource or PlainTextSource`35683569 - `Base64PDFSource object`35703571 - `type: "base64"`35723573 - `data: string`35743575 format: byte35763577 - `media_type: "application/pdf"`35783579 - `PlainTextSource object`35803581 - `type: "text"`35823583 - `data: string`35843585 - `media_type: "text/plain"`35863587 - `title: string or null`35883589 The title of the document35903591 - `retrieved_at: string or null`35923593 ISO 8601 timestamp when the content was retrieved35943595 - `url: string`35963597 Fetched content URL35983599 - `tool_use_id: string`36003601 pattern: ^srvtoolu_[a-zA-Z0-9_]+$36023603 - `CodeExecutionToolResultBlock object`36043605 - `type: "code_execution_tool_result"`36063607 default: code_execution_tool_result36083609 - `content: CodeExecutionToolResultBlockContent`36103611 - `CodeExecutionToolResultError object`36123613 - `type: "code_execution_tool_result_error"`36143615 default: code_execution_tool_result_error36163617 - `error_code: CodeExecutionToolResultErrorCode`36183619 - `"invalid_tool_input"`36203621 - `"unavailable"`36223623 - `"too_many_requests"`36243625 - `"execution_time_exceeded"`36263627 - `CodeExecutionResultBlock object`36283629 - `type: "code_execution_result"`36303631 default: code_execution_result36323633 - `content: array of CodeExecutionOutputBlock`36343635 - `type: "code_execution_output"`36363637 default: code_execution_output36383639 - `file_id: string`36403641 - `return_code: number`36423643 - `stderr: string`36443645 - `stdout: string`36463647 - `EncryptedCodeExecutionResultBlock object`36483649 Code execution result with encrypted stdout for PFC + web_search results.36503651 - `type: "encrypted_code_execution_result"`36523653 default: encrypted_code_execution_result36543655 - `content: array of CodeExecutionOutputBlock`36563657 - `type: "code_execution_output"`36583659 default: code_execution_output36603661 - `file_id: string`36623663 - `encrypted_stdout: string`36643665 - `return_code: number`36663667 - `stderr: string`36683669 - `tool_use_id: string`36703671 pattern: ^srvtoolu_[a-zA-Z0-9_]+$36723673 - `BashCodeExecutionToolResultBlock object`36743675 - `type: "bash_code_execution_tool_result"`36763677 default: bash_code_execution_tool_result36783679 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`36803681 - `BashCodeExecutionToolResultError object`36823683 - `type: "bash_code_execution_tool_result_error"`36843685 default: bash_code_execution_tool_result_error36863687 - `error_code: BashCodeExecutionToolResultErrorCode`36883689 - `"invalid_tool_input"`36903691 - `"unavailable"`36923693 - `"too_many_requests"`36943695 - `"execution_time_exceeded"`36963697 - `"output_file_too_large"`36983699 - `BashCodeExecutionResultBlock object`37003701 - `type: "bash_code_execution_result"`37023703 default: bash_code_execution_result37043705 - `content: array of BashCodeExecutionOutputBlock`37063707 - `type: "bash_code_execution_output"`37083709 default: bash_code_execution_output37103711 - `file_id: string`37123713 - `return_code: number`37143715 - `stderr: string`37163717 - `stdout: string`37183719 - `tool_use_id: string`37203721 pattern: ^srvtoolu_[a-zA-Z0-9_]+$37223723 - `TextEditorCodeExecutionToolResultBlock object`37243725 - `type: "text_editor_code_execution_tool_result"`37263727 default: text_editor_code_execution_tool_result37283729 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`37303731 - `TextEditorCodeExecutionToolResultError object`37323733 - `type: "text_editor_code_execution_tool_result_error"`37343735 default: text_editor_code_execution_tool_result_error37363737 - `error_code: TextEditorCodeExecutionToolResultErrorCode`37383739 - `"invalid_tool_input"`37403741 - `"unavailable"`37423743 - `"too_many_requests"`37443745 - `"execution_time_exceeded"`37463747 - `"file_not_found"`37483749 - `error_message: string or null`37503751 - `TextEditorCodeExecutionViewResultBlock object`37523753 - `type: "text_editor_code_execution_view_result"`37543755 default: text_editor_code_execution_view_result37563757 - `content: string`37583759 - `file_type: "text" or "image" or "pdf"`37603761 - `"text"`37623763 - `"image"`37643765 - `"pdf"`37663767 - `num_lines: number or null`37683769 - `start_line: number or null`37703771 - `total_lines: number or null`37723773 - `TextEditorCodeExecutionCreateResultBlock object`37743775 - `type: "text_editor_code_execution_create_result"`37763777 default: text_editor_code_execution_create_result37783779 - `is_file_update: boolean`37803781 - `TextEditorCodeExecutionStrReplaceResultBlock object`37823783 - `type: "text_editor_code_execution_str_replace_result"`37843785 default: text_editor_code_execution_str_replace_result37863787 - `lines: array of string or null`37883789 - `new_lines: number or null`37903791 - `new_start: number or null`37923793 - `old_lines: number or null`37943795 - `old_start: number or null`37963797 - `tool_use_id: string`37983799 pattern: ^srvtoolu_[a-zA-Z0-9_]+$38003801 - `ToolSearchToolResultBlock object`38023803 - `type: "tool_search_tool_result"`38043805 default: tool_search_tool_result38063807 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`38083809 - `ToolSearchToolResultError object`38103811 - `type: "tool_search_tool_result_error"`38123813 default: tool_search_tool_result_error38143815 - `error_code: ToolSearchToolResultErrorCode`38163817 - `"invalid_tool_input"`38183819 - `"unavailable"`38203821 - `"too_many_requests"`38223823 - `"execution_time_exceeded"`38243825 - `error_message: string or null`38263827 - `ToolSearchToolSearchResultBlock object`38283829 - `type: "tool_search_tool_search_result"`38303831 default: tool_search_tool_search_result38323833 - `tool_references: array of ToolReferenceBlock`38343835 - `type: "tool_reference"`38363837 default: tool_reference38383839 - `tool_name: string`38403841 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$38423843 - `tool_use_id: string`38443845 pattern: ^srvtoolu_[a-zA-Z0-9_]+$38463847 - `ContainerUploadBlock object`38483849 Response model for a file uploaded to the container.38503851 - `type: "container_upload"`38523853 default: container_upload38543855 - `file_id: string`38563857 - `model: Model`38583859 The model that will complete your prompt.38603861 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.38623863 - `"claude-fable-5-1" or "claude-mythos-5-1" or "claude-sonnet-5" or 14 more`38643865 The model that will complete your prompt.38663867 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.38683869 - `"claude-fable-5-1"`38703871 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows38723873 - `"claude-mythos-5-1"`38743875 Our most capable model for cybersecurity and biology research, available through trusted access programs38763877 - `"claude-sonnet-5"`38783879 High-performance model for coding and agents38803881 - `"claude-fable-5"`38823883 Next generation of intelligence for the hardest knowledge work and coding problems38843885 - `"claude-mythos-5"`38863887 Most capable model for cybersecurity and biology research38883889 - `"claude-opus-5"`38903891 Powerful intelligence for long-running agents and coding38923893 - `"claude-opus-4-8"`38943895 Powerful intelligence for long-running agents and coding38963897 - `"claude-opus-4-7"`38983899 Powerful intelligence for long-running agents and coding39003901 - `"claude-mythos-preview"`39023903 New class of intelligence, strongest in coding and cybersecurity39043905 - `"claude-opus-4-6"`39063907 Powerful intelligence for long-running agents and coding39083909 - `"claude-sonnet-4-6"`39103911 Best combination of speed and intelligence39123913 - `"claude-haiku-4-5"`39143915 Fastest model with near-frontier intelligence39163917 - `"claude-haiku-4-5-20251001"`39183919 Fastest model with near-frontier intelligence39203921 - `"claude-opus-4-5"`39223923 Powerful intelligence for long-running agents and coding39243925 - `"claude-opus-4-5-20251101"`39263927 Powerful intelligence for long-running agents and coding39283929 - `"claude-sonnet-4-5"`39303931 High-performance model for agents and coding39323933 - `"claude-sonnet-4-5-20250929"`39343935 High-performance model for agents and coding39363937 - `string`39383939 - `role: "assistant"`39403941 Conversational role of the generated message.39423943 This will always be `"assistant"`.39443945 default: assistant39463947 - `stop_details: RefusalStopDetails or null`39483949 Structured information about a refusal.39503951 - `type: "refusal"`39523953 default: refusal39543955 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`39563957 The policy category that triggered a refusal.39583959 - `"cyber"`39603961 The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.39623963 - `"bio"`39643965 The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.39663967 - `"frontier_llm"`39683969 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.39703971 - `"reasoning_extraction"`39723973 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).39743975 - `"general_harms"`39763977 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.39783979 - `explanation: string or null`39803981 Human-readable explanation of the refusal.39823983 This text is not guaranteed to be stable. `null` when no explanation is available for the category.39843985 - `stop_reason: StopReason or null`39863987 The reason that we stopped.39883989 This may be one the following values:39903991 * `"end_turn"`: the model reached a natural stopping point3992 * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum3993 * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated3994 * `"tool_use"`: the model invoked one or more tools3995 * `"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.3996 * `"refusal"`: when streaming classifiers intervene to handle potential policy violations3997 * `"model_context_window_exceeded"`: we exceeded the model's context window39983999 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.40004001 - `"end_turn"`40024003 - `"max_tokens"`40044005 - `"stop_sequence"`40064007 - `"tool_use"`40084009 - `"pause_turn"`40104011 - `"refusal"`40124013 - `"model_context_window_exceeded"`40144015 - `stop_sequence: string or null`40164017 Which custom stop sequence was generated, if any.40184019 This value will be a non-null string if one of your custom stop sequences was generated.40204021 - `usage: Usage`40224023 Billing and rate-limit usage.40244025 Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.40264027 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.40284029 For example, `output_tokens` will be non-zero, even for an empty string response from Claude.40304031 Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.40324033 - `cache_creation: CacheCreation or null`40344035 Breakdown of cached tokens by TTL40364037 - `ephemeral_1h_input_tokens: number`40384039 The number of input tokens used to create the 1 hour cache entry.40404041 default: 0, minimum: 040424043 - `ephemeral_5m_input_tokens: number`40444045 The number of input tokens used to create the 5 minute cache entry.40464047 default: 0, minimum: 040484049 - `cache_creation_input_tokens: number or null`40504051 The number of input tokens used to create the cache entry.40524053 minimum: 040544055 - `cache_read_input_tokens: number or null`40564057 The number of input tokens read from the cache.40584059 minimum: 040604061 - `inference_geo: string or null`40624063 The geographic region where inference was performed for this request.40644065 - `input_tokens: number`40664067 The number of input tokens which were used.40684069 minimum: 040704071 - `output_tokens: number`40724073 The number of output tokens which were used.40744075 minimum: 040764077 - `output_tokens_details: OutputTokensDetails or null`40784079 Breakdown of output tokens by category.40804081 `output_tokens` remains the inclusive, authoritative total used for billing.4082 This object provides a read-only decomposition for observability — for example,4083 how many of the billed output tokens were spent on internal reasoning that may4084 have been summarized before being returned to you.40854086 - `thinking_tokens: number`40874088 Number of output tokens the model generated as internal reasoning, including4089 the thinking-block delimiter tokens.40904091 Reflects the raw reasoning the model produced, not the (possibly shorter)4092 summarized thinking text returned in the response body. Computed by4093 re-tokenizing the raw reasoning text, so it may differ from the model's exact4094 generation count by a small number of tokens. Always ≤ `output_tokens`;4095 `output_tokens - thinking_tokens` approximates the non-reasoning output.40964097 default: 0, minimum: 040984099 - `server_tool_use: ServerToolUsage or null`41004101 The number of server tool requests.41024103 - `web_fetch_requests: number`41044105 The number of web fetch tool requests.41064107 default: 0, minimum: 041084109 - `web_search_requests: number`41104111 The number of web search tool requests.41124113 default: 0, minimum: 041144115 - `service_tier: "standard" or "priority" or "batch" or null`41164117 If the request used the priority, standard, or batch tier.41184119 - `"standard"`41204121 - `"priority"`41224123 - `"batch"`41244125- `RawMessageStreamEvent = RawMessageStartEvent or RawMessageDeltaEvent or RawMessageStopEvent or 3 more`41264127 - `RawMessageStartEvent object`41284129 - `type: "message_start"`41304131 default: message_start41324133 - `message: Message`41344135 - `RawMessageDeltaEvent object`41364137 - `type: "message_delta"`41384139 default: message_delta41404141 - `delta: object`41424143 - `container: Container or null`41444145 Information about the container used in the request (for the code execution tool)41464147 - `stop_details: RefusalStopDetails or null`41484149 Structured information about a refusal.41504151 - `stop_reason: StopReason or null`41524153 - `stop_sequence: string or null`41544155 - `usage: MessageDeltaUsage`41564157 Billing and rate-limit usage.41584159 Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.41604161 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.41624163 For example, `output_tokens` will be non-zero, even for an empty string response from Claude.41644165 Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.41664167 - `cache_creation_input_tokens: number or null`41684169 The cumulative number of input tokens used to create the cache entry.41704171 minimum: 041724173 - `cache_read_input_tokens: number or null`41744175 The cumulative number of input tokens read from the cache.41764177 minimum: 041784179 - `input_tokens: number or null`41804181 The cumulative number of input tokens which were used.41824183 minimum: 041844185 - `output_tokens: number`41864187 The cumulative number of output tokens which were used.41884189 - `output_tokens_details: OutputTokensDetails or null`41904191 Breakdown of output tokens by category.41924193 `output_tokens` remains the inclusive, authoritative total used for billing.4194 This object provides a read-only decomposition for observability — for example,4195 how many of the billed output tokens were spent on internal reasoning that may4196 have been summarized before being returned to you.41974198 - `server_tool_use: ServerToolUsage or null`41994200 The number of server tool requests.42014202 - `RawMessageStopEvent object`42034204 - `type: "message_stop"`42054206 default: message_stop42074208 - `RawContentBlockStartEvent object`42094210 - `type: "content_block_start"`42114212 default: content_block_start42134214 - `content_block: TextBlock or ThinkingBlock or RedactedThinkingBlock or 9 more`42154216 - `TextBlock object`42174218 - `ThinkingBlock object`42194220 - `RedactedThinkingBlock object`42214222 - `ToolUseBlock object`42234224 - `ServerToolUseBlock object`42254226 - `WebSearchToolResultBlock object`42274228 - `WebFetchToolResultBlock object`42294230 - `CodeExecutionToolResultBlock object`42314232 - `BashCodeExecutionToolResultBlock object`42334234 - `TextEditorCodeExecutionToolResultBlock object`42354236 - `ToolSearchToolResultBlock object`42374238 - `ContainerUploadBlock object`42394240 Response model for a file uploaded to the container.42414242 - `index: number`42434244 - `RawContentBlockDeltaEvent object`42454246 - `type: "content_block_delta"`42474248 default: content_block_delta42494250 - `delta: RawContentBlockDelta`42514252 - `TextDelta object`42534254 - `type: "text_delta"`42554256 default: text_delta42574258 - `text: string`42594260 - `InputJSONDelta object`42614262 - `type: "input_json_delta"`42634264 default: input_json_delta42654266 - `partial_json: string`42674268 - `CitationsDelta object`42694270 - `type: "citations_delta"`42714272 default: citations_delta42734274 - `citation: CitationCharLocation or CitationPageLocation or CitationContentBlockLocation or 2 more`42754276 - `CitationCharLocation object`42774278 - `CitationPageLocation object`42794280 - `CitationContentBlockLocation object`42814282 - `CitationsWebSearchResultLocation object`42834284 - `CitationsSearchResultLocation object`42854286 - `ThinkingDelta object`42874288 - `type: "thinking_delta"`42894290 default: thinking_delta42914292 - `thinking: string`42934294 The incremental `thinking` text for this content block. Concatenate the `thinking` values of successive `thinking_delta` events to assemble the block's full `thinking` value.42954296 - `SignatureDelta object`42974298 - `type: "signature_delta"`42994300 default: signature_delta43014302 - `signature: string`43034304 The `signature` for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a `signature_delta` event just before the block's `content_block_stop` event.43054306 - `index: number`43074308 - `RawContentBlockStopEvent object`43094310 - `type: "content_block_stop"`43114312 default: content_block_stop43134314 - `index: number`43154316## Example43174318```bash4319curl https://api.anthropic.com/v1/messages \4320 -H 'Content-Type: application/json' \4321 -H 'anthropic-version: 2023-06-01' \4322 -H "X-Api-Key: $ANTHROPIC_API_KEY" \4323 --max-time 600 \4324 -d '{4325 "max_tokens": 1024,4326 "messages": [4327 {4328 "content": "Hello, world",4329 "role": "user"4330 }4331 ],4332 "model": "claude-opus-5",4333 "stream": false,4334 "system": [4335 {4336 "text": "Today'\''s date is 2024-06-01.",4337 "type": "text"4338 }4339 ],4340 "temperature": 1,4341 "thinking": {4342 "type": "adaptive"4343 },4344 "tools": [4345 {4346 "input_schema": {4347 "type": "object",4348 "properties": {4349 "location": "bar",4350 "unit": "bar"4351 },4352 "required": [4353 "location"4354 ]4355 },4356 "name": "name"4357 }4358 ],4359 "top_k": 5,4360 "top_p": 0.74361 }'4362```43634364### Response (200)43654366```json4367{4368 "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",4369 "container": {4370 "id": "container_011CpZohnwH4vuy7gazohgSP",4371 "expires_at": "2019-12-27T18:11:19.117Z",4372 "skills": [4373 {4374 "skill_id": "pdf",4375 "type": "anthropic",4376 "version": "latest"4377 }4378 ]4379 },4380 "content": [4381 {4382 "citations": [4383 {4384 "cited_text": "The grass is green. The sky is blue.",4385 "document_index": 0,4386 "document_title": "My Document",4387 "end_char_index": 0,4388 "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",4389 "start_char_index": 0,4390 "type": "char_location"4391 }4392 ],4393 "text": "Hi! My name is Claude.",4394 "type": "text"4395 }4396 ],4397 "model": "claude-opus-5",4398 "role": "assistant",4399 "stop_details": {4400 "category": "cyber",4401 "explanation": "This request was declined because it conflicts with Anthropic's Usage Policy.",4402 "type": "refusal"4403 },4404 "stop_reason": "end_turn",4405 "stop_sequence": null,4406 "type": "message",4407 "usage": {4408 "cache_creation": {4409 "ephemeral_1h_input_tokens": 0,4410 "ephemeral_5m_input_tokens": 04411 },4412 "cache_creation_input_tokens": 2051,4413 "cache_read_input_tokens": 2051,4414 "inference_geo": "global",4415 "input_tokens": 2095,4416 "output_tokens": 503,4417 "output_tokens_details": {4418 "thinking_tokens": 04419 },4420 "server_tool_use": {4421 "web_fetch_requests": 2,4422 "web_search_requests": 04423 },4424 "service_tier": "standard"4425 }4426}4427```4428