Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

Batches changedapi/messages/batches

Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+1,459added
Lines−1,046removed
From line 1 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits24to this page, all time

### Headers ### Body parameters #### Response (200) ### Path parameters #### Response (200) ### Query parameters #### Response (200) ### Path parameters #### Response (200) ### Path parameters #### Response (200) ### Path parameters ## Domain types ### Header Parameters ### Body Parameters #### Response ### Path Parameters #### Response ### Query Parameters #### Response ### Path Parameters #### Response ### Path Parameters #### Response ### Path Parameters ## Domain Types

The whole hunk

from line 1, old and new numbered
/
lines

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

from line 1
1---
2title: Batches
3url: https://platform.claude.com/docs/en/api/messages/batches
4---
5 
61# Batches
72 
83## Create a Message Batch
94 
10**post** `/v1/messages/batches`
5**POST** `/v1/messages/batches`
116 
127Send a batch of Message creation requests.
138 
from line 10
1510 
1611Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
1712 
18### Header Parameters
13### Headers
1914 
2015- `"anthropic-user-profile-id": optional string`
2116 
2217 The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.
2318 
24### Body Parameters
25 
26- `requests: array of object { custom_id, params }`
19### Body parameters
20 
21- `requests: array of object`
2722 
2823 List of requests for prompt completion. Each is an individual request to create a Message.
2924 
25 maxItems: 100000, minItems: 1
26 
3027 - `custom_id: string`
3128 
3229 Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
3330 
3431 Must be unique for each request within the Message Batch.
3532 
36 - `params: object { max_tokens, messages, model, 15 more }`
33 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,64}$
34 
35 - `params: object`
3736 
3837 Messages API creation parameters for the individual request.
3938 
from line 47
4847 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.
4948 
5049 Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
50 
51 minimum: 0
5152 
5253 - `messages: array of MessageParam`
5354 
from line 107
106107 
107108 - `array of ContentBlockParam`
108109 
109 - `TextBlockParam object { text, type, cache_control, citations }`
110 - `TextBlockParam object`
110111 
111112 - `text: string`
112113 
114 minLength: 1
115 
113116 - `type: "text"`
114117 
115 - `"text"`
116 
117118 - `cache_control: optional CacheControlEphemeral or null`
118119 
119120 Create a cache control breakpoint at this content block.
120121 
121122 - `type: "ephemeral"`
122 
123 - `"ephemeral"`
124123 
125124 - `ttl: optional "5m" or "1h"`
126125 
from line 138
139138 
140139 - `citations: optional array of TextCitationParam or null`
141140 
142 - `CitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
141 - `CitationCharLocationParam object`
143142 
144143 - `cited_text: string`
145144 
146145 - `document_index: number`
147146 
147 minimum: 0
148 
148149 - `document_title: string or null`
149150 
151 maxLength: 500, minLength: 1
152 
150153 - `end_char_index: number`
151154 
152155 - `start_char_index: number`
153156 
157 minimum: 0
158 
154159 - `type: "char_location"`
155160 
156 - `"char_location"`
157 
158 - `CitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
161 - `CitationPageLocationParam object`
159162 
160163 - `cited_text: string`
161164 
162165 - `document_index: number`
163166 
167 minimum: 0
168 
164169 - `document_title: string or null`
165170 
171 maxLength: 500, minLength: 1
172 
166173 - `end_page_number: number`
167174 
168175 - `start_page_number: number`
169176 
177 minimum: 1
178 
170179 - `type: "page_location"`
171180 
172 - `"page_location"`
173 
174 - `CitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
181 - `CitationContentBlockLocationParam object`
175182 
176183 - `cited_text: string`
177184 
from line 188
181188 
182189 - `document_index: number`
183190 
191 minimum: 0
192 
184193 - `document_title: string or null`
185194 
195 maxLength: 500, minLength: 1
196 
186197 - `end_block_index: number`
187198 
188199 Exclusive 0-based end index of the cited block range in the source's `content` array.
from line 204
193204 
194205 0-based index of the first cited block in the source's `content` array.
195206 
207 minimum: 0
208 
196209 - `type: "content_block_location"`
197210 
198 - `"content_block_location"`
199 
200 - `CitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
211 - `CitationWebSearchResultLocationParam object`
201212 
202213 - `cited_text: string`
203214 
from line 216
205216 
206217 - `title: string or null`
207218 
219 maxLength: 512, minLength: 1
220 
208221 - `type: "web_search_result_location"`
209222 
210 - `"web_search_result_location"`
211 
212223 - `url: string`
213224 
214 - `CitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
225 minLength: 1
226 
227 - `CitationSearchResultLocationParam object`
215228 
216229 - `cited_text: string`
217230 
from line 244
231244 
232245 Counted separately from `document_index`; server-side web search results are not included in this count.
233246 
247 minimum: 0
248 
234249 - `source: string`
235250 
236251 - `start_block_index: number`
237252 
238253 0-based index of the first cited block in the source's `content` array.
239254 
255 minimum: 0
256 
240257 - `title: string or null`
241258 
242259 - `type: "search_result_location"`
243260 
244 - `"search_result_location"`
245 
246 - `ImageBlockParam object { source, type, cache_control, transformations }`
261 - `ImageBlockParam object`
247262 
248263 - `source: Base64ImageSource or URLImageSource or FileImageSource`
249264 
250 - `Base64ImageSource object { data, media_type, type }`
265 - `Base64ImageSource object`
251266 
252267 - `data: string`
253268 
269 format: byte
270 
254271 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
255272 
256273 - `"image/jpeg"`
from line 280
263280 
264281 - `type: "base64"`
265282 
266 - `"base64"`
267 
268 - `URLImageSource object { type, url }`
283 - `URLImageSource object`
269284 
270285 - `type: "url"`
271286 
272 - `"url"`
273 
274287 - `url: string`
275288 
276 - `FileImageSource object { file_id, type }`
289 - `FileImageSource object`
277290 
278291 - `file_id: string`
279292 
280293 - `type: "file"`
281294 
282 - `"file"`
283 
284295 - `type: "image"`
285296 
286 - `"image"`
287 
288297 - `cache_control: optional CacheControlEphemeral or null`
289298 
290299 Create a cache control breakpoint at this content block.
from line 310
301310 
302311 - `"error"`
303312 
304 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
313 - `DocumentBlockParam object`
305314 
306315 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
307316 
308 - `Base64PDFSource object { data, media_type, type }`
317 - `Base64PDFSource object`
309318 
310319 - `data: string`
311320 
321 format: byte
322 
312323 - `media_type: "application/pdf"`
313324 
314 - `"application/pdf"`
315 
316325 - `type: "base64"`
317326 
318 - `"base64"`
319 
320 - `PlainTextSource object { data, media_type, type }`
327 - `PlainTextSource object`
321328 
322329 - `data: string`
323330 
324331 - `media_type: "text/plain"`
325332 
326 - `"text/plain"`
327 
328333 - `type: "text"`
329334 
330 - `"text"`
331 
332 - `ContentBlockSource object { content, type }`
335 - `ContentBlockSource object`
333336 
334337 - `content: string or array of ContentBlockSourceContent`
335338 
from line 340
337340 
338341 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
339342 
340 - `TextBlockParam object { text, type, cache_control, citations }`
341 
342 - `ImageBlockParam object { source, type, cache_control, transformations }`
343 - `TextBlockParam object`
344 
345 - `ImageBlockParam object`
343346 
344347 - `type: "content"`
345348 
346 - `"content"`
347 
348 - `URLPDFSource object { type, url }`
349 - `URLPDFSource object`
349350 
350351 - `type: "url"`
351352 
352 - `"url"`
353 
354353 - `url: string`
355354 
356 - `FileDocumentSource object { file_id, type }`
355 - `FileDocumentSource object`
357356 
358357 - `file_id: string`
359358 
360359 - `type: "file"`
361360 
362 - `"file"`
363 
364361 - `type: "document"`
365362 
366 - `"document"`
367 
368363 - `cache_control: optional CacheControlEphemeral or null`
369364 
370365 Create a cache control breakpoint at this content block.
from line 370
375370 
376371 - `context: optional string or null`
377372 
373 minLength: 1
374 
378375 - `title: optional string or null`
379376 
380 - `SearchResultBlockParam object { content, source, title, 3 more }`
377 maxLength: 500, minLength: 1
378 
379 - `SearchResultBlockParam object`
381380 
382381 - `content: array of TextBlockParam`
383382 
384383 - `text: string`
385384 
385 minLength: 1
386 
386387 - `type: "text"`
387388 
388389 - `cache_control: optional CacheControlEphemeral or null`
from line 398
397398 
398399 - `type: "search_result"`
399400 
400 - `"search_result"`
401 
402401 - `cache_control: optional CacheControlEphemeral or null`
403402 
404403 Create a cache control breakpoint at this content block.
405404 
406405 - `citations: optional CitationsConfigParam`
407406 
408 - `ThinkingBlockParam object { signature, thinking, type }`
407 - `ThinkingBlockParam object`
409408 
410409 - `signature: string`
411410 
from line 418
419418 
420419 - `type: "thinking"`
421420 
422 - `"thinking"`
423 
424 - `RedactedThinkingBlockParam object { data, type }`
421 - `RedactedThinkingBlockParam object`
425422 
426423 - `data: string`
427424 
from line 426
429426 
430427 - `type: "redacted_thinking"`
431428 
432 - `"redacted_thinking"`
433 
434 - `ToolUseBlockParam object { id, input, name, 4 more }`
429 - `ToolUseBlockParam object`
435430 
436431 - `id: string`
437432 
433 pattern: ^[a-zA-Z0-9_-]+$
434 
438435 - `input: map[unknown]`
439436 
440437 - `name: string`
441438 
439 maxLength: 200, minLength: 1
440 
442441 - `type: "tool_use"`
443442 
444 - `"tool_use"`
445 
446443 - `cache_control: optional CacheControlEphemeral or null`
447444 
448445 Create a cache control breakpoint at this content block.
from line 448
451448 
452449 Tool invocation directly from the model.
453450 
454 - `DirectCaller object { type }`
451 - `DirectCaller object`
455452 
456453 Tool invocation directly from the model.
457454 
458455 - `type: "direct"`
459456 
460 - `"direct"`
461 
462 - `ServerToolCaller object { tool_id, type }`
457 - `ServerToolCaller object`
463458 
464459 Tool invocation generated by a server-side tool.
465460 
466461 - `tool_id: string`
467462 
463 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
464 
468465 - `type: "code_execution_20250825"`
469466 
470 - `"code_execution_20250825"`
471 
472 - `ServerToolCaller20260120 object { tool_id, type }`
467 - `ServerToolCaller20260120 object`
473468 
474469 - `tool_id: string`
475470 
471 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
472 
476473 - `type: "code_execution_20260120"`
477474 
478 - `"code_execution_20260120"`
479 
480475 - `toolset_name: optional string or null`
481476 
482477 For a toolset member tool_use, the toolset family this member belongs to.
483478 
484 - `ToolResultBlockParam object { tool_use_id, type, cache_control, 3 more }`
479 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
480 
481 - `ToolResultBlockParam object`
485482 
486483 - `tool_use_id: string`
487484 
485 pattern: ^[a-zA-Z0-9_-]+$
486 
488487 - `type: "tool_result"`
489488 
490 - `"tool_result"`
491 
492489 - `cache_control: optional CacheControlEphemeral or null`
493490 
494491 Create a cache control breakpoint at this content block.
from line 496
499496 
500497 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
501498 
502 - `TextBlockParam object { text, type, cache_control, citations }`
503 
504 - `ImageBlockParam object { source, type, cache_control, transformations }`
505 
506 - `SearchResultBlockParam object { content, source, title, 3 more }`
507 
508 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
509 
510 - `ToolReferenceBlockParam object { tool_name, type, cache_control }`
499 - `TextBlockParam object`
500 
501 - `ImageBlockParam object`
502 
503 - `SearchResultBlockParam object`
504 
505 - `DocumentBlockParam object`
506 
507 - `ToolReferenceBlockParam object`
511508 
512509 Tool reference block that can be included in tool_result content.
513510 
514511 - `tool_name: string`
515512 
513 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
514 
516515 - `type: "tool_reference"`
517516 
518 - `"tool_reference"`
519 
520517 - `cache_control: optional CacheControlEphemeral or null`
521518 
522519 Create a cache control breakpoint at this content block.
523520 
524 - `BrowserStateBlockParam object { tabs, type, cache_control, state_changes }`
521 - `BrowserStateBlockParam object`
525522 
526523 The caller's browser state after a browser toolset member call —
527524 the full inventory of open tabs, which tab is active, and any side
from line 532
535532 
536533 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`.
537534 
535 maxItems: 100
536 
538537 - `tab_id: string`
539538 
540539 The caller-assigned identifier for this tab, unique within the inventory.
541540 
541 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
542 
542543 - `title: string`
543544 
544545 The title of the page the tab is showing. May be empty.
545546 
547 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
548 
546549 - `url: string`
547550 
548551 The URL of the page the tab is showing. May be empty.
549552 
553 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
554 
550555 - `active: optional boolean`
551556 
552557 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
553558 
554559 - `type: "browser_state"`
555560 
556 - `"browser_state"`
557 
558561 - `cache_control: optional CacheControlEphemeral or null`
559562 
560563 Create a cache control breakpoint at this content block.
from line 566
563566 
564567 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
565568 
566 - `BrowserStateChangeTabOpened object { tab_id, type }`
569 maxItems: 200, minItems: 1
570 
571 - `BrowserStateChangeTabOpened object`
567572 
568573 A tab this call's execution opened that remains open at its end —
569574 the creation delta of the `tabs` inventory, not an event log.
from line 582
577582 
578583 The `tab_id` of the opened tab, present in `tabs`.
579584 
585 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
586 
580587 - `type: "tab_opened"`
581588 
582 - `"tab_opened"`
583 
584 - `BrowserStateChangeDownloadStarted object { download_id, type, url }`
589 - `BrowserStateChangeDownloadStarted object`
585590 
586591 A file download that started during this call.
587592 
from line 594
589594 
590595 The caller-assigned identifier for this download, stable across the state changes reporting it.
591596 
597 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
598 
592599 - `type: "download_started"`
593600 
594 - `"download_started"`
595 
596601 - `url: string`
597602 
598603 The final post-redirect URL the download was served from.
599604 
600 - `BrowserStateChangeDownloadCompleted object { download_id, type, url, 2 more }`
605 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
606 
607 - `BrowserStateChangeDownloadCompleted object`
601608 
602609 A file download that finished during this call, reported with the
603610 same `download_id` as its `download_started` — or without a prior
from line 615
608615 
609616 The caller-assigned identifier for this download, stable across the state changes reporting it.
610617 
618 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
619 
611620 - `type: "download_completed"`
612621 
613 - `"download_completed"`
614 
615622 - `url: string`
616623 
617624 The final post-redirect URL the download was served from.
618625 
626 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
627 
619628 - `path: optional string or null`
620629 
621630 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.
622631 
632 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
633 
623634 - `size_bytes: optional number or null`
624635 
625636 The completed download's size.
626637 
627 - `BrowserStateChangeDownloadFailed object { download_id, type, url, error }`
638 minimum: 0
639 
640 - `BrowserStateChangeDownloadFailed object`
628641 
629642 A file download that failed — or was cancelled — during this call.
630643 
from line 645
632645 
633646 The caller-assigned identifier for this download, stable across the state changes reporting it.
634647 
648 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
649 
635650 - `type: "download_failed"`
636651 
637 - `"download_failed"`
638 
639652 - `url: string`
640653 
641654 The final post-redirect URL the download was served from.
642655 
656 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
657 
643658 - `error: optional string or null`
644659 
645660 The failure or cancellation detail, when known.
646661 
662 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
663 
647664 - `is_error: optional boolean`
648665 
649666 - `toolset_name: optional string or null`
650667 
651668 For a toolset member tool_result, the toolset family of the paired tool_use.
652669 
653 - `ServerToolUseBlockParam object { id, input, name, 3 more }`
670 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
671 
672 - `ServerToolUseBlockParam object`
654673 
655674 - `id: string`
656675 
676 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
677 
657678 - `input: map[unknown]`
658679 
659680 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
from line 695
674695 
675696 - `type: "server_tool_use"`
676697 
677 - `"server_tool_use"`
678 
679698 - `cache_control: optional CacheControlEphemeral or null`
680699 
681700 Create a cache control breakpoint at this content block.
from line 703
684703 
685704 Tool invocation directly from the model.
686705 
687 - `DirectCaller object { type }`
706 - `DirectCaller object`
688707 
689708 Tool invocation directly from the model.
690709 
691 - `ServerToolCaller object { tool_id, type }`
710 - `ServerToolCaller object`
692711 
693712 Tool invocation generated by a server-side tool.
694713 
695 - `ServerToolCaller20260120 object { tool_id, type }`
696 
697 - `WebSearchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
714 - `ServerToolCaller20260120 object`
715 
716 - `WebSearchToolResultBlockParam object`
698717 
699718 - `content: WebSearchToolResultBlockParamContent`
700719 
from line 725
706725 
707726 - `type: "web_search_result"`
708727 
709 - `"web_search_result"`
710 
711728 - `url: string`
712729 
713730 - `page_age: optional string or null`
714731 
715 - `WebSearchToolRequestError object { error_code, type }`
732 - `WebSearchToolRequestError object`
716733 
717734 - `error_code: WebSearchToolResultErrorCode`
718735 
from line 747
730747 
731748 - `type: "web_search_tool_result_error"`
732749 
733 - `"web_search_tool_result_error"`
734 
735750 - `tool_use_id: string`
736751 
752 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
753 
737754 - `type: "web_search_tool_result"`
738755 
739 - `"web_search_tool_result"`
740 
741756 - `cache_control: optional CacheControlEphemeral or null`
742757 
743758 Create a cache control breakpoint at this content block.
from line 761
746761 
747762 Tool invocation directly from the model.
748763 
749 - `DirectCaller object { type }`
764 - `DirectCaller object`
750765 
751766 Tool invocation directly from the model.
752767 
753 - `ServerToolCaller object { tool_id, type }`
768 - `ServerToolCaller object`
754769 
755770 Tool invocation generated by a server-side tool.
756771 
757 - `ServerToolCaller20260120 object { tool_id, type }`
758 
759 - `WebFetchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
772 - `ServerToolCaller20260120 object`
773 
774 - `WebFetchToolResultBlockParam object`
760775 
761776 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
762777 
763 - `WebFetchToolResultErrorBlockParam object { error_code, type }`
778 - `WebFetchToolResultErrorBlockParam object`
764779 
765780 - `error_code: WebFetchToolResultErrorCode`
766781 
from line 799
784799 
785800 - `type: "web_fetch_tool_result_error"`
786801 
787 - `"web_fetch_tool_result_error"`
788 
789 - `WebFetchBlockParam object { content, type, url, retrieved_at }`
802 - `WebFetchBlockParam object`
790803 
791804 - `content: DocumentBlockParam`
792805 
793806 - `type: "web_fetch_result"`
794807 
795 - `"web_fetch_result"`
796 
797808 - `url: string`
798809 
799810 Fetched content URL
from line 815
804815 
805816 - `tool_use_id: string`
806817 
818 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
819 
807820 - `type: "web_fetch_tool_result"`
808821 
809 - `"web_fetch_tool_result"`
810 
811822 - `cache_control: optional CacheControlEphemeral or null`
812823 
813824 Create a cache control breakpoint at this content block.
from line 827
816827 
817828 Tool invocation directly from the model.
818829 
819 - `DirectCaller object { type }`
830 - `DirectCaller object`
820831 
821832 Tool invocation directly from the model.
822833 
823 - `ServerToolCaller object { tool_id, type }`
834 - `ServerToolCaller object`
824835 
825836 Tool invocation generated by a server-side tool.
826837 
827 - `ServerToolCaller20260120 object { tool_id, type }`
828 
829 - `CodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
838 - `ServerToolCaller20260120 object`
839 
840 - `CodeExecutionToolResultBlockParam object`
830841 
831842 - `content: CodeExecutionToolResultBlockParamContent`
832843 
833844 Code execution result with encrypted stdout for PFC + web_search results.
834845 
835 - `CodeExecutionToolResultErrorParam object { error_code, type }`
846 - `CodeExecutionToolResultErrorParam object`
836847 
837848 - `error_code: CodeExecutionToolResultErrorCode`
838849 
from line 857
846857 
847858 - `type: "code_execution_tool_result_error"`
848859 
849 - `"code_execution_tool_result_error"`
850 
851 - `CodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
860 - `CodeExecutionResultBlockParam object`
852861 
853862 - `content: array of CodeExecutionOutputBlockParam`
854863 
from line 865
856865 
857866 - `type: "code_execution_output"`
858867 
859 - `"code_execution_output"`
860 
861868 - `return_code: number`
862869 
863870 - `stderr: string`
from line 873
866873 
867874 - `type: "code_execution_result"`
868875 
869 - `"code_execution_result"`
870 
871 - `EncryptedCodeExecutionResultBlockParam object { content, encrypted_stdout, return_code, 2 more }`
876 - `EncryptedCodeExecutionResultBlockParam object`
872877 
873878 Code execution result with encrypted stdout for PFC + web_search results.
874879 
from line 891
886891 
887892 - `type: "encrypted_code_execution_result"`
888893 
889 - `"encrypted_code_execution_result"`
890 
891894 - `tool_use_id: string`
892895 
896 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
897 
893898 - `type: "code_execution_tool_result"`
894899 
895 - `"code_execution_tool_result"`
896 
897900 - `cache_control: optional CacheControlEphemeral or null`
898901 
899902 Create a cache control breakpoint at this content block.
900903 
901 - `BashCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
904 - `BashCodeExecutionToolResultBlockParam object`
902905 
903906 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
904907 
905 - `BashCodeExecutionToolResultErrorParam object { error_code, type }`
908 - `BashCodeExecutionToolResultErrorParam object`
906909 
907910 - `error_code: BashCodeExecutionToolResultErrorCode`
908911 
from line 921
918921 
919922 - `type: "bash_code_execution_tool_result_error"`
920923 
921 - `"bash_code_execution_tool_result_error"`
922 
923 - `BashCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
924 - `BashCodeExecutionResultBlockParam object`
924925 
925926 - `content: array of BashCodeExecutionOutputBlockParam`
926927 
from line 929
928929 
929930 - `type: "bash_code_execution_output"`
930931 
931 - `"bash_code_execution_output"`
932 
933932 - `return_code: number`
934933 
935934 - `stderr: string`
from line 937
938937 
939938 - `type: "bash_code_execution_result"`
940939 
941 - `"bash_code_execution_result"`
942 
943940 - `tool_use_id: string`
944941 
942 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
943 
945944 - `type: "bash_code_execution_tool_result"`
946945 
947 - `"bash_code_execution_tool_result"`
948 
949946 - `cache_control: optional CacheControlEphemeral or null`
950947 
951948 Create a cache control breakpoint at this content block.
952949 
953 - `TextEditorCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
950 - `TextEditorCodeExecutionToolResultBlockParam object`
954951 
955952 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
956953 
957 - `TextEditorCodeExecutionToolResultErrorParam object { error_code, type, error_message }`
954 - `TextEditorCodeExecutionToolResultErrorParam object`
958955 
959956 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
960957 
from line 967
970967 
971968 - `type: "text_editor_code_execution_tool_result_error"`
972969 
973 - `"text_editor_code_execution_tool_result_error"`
974 
975970 - `error_message: optional string or null`
976971 
977 - `TextEditorCodeExecutionViewResultBlockParam object { content, file_type, type, 3 more }`
972 - `TextEditorCodeExecutionViewResultBlockParam object`
978973 
979974 - `content: string`
980975 
from line 983
988983 
989984 - `type: "text_editor_code_execution_view_result"`
990985 
991 - `"text_editor_code_execution_view_result"`
992 
993986 - `num_lines: optional number or null`
994987 
995988 - `start_line: optional number or null`
996989 
997990 - `total_lines: optional number or null`
998991 
999 - `TextEditorCodeExecutionCreateResultBlockParam object { is_file_update, type }`
992 - `TextEditorCodeExecutionCreateResultBlockParam object`
1000993 
1001994 - `is_file_update: boolean`
1002995 
1003996 - `type: "text_editor_code_execution_create_result"`
1004997 
1005 - `"text_editor_code_execution_create_result"`
1006 
1007 - `TextEditorCodeExecutionStrReplaceResultBlockParam object { type, lines, new_lines, 3 more }`
998 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1008999 
10091000 - `type: "text_editor_code_execution_str_replace_result"`
10101001 
1011 - `"text_editor_code_execution_str_replace_result"`
1012 
10131002 - `lines: optional array of string or null`
10141003 
10151004 - `new_lines: optional number or null`
from line 1011
10221011 
10231012 - `tool_use_id: string`
10241013 
1014 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1015 
10251016 - `type: "text_editor_code_execution_tool_result"`
10261017 
1027 - `"text_editor_code_execution_tool_result"`
1028 
10291018 - `cache_control: optional CacheControlEphemeral or null`
10301019 
10311020 Create a cache control breakpoint at this content block.
10321021 
1033 - `ToolSearchToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1022 - `ToolSearchToolResultBlockParam object`
10341023 
10351024 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
10361025 
1037 - `ToolSearchToolResultErrorParam object { error_code, type, error_message }`
1026 - `ToolSearchToolResultErrorParam object`
10381027 
10391028 - `error_code: ToolSearchToolResultErrorCode`
10401029 
from line 1037
10481037 
10491038 - `type: "tool_search_tool_result_error"`
10501039 
1051 - `"tool_search_tool_result_error"`
1052 
10531040 - `error_message: optional string or null`
10541041 
1055 - `ToolSearchToolSearchResultBlockParam object { tool_references, type }`
1042 - `ToolSearchToolSearchResultBlockParam object`
10561043 
10571044 - `tool_references: array of ToolReferenceBlockParam`
10581045 
10591046 - `tool_name: string`
10601047 
1048 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1049 
10611050 - `type: "tool_reference"`
10621051 
10631052 - `cache_control: optional CacheControlEphemeral or null`
from line 1055
10661055 
10671056 - `type: "tool_search_tool_search_result"`
10681057 
1069 - `"tool_search_tool_search_result"`
1070 
10711058 - `tool_use_id: string`
10721059 
1060 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1061 
10731062 - `type: "tool_search_tool_result"`
10741063 
1075 - `"tool_search_tool_result"`
1076 
10771064 - `cache_control: optional CacheControlEphemeral or null`
10781065 
10791066 Create a cache control breakpoint at this content block.
10801067 
1081 - `ContainerUploadBlockParam object { file_id, type, cache_control }`
1068 - `ContainerUploadBlockParam object`
10821069 
10831070 A content block that represents a file to be uploaded to the container
10841071 Files uploaded via this block will be available in the container's input directory.
from line 1074
10871074 
10881075 - `type: "container_upload"`
10891076 
1090 - `"container_upload"`
1091 
10921077 - `cache_control: optional CacheControlEphemeral or null`
10931078 
10941079 Create a cache control breakpoint at this content block.
from line 1168
11831168 
11841169 Container identifier for reuse across requests.
11851170 
1186 - `ContainerParams object { id, skills }`
1171 - `ContainerParams object`
11871172 
11881173 Container parameters with skills to be loaded.
11891174 
from line 1180
11951180 
11961181 List of skills to load in the container
11971182 
1183 maxItems: 20
1184 
11981185 - `skill_id: string`
11991186 
12001187 Skill ID
12011188 
1189 maxLength: 64, minLength: 1
1190 
12021191 - `type: "anthropic" or "custom"`
12031192 
12041193 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 1200
12111200 
12121201 Skill version or 'latest' for most recent version
12131202 
1203 maxLength: 64, minLength: 1
1204 
12141205 - `string`
12151206 
12161207 - `inference_geo: optional string or null`
from line 1218
12271218 
12281219 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.
12291220 
1221 maxLength: 512
1222 
12301223 - `output_config: optional OutputConfig`
12311224 
12321225 Configuration options for the model's output, such as the output format.
from line 1248
12551248 
12561249 - `type: "json_schema"`
12571250 
1258 - `"json_schema"`
1259 
12601251 - `service_tier: optional "auto" or "standard_only"`
12611252 
12621253 Determines whether to use priority capacity (if available) or standard capacity for this request.
from line 1284
12931284 
12941285 - `text: string`
12951286 
1287 minLength: 1
1288 
12961289 - `type: "text"`
12971290 
12981291 - `cache_control: optional CacheControlEphemeral or null`
from line 1294
13011294 
13021295 - `citations: optional array of TextCitationParam or null`
13031296 
1304 - `temperature: optional number`
1305 
1306 Amount of randomness injected into the response.
1307 
1308 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.
1309 
1310 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
1311 
13121297 - `thinking: optional ThinkingConfigParam`
13131298 
13141299 Configuration for enabling Claude's extended thinking.
from line 1302
13171302 
13181303 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
13191304 
1320 - `ThinkingConfigEnabled object { budget_tokens, type, display }`
1305 - `ThinkingConfigEnabled object`
13211306 
13221307 - `budget_tokens: number`
13231308 
from line 1312
13271312 
13281313 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
13291314 
1315 minimum: 1024
1316 
13301317 - `type: "enabled"`
13311318 
1332 - `"enabled"`
1333 
13341319 - `display: optional "summarized" or "omitted" or null`
13351320 
13361321 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`.
from line 1324
13391324 
13401325 - `"omitted"`
13411326 
1342 - `ThinkingConfigDisabled object { type }`
1327 - `ThinkingConfigDisabled object`
13431328 
13441329 - `type: "disabled"`
13451330 
1346 - `"disabled"`
1347 
1348 - `ThinkingConfigAdaptive object { type, display }`
1331 - `ThinkingConfigAdaptive object`
13491332 
13501333 - `type: "adaptive"`
13511334 
1352 - `"adaptive"`
1353 
13541335 - `display: optional "summarized" or "omitted" or null`
13551336 
13561337 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`.
from line 1344
13631344 
13641345 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.
13651346 
1366 - `ToolChoiceAuto object { type, disable_parallel_tool_use }`
1347 - `ToolChoiceAuto object`
13671348 
13681349 The model will automatically decide whether to use tools.
13691350 
13701351 - `type: "auto"`
13711352 
1372 - `"auto"`
1373 
13741353 - `disable_parallel_tool_use: optional boolean`
13751354 
13761355 Whether to disable parallel tool use.
13771356 
13781357 Defaults to `false`. If set to `true`, the model will output at most one tool use.
13791358 
1380 - `ToolChoiceAny object { type, disable_parallel_tool_use }`
1359 - `ToolChoiceAny object`
13811360 
13821361 The model will use any available tools.
13831362 
13841363 - `type: "any"`
13851364 
1386 - `"any"`
1387 
13881365 - `disable_parallel_tool_use: optional boolean`
13891366 
13901367 Whether to disable parallel tool use.
13911368 
13921369 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
13931370 
1394 - `ToolChoiceTool object { name, type, disable_parallel_tool_use }`
1371 - `ToolChoiceTool object`
13951372 
13961373 The model will use the specified tool with `tool_choice.name`.
13971374 
from line 1378
14011378 
14021379 - `type: "tool"`
14031380 
1404 - `"tool"`
1405 
14061381 - `disable_parallel_tool_use: optional boolean`
14071382 
14081383 Whether to disable parallel tool use.
14091384 
14101385 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
14111386 
1412 - `ToolChoiceNone object { type }`
1387 - `ToolChoiceNone object`
14131388 
14141389 The model will not be allowed to use tools.
14151390 
14161391 - `type: "none"`
1417 
1418 - `"none"`
14191392 
14201393 - `tools: optional array of ToolUnion`
14211394 
from line 1454
14811454 
14821455 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
14831456 
1484 - `Tool object { input_schema, name, allowed_callers, 7 more }`
1485 
1486 - `input_schema: object { type, properties, required }`
1457 - `Tool object`
1458 
1459 - `input_schema: object`
14871460 
14881461 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
14891462 
from line 1464
14911464 
14921465 - `type: "object"`
14931466 
1494 - `"object"`
1495 
14961467 - `properties: optional map[unknown] or null`
14971468 
14981469 - `required: optional array of string or null`
from line 1474
15031474 
15041475 This is how the tool will be called by the model and in `tool_use` blocks.
15051476 
1477 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$
1478 
15061479 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15071480 
15081481 - `"direct"`
from line 1512
15391512 
15401513 - `type: optional "custom" or null`
15411514 
1542 - `"custom"`
1543 
1544 - `ToolBash20250124 object { name, type, allowed_callers, 4 more }`
1515 - `ToolBash20250124 object`
15451516 
15461517 - `name: "bash"`
15471518 
from line 1520
15491520 
15501521 This is how the tool will be called by the model and in `tool_use` blocks.
15511522 
1552 - `"bash"`
1553 
15541523 - `type: "bash_20250124"`
15551524 
1556 - `"bash_20250124"`
1557 
15581525 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15591526 
15601527 - `"direct"`
from line 1546
15791546 
15801547 When true, guarantees schema validation on tool names and inputs
15811548 
1582 - `CodeExecutionTool20250522 object { name, type, allowed_callers, 3 more }`
1549 - `CodeExecutionTool20250522 object`
15831550 
15841551 - `name: "code_execution"`
15851552 
from line 1554
15871554 
15881555 This is how the tool will be called by the model and in `tool_use` blocks.
15891556 
1590 - `"code_execution"`
1591 
15921557 - `type: "code_execution_20250522"`
15931558 
1594 - `"code_execution_20250522"`
1595 
15961559 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15971560 
15981561 - `"direct"`
from line 1578
16151578 
16161579 When true, guarantees schema validation on tool names and inputs
16171580 
1618 - `CodeExecutionTool20250825 object { name, type, allowed_callers, 3 more }`
1581 - `CodeExecutionTool20250825 object`
16191582 
16201583 - `name: "code_execution"`
16211584 
from line 1586
16231586 
16241587 This is how the tool will be called by the model and in `tool_use` blocks.
16251588 
1626 - `"code_execution"`
1627 
16281589 - `type: "code_execution_20250825"`
16291590 
1591 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1592 
1593 - `"direct"`
1594 
16301595 - `"code_execution_20250825"`
16311596 
1597 - `"code_execution_20260120"`
1598 
1599 - `"code_execution_20260521"`
1600 
1601 - `cache_control: optional CacheControlEphemeral or null`
1602 
1603 Create a cache control breakpoint at this content block.
1604 
1605 - `defer_loading: optional boolean`
1606 
1607 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1608 
1609 - `strict: optional boolean`
1610 
1611 When true, guarantees schema validation on tool names and inputs
1612 
1613 - `CodeExecutionTool20260120 object`
1614 
1615 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1616 
1617 - `name: "code_execution"`
1618 
1619 Name of the tool.
1620 
1621 This is how the tool will be called by the model and in `tool_use` blocks.
1622 
1623 - `type: "code_execution_20260120"`
1624 
16321625 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16331626 
16341627 - `"direct"`
from line 1644
16511644 
16521645 When true, guarantees schema validation on tool names and inputs
16531646 
1654 - `CodeExecutionTool20260120 object { name, type, allowed_callers, 3 more }`
1655 
1656 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1647 - `CodeExecutionTool20260521 object`
1648 
1649 Code execution tool with REPL state persistence.
16571650 
16581651 - `name: "code_execution"`
16591652 
from line 1654
16611654 
16621655 This is how the tool will be called by the model and in `tool_use` blocks.
16631656 
1664 - `"code_execution"`
1665 
1666 - `type: "code_execution_20260120"`
1657 - `type: "code_execution_20260521"`
1658 
1659 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1660 
1661 - `"direct"`
1662 
1663 - `"code_execution_20250825"`
16671664 
16681665 - `"code_execution_20260120"`
16691666 
1670 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1671 
1672 - `"direct"`
1673 
1674 - `"code_execution_20250825"`
1675 
1676 - `"code_execution_20260120"`
1677 
16781667 - `"code_execution_20260521"`
16791668 
16801669 - `cache_control: optional CacheControlEphemeral or null`
from line 1678
16891678 
16901679 When true, guarantees schema validation on tool names and inputs
16911680 
1692 - `CodeExecutionTool20260521 object { name, type, allowed_callers, 3 more }`
1693 
1694 Code execution tool with REPL state persistence.
1695 
1696 - `name: "code_execution"`
1697 
1698 Name of the tool.
1699 
1700 This is how the tool will be called by the model and in `tool_use` blocks.
1701 
1702 - `"code_execution"`
1703 
1704 - `type: "code_execution_20260521"`
1705 
1706 - `"code_execution_20260521"`
1707 
1708 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1709 
1710 - `"direct"`
1711 
1712 - `"code_execution_20250825"`
1713 
1714 - `"code_execution_20260120"`
1715 
1716 - `"code_execution_20260521"`
1717 
1718 - `cache_control: optional CacheControlEphemeral or null`
1719 
1720 Create a cache control breakpoint at this content block.
1721 
1722 - `defer_loading: optional boolean`
1723 
1724 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1725 
1726 - `strict: optional boolean`
1727 
1728 When true, guarantees schema validation on tool names and inputs
1729 
1730 - `BrowserToolset20260801 object { type, allowed_callers, cache_control, configs }`
1681 - `BrowserToolset20260801 object`
17311682 
17321683 The browser toolset: a single `tools[]` entry (carrying no
17331684 `name`) that declares the browser tool family. The model is served
from line 1686
17351686 from its schema.
17361687 
17371688 - `type: "browser_toolset_20260801"`
1738 
1739 - `"browser_toolset_20260801"`
17401689 
17411690 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
17421691 
from line 2082
21332082 
21342083 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.
21352084 
2136 - `MemoryTool20250818 object { name, type, allowed_callers, 4 more }`
2085 - `MemoryTool20250818 object`
21372086 
21382087 - `name: "memory"`
21392088 
from line 2090
21412090 
21422091 This is how the tool will be called by the model and in `tool_use` blocks.
21432092 
2144 - `"memory"`
2145 
21462093 - `type: "memory_20250818"`
21472094 
2148 - `"memory_20250818"`
2149 
21502095 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21512096 
21522097 - `"direct"`
from line 2116
21712116 
21722117 When true, guarantees schema validation on tool names and inputs
21732118 
2174 - `ComputerToolset20260801 object { type, allowed_callers, cache_control, configs }`
2119 - `ComputerToolset20260801 object`
21752120 
21762121 The computer toolset: a single `tools[]` entry (carrying no
21772122 `name`) that declares the computer tool family. The model is
from line 2129
21842129 
21852130 - `type: "computer_toolset_20260801"`
21862131 
2187 - `"computer_toolset_20260801"`
2188 
21892132 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21902133 
21912134 - `"direct"`
from line 2356
24132356 
24142357 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.
24152358 
2416 - `ToolTextEditor20250124 object { name, type, allowed_callers, 4 more }`
2359 - `ToolTextEditor20250124 object`
24172360 
24182361 - `name: "str_replace_editor"`
24192362 
from line 2364
24212364 
24222365 This is how the tool will be called by the model and in `tool_use` blocks.
24232366 
2424 - `"str_replace_editor"`
2425 
24262367 - `type: "text_editor_20250124"`
24272368 
2428 - `"text_editor_20250124"`
2429 
24302369 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24312370 
24322371 - `"direct"`
from line 2390
24512390 
24522391 When true, guarantees schema validation on tool names and inputs
24532392 
2454 - `ToolTextEditor20250429 object { name, type, allowed_callers, 4 more }`
2393 - `ToolTextEditor20250429 object`
24552394 
24562395 - `name: "str_replace_based_edit_tool"`
24572396 
from line 2398
24592398 
24602399 This is how the tool will be called by the model and in `tool_use` blocks.
24612400 
2462 - `"str_replace_based_edit_tool"`
2463 
24642401 - `type: "text_editor_20250429"`
24652402 
2466 - `"text_editor_20250429"`
2467 
24682403 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24692404 
24702405 - `"direct"`
from line 2424
24892424 
24902425 When true, guarantees schema validation on tool names and inputs
24912426 
2492 - `ToolTextEditor20250728 object { name, type, allowed_callers, 5 more }`
2427 - `ToolTextEditor20250728 object`
24932428 
24942429 - `name: "str_replace_based_edit_tool"`
24952430 
from line 2432
24972432 
24982433 This is how the tool will be called by the model and in `tool_use` blocks.
24992434 
2500 - `"str_replace_based_edit_tool"`
2501 
25022435 - `type: "text_editor_20250728"`
25032436 
2504 - `"text_editor_20250728"`
2505 
25062437 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25072438 
25082439 - `"direct"`
from line 2458
25272458 
25282459 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
25292460 
2461 minimum: 1
2462 
25302463 - `strict: optional boolean`
25312464 
25322465 When true, guarantees schema validation on tool names and inputs
25332466 
2534 - `WebSearchTool20250305 object { name, type, allowed_callers, 7 more }`
2467 - `WebSearchTool20250305 object`
25352468 
25362469 - `name: "web_search"`
25372470 
from line 2472
25392472 
25402473 This is how the tool will be called by the model and in `tool_use` blocks.
25412474 
2542 - `"web_search"`
2543 
25442475 - `type: "web_search_20250305"`
25452476 
2546 - `"web_search_20250305"`
2547 
25482477 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25492478 
25502479 - `"direct"`
from line 2504
25752504 
25762505 Maximum number of times the tool can be used in the API request.
25772506 
2507 exclusiveMinimum: 0
2508 
25782509 - `strict: optional boolean`
25792510 
25802511 When true, guarantees schema validation on tool names and inputs
from line 2516
25852516 
25862517 - `type: "approximate"`
25872518 
2588 - `"approximate"`
2589 
25902519 - `city: optional string or null`
25912520 
25922521 The city of the user.
25932522 
2523 maxLength: 255, minLength: 1
2524 
25942525 - `country: optional string or null`
25952526 
25962527 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
25972528 
2529 maxLength: 2, minLength: 2
2530 
25982531 - `region: optional string or null`
25992532 
26002533 The region of the user.
26012534 
2535 maxLength: 255, minLength: 1
2536 
26022537 - `timezone: optional string or null`
26032538 
26042539 The [IANA timezone](https://nodatime.org/TimeZones) of the user.
26052540 
2606 - `WebFetchTool20250910 object { name, type, allowed_callers, 8 more }`
2541 maxLength: 255, minLength: 1
2542 
2543 - `WebFetchTool20250910 object`
26072544 
26082545 - `name: "web_fetch"`
26092546 
from line 2548
26112548 
26122549 This is how the tool will be called by the model and in `tool_use` blocks.
26132550 
2614 - `"web_fetch"`
2615 
26162551 - `type: "web_fetch_20250910"`
26172552 
2618 - `"web_fetch_20250910"`
2619 
26202553 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26212554 
26222555 - `"direct"`
from line 2584
26512584 
26522585 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.
26532586 
2587 exclusiveMinimum: 0
2588 
26542589 - `max_uses: optional number or null`
26552590 
26562591 Maximum number of times the tool can be used in the API request.
26572592 
2593 exclusiveMinimum: 0
2594 
26582595 - `strict: optional boolean`
26592596 
26602597 When true, guarantees schema validation on tool names and inputs
26612598 
2662 - `WebSearchTool20260209 object { name, type, allowed_callers, 7 more }`
2599 - `WebSearchTool20260209 object`
26632600 
26642601 - `name: "web_search"`
26652602 
from line 2604
26672604 
26682605 This is how the tool will be called by the model and in `tool_use` blocks.
26692606 
2670 - `"web_search"`
2671 
26722607 - `type: "web_search_20260209"`
26732608 
2674 - `"web_search_20260209"`
2675 
26762609 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26772610 
26782611 - `"direct"`
from line 2636
27032636 
27042637 Maximum number of times the tool can be used in the API request.
27052638 
2639 exclusiveMinimum: 0
2640 
27062641 - `strict: optional boolean`
27072642 
27082643 When true, guarantees schema validation on tool names and inputs
from line 2646
27112646 
27122647 Parameters for the user's location. Used to provide more relevant search results.
27132648 
2714 - `WebFetchTool20260209 object { name, type, allowed_callers, 8 more }`
2649 - `WebFetchTool20260209 object`
27152650 
27162651 - `name: "web_fetch"`
27172652 
from line 2654
27192654 
27202655 This is how the tool will be called by the model and in `tool_use` blocks.
27212656 
2722 - `"web_fetch"`
2723 
27242657 - `type: "web_fetch_20260209"`
27252658 
2726 - `"web_fetch_20260209"`
2727 
27282659 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27292660 
27302661 - `"direct"`
from line 2690
27592690 
27602691 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.
27612692 
2693 exclusiveMinimum: 0
2694 
27622695 - `max_uses: optional number or null`
27632696 
27642697 Maximum number of times the tool can be used in the API request.
27652698 
2699 exclusiveMinimum: 0
2700 
27662701 - `strict: optional boolean`
27672702 
27682703 When true, guarantees schema validation on tool names and inputs
27692704 
2770 - `WebFetchTool20260309 object { name, type, allowed_callers, 9 more }`
2705 - `WebFetchTool20260309 object`
27712706 
27722707 Web fetch tool with use_cache parameter for bypassing cached content.
27732708 
from line 2712
27772712 
27782713 This is how the tool will be called by the model and in `tool_use` blocks.
27792714 
2780 - `"web_fetch"`
2781 
27822715 - `type: "web_fetch_20260309"`
27832716 
2784 - `"web_fetch_20260309"`
2785 
27862717 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27872718 
27882719 - `"direct"`
from line 2748
28172748 
28182749 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.
28192750 
2751 exclusiveMinimum: 0
2752 
28202753 - `max_uses: optional number or null`
28212754 
28222755 Maximum number of times the tool can be used in the API request.
28232756 
2757 exclusiveMinimum: 0
2758 
28242759 - `strict: optional boolean`
28252760 
28262761 When true, guarantees schema validation on tool names and inputs
from line 2764
28292764 
28302765 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.
28312766 
2832 - `WebSearchTool20260318 object { name, type, allowed_callers, 8 more }`
2767 - `WebSearchTool20260318 object`
28332768 
28342769 - `name: "web_search"`
28352770 
from line 2772
28372772 
28382773 This is how the tool will be called by the model and in `tool_use` blocks.
28392774 
2840 - `"web_search"`
2841 
28422775 - `type: "web_search_20260318"`
28432776 
2844 - `"web_search_20260318"`
2845 
28462777 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28472778 
28482779 - `"direct"`
from line 2804
28732804 
28742805 Maximum number of times the tool can be used in the API request.
28752806 
2807 exclusiveMinimum: 0
2808 
28762809 - `response_inclusion: optional "full" or "excluded"`
28772810 
28782811 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.
from line 2822
28892822 
28902823 Parameters for the user's location. Used to provide more relevant search results.
28912824 
2892 - `WebFetchTool20260318 object { name, type, allowed_callers, 10 more }`
2825 - `WebFetchTool20260318 object`
28932826 
28942827 - `name: "web_fetch"`
28952828 
from line 2830
28972830 
28982831 This is how the tool will be called by the model and in `tool_use` blocks.
28992832 
2900 - `"web_fetch"`
2901 
29022833 - `type: "web_fetch_20260318"`
29032834 
2904 - `"web_fetch_20260318"`
2905 
29062835 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29072836 
29082837 - `"direct"`
from line 2866
29372866 
29382867 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.
29392868 
2869 exclusiveMinimum: 0
2870 
29402871 - `max_uses: optional number or null`
29412872 
29422873 Maximum number of times the tool can be used in the API request.
29432874 
2875 exclusiveMinimum: 0
2876 
29442877 - `response_inclusion: optional "full" or "excluded"`
29452878 
29462879 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.
from line 2890
29572890 
29582891 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.
29592892 
2960 - `ToolSearchToolBm25_20251119 object { name, type, allowed_callers, 3 more }`
2893 - `ToolSearchToolBm25_20251119 object`
29612894 
29622895 - `name: "tool_search_tool_bm25"`
29632896 
from line 2898
29652898 
29662899 This is how the tool will be called by the model and in `tool_use` blocks.
29672900 
2901 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2902 
2903 - `"tool_search_tool_bm25_20251119"`
2904 
29682905 - `"tool_search_tool_bm25"`
29692906 
2970 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2971 
2972 - `"tool_search_tool_bm25_20251119"`
2973 
2974 - `"tool_search_tool_bm25"`
2975 
29762907 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29772908 
29782909 - `"direct"`
from line 2926
29952926 
29962927 When true, guarantees schema validation on tool names and inputs
29972928 
2998 - `ToolSearchToolRegex20251119 object { name, type, allowed_callers, 3 more }`
2929 - `ToolSearchToolRegex20251119 object`
29992930 
30002931 - `name: "tool_search_tool_regex"`
30012932 
from line 2934
30032934 
30042935 This is how the tool will be called by the model and in `tool_use` blocks.
30052936 
2937 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2938 
2939 - `"tool_search_tool_regex_20251119"`
2940 
30062941 - `"tool_search_tool_regex"`
30072942 
3008 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3009 
3010 - `"tool_search_tool_regex_20251119"`
3011 
3012 - `"tool_search_tool_regex"`
3013 
30142943 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
30152944 
30162945 - `"direct"`
from line 2962
30332962 
30342963 When true, guarantees schema validation on tool names and inputs
30352964 
2965 - `temperature: optional number`
2966 
2967 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
2968 
2969 Amount of randomness injected into the response.
2970 
2971 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.
2972 
2973 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
2974 
2975 maximum: 1, minimum: 0
2976 
30362977 - `top_k: optional number`
30372978 
2979 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
2980 
30382981 Only sample from the top K options for each subsequent token.
30392982 
30402983 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
30412984 
30422985 Recommended for advanced use cases only.
30432986 
2987 minimum: 0
2988 
30442989 - `top_p: optional number`
30452990 
2991 **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.
2992 
30462993 Use nucleus sampling.
30472994 
30482995 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`.
30492996 
30502997 Recommended for advanced use cases only.
30512998 
2999 maximum: 1, minimum: 0
3000 
30523001### Returns
30533002 
3054- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
3003- `MessageBatch object`
30553004 
30563005 - `id: string`
30573006 
from line 3012
30633012 
30643013 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
30653014 
3015 format: date-time
3016 
30663017 - `cancel_initiated_at: string or null`
30673018 
30683019 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
30693020 
3021 format: date-time
3022 
30703023 - `created_at: string`
30713024 
30723025 RFC 3339 datetime string representing the time at which the Message Batch was created.
30733026 
3027 format: date-time
3028 
30743029 - `ended_at: string or null`
30753030 
30763031 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
30773032 
30783033 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
30793034 
3035 format: date-time
3036 
30803037 - `expires_at: string`
30813038 
30823039 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
30833040 
3041 format: date-time
3042 
30843043 - `processing_status: "in_progress" or "canceling" or "ended"`
30853044 
30863045 Processing status of the Message Batch.
from line 3062
31033062 
31043063 This is zero until processing of the entire Message Batch has ended.
31053064 
3065 default: 0
3066 
31063067 - `errored: number`
31073068 
31083069 Number of requests in the Message Batch that encountered an error.
31093070 
31103071 This is zero until processing of the entire Message Batch has ended.
31113072 
3073 default: 0
3074 
31123075 - `expired: number`
31133076 
31143077 Number of requests in the Message Batch that have expired.
31153078 
31163079 This is zero until processing of the entire Message Batch has ended.
31173080 
3081 default: 0
3082 
31183083 - `processing: number`
31193084 
31203085 Number of requests in the Message Batch that are processing.
31213086 
3087 default: 0
3088 
31223089 - `succeeded: number`
31233090 
31243091 Number of requests in the Message Batch that have completed successfully.
31253092 
31263093 This is zero until processing of the entire Message Batch has ended.
31273094 
3095 default: 0
3096 
31283097 - `results_url: string or null`
31293098 
31303099 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3106
31373106 
31383107 For Message Batches, this is always `"message_batch"`.
31393108 
3140 - `"message_batch"`
3109 default: message_batch
31413110 
31423111### Example
31433112 
3144```http
3113```bash
31453114curl https://api.anthropic.com/v1/messages/batches \
31463115 -H 'Content-Type: application/json' \
31473116 -H 'anthropic-version: 2023-06-01' \
from line 3134
31653134 }'
31663135```
31673136 
3168#### Response
3137#### Response (200)
31693138 
31703139```json
31713140{
from line 3159
31903159 
31913160## Retrieve a Message Batch
31923161 
3193**get** `/v1/messages/batches/{message_batch_id}`
3162**GET** `/v1/messages/batches/{message_batch_id}`
31943163 
31953164This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
31963165 
31973166Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
31983167 
3199### Path Parameters
3168### Path parameters
32003169 
32013170- `message_batch_id: string`
32023171 
from line 3173
32043173 
32053174### Returns
32063175 
3207- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
3176- `MessageBatch object`
32083177 
32093178 - `id: string`
32103179 
from line 3185
32163185 
32173186 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
32183187 
3188 format: date-time
3189 
32193190 - `cancel_initiated_at: string or null`
32203191 
32213192 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
32223193 
3194 format: date-time
3195 
32233196 - `created_at: string`
32243197 
32253198 RFC 3339 datetime string representing the time at which the Message Batch was created.
32263199 
3200 format: date-time
3201 
32273202 - `ended_at: string or null`
32283203 
32293204 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
32303205 
32313206 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
32323207 
3208 format: date-time
3209 
32333210 - `expires_at: string`
32343211 
32353212 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
32363213 
3214 format: date-time
3215 
32373216 - `processing_status: "in_progress" or "canceling" or "ended"`
32383217 
32393218 Processing status of the Message Batch.
from line 3235
32563235 
32573236 This is zero until processing of the entire Message Batch has ended.
32583237 
3238 default: 0
3239 
32593240 - `errored: number`
32603241 
32613242 Number of requests in the Message Batch that encountered an error.
32623243 
32633244 This is zero until processing of the entire Message Batch has ended.
32643245 
3246 default: 0
3247 
32653248 - `expired: number`
32663249 
32673250 Number of requests in the Message Batch that have expired.
32683251 
32693252 This is zero until processing of the entire Message Batch has ended.
32703253 
3254 default: 0
3255 
32713256 - `processing: number`
32723257 
32733258 Number of requests in the Message Batch that are processing.
32743259 
3260 default: 0
3261 
32753262 - `succeeded: number`
32763263 
32773264 Number of requests in the Message Batch that have completed successfully.
32783265 
32793266 This is zero until processing of the entire Message Batch has ended.
32803267 
3268 default: 0
3269 
32813270 - `results_url: string or null`
32823271 
32833272 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3279
32903279 
32913280 For Message Batches, this is always `"message_batch"`.
32923281 
3293 - `"message_batch"`
3282 default: message_batch
32943283 
32953284### Example
32963285 
3297```http
3286```bash
32983287curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
32993288 -H 'anthropic-version: 2023-06-01' \
33003289 -H "X-Api-Key: $ANTHROPIC_API_KEY"
33013290```
33023291 
3303#### Response
3292#### Response (200)
33043293 
33053294```json
33063295{
from line 3314
33253314 
33263315## List Message Batches
33273316 
3328**get** `/v1/messages/batches`
3317**GET** `/v1/messages/batches`
33293318 
33303319List all Message Batches within a Workspace. Most recently created batches are returned first.
33313320 
33323321Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
33333322 
3334### Query Parameters
3323### Query parameters
33353324 
33363325- `after_id: optional string`
33373326 
from line 3336
33473336 
33483337 Defaults to `20`. Ranges from `1` to `1000`.
33493338 
3339 default: 20, maximum: 1000, minimum: 1
3340 
33503341### Returns
33513342 
33523343- `data: array of MessageBatch`
from line 3352
33613352 
33623353 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
33633354 
3355 format: date-time
3356 
33643357 - `cancel_initiated_at: string or null`
33653358 
33663359 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
33673360 
3361 format: date-time
3362 
33683363 - `created_at: string`
33693364 
33703365 RFC 3339 datetime string representing the time at which the Message Batch was created.
33713366 
3367 format: date-time
3368 
33723369 - `ended_at: string or null`
33733370 
33743371 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
33753372 
33763373 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
33773374 
3375 format: date-time
3376 
33783377 - `expires_at: string`
33793378 
33803379 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
33813380 
3381 format: date-time
3382 
33823383 - `processing_status: "in_progress" or "canceling" or "ended"`
33833384 
33843385 Processing status of the Message Batch.
from line 3402
34013402 
34023403 This is zero until processing of the entire Message Batch has ended.
34033404 
3405 default: 0
3406 
34043407 - `errored: number`
34053408 
34063409 Number of requests in the Message Batch that encountered an error.
34073410 
34083411 This is zero until processing of the entire Message Batch has ended.
34093412 
3413 default: 0
3414 
34103415 - `expired: number`
34113416 
34123417 Number of requests in the Message Batch that have expired.
34133418 
34143419 This is zero until processing of the entire Message Batch has ended.
34153420 
3421 default: 0
3422 
34163423 - `processing: number`
34173424 
34183425 Number of requests in the Message Batch that are processing.
34193426 
3427 default: 0
3428 
34203429 - `succeeded: number`
34213430 
34223431 Number of requests in the Message Batch that have completed successfully.
34233432 
34243433 This is zero until processing of the entire Message Batch has ended.
34253434 
3435 default: 0
3436 
34263437 - `results_url: string or null`
34273438 
34283439 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3446
34353446 
34363447 For Message Batches, this is always `"message_batch"`.
34373448 
3438 - `"message_batch"`
3449 default: message_batch
34393450 
34403451- `first_id: string or null`
34413452 
from line 3462
34513462 
34523463### Example
34533464 
3454```http
3465```bash
34553466curl https://api.anthropic.com/v1/messages/batches \
34563467 -H 'anthropic-version: 2023-06-01' \
34573468 -H "X-Api-Key: $ANTHROPIC_API_KEY"
34583469```
34593470 
3460#### Response
3471#### Response (200)
34613472 
34623473```json
34633474{
from line 3500
34893500 
34903501## Cancel a Message Batch
34913502 
3492**post** `/v1/messages/batches/{message_batch_id}/cancel`
3503**POST** `/v1/messages/batches/{message_batch_id}/cancel`
34933504 
34943505Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
34953506 
from line 3508
34973508 
34983509Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
34993510 
3500### Path Parameters
3511### Path parameters
35013512 
35023513- `message_batch_id: string`
35033514 
from line 3516
35053516 
35063517### Returns
35073518 
3508- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
3519- `MessageBatch object`
35093520 
35103521 - `id: string`
35113522 
from line 3528
35173528 
35183529 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
35193530 
3531 format: date-time
3532 
35203533 - `cancel_initiated_at: string or null`
35213534 
35223535 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
35233536 
3537 format: date-time
3538 
35243539 - `created_at: string`
35253540 
35263541 RFC 3339 datetime string representing the time at which the Message Batch was created.
35273542 
3543 format: date-time
3544 
35283545 - `ended_at: string or null`
35293546 
35303547 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
35313548 
35323549 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
35333550 
3551 format: date-time
3552 
35343553 - `expires_at: string`
35353554 
35363555 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
35373556 
3557 format: date-time
3558 
35383559 - `processing_status: "in_progress" or "canceling" or "ended"`
35393560 
35403561 Processing status of the Message Batch.
from line 3578
35573578 
35583579 This is zero until processing of the entire Message Batch has ended.
35593580 
3581 default: 0
3582 
35603583 - `errored: number`
35613584 
35623585 Number of requests in the Message Batch that encountered an error.
35633586 
35643587 This is zero until processing of the entire Message Batch has ended.
35653588 
3589 default: 0
3590 
35663591 - `expired: number`
35673592 
35683593 Number of requests in the Message Batch that have expired.
35693594 
35703595 This is zero until processing of the entire Message Batch has ended.
35713596 
3597 default: 0
3598 
35723599 - `processing: number`
35733600 
35743601 Number of requests in the Message Batch that are processing.
35753602 
3603 default: 0
3604 
35763605 - `succeeded: number`
35773606 
35783607 Number of requests in the Message Batch that have completed successfully.
35793608 
35803609 This is zero until processing of the entire Message Batch has ended.
35813610 
3611 default: 0
3612 
35823613 - `results_url: string or null`
35833614 
35843615 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3622
35913622 
35923623 For Message Batches, this is always `"message_batch"`.
35933624 
3594 - `"message_batch"`
3625 default: message_batch
35953626 
35963627### Example
35973628 
3598```http
3629```bash
35993630curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \
36003631 -X POST \
36013632 -H 'anthropic-version: 2023-06-01' \
36023633 -H "X-Api-Key: $ANTHROPIC_API_KEY"
36033634```
36043635 
3605#### Response
3636#### Response (200)
36063637 
36073638```json
36083639{
from line 3658
36273658 
36283659## Delete a Message Batch
36293660 
3630**delete** `/v1/messages/batches/{message_batch_id}`
3661**DELETE** `/v1/messages/batches/{message_batch_id}`
36313662 
36323663Delete a Message Batch.
36333664 
from line 3666
36353666 
36363667Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
36373668 
3638### Path Parameters
3669### Path parameters
36393670 
36403671- `message_batch_id: string`
36413672 
from line 3674
36433674 
36443675### Returns
36453676 
3646- `DeletedMessageBatch object { id, type }`
3677- `DeletedMessageBatch object`
36473678 
36483679 - `id: string`
36493680 
from line 3686
36553686 
36563687 For Message Batches, this is always `"message_batch_deleted"`.
36573688 
3658 - `"message_batch_deleted"`
3689 default: message_batch_deleted
36593690 
36603691### Example
36613692 
3662```http
3693```bash
36633694curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
36643695 -X DELETE \
36653696 -H 'anthropic-version: 2023-06-01' \
36663697 -H "X-Api-Key: $ANTHROPIC_API_KEY"
36673698```
36683699 
3669#### Response
3700#### Response (200)
36703701 
36713702```json
36723703{
from line 3708
36773708 
36783709## Retrieve Message Batch results
36793710 
3680**get** `/v1/messages/batches/{message_batch_id}/results`
3711**GET** `/v1/messages/batches/{message_batch_id}/results`
36813712 
36823713Streams the results of a Message Batch as a `.jsonl` file.
36833714 
from line 3716
36853716 
36863717Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
36873718 
3688### Path Parameters
3719### Path parameters
36893720 
36903721- `message_batch_id: string`
36913722 
from line 3724
36933724 
36943725### Returns
36953726 
3696- `MessageBatchIndividualResponse object { custom_id, result }`
3727- `MessageBatchIndividualResponse object`
36973728 
36983729 This is a single line in the response `.jsonl` file and does not represent the response as a whole.
36993730 
from line 3740
37093740 
37103741 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
37113742 
3712 - `MessageBatchSucceededResult object { message, type }`
3743 - `MessageBatchSucceededResult object`
37133744 
37143745 - `message: Message`
37153746 
from line 3762
37313762 
37323763 The time at which the container will expire.
37333764 
3765 format: date-time
3766 
37343767 - `skills: array of ContainerSkill or null`
37353768 
37363769 Skills loaded in the container
from line 3772
37393772 
37403773 Skill ID
37413774 
3775 maxLength: 64, minLength: 1
3776 
37423777 - `type: "anthropic" or "custom"`
37433778 
37443779 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 3785
37503785 - `version: string`
37513786 
37523787 The resolved version: a skill version ID for custom skills.
3788 
3789 maxLength: 64, minLength: 1
37533790 
37543791 - `content: array of ContentBlock`
37553792 
from line 3817
37803817 [{"type": "text", "text": "B)"}]
37813818 ```
37823819 
3783 - `TextBlock object { citations, text, type }`
3820 - `TextBlock object`
37843821 
37853822 - `citations: array of TextCitation or null`
37863823 
from line 3825
37883825 
37893826 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`.
37903827 
3791 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
3828 - `CitationCharLocation object`
37923829 
37933830 - `cited_text: string`
37943831 
37953832 - `document_index: number`
37963833 
3834 minimum: 0
3835 
37973836 - `document_title: string or null`
37983837 
37993838 - `end_char_index: number`
from line 3841
38023841 
38033842 - `start_char_index: number`
38043843 
3844 minimum: 0
3845 
38053846 - `type: "char_location"`
38063847 
3807 - `"char_location"`
3808 
3809 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
3848 default: char_location
3849 
3850 - `CitationPageLocation object`
38103851 
38113852 - `cited_text: string`
38123853 
38133854 - `document_index: number`
38143855 
3856 minimum: 0
3857 
38153858 - `document_title: string or null`
38163859 
38173860 - `end_page_number: number`
from line 3863
38203863 
38213864 - `start_page_number: number`
38223865 
3866 minimum: 1
3867 
38233868 - `type: "page_location"`
38243869 
3825 - `"page_location"`
3826 
3827 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
3870 default: page_location
3871 
3872 - `CitationContentBlockLocation object`
38283873 
38293874 - `cited_text: string`
38303875 
from line 3879
38343879 
38353880 - `document_index: number`
38363881 
3882 minimum: 0
3883 
38373884 - `document_title: string or null`
38383885 
38393886 - `end_block_index: number`
from line 3895
38483895 
38493896 0-based index of the first cited block in the source's `content` array.
38503897 
3898 minimum: 0
3899 
38513900 - `type: "content_block_location"`
38523901 
3853 - `"content_block_location"`
3854 
3855 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
3902 default: content_block_location
3903 
3904 - `CitationsWebSearchResultLocation object`
38563905 
38573906 - `cited_text: string`
38583907 
from line 3909
38603909 
38613910 - `title: string or null`
38623911 
3912 maxLength: 512
3913 
38633914 - `type: "web_search_result_location"`
38643915 
3865 - `"web_search_result_location"`
3916 default: web_search_result_location
38663917 
38673918 - `url: string`
38683919 
3869 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
3920 - `CitationsSearchResultLocation object`
38703921 
38713922 - `cited_text: string`
38723923 
from line 3937
38863937 
38873938 Counted separately from `document_index`; server-side web search results are not included in this count.
38883939 
3940 minimum: 0
3941 
38893942 - `source: string`
38903943 
38913944 - `start_block_index: number`
38923945 
38933946 0-based index of the first cited block in the source's `content` array.
38943947 
3948 minimum: 0
3949 
38953950 - `title: string or null`
38963951 
38973952 - `type: "search_result_location"`
38983953 
3899 - `"search_result_location"`
3954 default: search_result_location
39003955 
39013956 - `text: string`
39023957 
3958 maxLength: 5000000, minLength: 0
3959 
39033960 - `type: "text"`
39043961 
3905 - `"text"`
3906 
3907 - `ThinkingBlock object { signature, thinking, type }`
3962 default: text
3963 
3964 - `ThinkingBlock object`
39083965 
39093966 - `signature: string`
39103967 
from line 3977
39203977 
39213978 - `type: "thinking"`
39223979 
3923 - `"thinking"`
3924 
3925 - `RedactedThinkingBlock object { data, type }`
3980 default: thinking
3981 
3982 - `RedactedThinkingBlock object`
39263983 
39273984 - `data: string`
39283985 
from line 3991
39343991 
39353992 - `type: "redacted_thinking"`
39363993 
3937 - `"redacted_thinking"`
3938 
3939 - `ToolUseBlock object { id, caller, input, 3 more }`
3994 default: redacted_thinking
3995 
3996 - `ToolUseBlock object`
39403997 
39413998 - `id: string`
39423999 
4000 pattern: ^[a-zA-Z0-9_-]+$
4001 
39434002 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
39444003 
39454004 Tool invocation directly from the model.
39464005 
3947 - `DirectCaller object { type }`
4006 default: {"type":"direct"}
4007 
4008 - `DirectCaller object`
39484009 
39494010 Tool invocation directly from the model.
39504011 
39514012 - `type: "direct"`
39524013 
3953 - `"direct"`
3954 
3955 - `ServerToolCaller object { tool_id, type }`
4014 - `ServerToolCaller object`
39564015 
39574016 Tool invocation generated by a server-side tool.
39584017 
39594018 - `tool_id: string`
39604019 
4020 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4021 
39614022 - `type: "code_execution_20250825"`
39624023 
3963 - `"code_execution_20250825"`
3964 
3965 - `ServerToolCaller20260120 object { tool_id, type }`
4024 - `ServerToolCaller20260120 object`
39664025 
39674026 - `tool_id: string`
39684027 
4028 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4029 
39694030 - `type: "code_execution_20260120"`
39704031 
3971 - `"code_execution_20260120"`
3972 
39734032 - `input: map[unknown]`
39744033 
39754034 - `name: string`
39764035 
4036 minLength: 1
4037 
39774038 - `type: "tool_use"`
39784039 
3979 - `"tool_use"`
4040 default: tool_use
39804041 
39814042 - `toolset_name: optional string or null`
39824043 
39834044 For a toolset member tool_use, the toolset family.
39844045 
3985 - `ServerToolUseBlock object { id, caller, input, 2 more }`
4046 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
4047 
4048 - `ServerToolUseBlock object`
39864049 
39874050 - `id: string`
39884051 
4052 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4053 
39894054 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
39904055 
39914056 Tool invocation directly from the model.
39924057 
3993 - `DirectCaller object { type }`
4058 default: {"type":"direct"}
4059 
4060 - `DirectCaller object`
39944061 
39954062 Tool invocation directly from the model.
39964063 
3997 - `ServerToolCaller object { tool_id, type }`
4064 - `ServerToolCaller object`
39984065 
39994066 Tool invocation generated by a server-side tool.
40004067 
4001 - `ServerToolCaller20260120 object { tool_id, type }`
4068 - `ServerToolCaller20260120 object`
40024069 
40034070 - `input: map[unknown]`
40044071 
from line 4087
40204087 
40214088 - `type: "server_tool_use"`
40224089 
4023 - `"server_tool_use"`
4024 
4025 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
4090 default: server_tool_use
4091 
4092 - `WebSearchToolResultBlock object`
40264093 
40274094 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
40284095 
40294096 Tool invocation directly from the model.
40304097 
4031 - `DirectCaller object { type }`
4098 default: {"type":"direct"}
4099 
4100 - `DirectCaller object`
40324101 
40334102 Tool invocation directly from the model.
40344103 
4035 - `ServerToolCaller object { tool_id, type }`
4104 - `ServerToolCaller object`
40364105 
40374106 Tool invocation generated by a server-side tool.
40384107 
4039 - `ServerToolCaller20260120 object { tool_id, type }`
4108 - `ServerToolCaller20260120 object`
40404109 
40414110 - `content: WebSearchToolResultBlockContent`
40424111 
4043 - `WebSearchToolResultError object { error_code, type }`
4112 - `WebSearchToolResultError object`
40444113 
40454114 - `error_code: WebSearchToolResultErrorCode`
40464115 
from line 4127
40584127 
40594128 - `type: "web_search_tool_result_error"`
40604129 
4061 - `"web_search_tool_result_error"`
4130 default: web_search_tool_result_error
40624131 
40634132 - `array of WebSearchResultBlock`
40644133 
from line 4139
40704139 
40714140 - `type: "web_search_result"`
40724141 
4073 - `"web_search_result"`
4142 default: web_search_result
40744143 
40754144 - `url: string`
40764145 
40774146 - `tool_use_id: string`
40784147 
4148 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4149 
40794150 - `type: "web_search_tool_result"`
40804151 
4081 - `"web_search_tool_result"`
4082 
4083 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
4152 default: web_search_tool_result
4153 
4154 - `WebFetchToolResultBlock object`
40844155 
40854156 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
40864157 
40874158 Tool invocation directly from the model.
40884159 
4089 - `DirectCaller object { type }`
4160 default: {"type":"direct"}
4161 
4162 - `DirectCaller object`
40904163 
40914164 Tool invocation directly from the model.
40924165 
4093 - `ServerToolCaller object { tool_id, type }`
4166 - `ServerToolCaller object`
40944167 
40954168 Tool invocation generated by a server-side tool.
40964169 
4097 - `ServerToolCaller20260120 object { tool_id, type }`
4170 - `ServerToolCaller20260120 object`
40984171 
40994172 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
41004173 
4101 - `WebFetchToolResultErrorBlock object { error_code, type }`
4174 - `WebFetchToolResultErrorBlock object`
41024175 
41034176 - `error_code: WebFetchToolResultErrorCode`
41044177 
from line 4195
41224195 
41234196 - `type: "web_fetch_tool_result_error"`
41244197 
4125 - `"web_fetch_tool_result_error"`
4126 
4127 - `WebFetchBlock object { content, retrieved_at, type, url }`
4198 default: web_fetch_tool_result_error
4199 
4200 - `WebFetchBlock object`
41284201 
41294202 - `content: DocumentBlock`
41304203 
from line 4207
41344207 
41354208 - `enabled: boolean`
41364209 
4210 default: false
4211 
41374212 - `source: Base64PDFSource or PlainTextSource`
41384213 
4139 - `Base64PDFSource object { data, media_type, type }`
4214 - `Base64PDFSource object`
41404215 
41414216 - `data: string`
41424217 
4218 format: byte
4219 
41434220 - `media_type: "application/pdf"`
41444221 
4145 - `"application/pdf"`
4146 
41474222 - `type: "base64"`
41484223 
4149 - `"base64"`
4150 
4151 - `PlainTextSource object { data, media_type, type }`
4224 - `PlainTextSource object`
41524225 
41534226 - `data: string`
41544227 
41554228 - `media_type: "text/plain"`
41564229 
4157 - `"text/plain"`
4158 
41594230 - `type: "text"`
41604231 
4161 - `"text"`
4162 
41634232 - `title: string or null`
41644233 
41654234 The title of the document
41664235 
41674236 - `type: "document"`
41684237 
4169 - `"document"`
4238 default: document
41704239 
41714240 - `retrieved_at: string or null`
41724241 
from line 4243
41744243 
41754244 - `type: "web_fetch_result"`
41764245 
4177 - `"web_fetch_result"`
4246 default: web_fetch_result
41784247 
41794248 - `url: string`
41804249 
from line 4251
41824251 
41834252 - `tool_use_id: string`
41844253 
4254 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4255 
41854256 - `type: "web_fetch_tool_result"`
41864257 
4187 - `"web_fetch_tool_result"`
4188 
4189 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
4258 default: web_fetch_tool_result
4259 
4260 - `CodeExecutionToolResultBlock object`
41904261 
41914262 - `content: CodeExecutionToolResultBlockContent`
41924263 
41934264 Code execution result with encrypted stdout for PFC + web_search results.
41944265 
4195 - `CodeExecutionToolResultError object { error_code, type }`
4266 - `CodeExecutionToolResultError object`
41964267 
41974268 - `error_code: CodeExecutionToolResultErrorCode`
41984269 
from line 4277
42064277 
42074278 - `type: "code_execution_tool_result_error"`
42084279 
4209 - `"code_execution_tool_result_error"`
4210 
4211 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
4280 default: code_execution_tool_result_error
4281 
4282 - `CodeExecutionResultBlock object`
42124283 
42134284 - `content: array of CodeExecutionOutputBlock`
42144285 
from line 4287
42164287 
42174288 - `type: "code_execution_output"`
42184289 
4219 - `"code_execution_output"`
4290 default: code_execution_output
42204291 
42214292 - `return_code: number`
42224293 
from line 4297
42264297 
42274298 - `type: "code_execution_result"`
42284299 
4229 - `"code_execution_result"`
4230 
4231 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
4300 default: code_execution_result
4301 
4302 - `EncryptedCodeExecutionResultBlock object`
42324303 
42334304 Code execution result with encrypted stdout for PFC + web_search results.
42344305 
from line 4309
42384309 
42394310 - `type: "code_execution_output"`
42404311 
4312 default: code_execution_output
4313 
42414314 - `encrypted_stdout: string`
42424315 
42434316 - `return_code: number`
from line 4319
42464319 
42474320 - `type: "encrypted_code_execution_result"`
42484321 
4249 - `"encrypted_code_execution_result"`
4322 default: encrypted_code_execution_result
42504323 
42514324 - `tool_use_id: string`
42524325 
4326 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4327 
42534328 - `type: "code_execution_tool_result"`
42544329 
4255 - `"code_execution_tool_result"`
4256 
4257 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
4330 default: code_execution_tool_result
4331 
4332 - `BashCodeExecutionToolResultBlock object`
42584333 
42594334 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
42604335 
4261 - `BashCodeExecutionToolResultError object { error_code, type }`
4336 - `BashCodeExecutionToolResultError object`
42624337 
42634338 - `error_code: BashCodeExecutionToolResultErrorCode`
42644339 
from line 4349
42744349 
42754350 - `type: "bash_code_execution_tool_result_error"`
42764351 
4277 - `"bash_code_execution_tool_result_error"`
4278 
4279 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
4352 default: bash_code_execution_tool_result_error
4353 
4354 - `BashCodeExecutionResultBlock object`
42804355 
42814356 - `content: array of BashCodeExecutionOutputBlock`
42824357 
from line 4359
42844359 
42854360 - `type: "bash_code_execution_output"`
42864361 
4287 - `"bash_code_execution_output"`
4362 default: bash_code_execution_output
42884363 
42894364 - `return_code: number`
42904365 
from line 4369
42944369 
42954370 - `type: "bash_code_execution_result"`
42964371 
4297 - `"bash_code_execution_result"`
4372 default: bash_code_execution_result
42984373 
42994374 - `tool_use_id: string`
43004375 
4376 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4377 
43014378 - `type: "bash_code_execution_tool_result"`
43024379 
4303 - `"bash_code_execution_tool_result"`
4304 
4305 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
4380 default: bash_code_execution_tool_result
4381 
4382 - `TextEditorCodeExecutionToolResultBlock object`
43064383 
43074384 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
43084385 
4309 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
4386 - `TextEditorCodeExecutionToolResultError object`
43104387 
43114388 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
43124389 
from line 4401
43244401 
43254402 - `type: "text_editor_code_execution_tool_result_error"`
43264403 
4327 - `"text_editor_code_execution_tool_result_error"`
4328 
4329 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
4404 default: text_editor_code_execution_tool_result_error
4405 
4406 - `TextEditorCodeExecutionViewResultBlock object`
43304407 
43314408 - `content: string`
43324409 
from line 4423
43464423 
43474424 - `type: "text_editor_code_execution_view_result"`
43484425 
4349 - `"text_editor_code_execution_view_result"`
4350 
4351 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
4426 default: text_editor_code_execution_view_result
4427 
4428 - `TextEditorCodeExecutionCreateResultBlock object`
43524429 
43534430 - `is_file_update: boolean`
43544431 
43554432 - `type: "text_editor_code_execution_create_result"`
43564433 
4357 - `"text_editor_code_execution_create_result"`
4358 
4359 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
4434 default: text_editor_code_execution_create_result
4435 
4436 - `TextEditorCodeExecutionStrReplaceResultBlock object`
43604437 
43614438 - `lines: array of string or null`
43624439 
from line 4447
43704447 
43714448 - `type: "text_editor_code_execution_str_replace_result"`
43724449 
4373 - `"text_editor_code_execution_str_replace_result"`
4450 default: text_editor_code_execution_str_replace_result
43744451 
43754452 - `tool_use_id: string`
43764453 
4454 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4455 
43774456 - `type: "text_editor_code_execution_tool_result"`
43784457 
4379 - `"text_editor_code_execution_tool_result"`
4380 
4381 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
4458 default: text_editor_code_execution_tool_result
4459 
4460 - `ToolSearchToolResultBlock object`
43824461 
43834462 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
43844463 
4385 - `ToolSearchToolResultError object { error_code, error_message, type }`
4464 - `ToolSearchToolResultError object`
43864465 
43874466 - `error_code: ToolSearchToolResultErrorCode`
43884467 
from line 4477
43984477 
43994478 - `type: "tool_search_tool_result_error"`
44004479 
4401 - `"tool_search_tool_result_error"`
4402 
4403 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
4480 default: tool_search_tool_result_error
4481 
4482 - `ToolSearchToolSearchResultBlock object`
44044483 
44054484 - `tool_references: array of ToolReferenceBlock`
44064485 
44074486 - `tool_name: string`
44084487 
4488 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
4489 
44094490 - `type: "tool_reference"`
44104491 
4411 - `"tool_reference"`
4492 default: tool_reference
44124493 
44134494 - `type: "tool_search_tool_search_result"`
44144495 
4415 - `"tool_search_tool_search_result"`
4496 default: tool_search_tool_search_result
44164497 
44174498 - `tool_use_id: string`
44184499 
4500 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4501 
44194502 - `type: "tool_search_tool_result"`
44204503 
4421 - `"tool_search_tool_result"`
4422 
4423 - `ContainerUploadBlock object { file_id, type }`
4504 default: tool_search_tool_result
4505 
4506 - `ContainerUploadBlock object`
44244507 
44254508 Response model for a file uploaded to the container.
44264509 
from line 4511
44284511 
44294512 - `type: "container_upload"`
44304513 
4431 - `"container_upload"`
4514 default: container_upload
44324515 
44334516 - `model: Model`
44344517 
from line 4593
45104593 
45114594 This will always be `"assistant"`.
45124595 
4513 - `"assistant"`
4596 default: assistant
45144597 
45154598 - `stop_details: RefusalStopDetails or null`
45164599 
from line 4631
45484631 
45494632 - `type: "refusal"`
45504633 
4551 - `"refusal"`
4634 default: refusal
45524635 
45534636 - `stop_reason: StopReason or null`
45544637 
from line 4675
45924675 
45934676 For Messages, this is always `"message"`.
45944677 
4595 - `"message"`
4678 default: message
45964679 
45974680 - `usage: Usage`
45984681 
from line 4697
46144697 
46154698 The number of input tokens used to create the 1 hour cache entry.
46164699 
4700 default: 0, minimum: 0
4701 
46174702 - `ephemeral_5m_input_tokens: number`
46184703 
46194704 The number of input tokens used to create the 5 minute cache entry.
46204705 
4706 default: 0, minimum: 0
4707 
46214708 - `cache_creation_input_tokens: number or null`
46224709 
46234710 The number of input tokens used to create the cache entry.
46244711 
4712 minimum: 0
4713 
46254714 - `cache_read_input_tokens: number or null`
46264715 
46274716 The number of input tokens read from the cache.
46284717 
4718 minimum: 0
4719 
46294720 - `inference_geo: string or null`
46304721 
46314722 The geographic region where inference was performed for this request.
from line 4725
46344725 
46354726 The number of input tokens which were used.
46364727 
4728 minimum: 0
4729 
46374730 - `output_tokens: number`
46384731 
46394732 The number of output tokens which were used.
4733 
4734 minimum: 0
46404735 
46414736 - `output_tokens_details: OutputTokensDetails or null`
46424737 
from line 4753
46584753 generation count by a small number of tokens. Always ≤ `output_tokens`;
46594754 `output_tokens - thinking_tokens` approximates the non-reasoning output.
46604755 
4756 default: 0, minimum: 0
4757 
46614758 - `server_tool_use: ServerToolUsage or null`
46624759 
46634760 The number of server tool requests.
from line 4763
46664763 
46674764 The number of web fetch tool requests.
46684765 
4766 default: 0, minimum: 0
4767 
46694768 - `web_search_requests: number`
46704769 
46714770 The number of web search tool requests.
46724771 
4772 default: 0, minimum: 0
4773 
46734774 - `service_tier: "standard" or "priority" or "batch" or null`
46744775 
46754776 If the request used the priority, standard, or batch tier.
from line 4783
46824783 
46834784 - `type: "succeeded"`
46844785 
4685 - `"succeeded"`
4686 
4687 - `MessageBatchErroredResult object { error, type }`
4786 default: succeeded
4787 
4788 - `MessageBatchErroredResult object`
46884789 
46894790 - `error: ErrorResponse`
46904791 
46914792 - `error: ErrorObject`
46924793 
4693 - `InvalidRequestError object { message, type }`
4794 - `InvalidRequestError object`
46944795 
46954796 - `message: string`
46964797 
4798 default: Invalid request
4799 
46974800 - `type: "invalid_request_error"`
46984801 
4699 - `"invalid_request_error"`
4700 
4701 - `AuthenticationError object { message, type }`
4802 default: invalid_request_error
4803 
4804 - `AuthenticationError object`
47024805 
47034806 - `message: string`
47044807 
4808 default: Authentication error
4809 
47054810 - `type: "authentication_error"`
47064811 
4707 - `"authentication_error"`
4708 
4709 - `BillingError object { message, type }`
4812 default: authentication_error
4813 
4814 - `BillingError object`
47104815 
47114816 - `message: string`
47124817 
4818 default: Billing error
4819 
47134820 - `type: "billing_error"`
47144821 
4715 - `"billing_error"`
4716 
4717 - `PermissionError object { message, type }`
4822 default: billing_error
4823 
4824 - `PermissionError object`
47184825 
47194826 - `message: string`
47204827 
4828 default: Permission denied
4829 
47214830 - `type: "permission_error"`
47224831 
4723 - `"permission_error"`
4724 
4725 - `NotFoundError object { message, type }`
4832 default: permission_error
4833 
4834 - `NotFoundError object`
47264835 
47274836 - `message: string`
47284837 
4838 default: Not found
4839 
47294840 - `type: "not_found_error"`
47304841 
4731 - `"not_found_error"`
4732 
4733 - `RateLimitError object { message, type }`
4842 default: not_found_error
4843 
4844 - `RateLimitError object`
47344845 
47354846 - `message: string`
47364847 
4848 default: Rate limited
4849 
47374850 - `type: "rate_limit_error"`
47384851 
4739 - `"rate_limit_error"`
4740 
4741 - `GatewayTimeoutError object { message, type }`
4852 default: rate_limit_error
4853 
4854 - `GatewayTimeoutError object`
47424855 
47434856 - `message: string`
47444857 
4858 default: Request timeout
4859 
47454860 - `type: "timeout_error"`
47464861 
4747 - `"timeout_error"`
4748 
4749 - `APIErrorObject object { message, type }`
4862 default: timeout_error
4863 
4864 - `APIErrorObject object`
47504865 
47514866 - `message: string`
47524867 
4868 default: Internal server error
4869 
47534870 - `type: "api_error"`
47544871 
4755 - `"api_error"`
4756 
4757 - `OverloadedError object { message, type }`
4872 default: api_error
4873 
4874 - `OverloadedError object`
47584875 
47594876 - `message: string`
47604877 
4878 default: Overloaded
4879 
47614880 - `type: "overloaded_error"`
47624881 
4763 - `"overloaded_error"`
4882 default: overloaded_error
47644883 
47654884 - `request_id: string or null`
47664885 
47674886 - `type: "error"`
47684887 
4769 - `"error"`
4888 default: error
47704889 
47714890 - `type: "errored"`
47724891 
4773 - `"errored"`
4774 
4775 - `MessageBatchCanceledResult object { type }`
4892 default: errored
4893 
4894 - `MessageBatchCanceledResult object`
47764895 
47774896 - `type: "canceled"`
47784897 
4779 - `"canceled"`
4780 
4781 - `MessageBatchExpiredResult object { type }`
4898 default: canceled
4899 
4900 - `MessageBatchExpiredResult object`
47824901 
47834902 - `type: "expired"`
47844903 
4785 - `"expired"`
4904 default: expired
47864905 
47874906### Example
47884907 
4789```http
4908```bash
47904909curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/results \
47914910 -H 'anthropic-version: 2023-06-01' \
47924911 -H "X-Api-Key: $ANTHROPIC_API_KEY"
47934912```
47944913 
4795## Domain Types
4914## Domain types
47964915 
47974916### Deleted Message Batch
47984917 
4799- `DeletedMessageBatch object { id, type }`
4918- `DeletedMessageBatch object`
48004919 
48014920 - `id: string`
48024921 
from line 4927
48084927 
48094928 For Message Batches, this is always `"message_batch_deleted"`.
48104929 
4811 - `"message_batch_deleted"`
4930 default: message_batch_deleted
48124931 
48134932### Message Batch
48144933 
4815- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
4934- `MessageBatch object`
48164935 
48174936 - `id: string`
48184937 
from line 4943
48244943 
48254944 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
48264945 
4946 format: date-time
4947 
48274948 - `cancel_initiated_at: string or null`
48284949 
48294950 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
48304951 
4952 format: date-time
4953 
48314954 - `created_at: string`
48324955 
48334956 RFC 3339 datetime string representing the time at which the Message Batch was created.
48344957 
4958 format: date-time
4959 
48354960 - `ended_at: string or null`
48364961 
48374962 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
48384963 
48394964 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
48404965 
4966 format: date-time
4967 
48414968 - `expires_at: string`
48424969 
48434970 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
48444971 
4972 format: date-time
4973 
48454974 - `processing_status: "in_progress" or "canceling" or "ended"`
48464975 
48474976 Processing status of the Message Batch.
from line 4993
48644993 
48654994 This is zero until processing of the entire Message Batch has ended.
48664995 
4996 default: 0
4997 
48674998 - `errored: number`
48684999 
48695000 Number of requests in the Message Batch that encountered an error.
48705001 
48715002 This is zero until processing of the entire Message Batch has ended.
48725003 
5004 default: 0
5005 
48735006 - `expired: number`
48745007 
48755008 Number of requests in the Message Batch that have expired.
48765009 
48775010 This is zero until processing of the entire Message Batch has ended.
48785011 
5012 default: 0
5013 
48795014 - `processing: number`
48805015 
48815016 Number of requests in the Message Batch that are processing.
48825017 
5018 default: 0
5019 
48835020 - `succeeded: number`
48845021 
48855022 Number of requests in the Message Batch that have completed successfully.
48865023 
48875024 This is zero until processing of the entire Message Batch has ended.
48885025 
5026 default: 0
5027 
48895028 - `results_url: string or null`
48905029 
48915030 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 5037
48985037 
48995038 For Message Batches, this is always `"message_batch"`.
49005039 
4901 - `"message_batch"`
5040 default: message_batch
49025041 
49035042### Message Batch Canceled Result
49045043 
4905- `MessageBatchCanceledResult object { type }`
5044- `MessageBatchCanceledResult object`
49065045 
49075046 - `type: "canceled"`
49085047 
4909 - `"canceled"`
5048 default: canceled
49105049 
49115050### Message Batch Errored Result
49125051 
4913- `MessageBatchErroredResult object { error, type }`
5052- `MessageBatchErroredResult object`
49145053 
49155054 - `error: ErrorResponse`
49165055 
49175056 - `error: ErrorObject`
49185057 
4919 - `InvalidRequestError object { message, type }`
5058 - `InvalidRequestError object`
49205059 
49215060 - `message: string`
49225061 
5062 default: Invalid request
5063 
49235064 - `type: "invalid_request_error"`
49245065 
4925 - `"invalid_request_error"`
4926 
4927 - `AuthenticationError object { message, type }`
5066 default: invalid_request_error
5067 
5068 - `AuthenticationError object`
49285069 
49295070 - `message: string`
49305071 
5072 default: Authentication error
5073 
49315074 - `type: "authentication_error"`
49325075 
4933 - `"authentication_error"`
4934 
4935 - `BillingError object { message, type }`
5076 default: authentication_error
5077 
5078 - `BillingError object`
49365079 
49375080 - `message: string`
49385081 
5082 default: Billing error
5083 
49395084 - `type: "billing_error"`
49405085 
4941 - `"billing_error"`
4942 
4943 - `PermissionError object { message, type }`
5086 default: billing_error
5087 
5088 - `PermissionError object`
49445089 
49455090 - `message: string`
49465091 
5092 default: Permission denied
5093 
49475094 - `type: "permission_error"`
49485095 
4949 - `"permission_error"`
4950 
4951 - `NotFoundError object { message, type }`
5096 default: permission_error
5097 
5098 - `NotFoundError object`
49525099 
49535100 - `message: string`
49545101 
5102 default: Not found
5103 
49555104 - `type: "not_found_error"`
49565105 
4957 - `"not_found_error"`
4958 
4959 - `RateLimitError object { message, type }`
5106 default: not_found_error
5107 
5108 - `RateLimitError object`
49605109 
49615110 - `message: string`
49625111 
5112 default: Rate limited
5113 
49635114 - `type: "rate_limit_error"`
49645115 
4965 - `"rate_limit_error"`
4966 
4967 - `GatewayTimeoutError object { message, type }`
5116 default: rate_limit_error
5117 
5118 - `GatewayTimeoutError object`
49685119 
49695120 - `message: string`
49705121 
5122 default: Request timeout
5123 
49715124 - `type: "timeout_error"`
49725125 
4973 - `"timeout_error"`
4974 
4975 - `APIErrorObject object { message, type }`
5126 default: timeout_error
5127 
5128 - `APIErrorObject object`
49765129 
49775130 - `message: string`
49785131 
5132 default: Internal server error
5133 
49795134 - `type: "api_error"`
49805135 
4981 - `"api_error"`
4982 
4983 - `OverloadedError object { message, type }`
5136 default: api_error
5137 
5138 - `OverloadedError object`
49845139 
49855140 - `message: string`
49865141 
5142 default: Overloaded
5143 
49875144 - `type: "overloaded_error"`
49885145 
4989 - `"overloaded_error"`
5146 default: overloaded_error
49905147 
49915148 - `request_id: string or null`
49925149 
49935150 - `type: "error"`
49945151 
4995 - `"error"`
5152 default: error
49965153 
49975154 - `type: "errored"`
49985155 
4999 - `"errored"`
5156 default: errored
50005157 
50015158### Message Batch Expired Result
50025159 
5003- `MessageBatchExpiredResult object { type }`
5160- `MessageBatchExpiredResult object`
50045161 
50055162 - `type: "expired"`
50065163 
5007 - `"expired"`
5164 default: expired
50085165 
50095166### Message Batch Individual Response
50105167 
5011- `MessageBatchIndividualResponse object { custom_id, result }`
5168- `MessageBatchIndividualResponse object`
50125169 
50135170 This is a single line in the response `.jsonl` file and does not represent the response as a whole.
50145171 
from line 5181
50245181 
50255182 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
50265183 
5027 - `MessageBatchSucceededResult object { message, type }`
5184 - `MessageBatchSucceededResult object`
50285185 
50295186 - `message: Message`
50305187 
from line 5203
50465203 
50475204 The time at which the container will expire.
50485205 
5206 format: date-time
5207 
50495208 - `skills: array of ContainerSkill or null`
50505209 
50515210 Skills loaded in the container
from line 5213
50545213 
50555214 Skill ID
50565215 
5216 maxLength: 64, minLength: 1
5217 
50575218 - `type: "anthropic" or "custom"`
50585219 
50595220 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 5226
50655226 - `version: string`
50665227 
50675228 The resolved version: a skill version ID for custom skills.
5229 
5230 maxLength: 64, minLength: 1
50685231 
50695232 - `content: array of ContentBlock`
50705233 
from line 5258
50955258 [{"type": "text", "text": "B)"}]
50965259 ```
50975260 
5098 - `TextBlock object { citations, text, type }`
5261 - `TextBlock object`
50995262 
51005263 - `citations: array of TextCitation or null`
51015264 
from line 5266
51035266 
51045267 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`.
51055268 
5106 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
5269 - `CitationCharLocation object`
51075270 
51085271 - `cited_text: string`
51095272 
51105273 - `document_index: number`
51115274 
5275 minimum: 0
5276 
51125277 - `document_title: string or null`
51135278 
51145279 - `end_char_index: number`
from line 5282
51175282 
51185283 - `start_char_index: number`
51195284 
5285 minimum: 0
5286 
51205287 - `type: "char_location"`
51215288 
5122 - `"char_location"`
5123 
5124 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
5289 default: char_location
5290 
5291 - `CitationPageLocation object`
51255292 
51265293 - `cited_text: string`
51275294 
51285295 - `document_index: number`
51295296 
5297 minimum: 0
5298 
51305299 - `document_title: string or null`
51315300 
51325301 - `end_page_number: number`
from line 5304
51355304 
51365305 - `start_page_number: number`
51375306 
5307 minimum: 1
5308 
51385309 - `type: "page_location"`
51395310 
5140 - `"page_location"`
5141 
5142 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
5311 default: page_location
5312 
5313 - `CitationContentBlockLocation object`
51435314 
51445315 - `cited_text: string`
51455316 
from line 5320
51495320 
51505321 - `document_index: number`
51515322 
5323 minimum: 0
5324 
51525325 - `document_title: string or null`
51535326 
51545327 - `end_block_index: number`
from line 5336
51635336 
51645337 0-based index of the first cited block in the source's `content` array.
51655338 
5339 minimum: 0
5340 
51665341 - `type: "content_block_location"`
51675342 
5168 - `"content_block_location"`
5169 
5170 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
5343 default: content_block_location
5344 
5345 - `CitationsWebSearchResultLocation object`
51715346 
51725347 - `cited_text: string`
51735348 
from line 5350
51755350 
51765351 - `title: string or null`
51775352 
5353 maxLength: 512
5354 
51785355 - `type: "web_search_result_location"`
51795356 
5180 - `"web_search_result_location"`
5357 default: web_search_result_location
51815358 
51825359 - `url: string`
51835360 
5184 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
5361 - `CitationsSearchResultLocation object`
51855362 
51865363 - `cited_text: string`
51875364 
from line 5378
52015378 
52025379 Counted separately from `document_index`; server-side web search results are not included in this count.
52035380 
5381 minimum: 0
5382 
52045383 - `source: string`
52055384 
52065385 - `start_block_index: number`
52075386 
52085387 0-based index of the first cited block in the source's `content` array.
52095388 
5389 minimum: 0
5390 
52105391 - `title: string or null`
52115392 
52125393 - `type: "search_result_location"`
52135394 
5214 - `"search_result_location"`
5395 default: search_result_location
52155396 
52165397 - `text: string`
52175398 
5399 maxLength: 5000000, minLength: 0
5400 
52185401 - `type: "text"`
52195402 
5220 - `"text"`
5221 
5222 - `ThinkingBlock object { signature, thinking, type }`
5403 default: text
5404 
5405 - `ThinkingBlock object`
52235406 
52245407 - `signature: string`
52255408 
from line 5418
52355418 
52365419 - `type: "thinking"`
52375420 
5238 - `"thinking"`
5239 
5240 - `RedactedThinkingBlock object { data, type }`
5421 default: thinking
5422 
5423 - `RedactedThinkingBlock object`
52415424 
52425425 - `data: string`
52435426 
from line 5432
52495432 
52505433 - `type: "redacted_thinking"`
52515434 
5252 - `"redacted_thinking"`
5253 
5254 - `ToolUseBlock object { id, caller, input, 3 more }`
5435 default: redacted_thinking
5436 
5437 - `ToolUseBlock object`
52555438 
52565439 - `id: string`
52575440 
5441 pattern: ^[a-zA-Z0-9_-]+$
5442 
52585443 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
52595444 
52605445 Tool invocation directly from the model.
52615446 
5262 - `DirectCaller object { type }`
5447 default: {"type":"direct"}
5448 
5449 - `DirectCaller object`
52635450 
52645451 Tool invocation directly from the model.
52655452 
52665453 - `type: "direct"`
52675454 
5268 - `"direct"`
5269 
5270 - `ServerToolCaller object { tool_id, type }`
5455 - `ServerToolCaller object`
52715456 
52725457 Tool invocation generated by a server-side tool.
52735458 
52745459 - `tool_id: string`
52755460 
5461 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5462 
52765463 - `type: "code_execution_20250825"`
52775464 
5278 - `"code_execution_20250825"`
5279 
5280 - `ServerToolCaller20260120 object { tool_id, type }`
5465 - `ServerToolCaller20260120 object`
52815466 
52825467 - `tool_id: string`
52835468 
5469 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5470 
52845471 - `type: "code_execution_20260120"`
52855472 
5286 - `"code_execution_20260120"`
5287 
52885473 - `input: map[unknown]`
52895474 
52905475 - `name: string`
52915476 
5477 minLength: 1
5478 
52925479 - `type: "tool_use"`
52935480 
5294 - `"tool_use"`
5481 default: tool_use
52955482 
52965483 - `toolset_name: optional string or null`
52975484 
52985485 For a toolset member tool_use, the toolset family.
52995486 
5300 - `ServerToolUseBlock object { id, caller, input, 2 more }`
5487 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
5488 
5489 - `ServerToolUseBlock object`
53015490 
53025491 - `id: string`
53035492 
5493 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5494 
53045495 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
53055496 
53065497 Tool invocation directly from the model.
53075498 
5308 - `DirectCaller object { type }`
5499 default: {"type":"direct"}
5500 
5501 - `DirectCaller object`
53095502 
53105503 Tool invocation directly from the model.
53115504 
5312 - `ServerToolCaller object { tool_id, type }`
5505 - `ServerToolCaller object`
53135506 
53145507 Tool invocation generated by a server-side tool.
53155508 
5316 - `ServerToolCaller20260120 object { tool_id, type }`
5509 - `ServerToolCaller20260120 object`
53175510 
53185511 - `input: map[unknown]`
53195512 
from line 5528
53355528 
53365529 - `type: "server_tool_use"`
53375530 
5338 - `"server_tool_use"`
5339 
5340 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
5531 default: server_tool_use
5532 
5533 - `WebSearchToolResultBlock object`
53415534 
53425535 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
53435536 
53445537 Tool invocation directly from the model.
53455538 
5346 - `DirectCaller object { type }`
5539 default: {"type":"direct"}
5540 
5541 - `DirectCaller object`
53475542 
53485543 Tool invocation directly from the model.
53495544 
5350 - `ServerToolCaller object { tool_id, type }`
5545 - `ServerToolCaller object`
53515546 
53525547 Tool invocation generated by a server-side tool.
53535548 
5354 - `ServerToolCaller20260120 object { tool_id, type }`
5549 - `ServerToolCaller20260120 object`
53555550 
53565551 - `content: WebSearchToolResultBlockContent`
53575552 
5358 - `WebSearchToolResultError object { error_code, type }`
5553 - `WebSearchToolResultError object`
53595554 
53605555 - `error_code: WebSearchToolResultErrorCode`
53615556 
from line 5568
53735568 
53745569 - `type: "web_search_tool_result_error"`
53755570 
5376 - `"web_search_tool_result_error"`
5571 default: web_search_tool_result_error
53775572 
53785573 - `array of WebSearchResultBlock`
53795574 
from line 5580
53855580 
53865581 - `type: "web_search_result"`
53875582 
5388 - `"web_search_result"`
5583 default: web_search_result
53895584 
53905585 - `url: string`
53915586 
53925587 - `tool_use_id: string`
53935588 
5589 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5590 
53945591 - `type: "web_search_tool_result"`
53955592 
5396 - `"web_search_tool_result"`
5397 
5398 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
5593 default: web_search_tool_result
5594 
5595 - `WebFetchToolResultBlock object`
53995596 
54005597 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
54015598 
54025599 Tool invocation directly from the model.
54035600 
5404 - `DirectCaller object { type }`
5601 default: {"type":"direct"}
5602 
5603 - `DirectCaller object`
54055604 
54065605 Tool invocation directly from the model.
54075606 
5408 - `ServerToolCaller object { tool_id, type }`
5607 - `ServerToolCaller object`
54095608 
54105609 Tool invocation generated by a server-side tool.
54115610 
5412 - `ServerToolCaller20260120 object { tool_id, type }`
5611 - `ServerToolCaller20260120 object`
54135612 
54145613 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
54155614 
5416 - `WebFetchToolResultErrorBlock object { error_code, type }`
5615 - `WebFetchToolResultErrorBlock object`
54175616 
54185617 - `error_code: WebFetchToolResultErrorCode`
54195618 
from line 5636
54375636 
54385637 - `type: "web_fetch_tool_result_error"`
54395638 
5440 - `"web_fetch_tool_result_error"`
5441 
5442 - `WebFetchBlock object { content, retrieved_at, type, url }`
5639 default: web_fetch_tool_result_error
5640 
5641 - `WebFetchBlock object`
54435642 
54445643 - `content: DocumentBlock`
54455644 
from line 5648
54495648 
54505649 - `enabled: boolean`
54515650 
5651 default: false
5652 
54525653 - `source: Base64PDFSource or PlainTextSource`
54535654 
5454 - `Base64PDFSource object { data, media_type, type }`
5655 - `Base64PDFSource object`
54555656 
54565657 - `data: string`
54575658 
5659 format: byte
5660 
54585661 - `media_type: "application/pdf"`
54595662 
5460 - `"application/pdf"`
5461 
54625663 - `type: "base64"`
54635664 
5464 - `"base64"`
5465 
5466 - `PlainTextSource object { data, media_type, type }`
5665 - `PlainTextSource object`
54675666 
54685667 - `data: string`
54695668 
54705669 - `media_type: "text/plain"`
54715670 
5472 - `"text/plain"`
5473 
54745671 - `type: "text"`
54755672 
5476 - `"text"`
5477 
54785673 - `title: string or null`
54795674 
54805675 The title of the document
54815676 
54825677 - `type: "document"`
54835678 
5484 - `"document"`
5679 default: document
54855680 
54865681 - `retrieved_at: string or null`
54875682 
from line 5684
54895684 
54905685 - `type: "web_fetch_result"`
54915686 
5492 - `"web_fetch_result"`
5687 default: web_fetch_result
54935688 
54945689 - `url: string`
54955690 
from line 5692
54975692 
54985693 - `tool_use_id: string`
54995694 
5695 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5696 
55005697 - `type: "web_fetch_tool_result"`
55015698 
5502 - `"web_fetch_tool_result"`
5503 
5504 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
5699 default: web_fetch_tool_result
5700 
5701 - `CodeExecutionToolResultBlock object`
55055702 
55065703 - `content: CodeExecutionToolResultBlockContent`
55075704 
55085705 Code execution result with encrypted stdout for PFC + web_search results.
55095706 
5510 - `CodeExecutionToolResultError object { error_code, type }`
5707 - `CodeExecutionToolResultError object`
55115708 
55125709 - `error_code: CodeExecutionToolResultErrorCode`
55135710 
from line 5718
55215718 
55225719 - `type: "code_execution_tool_result_error"`
55235720 
5524 - `"code_execution_tool_result_error"`
5525 
5526 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
5721 default: code_execution_tool_result_error
5722 
5723 - `CodeExecutionResultBlock object`
55275724 
55285725 - `content: array of CodeExecutionOutputBlock`
55295726 
from line 5728
55315728 
55325729 - `type: "code_execution_output"`
55335730 
5534 - `"code_execution_output"`
5731 default: code_execution_output
55355732 
55365733 - `return_code: number`
55375734 
from line 5738
55415738 
55425739 - `type: "code_execution_result"`
55435740 
5544 - `"code_execution_result"`
5545 
5546 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
5741 default: code_execution_result
5742 
5743 - `EncryptedCodeExecutionResultBlock object`
55475744 
55485745 Code execution result with encrypted stdout for PFC + web_search results.
55495746 
from line 5750
55535750 
55545751 - `type: "code_execution_output"`
55555752 
5753 default: code_execution_output
5754 
55565755 - `encrypted_stdout: string`
55575756 
55585757 - `return_code: number`
from line 5760
55615760 
55625761 - `type: "encrypted_code_execution_result"`
55635762 
5564 - `"encrypted_code_execution_result"`
5763 default: encrypted_code_execution_result
55655764 
55665765 - `tool_use_id: string`
55675766 
5767 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5768 
55685769 - `type: "code_execution_tool_result"`
55695770 
5570 - `"code_execution_tool_result"`
5571 
5572 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
5771 default: code_execution_tool_result
5772 
5773 - `BashCodeExecutionToolResultBlock object`
55735774 
55745775 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
55755776 
5576 - `BashCodeExecutionToolResultError object { error_code, type }`
5777 - `BashCodeExecutionToolResultError object`
55775778 
55785779 - `error_code: BashCodeExecutionToolResultErrorCode`
55795780 
from line 5790
55895790 
55905791 - `type: "bash_code_execution_tool_result_error"`
55915792 
5592 - `"bash_code_execution_tool_result_error"`
5593 
5594 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
5793 default: bash_code_execution_tool_result_error
5794 
5795 - `BashCodeExecutionResultBlock object`
55955796 
55965797 - `content: array of BashCodeExecutionOutputBlock`
55975798 
from line 5800
55995800 
56005801 - `type: "bash_code_execution_output"`
56015802 
5602 - `"bash_code_execution_output"`
5803 default: bash_code_execution_output
56035804 
56045805 - `return_code: number`
56055806 
from line 5810
56095810 
56105811 - `type: "bash_code_execution_result"`
56115812 
5612 - `"bash_code_execution_result"`
5813 default: bash_code_execution_result
56135814 
56145815 - `tool_use_id: string`
56155816 
5817 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5818 
56165819 - `type: "bash_code_execution_tool_result"`
56175820 
5618 - `"bash_code_execution_tool_result"`
5619 
5620 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
5821 default: bash_code_execution_tool_result
5822 
5823 - `TextEditorCodeExecutionToolResultBlock object`
56215824 
56225825 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
56235826 
5624 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
5827 - `TextEditorCodeExecutionToolResultError object`
56255828 
56265829 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
56275830 
from line 5842
56395842 
56405843 - `type: "text_editor_code_execution_tool_result_error"`
56415844 
5642 - `"text_editor_code_execution_tool_result_error"`
5643 
5644 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
5845 default: text_editor_code_execution_tool_result_error
5846 
5847 - `TextEditorCodeExecutionViewResultBlock object`
56455848 
56465849 - `content: string`
56475850 
from line 5864
56615864 
56625865 - `type: "text_editor_code_execution_view_result"`
56635866 
5664 - `"text_editor_code_execution_view_result"`
5665 
5666 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
5867 default: text_editor_code_execution_view_result
5868 
5869 - `TextEditorCodeExecutionCreateResultBlock object`
56675870 
56685871 - `is_file_update: boolean`
56695872 
56705873 - `type: "text_editor_code_execution_create_result"`
56715874 
5672 - `"text_editor_code_execution_create_result"`
5673 
5674 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
5875 default: text_editor_code_execution_create_result
5876 
5877 - `TextEditorCodeExecutionStrReplaceResultBlock object`
56755878 
56765879 - `lines: array of string or null`
56775880 
from line 5888
56855888 
56865889 - `type: "text_editor_code_execution_str_replace_result"`
56875890 
5688 - `"text_editor_code_execution_str_replace_result"`
5891 default: text_editor_code_execution_str_replace_result
56895892 
56905893 - `tool_use_id: string`
56915894 
5895 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5896 
56925897 - `type: "text_editor_code_execution_tool_result"`
56935898 
5694 - `"text_editor_code_execution_tool_result"`
5695 
5696 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
5899 default: text_editor_code_execution_tool_result
5900 
5901 - `ToolSearchToolResultBlock object`
56975902 
56985903 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
56995904 
5700 - `ToolSearchToolResultError object { error_code, error_message, type }`
5905 - `ToolSearchToolResultError object`
57015906 
57025907 - `error_code: ToolSearchToolResultErrorCode`
57035908 
from line 5918
57135918 
57145919 - `type: "tool_search_tool_result_error"`
57155920 
5716 - `"tool_search_tool_result_error"`
5717 
5718 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
5921 default: tool_search_tool_result_error
5922 
5923 - `ToolSearchToolSearchResultBlock object`
57195924 
57205925 - `tool_references: array of ToolReferenceBlock`
57215926 
57225927 - `tool_name: string`
57235928 
5929 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
5930 
57245931 - `type: "tool_reference"`
57255932 
5726 - `"tool_reference"`
5933 default: tool_reference
57275934 
57285935 - `type: "tool_search_tool_search_result"`
57295936 
5730 - `"tool_search_tool_search_result"`
5937 default: tool_search_tool_search_result
57315938 
57325939 - `tool_use_id: string`
57335940 
5941 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5942 
57345943 - `type: "tool_search_tool_result"`
57355944 
5736 - `"tool_search_tool_result"`
5737 
5738 - `ContainerUploadBlock object { file_id, type }`
5945 default: tool_search_tool_result
5946 
5947 - `ContainerUploadBlock object`
57395948 
57405949 Response model for a file uploaded to the container.
57415950 
from line 5952
57435952 
57445953 - `type: "container_upload"`
57455954 
5746 - `"container_upload"`
5955 default: container_upload
57475956 
57485957 - `model: Model`
57495958 
from line 6034
58256034 
58266035 This will always be `"assistant"`.
58276036 
5828 - `"assistant"`
6037 default: assistant
58296038 
58306039 - `stop_details: RefusalStopDetails or null`
58316040 
from line 6072
58636072 
58646073 - `type: "refusal"`
58656074 
5866 - `"refusal"`
6075 default: refusal
58676076 
58686077 - `stop_reason: StopReason or null`
58696078 
from line 6116
59076116 
59086117 For Messages, this is always `"message"`.
59096118 
5910 - `"message"`
6119 default: message
59116120 
59126121 - `usage: Usage`
59136122 
from line 6138
59296138 
59306139 The number of input tokens used to create the 1 hour cache entry.
59316140 
6141 default: 0, minimum: 0
6142 
59326143 - `ephemeral_5m_input_tokens: number`
59336144 
59346145 The number of input tokens used to create the 5 minute cache entry.
59356146 
6147 default: 0, minimum: 0
6148 
59366149 - `cache_creation_input_tokens: number or null`
59376150 
59386151 The number of input tokens used to create the cache entry.
59396152 
6153 minimum: 0
6154 
59406155 - `cache_read_input_tokens: number or null`
59416156 
59426157 The number of input tokens read from the cache.
59436158 
6159 minimum: 0
6160 
59446161 - `inference_geo: string or null`
59456162 
59466163 The geographic region where inference was performed for this request.
from line 6166
59496166 
59506167 The number of input tokens which were used.
59516168 
6169 minimum: 0
6170 
59526171 - `output_tokens: number`
59536172 
59546173 The number of output tokens which were used.
6174 
6175 minimum: 0
59556176 
59566177 - `output_tokens_details: OutputTokensDetails or null`
59576178 
from line 6194
59736194 generation count by a small number of tokens. Always ≤ `output_tokens`;
59746195 `output_tokens - thinking_tokens` approximates the non-reasoning output.
59756196 
6197 default: 0, minimum: 0
6198 
59766199 - `server_tool_use: ServerToolUsage or null`
59776200 
59786201 The number of server tool requests.
from line 6204
59816204 
59826205 The number of web fetch tool requests.
59836206 
6207 default: 0, minimum: 0
6208 
59846209 - `web_search_requests: number`
59856210 
59866211 The number of web search tool requests.
59876212 
6213 default: 0, minimum: 0
6214 
59886215 - `service_tier: "standard" or "priority" or "batch" or null`
59896216 
59906217 If the request used the priority, standard, or batch tier.
from line 6224
59976224 
59986225 - `type: "succeeded"`
59996226 
6000 - `"succeeded"`
6001 
6002 - `MessageBatchErroredResult object { error, type }`
6227 default: succeeded
6228 
6229 - `MessageBatchErroredResult object`
60036230 
60046231 - `error: ErrorResponse`
60056232 
60066233 - `error: ErrorObject`
60076234 
6008 - `InvalidRequestError object { message, type }`
6235 - `InvalidRequestError object`
60096236 
60106237 - `message: string`
60116238 
6239 default: Invalid request
6240 
60126241 - `type: "invalid_request_error"`
60136242 
6014 - `"invalid_request_error"`
6015 
6016 - `AuthenticationError object { message, type }`
6243 default: invalid_request_error
6244 
6245 - `AuthenticationError object`
60176246 
60186247 - `message: string`
60196248 
6249 default: Authentication error
6250 
60206251 - `type: "authentication_error"`
60216252 
6022 - `"authentication_error"`
6023 
6024 - `BillingError object { message, type }`
6253 default: authentication_error
6254 
6255 - `BillingError object`
60256256 
60266257 - `message: string`
60276258 
6259 default: Billing error
6260 
60286261 - `type: "billing_error"`
60296262 
6030 - `"billing_error"`
6031 
6032 - `PermissionError object { message, type }`
6263 default: billing_error
6264 
6265 - `PermissionError object`
60336266 
60346267 - `message: string`
60356268 
6269 default: Permission denied
6270 
60366271 - `type: "permission_error"`
60376272 
6038 - `"permission_error"`
6039 
6040 - `NotFoundError object { message, type }`
6273 default: permission_error
6274 
6275 - `NotFoundError object`
60416276 
60426277 - `message: string`
60436278 
6279 default: Not found
6280 
60446281 - `type: "not_found_error"`
60456282 
6046 - `"not_found_error"`
6047 
6048 - `RateLimitError object { message, type }`
6283 default: not_found_error
6284 
6285 - `RateLimitError object`
60496286 
60506287 - `message: string`
60516288 
6289 default: Rate limited
6290 
60526291 - `type: "rate_limit_error"`
60536292 
6054 - `"rate_limit_error"`
6055 
6056 - `GatewayTimeoutError object { message, type }`
6293 default: rate_limit_error
6294 
6295 - `GatewayTimeoutError object`
60576296 
60586297 - `message: string`
60596298 
6299 default: Request timeout
6300 
60606301 - `type: "timeout_error"`
60616302 
6062 - `"timeout_error"`
6063 
6064 - `APIErrorObject object { message, type }`
6303 default: timeout_error
6304 
6305 - `APIErrorObject object`
60656306 
60666307 - `message: string`
60676308 
6309 default: Internal server error
6310 
60686311 - `type: "api_error"`
60696312 
6070 - `"api_error"`
6071 
6072 - `OverloadedError object { message, type }`
6313 default: api_error
6314 
6315 - `OverloadedError object`
60736316 
60746317 - `message: string`
60756318 
6319 default: Overloaded
6320 
60766321 - `type: "overloaded_error"`
60776322 
6078 - `"overloaded_error"`
6323 default: overloaded_error
60796324 
60806325 - `request_id: string or null`
60816326 
60826327 - `type: "error"`
60836328 
6084 - `"error"`
6329 default: error
60856330 
60866331 - `type: "errored"`
60876332 
6088 - `"errored"`
6089 
6090 - `MessageBatchCanceledResult object { type }`
6333 default: errored
6334 
6335 - `MessageBatchCanceledResult object`
60916336 
60926337 - `type: "canceled"`
60936338 
6094 - `"canceled"`
6095 
6096 - `MessageBatchExpiredResult object { type }`
6339 default: canceled
6340 
6341 - `MessageBatchExpiredResult object`
60976342 
60986343 - `type: "expired"`
60996344 
6100 - `"expired"`
6345 default: expired
61016346 
61026347### Message Batch Request Counts
61036348 
6104- `MessageBatchRequestCounts object { canceled, errored, expired, 2 more }`
6349- `MessageBatchRequestCounts object`
61056350 
61066351 - `canceled: number`
61076352 
from line 6354
61096354 
61106355 This is zero until processing of the entire Message Batch has ended.
61116356 
6357 default: 0
6358 
61126359 - `errored: number`
61136360 
61146361 Number of requests in the Message Batch that encountered an error.
61156362 
61166363 This is zero until processing of the entire Message Batch has ended.
61176364 
6365 default: 0
6366 
61186367 - `expired: number`
61196368 
61206369 Number of requests in the Message Batch that have expired.
61216370 
61226371 This is zero until processing of the entire Message Batch has ended.
61236372 
6373 default: 0
6374 
61246375 - `processing: number`
61256376 
61266377 Number of requests in the Message Batch that are processing.
61276378 
6379 default: 0
6380 
61286381 - `succeeded: number`
61296382 
61306383 Number of requests in the Message Batch that have completed successfully.
61316384 
61326385 This is zero until processing of the entire Message Batch has ended.
61336386 
6387 default: 0
6388 
61346389### Message Batch Result
61356390 
61366391- `MessageBatchResult = MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
from line 6394
61396394 
61406395 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
61416396 
6142 - `MessageBatchSucceededResult object { message, type }`
6397 - `MessageBatchSucceededResult object`
61436398 
61446399 - `message: Message`
61456400 
from line 6416
61616416 
61626417 The time at which the container will expire.
61636418 
6419 format: date-time
6420 
61646421 - `skills: array of ContainerSkill or null`
61656422 
61666423 Skills loaded in the container
from line 6426
61696426 
61706427 Skill ID
61716428 
6429 maxLength: 64, minLength: 1
6430 
61726431 - `type: "anthropic" or "custom"`
61736432 
61746433 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 6439
61806439 - `version: string`
61816440 
61826441 The resolved version: a skill version ID for custom skills.
6442 
6443 maxLength: 64, minLength: 1
61836444 
61846445 - `content: array of ContentBlock`
61856446 
from line 6471
62106471 [{"type": "text", "text": "B)"}]
62116472 ```
62126473 
6213 - `TextBlock object { citations, text, type }`
6474 - `TextBlock object`
62146475 
62156476 - `citations: array of TextCitation or null`
62166477 
from line 6479
62186479 
62196480 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`.
62206481 
6221 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
6482 - `CitationCharLocation object`
62226483 
62236484 - `cited_text: string`
62246485 
62256486 - `document_index: number`
62266487 
6488 minimum: 0
6489 
62276490 - `document_title: string or null`
62286491 
62296492 - `end_char_index: number`
from line 6495
62326495 
62336496 - `start_char_index: number`
62346497 
6498 minimum: 0
6499 
62356500 - `type: "char_location"`
62366501 
6237 - `"char_location"`
6238 
6239 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
6502 default: char_location
6503 
6504 - `CitationPageLocation object`
62406505 
62416506 - `cited_text: string`
62426507 
62436508 - `document_index: number`
62446509 
6510 minimum: 0
6511 
62456512 - `document_title: string or null`
62466513 
62476514 - `end_page_number: number`
from line 6517
62506517 
62516518 - `start_page_number: number`
62526519 
6520 minimum: 1
6521 
62536522 - `type: "page_location"`
62546523 
6255 - `"page_location"`
6256 
6257 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
6524 default: page_location
6525 
6526 - `CitationContentBlockLocation object`
62586527 
62596528 - `cited_text: string`
62606529 
from line 6533
62646533 
62656534 - `document_index: number`
62666535 
6536 minimum: 0
6537 
62676538 - `document_title: string or null`
62686539 
62696540 - `end_block_index: number`
from line 6549
62786549 
62796550 0-based index of the first cited block in the source's `content` array.
62806551 
6552 minimum: 0
6553 
62816554 - `type: "content_block_location"`
62826555 
6283 - `"content_block_location"`
6284 
6285 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
6556 default: content_block_location
6557 
6558 - `CitationsWebSearchResultLocation object`
62866559 
62876560 - `cited_text: string`
62886561 
from line 6563
62906563 
62916564 - `title: string or null`
62926565 
6566 maxLength: 512
6567 
62936568 - `type: "web_search_result_location"`
62946569 
6295 - `"web_search_result_location"`
6570 default: web_search_result_location
62966571 
62976572 - `url: string`
62986573 
6299 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
6574 - `CitationsSearchResultLocation object`
63006575 
63016576 - `cited_text: string`
63026577 
from line 6591
63166591 
63176592 Counted separately from `document_index`; server-side web search results are not included in this count.
63186593 
6594 minimum: 0
6595 
63196596 - `source: string`
63206597 
63216598 - `start_block_index: number`
63226599 
63236600 0-based index of the first cited block in the source's `content` array.
63246601 
6602 minimum: 0
6603 
63256604 - `title: string or null`
63266605 
63276606 - `type: "search_result_location"`
63286607 
6329 - `"search_result_location"`
6608 default: search_result_location
63306609 
63316610 - `text: string`
63326611 
6612 maxLength: 5000000, minLength: 0
6613 
63336614 - `type: "text"`
63346615 
6335 - `"text"`
6336 
6337 - `ThinkingBlock object { signature, thinking, type }`
6616 default: text
6617 
6618 - `ThinkingBlock object`
63386619 
63396620 - `signature: string`
63406621 
from line 6631
63506631 
63516632 - `type: "thinking"`
63526633 
6353 - `"thinking"`
6354 
6355 - `RedactedThinkingBlock object { data, type }`
6634 default: thinking
6635 
6636 - `RedactedThinkingBlock object`
63566637 
63576638 - `data: string`
63586639 
from line 6645
63646645 
63656646 - `type: "redacted_thinking"`
63666647 
6367 - `"redacted_thinking"`
6368 
6369 - `ToolUseBlock object { id, caller, input, 3 more }`
6648 default: redacted_thinking
6649 
6650 - `ToolUseBlock object`
63706651 
63716652 - `id: string`
63726653 
6654 pattern: ^[a-zA-Z0-9_-]+$
6655 
63736656 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
63746657 
63756658 Tool invocation directly from the model.
63766659 
6377 - `DirectCaller object { type }`
6660 default: {"type":"direct"}
6661 
6662 - `DirectCaller object`
63786663 
63796664 Tool invocation directly from the model.
63806665 
63816666 - `type: "direct"`
63826667 
6383 - `"direct"`
6384 
6385 - `ServerToolCaller object { tool_id, type }`
6668 - `ServerToolCaller object`
63866669 
63876670 Tool invocation generated by a server-side tool.
63886671 
63896672 - `tool_id: string`
63906673 
6674 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6675 
63916676 - `type: "code_execution_20250825"`
63926677 
6393 - `"code_execution_20250825"`
6394 
6395 - `ServerToolCaller20260120 object { tool_id, type }`
6678 - `ServerToolCaller20260120 object`
63966679 
63976680 - `tool_id: string`
63986681 
6682 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6683 
63996684 - `type: "code_execution_20260120"`
64006685 
6401 - `"code_execution_20260120"`
6402 
64036686 - `input: map[unknown]`
64046687 
64056688 - `name: string`
64066689 
6690 minLength: 1
6691 
64076692 - `type: "tool_use"`
64086693 
6409 - `"tool_use"`
6694 default: tool_use
64106695 
64116696 - `toolset_name: optional string or null`
64126697 
64136698 For a toolset member tool_use, the toolset family.
64146699 
6415 - `ServerToolUseBlock object { id, caller, input, 2 more }`
6700 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
6701 
6702 - `ServerToolUseBlock object`
64166703 
64176704 - `id: string`
64186705 
6706 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6707 
64196708 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
64206709 
64216710 Tool invocation directly from the model.
64226711 
6423 - `DirectCaller object { type }`
6712 default: {"type":"direct"}
6713 
6714 - `DirectCaller object`
64246715 
64256716 Tool invocation directly from the model.
64266717 
6427 - `ServerToolCaller object { tool_id, type }`
6718 - `ServerToolCaller object`
64286719 
64296720 Tool invocation generated by a server-side tool.
64306721 
6431 - `ServerToolCaller20260120 object { tool_id, type }`
6722 - `ServerToolCaller20260120 object`
64326723 
64336724 - `input: map[unknown]`
64346725 
from line 6741
64506741 
64516742 - `type: "server_tool_use"`
64526743 
6453 - `"server_tool_use"`
6454 
6455 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
6744 default: server_tool_use
6745 
6746 - `WebSearchToolResultBlock object`
64566747 
64576748 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
64586749 
64596750 Tool invocation directly from the model.
64606751 
6461 - `DirectCaller object { type }`
6752 default: {"type":"direct"}
6753 
6754 - `DirectCaller object`
64626755 
64636756 Tool invocation directly from the model.
64646757 
6465 - `ServerToolCaller object { tool_id, type }`
6758 - `ServerToolCaller object`
64666759 
64676760 Tool invocation generated by a server-side tool.
64686761 
6469 - `ServerToolCaller20260120 object { tool_id, type }`
6762 - `ServerToolCaller20260120 object`
64706763 
64716764 - `content: WebSearchToolResultBlockContent`
64726765 
6473 - `WebSearchToolResultError object { error_code, type }`
6766 - `WebSearchToolResultError object`
64746767 
64756768 - `error_code: WebSearchToolResultErrorCode`
64766769 
from line 6781
64886781 
64896782 - `type: "web_search_tool_result_error"`
64906783 
6491 - `"web_search_tool_result_error"`
6784 default: web_search_tool_result_error
64926785 
64936786 - `array of WebSearchResultBlock`
64946787 
from line 6793
65006793 
65016794 - `type: "web_search_result"`
65026795 
6503 - `"web_search_result"`
6796 default: web_search_result
65046797 
65056798 - `url: string`
65066799 
65076800 - `tool_use_id: string`
65086801 
6802 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6803 
65096804 - `type: "web_search_tool_result"`
65106805 
6511 - `"web_search_tool_result"`
6512 
6513 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
6806 default: web_search_tool_result
6807 
6808 - `WebFetchToolResultBlock object`
65146809 
65156810 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
65166811 
65176812 Tool invocation directly from the model.
65186813 
6519 - `DirectCaller object { type }`
6814 default: {"type":"direct"}
6815 
6816 - `DirectCaller object`
65206817 
65216818 Tool invocation directly from the model.
65226819 
6523 - `ServerToolCaller object { tool_id, type }`
6820 - `ServerToolCaller object`
65246821 
65256822 Tool invocation generated by a server-side tool.
65266823 
6527 - `ServerToolCaller20260120 object { tool_id, type }`
6824 - `ServerToolCaller20260120 object`
65286825 
65296826 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
65306827 
6531 - `WebFetchToolResultErrorBlock object { error_code, type }`
6828 - `WebFetchToolResultErrorBlock object`
65326829 
65336830 - `error_code: WebFetchToolResultErrorCode`
65346831 
from line 6849
65526849 
65536850 - `type: "web_fetch_tool_result_error"`
65546851 
6555 - `"web_fetch_tool_result_error"`
6556 
6557 - `WebFetchBlock object { content, retrieved_at, type, url }`
6852 default: web_fetch_tool_result_error
6853 
6854 - `WebFetchBlock object`
65586855 
65596856 - `content: DocumentBlock`
65606857 
from line 6861
65646861 
65656862 - `enabled: boolean`
65666863 
6864 default: false
6865 
65676866 - `source: Base64PDFSource or PlainTextSource`
65686867 
6569 - `Base64PDFSource object { data, media_type, type }`
6868 - `Base64PDFSource object`
65706869 
65716870 - `data: string`
65726871 
6872 format: byte
6873 
65736874 - `media_type: "application/pdf"`
65746875 
6575 - `"application/pdf"`
6576 
65776876 - `type: "base64"`
65786877 
6579 - `"base64"`
6580 
6581 - `PlainTextSource object { data, media_type, type }`
6878 - `PlainTextSource object`
65826879 
65836880 - `data: string`
65846881 
65856882 - `media_type: "text/plain"`
65866883 
6587 - `"text/plain"`
6588 
65896884 - `type: "text"`
65906885 
6591 - `"text"`
6592 
65936886 - `title: string or null`
65946887 
65956888 The title of the document
65966889 
65976890 - `type: "document"`
65986891 
6599 - `"document"`
6892 default: document
66006893 
66016894 - `retrieved_at: string or null`
66026895 
from line 6897
66046897 
66056898 - `type: "web_fetch_result"`
66066899 
6607 - `"web_fetch_result"`
6900 default: web_fetch_result
66086901 
66096902 - `url: string`
66106903 
from line 6905
66126905 
66136906 - `tool_use_id: string`
66146907 
6908 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6909 
66156910 - `type: "web_fetch_tool_result"`
66166911 
6617 - `"web_fetch_tool_result"`
6618 
6619 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
6912 default: web_fetch_tool_result
6913 
6914 - `CodeExecutionToolResultBlock object`
66206915 
66216916 - `content: CodeExecutionToolResultBlockContent`
66226917 
66236918 Code execution result with encrypted stdout for PFC + web_search results.
66246919 
6625 - `CodeExecutionToolResultError object { error_code, type }`
6920 - `CodeExecutionToolResultError object`
66266921 
66276922 - `error_code: CodeExecutionToolResultErrorCode`
66286923 
from line 6931
66366931 
66376932 - `type: "code_execution_tool_result_error"`
66386933 
6639 - `"code_execution_tool_result_error"`
6640 
6641 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
6934 default: code_execution_tool_result_error
6935 
6936 - `CodeExecutionResultBlock object`
66426937 
66436938 - `content: array of CodeExecutionOutputBlock`
66446939 
from line 6941
66466941 
66476942 - `type: "code_execution_output"`
66486943 
6649 - `"code_execution_output"`
6944 default: code_execution_output
66506945 
66516946 - `return_code: number`
66526947 
from line 6951
66566951 
66576952 - `type: "code_execution_result"`
66586953 
6659 - `"code_execution_result"`
6660 
6661 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
6954 default: code_execution_result
6955 
6956 - `EncryptedCodeExecutionResultBlock object`
66626957 
66636958 Code execution result with encrypted stdout for PFC + web_search results.
66646959 
from line 6963
66686963 
66696964 - `type: "code_execution_output"`
66706965 
6966 default: code_execution_output
6967 
66716968 - `encrypted_stdout: string`
66726969 
66736970 - `return_code: number`
from line 6973
66766973 
66776974 - `type: "encrypted_code_execution_result"`
66786975 
6679 - `"encrypted_code_execution_result"`
6976 default: encrypted_code_execution_result
66806977 
66816978 - `tool_use_id: string`
66826979 
6980 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6981 
66836982 - `type: "code_execution_tool_result"`
66846983 
6685 - `"code_execution_tool_result"`
6686 
6687 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
6984 default: code_execution_tool_result
6985 
6986 - `BashCodeExecutionToolResultBlock object`
66886987 
66896988 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
66906989 
6691 - `BashCodeExecutionToolResultError object { error_code, type }`
6990 - `BashCodeExecutionToolResultError object`
66926991 
66936992 - `error_code: BashCodeExecutionToolResultErrorCode`
66946993 
from line 7003
67047003 
67057004 - `type: "bash_code_execution_tool_result_error"`
67067005 
6707 - `"bash_code_execution_tool_result_error"`
6708 
6709 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
7006 default: bash_code_execution_tool_result_error
7007 
7008 - `BashCodeExecutionResultBlock object`
67107009 
67117010 - `content: array of BashCodeExecutionOutputBlock`
67127011 
from line 7013
67147013 
67157014 - `type: "bash_code_execution_output"`
67167015 
6717 - `"bash_code_execution_output"`
7016 default: bash_code_execution_output
67187017 
67197018 - `return_code: number`
67207019 
from line 7023
67247023 
67257024 - `type: "bash_code_execution_result"`
67267025 
6727 - `"bash_code_execution_result"`
7026 default: bash_code_execution_result
67287027 
67297028 - `tool_use_id: string`
67307029 
7030 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7031 
67317032 - `type: "bash_code_execution_tool_result"`
67327033 
6733 - `"bash_code_execution_tool_result"`
6734 
6735 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
7034 default: bash_code_execution_tool_result
7035 
7036 - `TextEditorCodeExecutionToolResultBlock object`
67367037 
67377038 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
67387039 
6739 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
7040 - `TextEditorCodeExecutionToolResultError object`
67407041 
67417042 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
67427043 
from line 7055
67547055 
67557056 - `type: "text_editor_code_execution_tool_result_error"`
67567057 
6757 - `"text_editor_code_execution_tool_result_error"`
6758 
6759 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
7058 default: text_editor_code_execution_tool_result_error
7059 
7060 - `TextEditorCodeExecutionViewResultBlock object`
67607061 
67617062 - `content: string`
67627063 
from line 7077
67767077 
67777078 - `type: "text_editor_code_execution_view_result"`
67787079 
6779 - `"text_editor_code_execution_view_result"`
6780 
6781 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
7080 default: text_editor_code_execution_view_result
7081 
7082 - `TextEditorCodeExecutionCreateResultBlock object`
67827083 
67837084 - `is_file_update: boolean`
67847085 
67857086 - `type: "text_editor_code_execution_create_result"`
67867087 
6787 - `"text_editor_code_execution_create_result"`
6788 
6789 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
7088 default: text_editor_code_execution_create_result
7089 
7090 - `TextEditorCodeExecutionStrReplaceResultBlock object`
67907091 
67917092 - `lines: array of string or null`
67927093 
from line 7101
68007101 
68017102 - `type: "text_editor_code_execution_str_replace_result"`
68027103 
6803 - `"text_editor_code_execution_str_replace_result"`
7104 default: text_editor_code_execution_str_replace_result
68047105 
68057106 - `tool_use_id: string`
68067107 
7108 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7109 
68077110 - `type: "text_editor_code_execution_tool_result"`
68087111 
6809 - `"text_editor_code_execution_tool_result"`
6810 
6811 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
7112 default: text_editor_code_execution_tool_result
7113 
7114 - `ToolSearchToolResultBlock object`
68127115 
68137116 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
68147117 
6815 - `ToolSearchToolResultError object { error_code, error_message, type }`
7118 - `ToolSearchToolResultError object`
68167119 
68177120 - `error_code: ToolSearchToolResultErrorCode`
68187121 
from line 7131
68287131 
68297132 - `type: "tool_search_tool_result_error"`
68307133 
6831 - `"tool_search_tool_result_error"`
6832 
6833 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
7134 default: tool_search_tool_result_error
7135 
7136 - `ToolSearchToolSearchResultBlock object`
68347137 
68357138 - `tool_references: array of ToolReferenceBlock`
68367139 
68377140 - `tool_name: string`
68387141 
7142 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
7143 
68397144 - `type: "tool_reference"`
68407145 
6841 - `"tool_reference"`
7146 default: tool_reference
68427147 
68437148 - `type: "tool_search_tool_search_result"`
68447149 
6845 - `"tool_search_tool_search_result"`
7150 default: tool_search_tool_search_result
68467151 
68477152 - `tool_use_id: string`
68487153 
7154 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7155 
68497156 - `type: "tool_search_tool_result"`
68507157 
6851 - `"tool_search_tool_result"`
6852 
6853 - `ContainerUploadBlock object { file_id, type }`
7158 default: tool_search_tool_result
7159 
7160 - `ContainerUploadBlock object`
68547161 
68557162 Response model for a file uploaded to the container.
68567163 
from line 7165
68587165 
68597166 - `type: "container_upload"`
68607167 
6861 - `"container_upload"`
7168 default: container_upload
68627169 
68637170 - `model: Model`
68647171 
from line 7247
69407247 
69417248 This will always be `"assistant"`.
69427249 
6943 - `"assistant"`
7250 default: assistant
69447251 
69457252 - `stop_details: RefusalStopDetails or null`
69467253 
from line 7285
69787285 
69797286 - `type: "refusal"`
69807287 
6981 - `"refusal"`
7288 default: refusal
69827289 
69837290 - `stop_reason: StopReason or null`
69847291 
from line 7329
70227329 
70237330 For Messages, this is always `"message"`.
70247331 
7025 - `"message"`
7332 default: message
70267333 
70277334 - `usage: Usage`
70287335 
from line 7351
70447351 
70457352 The number of input tokens used to create the 1 hour cache entry.
70467353 
7354 default: 0, minimum: 0
7355 
70477356 - `ephemeral_5m_input_tokens: number`
70487357 
70497358 The number of input tokens used to create the 5 minute cache entry.
70507359 
7360 default: 0, minimum: 0
7361 
70517362 - `cache_creation_input_tokens: number or null`
70527363 
70537364 The number of input tokens used to create the cache entry.
70547365 
7366 minimum: 0
7367 
70557368 - `cache_read_input_tokens: number or null`
70567369 
70577370 The number of input tokens read from the cache.
70587371 
7372 minimum: 0
7373 
70597374 - `inference_geo: string or null`
70607375 
70617376 The geographic region where inference was performed for this request.
from line 7379
70647379 
70657380 The number of input tokens which were used.
70667381 
7382 minimum: 0
7383 
70677384 - `output_tokens: number`
70687385 
70697386 The number of output tokens which were used.
7387 
7388 minimum: 0
70707389 
70717390 - `output_tokens_details: OutputTokensDetails or null`
70727391 
from line 7407
70887407 generation count by a small number of tokens. Always ≤ `output_tokens`;
70897408 `output_tokens - thinking_tokens` approximates the non-reasoning output.
70907409 
7410 default: 0, minimum: 0
7411 
70917412 - `server_tool_use: ServerToolUsage or null`
70927413 
70937414 The number of server tool requests.
from line 7417
70967417 
70977418 The number of web fetch tool requests.
70987419 
7420 default: 0, minimum: 0
7421 
70997422 - `web_search_requests: number`
71007423 
71017424 The number of web search tool requests.
71027425 
7426 default: 0, minimum: 0
7427 
71037428 - `service_tier: "standard" or "priority" or "batch" or null`
71047429 
71057430 If the request used the priority, standard, or batch tier.
from line 7437
71127437 
71137438 - `type: "succeeded"`
71147439 
7115 - `"succeeded"`
7116 
7117 - `MessageBatchErroredResult object { error, type }`
7440 default: succeeded
7441 
7442 - `MessageBatchErroredResult object`
71187443 
71197444 - `error: ErrorResponse`
71207445 
71217446 - `error: ErrorObject`
71227447 
7123 - `InvalidRequestError object { message, type }`
7448 - `InvalidRequestError object`
71247449 
71257450 - `message: string`
71267451 
7452 default: Invalid request
7453 
71277454 - `type: "invalid_request_error"`
71287455 
7129 - `"invalid_request_error"`
7130 
7131 - `AuthenticationError object { message, type }`
7456 default: invalid_request_error
7457 
7458 - `AuthenticationError object`
71327459 
71337460 - `message: string`
71347461 
7462 default: Authentication error
7463 
71357464 - `type: "authentication_error"`
71367465 
7137 - `"authentication_error"`
7138 
7139 - `BillingError object { message, type }`
7466 default: authentication_error
7467 
7468 - `BillingError object`
71407469 
71417470 - `message: string`
71427471 
7472 default: Billing error
7473 
71437474 - `type: "billing_error"`
71447475 
7145 - `"billing_error"`
7146 
7147 - `PermissionError object { message, type }`
7476 default: billing_error
7477 
7478 - `PermissionError object`
71487479 
71497480 - `message: string`
71507481 
7482 default: Permission denied
7483 
71517484 - `type: "permission_error"`
71527485 
7153 - `"permission_error"`
7154 
7155 - `NotFoundError object { message, type }`
7486 default: permission_error
7487 
7488 - `NotFoundError object`
71567489 
71577490 - `message: string`
71587491 
7492 default: Not found
7493 
71597494 - `type: "not_found_error"`
71607495 
7161 - `"not_found_error"`
7162 
7163 - `RateLimitError object { message, type }`
7496 default: not_found_error
7497 
7498 - `RateLimitError object`
71647499 
71657500 - `message: string`
71667501 
7502 default: Rate limited
7503 
71677504 - `type: "rate_limit_error"`
71687505 
7169 - `"rate_limit_error"`
7170 
7171 - `GatewayTimeoutError object { message, type }`
7506 default: rate_limit_error
7507 
7508 - `GatewayTimeoutError object`
71727509 
71737510 - `message: string`
71747511 
7512 default: Request timeout
7513 
71757514 - `type: "timeout_error"`
71767515 
7177 - `"timeout_error"`
7178 
7179 - `APIErrorObject object { message, type }`
7516 default: timeout_error
7517 
7518 - `APIErrorObject object`
71807519 
71817520 - `message: string`
71827521 
7522 default: Internal server error
7523 
71837524 - `type: "api_error"`
71847525 
7185 - `"api_error"`
7186 
7187 - `OverloadedError object { message, type }`
7526 default: api_error
7527 
7528 - `OverloadedError object`
71887529 
71897530 - `message: string`
71907531 
7532 default: Overloaded
7533 
71917534 - `type: "overloaded_error"`
71927535 
7193 - `"overloaded_error"`
7536 default: overloaded_error
71947537 
71957538 - `request_id: string or null`
71967539 
71977540 - `type: "error"`
71987541 
7199 - `"error"`
7542 default: error
72007543 
72017544 - `type: "errored"`
72027545 
7203 - `"errored"`
7204 
7205 - `MessageBatchCanceledResult object { type }`
7546 default: errored
7547 
7548 - `MessageBatchCanceledResult object`
72067549 
72077550 - `type: "canceled"`
72087551 
7209 - `"canceled"`
7210 
7211 - `MessageBatchExpiredResult object { type }`
7552 default: canceled
7553 
7554 - `MessageBatchExpiredResult object`
72127555 
72137556 - `type: "expired"`
72147557 
7215 - `"expired"`
7558 default: expired
72167559 
72177560### Message Batch Succeeded Result
72187561 
7219- `MessageBatchSucceededResult object { message, type }`
7562- `MessageBatchSucceededResult object`
72207563 
72217564 - `message: Message`
72227565 
from line 7581
72387581 
72397582 The time at which the container will expire.
72407583 
7584 format: date-time
7585 
72417586 - `skills: array of ContainerSkill or null`
72427587 
72437588 Skills loaded in the container
from line 7591
72467591 
72477592 Skill ID
72487593 
7594 maxLength: 64, minLength: 1
7595 
72497596 - `type: "anthropic" or "custom"`
72507597 
72517598 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 7604
72577604 - `version: string`
72587605 
72597606 The resolved version: a skill version ID for custom skills.
7607 
7608 maxLength: 64, minLength: 1
72607609 
72617610 - `content: array of ContentBlock`
72627611 
from line 7636
72877636 [{"type": "text", "text": "B)"}]
72887637 ```
72897638 
7290 - `TextBlock object { citations, text, type }`
7639 - `TextBlock object`
72917640 
72927641 - `citations: array of TextCitation or null`
72937642 
from line 7644
72957644 
72967645 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`.
72977646 
7298 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
7647 - `CitationCharLocation object`
72997648 
73007649 - `cited_text: string`
73017650 
73027651 - `document_index: number`
73037652 
7653 minimum: 0
7654 
73047655 - `document_title: string or null`
73057656 
73067657 - `end_char_index: number`
from line 7660
73097660 
73107661 - `start_char_index: number`
73117662 
7663 minimum: 0
7664 
73127665 - `type: "char_location"`
73137666 
7314 - `"char_location"`
7315 
7316 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
7667 default: char_location
7668 
7669 - `CitationPageLocation object`
73177670 
73187671 - `cited_text: string`
73197672 
73207673 - `document_index: number`
73217674 
7675 minimum: 0
7676 
73227677 - `document_title: string or null`
73237678 
73247679 - `end_page_number: number`
from line 7682
73277682 
73287683 - `start_page_number: number`
73297684 
7685 minimum: 1
7686 
73307687 - `type: "page_location"`
73317688 
7332 - `"page_location"`
7333 
7334 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
7689 default: page_location
7690 
7691 - `CitationContentBlockLocation object`
73357692 
73367693 - `cited_text: string`
73377694 
from line 7698
73417698 
73427699 - `document_index: number`
73437700 
7701 minimum: 0
7702 
73447703 - `document_title: string or null`
73457704 
73467705 - `end_block_index: number`
from line 7714
73557714 
73567715 0-based index of the first cited block in the source's `content` array.
73577716 
7717 minimum: 0
7718 
73587719 - `type: "content_block_location"`
73597720 
7360 - `"content_block_location"`
7361 
7362 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
7721 default: content_block_location
7722 
7723 - `CitationsWebSearchResultLocation object`
73637724 
73647725 - `cited_text: string`
73657726 
from line 7728
73677728 
73687729 - `title: string or null`
73697730 
7731 maxLength: 512
7732 
73707733 - `type: "web_search_result_location"`
73717734 
7372 - `"web_search_result_location"`
7735 default: web_search_result_location
73737736 
73747737 - `url: string`
73757738 
7376 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
7739 - `CitationsSearchResultLocation object`
73777740 
73787741 - `cited_text: string`
73797742 
from line 7756
73937756 
73947757 Counted separately from `document_index`; server-side web search results are not included in this count.
73957758 
7759 minimum: 0
7760 
73967761 - `source: string`
73977762 
73987763 - `start_block_index: number`
73997764 
74007765 0-based index of the first cited block in the source's `content` array.
74017766 
7767 minimum: 0
7768 
74027769 - `title: string or null`
74037770 
74047771 - `type: "search_result_location"`
74057772 
7406 - `"search_result_location"`
7773 default: search_result_location
74077774 
74087775 - `text: string`
74097776 
7777 maxLength: 5000000, minLength: 0
7778 
74107779 - `type: "text"`
74117780 
7412 - `"text"`
7413 
7414 - `ThinkingBlock object { signature, thinking, type }`
7781 default: text
7782 
7783 - `ThinkingBlock object`
74157784 
74167785 - `signature: string`
74177786 
from line 7796
74277796 
74287797 - `type: "thinking"`
74297798 
7430 - `"thinking"`
7431 
7432 - `RedactedThinkingBlock object { data, type }`
7799 default: thinking
7800 
7801 - `RedactedThinkingBlock object`
74337802 
74347803 - `data: string`
74357804 
from line 7810
74417810 
74427811 - `type: "redacted_thinking"`
74437812 
7444 - `"redacted_thinking"`
7445 
7446 - `ToolUseBlock object { id, caller, input, 3 more }`
7813 default: redacted_thinking
7814 
7815 - `ToolUseBlock object`
74477816 
74487817 - `id: string`
74497818 
7819 pattern: ^[a-zA-Z0-9_-]+$
7820 
74507821 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
74517822 
74527823 Tool invocation directly from the model.
74537824 
7454 - `DirectCaller object { type }`
7825 default: {"type":"direct"}
7826 
7827 - `DirectCaller object`
74557828 
74567829 Tool invocation directly from the model.
74577830 
74587831 - `type: "direct"`
74597832 
7460 - `"direct"`
7461 
7462 - `ServerToolCaller object { tool_id, type }`
7833 - `ServerToolCaller object`
74637834 
74647835 Tool invocation generated by a server-side tool.
74657836 
74667837 - `tool_id: string`
74677838 
7839 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7840 
74687841 - `type: "code_execution_20250825"`
74697842 
7470 - `"code_execution_20250825"`
7471 
7472 - `ServerToolCaller20260120 object { tool_id, type }`
7843 - `ServerToolCaller20260120 object`
74737844 
74747845 - `tool_id: string`
74757846 
7847 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7848 
74767849 - `type: "code_execution_20260120"`
74777850 
7478 - `"code_execution_20260120"`
7479 
74807851 - `input: map[unknown]`
74817852 
74827853 - `name: string`
74837854 
7855 minLength: 1
7856 
74847857 - `type: "tool_use"`
74857858 
7486 - `"tool_use"`
7859 default: tool_use
74877860 
74887861 - `toolset_name: optional string or null`
74897862 
74907863 For a toolset member tool_use, the toolset family.
74917864 
7492 - `ServerToolUseBlock object { id, caller, input, 2 more }`
7865 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
7866 
7867 - `ServerToolUseBlock object`
74937868 
74947869 - `id: string`
74957870 
7871 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7872 
74967873 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
74977874 
74987875 Tool invocation directly from the model.
74997876 
7500 - `DirectCaller object { type }`
7877 default: {"type":"direct"}
7878 
7879 - `DirectCaller object`
75017880 
75027881 Tool invocation directly from the model.
75037882 
7504 - `ServerToolCaller object { tool_id, type }`
7883 - `ServerToolCaller object`
75057884 
75067885 Tool invocation generated by a server-side tool.
75077886 
7508 - `ServerToolCaller20260120 object { tool_id, type }`
7887 - `ServerToolCaller20260120 object`
75097888 
75107889 - `input: map[unknown]`
75117890 
from line 7906
75277906 
75287907 - `type: "server_tool_use"`
75297908 
7530 - `"server_tool_use"`
7531 
7532 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
7909 default: server_tool_use
7910 
7911 - `WebSearchToolResultBlock object`
75337912 
75347913 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
75357914 
75367915 Tool invocation directly from the model.
75377916 
7538 - `DirectCaller object { type }`
7917 default: {"type":"direct"}
7918 
7919 - `DirectCaller object`
75397920 
75407921 Tool invocation directly from the model.
75417922 
7542 - `ServerToolCaller object { tool_id, type }`
7923 - `ServerToolCaller object`
75437924 
75447925 Tool invocation generated by a server-side tool.
75457926 
7546 - `ServerToolCaller20260120 object { tool_id, type }`
7927 - `ServerToolCaller20260120 object`
75477928 
75487929 - `content: WebSearchToolResultBlockContent`
75497930 
7550 - `WebSearchToolResultError object { error_code, type }`
7931 - `WebSearchToolResultError object`
75517932 
75527933 - `error_code: WebSearchToolResultErrorCode`
75537934 
from line 7946
75657946 
75667947 - `type: "web_search_tool_result_error"`
75677948 
7568 - `"web_search_tool_result_error"`
7949 default: web_search_tool_result_error
75697950 
75707951 - `array of WebSearchResultBlock`
75717952 
from line 7958
75777958 
75787959 - `type: "web_search_result"`
75797960 
7580 - `"web_search_result"`
7961 default: web_search_result
75817962 
75827963 - `url: string`
75837964 
75847965 - `tool_use_id: string`
75857966 
7967 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7968 
75867969 - `type: "web_search_tool_result"`
75877970 
7588 - `"web_search_tool_result"`
7589 
7590 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
7971 default: web_search_tool_result
7972 
7973 - `WebFetchToolResultBlock object`
75917974 
75927975 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
75937976 
75947977 Tool invocation directly from the model.
75957978 
7596 - `DirectCaller object { type }`
7979 default: {"type":"direct"}
7980 
7981 - `DirectCaller object`
75977982 
75987983 Tool invocation directly from the model.
75997984 
7600 - `ServerToolCaller object { tool_id, type }`
7985 - `ServerToolCaller object`
76017986 
76027987 Tool invocation generated by a server-side tool.
76037988 
7604 - `ServerToolCaller20260120 object { tool_id, type }`
7989 - `ServerToolCaller20260120 object`
76057990 
76067991 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
76077992 
7608 - `WebFetchToolResultErrorBlock object { error_code, type }`
7993 - `WebFetchToolResultErrorBlock object`
76097994 
76107995 - `error_code: WebFetchToolResultErrorCode`
76117996 
from line 8014
76298014 
76308015 - `type: "web_fetch_tool_result_error"`
76318016 
7632 - `"web_fetch_tool_result_error"`
7633 
7634 - `WebFetchBlock object { content, retrieved_at, type, url }`
8017 default: web_fetch_tool_result_error
8018 
8019 - `WebFetchBlock object`
76358020 
76368021 - `content: DocumentBlock`
76378022 
from line 8026
76418026 
76428027 - `enabled: boolean`
76438028 
8029 default: false
8030 
76448031 - `source: Base64PDFSource or PlainTextSource`
76458032 
7646 - `Base64PDFSource object { data, media_type, type }`
8033 - `Base64PDFSource object`
76478034 
76488035 - `data: string`
76498036 
8037 format: byte
8038 
76508039 - `media_type: "application/pdf"`
76518040 
7652 - `"application/pdf"`
7653 
76548041 - `type: "base64"`
76558042 
7656 - `"base64"`
7657 
7658 - `PlainTextSource object { data, media_type, type }`
8043 - `PlainTextSource object`
76598044 
76608045 - `data: string`
76618046 
76628047 - `media_type: "text/plain"`
76638048 
7664 - `"text/plain"`
7665 
76668049 - `type: "text"`
76678050 
7668 - `"text"`
7669 
76708051 - `title: string or null`
76718052 
76728053 The title of the document
76738054 
76748055 - `type: "document"`
76758056 
7676 - `"document"`
8057 default: document
76778058 
76788059 - `retrieved_at: string or null`
76798060 
from line 8062
76818062 
76828063 - `type: "web_fetch_result"`
76838064 
7684 - `"web_fetch_result"`
8065 default: web_fetch_result
76858066 
76868067 - `url: string`
76878068 
from line 8070
76898070 
76908071 - `tool_use_id: string`
76918072 
8073 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8074 
76928075 - `type: "web_fetch_tool_result"`
76938076 
7694 - `"web_fetch_tool_result"`
7695 
7696 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
8077 default: web_fetch_tool_result
8078 
8079 - `CodeExecutionToolResultBlock object`
76978080 
76988081 - `content: CodeExecutionToolResultBlockContent`
76998082 
77008083 Code execution result with encrypted stdout for PFC + web_search results.
77018084 
7702 - `CodeExecutionToolResultError object { error_code, type }`
8085 - `CodeExecutionToolResultError object`
77038086 
77048087 - `error_code: CodeExecutionToolResultErrorCode`
77058088 
from line 8096
77138096 
77148097 - `type: "code_execution_tool_result_error"`
77158098 
7716 - `"code_execution_tool_result_error"`
7717 
7718 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
8099 default: code_execution_tool_result_error
8100 
8101 - `CodeExecutionResultBlock object`
77198102 
77208103 - `content: array of CodeExecutionOutputBlock`
77218104 
from line 8106
77238106 
77248107 - `type: "code_execution_output"`
77258108 
7726 - `"code_execution_output"`
8109 default: code_execution_output
77278110 
77288111 - `return_code: number`
77298112 
from line 8116
77338116 
77348117 - `type: "code_execution_result"`
77358118 
7736 - `"code_execution_result"`
7737 
7738 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
8119 default: code_execution_result
8120 
8121 - `EncryptedCodeExecutionResultBlock object`
77398122 
77408123 Code execution result with encrypted stdout for PFC + web_search results.
77418124 
from line 8128
77458128 
77468129 - `type: "code_execution_output"`
77478130 
8131 default: code_execution_output
8132 
77488133 - `encrypted_stdout: string`
77498134 
77508135 - `return_code: number`
from line 8138
77538138 
77548139 - `type: "encrypted_code_execution_result"`
77558140 
7756 - `"encrypted_code_execution_result"`
8141 default: encrypted_code_execution_result
77578142 
77588143 - `tool_use_id: string`
77598144 
8145 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8146 
77608147 - `type: "code_execution_tool_result"`
77618148 
7762 - `"code_execution_tool_result"`
7763 
7764 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
8149 default: code_execution_tool_result
8150 
8151 - `BashCodeExecutionToolResultBlock object`
77658152 
77668153 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
77678154 
7768 - `BashCodeExecutionToolResultError object { error_code, type }`
8155 - `BashCodeExecutionToolResultError object`
77698156 
77708157 - `error_code: BashCodeExecutionToolResultErrorCode`
77718158 
from line 8168
77818168 
77828169 - `type: "bash_code_execution_tool_result_error"`
77838170 
7784 - `"bash_code_execution_tool_result_error"`
7785 
7786 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
8171 default: bash_code_execution_tool_result_error
8172 
8173 - `BashCodeExecutionResultBlock object`
77878174 
77888175 - `content: array of BashCodeExecutionOutputBlock`
77898176 
from line 8178
77918178 
77928179 - `type: "bash_code_execution_output"`
77938180 
7794 - `"bash_code_execution_output"`
8181 default: bash_code_execution_output
77958182 
77968183 - `return_code: number`
77978184 
from line 8188
78018188 
78028189 - `type: "bash_code_execution_result"`
78038190 
7804 - `"bash_code_execution_result"`
8191 default: bash_code_execution_result
78058192 
78068193 - `tool_use_id: string`
78078194 
8195 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8196 
78088197 - `type: "bash_code_execution_tool_result"`
78098198 
7810 - `"bash_code_execution_tool_result"`
7811 
7812 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
8199 default: bash_code_execution_tool_result
8200 
8201 - `TextEditorCodeExecutionToolResultBlock object`
78138202 
78148203 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
78158204 
7816 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
8205 - `TextEditorCodeExecutionToolResultError object`
78178206 
78188207 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
78198208 
from line 8220
78318220 
78328221 - `type: "text_editor_code_execution_tool_result_error"`
78338222 
7834 - `"text_editor_code_execution_tool_result_error"`
7835 
7836 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
8223 default: text_editor_code_execution_tool_result_error
8224 
8225 - `TextEditorCodeExecutionViewResultBlock object`
78378226 
78388227 - `content: string`
78398228 
from line 8242
78538242 
78548243 - `type: "text_editor_code_execution_view_result"`
78558244 
7856 - `"text_editor_code_execution_view_result"`
7857 
7858 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
8245 default: text_editor_code_execution_view_result
8246 
8247 - `TextEditorCodeExecutionCreateResultBlock object`
78598248 
78608249 - `is_file_update: boolean`
78618250 
78628251 - `type: "text_editor_code_execution_create_result"`
78638252 
7864 - `"text_editor_code_execution_create_result"`
7865 
7866 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
8253 default: text_editor_code_execution_create_result
8254 
8255 - `TextEditorCodeExecutionStrReplaceResultBlock object`
78678256 
78688257 - `lines: array of string or null`
78698258 
from line 8266
78778266 
78788267 - `type: "text_editor_code_execution_str_replace_result"`
78798268 
7880 - `"text_editor_code_execution_str_replace_result"`
8269 default: text_editor_code_execution_str_replace_result
78818270 
78828271 - `tool_use_id: string`
78838272 
8273 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8274 
78848275 - `type: "text_editor_code_execution_tool_result"`
78858276 
7886 - `"text_editor_code_execution_tool_result"`
7887 
7888 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
8277 default: text_editor_code_execution_tool_result
8278 
8279 - `ToolSearchToolResultBlock object`
78898280 
78908281 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
78918282 
7892 - `ToolSearchToolResultError object { error_code, error_message, type }`
8283 - `ToolSearchToolResultError object`
78938284 
78948285 - `error_code: ToolSearchToolResultErrorCode`
78958286 
from line 8296
79058296 
79068297 - `type: "tool_search_tool_result_error"`
79078298 
7908 - `"tool_search_tool_result_error"`
7909 
7910 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
8299 default: tool_search_tool_result_error
8300 
8301 - `ToolSearchToolSearchResultBlock object`
79118302 
79128303 - `tool_references: array of ToolReferenceBlock`
79138304 
79148305 - `tool_name: string`
79158306 
8307 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
8308 
79168309 - `type: "tool_reference"`
79178310 
7918 - `"tool_reference"`
8311 default: tool_reference
79198312 
79208313 - `type: "tool_search_tool_search_result"`
79218314 
7922 - `"tool_search_tool_search_result"`
8315 default: tool_search_tool_search_result
79238316 
79248317 - `tool_use_id: string`
79258318 
8319 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8320 
79268321 - `type: "tool_search_tool_result"`
79278322 
7928 - `"tool_search_tool_result"`
7929 
7930 - `ContainerUploadBlock object { file_id, type }`
8323 default: tool_search_tool_result
8324 
8325 - `ContainerUploadBlock object`
79318326 
79328327 Response model for a file uploaded to the container.
79338328 
from line 8330
79358330 
79368331 - `type: "container_upload"`
79378332 
7938 - `"container_upload"`
8333 default: container_upload
79398334 
79408335 - `model: Model`
79418336 
from line 8412
80178412 
80188413 This will always be `"assistant"`.
80198414 
8020 - `"assistant"`
8415 default: assistant
80218416 
80228417 - `stop_details: RefusalStopDetails or null`
80238418 
from line 8450
80558450 
80568451 - `type: "refusal"`
80578452 
8058 - `"refusal"`
8453 default: refusal
80598454 
80608455 - `stop_reason: StopReason or null`
80618456 
from line 8494
80998494 
81008495 For Messages, this is always `"message"`.
81018496 
8102 - `"message"`
8497 default: message
81038498 
81048499 - `usage: Usage`
81058500 
from line 8516
81218516 
81228517 The number of input tokens used to create the 1 hour cache entry.
81238518 
8519 default: 0, minimum: 0
8520 
81248521 - `ephemeral_5m_input_tokens: number`
81258522 
81268523 The number of input tokens used to create the 5 minute cache entry.
81278524 
8525 default: 0, minimum: 0
8526 
81288527 - `cache_creation_input_tokens: number or null`
81298528 
81308529 The number of input tokens used to create the cache entry.
81318530 
8531 minimum: 0
8532 
81328533 - `cache_read_input_tokens: number or null`
81338534 
81348535 The number of input tokens read from the cache.
81358536 
8537 minimum: 0
8538 
81368539 - `inference_geo: string or null`
81378540 
81388541 The geographic region where inference was performed for this request.
from line 8544
81418544 
81428545 The number of input tokens which were used.
81438546 
8547 minimum: 0
8548 
81448549 - `output_tokens: number`
81458550 
81468551 The number of output tokens which were used.
8552 
8553 minimum: 0
81478554 
81488555 - `output_tokens_details: OutputTokensDetails or null`
81498556 
from line 8572
81658572 generation count by a small number of tokens. Always ≤ `output_tokens`;
81668573 `output_tokens - thinking_tokens` approximates the non-reasoning output.
81678574 
8575 default: 0, minimum: 0
8576 
81688577 - `server_tool_use: ServerToolUsage or null`
81698578 
81708579 The number of server tool requests.
from line 8582
81738582 
81748583 The number of web fetch tool requests.
81758584 
8585 default: 0, minimum: 0
8586 
81768587 - `web_search_requests: number`
81778588 
81788589 The number of web search tool requests.
81798590 
8591 default: 0, minimum: 0
8592 
81808593 - `service_tier: "standard" or "priority" or "batch" or null`
81818594 
81828595 If the request used the priority, standard, or batch tier.
from line 8602
81898602 
81908603 - `type: "succeeded"`
81918604 
8192 - `"succeeded"`
8605 default: succeeded
81938606 
Feedback