Batches changedapi/messages/batches
Nearest release: v2.1.309, published 2 hours 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,000added
Lines−1,012removed
From line
114
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits25to this page, all time
The whole hunk
from line 114, old and new numbered
/
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
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 114
114114
115115 See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages?sdk_languages=http).
116116
117 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
117 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter.
118118
119119 There is a limit of 100,000 messages in a single request.
120120
121 - `content: string or array of ContentBlockParam`
122
123 - `string`
124
125 - `array of ContentBlockParam`
126
127 - `TextBlockParam object`
121 - `UserMessageParam object`
122
123 - `content: MessageContentParam`
124
125 - `string`
126
127 - `array of ContentBlockParam`
128
129 - `TextBlockParam object`
130
131 - `type: "text"`
132
133 - `text: string`
134
135 minLength: 1
136
137 - `cache_control: optional CacheControlEphemeral or null`
138
139 Create a cache control breakpoint at this content block.
140
141 - `type: "ephemeral"`
142
143 - `ttl: optional "5m" or "1h"`
144
145 The time-to-live for the cache control breakpoint.
146
147 This may be one the following values:
148
149 - `5m`: 5 minutes
150 - `1h`: 1 hour
151
152 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
153
154 - `"5m"`
155
156 - `"1h"`
157
158 - `citations: optional array of TextCitationParam or null`
159
160 - `CitationCharLocationParam object`
161
162 - `type: "char_location"`
163
164 - `cited_text: string`
165
166 - `document_index: number`
167
168 minimum: 0
169
170 - `document_title: string or null`
171
172 minLength: 1, maxLength: 500
173
174 - `end_char_index: number`
175
176 - `start_char_index: number`
177
178 minimum: 0
179
180 - `CitationPageLocationParam object`
181
182 - `type: "page_location"`
183
184 - `cited_text: string`
185
186 - `document_index: number`
187
188 minimum: 0
189
190 - `document_title: string or null`
191
192 minLength: 1, maxLength: 500
193
194 - `end_page_number: number`
195
196 - `start_page_number: number`
197
198 minimum: 1
199
200 - `CitationContentBlockLocationParam object`
201
202 - `type: "content_block_location"`
203
204 - `cited_text: string`
205
206 The full text of the cited block range, concatenated.
207
208 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
209
210 - `document_index: number`
211
212 minimum: 0
213
214 - `document_title: string or null`
215
216 minLength: 1, maxLength: 500
217
218 - `end_block_index: number`
219
220 Exclusive 0-based end index of the cited block range in the source's `content` array.
221
222 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
223
224 - `start_block_index: number`
225
226 0-based index of the first cited block in the source's `content` array.
227
228 minimum: 0
229
230 - `CitationWebSearchResultLocationParam object`
231
232 - `type: "web_search_result_location"`
233
234 - `cited_text: string`
235
236 - `encrypted_index: string`
237
238 - `title: string or null`
239
240 minLength: 1, maxLength: 512
241
242 - `url: string`
243
244 minLength: 1
245
246 - `CitationSearchResultLocationParam object`
247
248 - `type: "search_result_location"`
249
250 - `cited_text: string`
251
252 The full text of the cited block range, concatenated.
253
254 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
255
256 - `end_block_index: number`
257
258 Exclusive 0-based end index of the cited block range in the source's `content` array.
259
260 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
261
262 - `search_result_index: number`
263
264 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
265
266 Counted separately from `document_index`; server-side web search results are not included in this count.
267
268 minimum: 0
269
270 - `source: string`
271
272 - `start_block_index: number`
273
274 0-based index of the first cited block in the source's `content` array.
275
276 minimum: 0
277
278 - `title: string or null`
279
280 - `ImageBlockParam object`
281
282 - `type: "image"`
283
284 - `source: Base64ImageSource or URLImageSource or FileImageSource`
285
286 - `Base64ImageSource object`
287
288 - `type: "base64"`
289
290 - `data: string`
291
292 format: byte
293
294 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
295
296 - `"image/jpeg"`
297
298 - `"image/png"`
299
300 - `"image/gif"`
301
302 - `"image/webp"`
303
304 - `URLImageSource object`
305
306 - `type: "url"`
307
308 - `url: string`
309
310 - `FileImageSource object`
311
312 - `type: "file"`
313
314 - `file_id: string`
315
316 - `cache_control: optional CacheControlEphemeral or null`
317
318 Create a cache control breakpoint at this content block.
319
320 - `transformations: optional ImageTransformationsParam or null`
321
322 Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
323
324 - `oversized_image: optional "downsize" or "error"`
325
326 What the server does when this image exceeds the model's maximum image size. `"downsize"` (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. `"error"` instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
327
328 - `"downsize"`
329
330 - `"error"`
331
332 - `DocumentBlockParam object`
333
334 - `type: "document"`
335
336 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
337
338 - `Base64PDFSource object`
339
340 - `type: "base64"`
341
342 - `data: string`
343
344 format: byte
345
346 - `media_type: "application/pdf"`
347
348 - `PlainTextSource object`
349
350 - `type: "text"`
351
352 - `data: string`
353
354 - `media_type: "text/plain"`
355
356 - `ContentBlockSource object`
357
358 - `type: "content"`
359
360 - `content: string or array of ContentBlockSourceContent`
361
362 - `string`
363
364 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
365
366 - `TextBlockParam object`
367
368 - `ImageBlockParam object`
369
370 - `URLPDFSource object`
371
372 - `type: "url"`
373
374 - `url: string`
375
376 - `FileDocumentSource object`
377
378 - `type: "file"`
379
380 - `file_id: string`
381
382 - `cache_control: optional CacheControlEphemeral or null`
383
384 Create a cache control breakpoint at this content block.
385
386 - `citations: optional CitationsConfigParam or null`
387
388 - `enabled: optional boolean`
389
390 - `context: optional string or null`
391
392 minLength: 1
393
394 - `title: optional string or null`
395
396 minLength: 1, maxLength: 500
397
398 - `SearchResultBlockParam object`
399
400 - `type: "search_result"`
401
402 - `content: array of TextBlockParam`
403
404 - `type: "text"`
405
406 - `text: string`
407
408 minLength: 1
409
410 - `cache_control: optional CacheControlEphemeral or null`
411
412 Create a cache control breakpoint at this content block.
413
414 - `citations: optional array of TextCitationParam or null`
415
416 - `source: string`
417
418 - `title: string`
419
420 - `cache_control: optional CacheControlEphemeral or null`
421
422 Create a cache control breakpoint at this content block.
423
424 - `citations: optional CitationsConfigParam`
425
426 - `ThinkingBlockParam object`
427
428 - `type: "thinking"`
429
430 - `signature: string`
431
432 The `signature` value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
433
434 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
435
436 - `thinking: string`
437
438 The `thinking` text of this block as returned by the API.
439
440 - `RedactedThinkingBlockParam object`
441
442 - `type: "redacted_thinking"`
443
444 - `data: string`
445
446 The `data` value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.
447
448 - `ToolUseBlockParam object`
449
450 - `type: "tool_use"`
451
452 - `id: string`
453
454 pattern: ^[a-zA-Z0-9_-]+$
455
456 - `input: map[unknown]`
457
458 - `name: string`
459
460 minLength: 1, maxLength: 200
461
462 - `cache_control: optional CacheControlEphemeral or null`
463
464 Create a cache control breakpoint at this content block.
465
466 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
467
468 - `DirectCaller object`
469
470 Tool invocation directly from the model.
471
472 - `type: "direct"`
473
474 - `ServerToolCaller object`
475
476 Tool invocation generated by a server-side tool.
477
478 - `type: "code_execution_20250825"`
479
480 - `tool_id: string`
481
482 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
483
484 - `ServerToolCaller20260120 object`
485
486 - `type: "code_execution_20260120"`
487
488 - `tool_id: string`
489
490 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
491
492 - `toolset_name: optional string or null`
493
494 For a toolset member tool_use, the toolset family this member belongs to.
495
496 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
497
498 - `ToolResultBlockParam object`
499
500 - `type: "tool_result"`
501
502 - `tool_use_id: string`
503
504 pattern: ^[a-zA-Z0-9_-]+$
505
506 - `cache_control: optional CacheControlEphemeral or null`
507
508 Create a cache control breakpoint at this content block.
509
510 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
511
512 - `string`
513
514 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
515
516 - `TextBlockParam object`
517
518 - `ImageBlockParam object`
519
520 - `SearchResultBlockParam object`
521
522 - `DocumentBlockParam object`
523
524 - `ToolReferenceBlockParam object`
525
526 Tool reference block that can be included in tool_result content.
527
528 - `type: "tool_reference"`
529
530 - `tool_name: string`
531
532 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
533
534 - `cache_control: optional CacheControlEphemeral or null`
535
536 Create a cache control breakpoint at this content block.
537
538 - `BrowserStateBlockParam object`
539
540 The caller's browser state after a browser toolset member call —
541 the full inventory of open tabs, which tab is active, and any side
542 effects (tabs opened, download state changes) the call produced.
543
544 At most one per `tool_result`, only on a non-error result answering a
545 browser toolset member `tool_use`. The server renders the
546 model-visible text from it; the model never sees the raw fields.
547
548 - `type: "browser_state"`
549
550 - `tabs: array of BrowserStateTabEntry`
551
552 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`.
553
554 maxItems: 100
555
556 - `tab_id: string`
557
558 The caller-assigned identifier for this tab, unique within the inventory.
559
560 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
561
562 - `title: string`
563
564 The title of the page the tab is showing. May be empty.
565
566 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
567
568 - `url: string`
569
570 The URL of the page the tab is showing. May be empty.
571
572 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
573
574 - `active: optional boolean`
575
576 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
577
578 - `cache_control: optional CacheControlEphemeral or null`
579
580 Create a cache control breakpoint at this content block.
581
582 - `state_changes: optional array of BrowserStateChange or null`
583
584 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
585
586 minItems: 1, maxItems: 200
587
588 - `BrowserStateChangeTabOpened object`
589
590 A tab this call's execution opened that remains open at its end —
591 the creation delta of the `tabs` inventory, not an event log.
592
593 Carries only the `tab_id`; the tab's `title` and `url` live on its
594 `tabs` entry, which must include the same `tab_id`. A tab opened
595 during a failed call gets no deferred `tab_opened`; it simply appears
596 in the next result's `tabs` inventory.
597
598 - `type: "tab_opened"`
599
600 - `tab_id: string`
601
602 The `tab_id` of the opened tab, present in `tabs`.
603
604 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
605
606 - `BrowserStateChangeDownloadStarted object`
607
608 A file download that started during this call.
609
610 - `type: "download_started"`
611
612 - `download_id: string`
613
614 The caller-assigned identifier for this download, stable across the state changes reporting it.
615
616 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
617
618 - `url: string`
619
620 The final post-redirect URL the download was served from.
621
622 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
623
624 - `BrowserStateChangeDownloadCompleted object`
625
626 A file download that finished during this call, reported with the
627 same `download_id` as its `download_started` — or without a prior
628 `download_started`, when the download finished during the call that
629 started it (at most one state change per `download_id` per result).
630
631 - `type: "download_completed"`
632
633 - `download_id: string`
634
635 The caller-assigned identifier for this download, stable across the state changes reporting it.
636
637 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
638
639 - `url: string`
640
641 The final post-redirect URL the download was served from.
642
643 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
644
645 - `path: optional string or null`
646
647 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.
648
649 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
650
651 - `size_bytes: optional number or null`
652
653 The completed download's size.
654
655 minimum: 0
656
657 - `BrowserStateChangeDownloadFailed object`
658
659 A file download that failed — or was cancelled — during this call.
660
661 - `type: "download_failed"`
662
663 - `download_id: string`
664
665 The caller-assigned identifier for this download, stable across the state changes reporting it.
666
667 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
668
669 - `url: string`
670
671 The final post-redirect URL the download was served from.
672
673 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
674
675 - `error: optional string or null`
676
677 The failure or cancellation detail, when known.
678
679 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
680
681 - `is_error: optional boolean`
682
683 - `toolset_name: optional string or null`
684
685 For a toolset member tool_result, the toolset family of the paired tool_use.
686
687 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
688
689 - `ServerToolUseBlockParam object`
690
691 - `type: "server_tool_use"`
692
693 - `id: string`
694
695 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
696
697 - `input: map[unknown]`
698
699 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
700
701 - `"web_search"`
702
703 - `"web_fetch"`
704
705 - `"code_execution"`
706
707 - `"bash_code_execution"`
708
709 - `"text_editor_code_execution"`
710
711 - `"tool_search_tool_regex"`
712
713 - `"tool_search_tool_bm25"`
714
715 - `cache_control: optional CacheControlEphemeral or null`
716
717 Create a cache control breakpoint at this content block.
718
719 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
720
721 - `DirectCaller object`
722
723 Tool invocation directly from the model.
724
725 - `ServerToolCaller object`
726
727 Tool invocation generated by a server-side tool.
728
729 - `ServerToolCaller20260120 object`
730
731 - `WebSearchToolResultBlockParam object`
732
733 - `type: "web_search_tool_result"`
734
735 - `content: WebSearchToolResultBlockParamContent`
736
737 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
738
739 - `type: "web_search_result"`
740
741 - `encrypted_content: string`
742
743 - `title: string`
744
745 - `url: string`
746
747 - `page_age: optional string or null`
748
749 - `WebSearchToolRequestError object`
750
751 - `type: "web_search_tool_result_error"`
752
753 - `error_code: WebSearchToolResultErrorCode`
754
755 - `"invalid_tool_input"`
756
757 - `"unavailable"`
758
759 - `"max_uses_exceeded"`
760
761 - `"too_many_requests"`
762
763 - `"query_too_long"`
764
765 - `"request_too_large"`
766
767 - `tool_use_id: string`
768
769 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
770
771 - `cache_control: optional CacheControlEphemeral or null`
772
773 Create a cache control breakpoint at this content block.
774
775 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
776
777 - `DirectCaller object`
778
779 Tool invocation directly from the model.
780
781 - `ServerToolCaller object`
782
783 Tool invocation generated by a server-side tool.
784
785 - `ServerToolCaller20260120 object`
786
787 - `WebFetchToolResultBlockParam object`
788
789 - `type: "web_fetch_tool_result"`
790
791 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
792
793 - `WebFetchToolResultErrorBlockParam object`
794
795 - `type: "web_fetch_tool_result_error"`
796
797 - `error_code: WebFetchToolResultErrorCode`
798
799 - `"invalid_tool_input"`
800
801 - `"url_too_long"`
802
803 - `"url_not_allowed"`
804
805 - `"url_not_in_prior_context"`
806
807 - `"url_not_accessible"`
808
809 - `"unsupported_content_type"`
810
811 - `"too_many_requests"`
812
813 - `"max_uses_exceeded"`
814
815 - `"unavailable"`
816
817 - `"content_too_large"`
818
819 - `WebFetchBlockParam object`
820
821 - `type: "web_fetch_result"`
822
823 - `content: DocumentBlockParam`
824
825 - `url: string`
826
827 Fetched content URL
828
829 - `retrieved_at: optional string or null`
830
831 ISO 8601 timestamp when the content was retrieved
832
833 - `tool_use_id: string`
834
835 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
836
837 - `cache_control: optional CacheControlEphemeral or null`
838
839 Create a cache control breakpoint at this content block.
840
841 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
842
843 - `DirectCaller object`
844
845 Tool invocation directly from the model.
846
847 - `ServerToolCaller object`
848
849 Tool invocation generated by a server-side tool.
850
851 - `ServerToolCaller20260120 object`
852
853 - `CodeExecutionToolResultBlockParam object`
854
855 - `type: "code_execution_tool_result"`
856
857 - `content: CodeExecutionToolResultBlockParamContent`
858
859 - `CodeExecutionToolResultErrorParam object`
860
861 - `type: "code_execution_tool_result_error"`
862
863 - `error_code: CodeExecutionToolResultErrorCode`
864
865 - `"invalid_tool_input"`
866
867 - `"unavailable"`
868
869 - `"too_many_requests"`
870
871 - `"execution_time_exceeded"`
872
873 - `CodeExecutionResultBlockParam object`
874
875 - `type: "code_execution_result"`
876
877 - `content: array of CodeExecutionOutputBlockParam`
878
879 - `type: "code_execution_output"`
880
881 - `file_id: string`
882
883 - `return_code: number`
884
885 - `stderr: string`
886
887 - `stdout: string`
888
889 - `EncryptedCodeExecutionResultBlockParam object`
890
891 Code execution result with encrypted stdout for PFC + web_search results.
892
893 - `type: "encrypted_code_execution_result"`
894
895 - `content: array of CodeExecutionOutputBlockParam`
896
897 - `type: "code_execution_output"`
898
899 - `file_id: string`
900
901 - `encrypted_stdout: string`
902
903 - `return_code: number`
904
905 - `stderr: string`
906
907 - `tool_use_id: string`
908
909 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
910
911 - `cache_control: optional CacheControlEphemeral or null`
912
913 Create a cache control breakpoint at this content block.
914
915 - `BashCodeExecutionToolResultBlockParam object`
916
917 - `type: "bash_code_execution_tool_result"`
918
919 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
920
921 - `BashCodeExecutionToolResultErrorParam object`
922
923 - `type: "bash_code_execution_tool_result_error"`
924
925 - `error_code: BashCodeExecutionToolResultErrorCode`
926
927 - `"invalid_tool_input"`
928
929 - `"unavailable"`
930
931 - `"too_many_requests"`
932
933 - `"execution_time_exceeded"`
934
935 - `"output_file_too_large"`
936
937 - `BashCodeExecutionResultBlockParam object`
938
939 - `type: "bash_code_execution_result"`
940
941 - `content: array of BashCodeExecutionOutputBlockParam`
942
943 - `type: "bash_code_execution_output"`
944
945 - `file_id: string`
946
947 - `return_code: number`
948
949 - `stderr: string`
950
951 - `stdout: string`
952
953 - `tool_use_id: string`
954
955 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
956
957 - `cache_control: optional CacheControlEphemeral or null`
958
959 Create a cache control breakpoint at this content block.
960
961 - `TextEditorCodeExecutionToolResultBlockParam object`
962
963 - `type: "text_editor_code_execution_tool_result"`
964
965 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
966
967 - `TextEditorCodeExecutionToolResultErrorParam object`
968
969 - `type: "text_editor_code_execution_tool_result_error"`
970
971 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
972
973 - `"invalid_tool_input"`
974
975 - `"unavailable"`
976
977 - `"too_many_requests"`
978
979 - `"execution_time_exceeded"`
980
981 - `"file_not_found"`
982
983 - `error_message: optional string or null`
984
985 - `TextEditorCodeExecutionViewResultBlockParam object`
986
987 - `type: "text_editor_code_execution_view_result"`
988
989 - `content: string`
990
991 - `file_type: "text" or "image" or "pdf"`
992
993 - `"text"`
994
995 - `"image"`
996
997 - `"pdf"`
998
999 - `num_lines: optional number or null`
1000
1001 - `start_line: optional number or null`
1002
1003 - `total_lines: optional number or null`
1004
1005 - `TextEditorCodeExecutionCreateResultBlockParam object`
1006
1007 - `type: "text_editor_code_execution_create_result"`
1008
1009 - `is_file_update: boolean`
1010
1011 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1012
1013 - `type: "text_editor_code_execution_str_replace_result"`
1014
1015 - `lines: optional array of string or null`
1016
1017 - `new_lines: optional number or null`
1018
1019 - `new_start: optional number or null`
1020
1021 - `old_lines: optional number or null`
1022
1023 - `old_start: optional number or null`
1024
1025 - `tool_use_id: string`
1026
1027 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1028
1029 - `cache_control: optional CacheControlEphemeral or null`
1030
1031 Create a cache control breakpoint at this content block.
1032
1033 - `ToolSearchToolResultBlockParam object`
1034
1035 - `type: "tool_search_tool_result"`
1036
1037 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1038
1039 - `ToolSearchToolResultErrorParam object`
1040
1041 - `type: "tool_search_tool_result_error"`
1042
1043 - `error_code: ToolSearchToolResultErrorCode`
1044
1045 - `"invalid_tool_input"`
1046
1047 - `"unavailable"`
1048
1049 - `"too_many_requests"`
1050
1051 - `"execution_time_exceeded"`
1052
1053 - `error_message: optional string or null`
1054
1055 - `ToolSearchToolSearchResultBlockParam object`
1056
1057 - `type: "tool_search_tool_search_result"`
1058
1059 - `tool_references: array of ToolReferenceBlockParam`
1060
1061 - `type: "tool_reference"`
1062
1063 - `tool_name: string`
1064
1065 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1066
1067 - `cache_control: optional CacheControlEphemeral or null`
1068
1069 Create a cache control breakpoint at this content block.
1070
1071 - `tool_use_id: string`
1072
1073 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1074
1075 - `cache_control: optional CacheControlEphemeral or null`
1076
1077 Create a cache control breakpoint at this content block.
1078
1079 - `ContainerUploadBlockParam object`
1080
1081 A content block that represents a file to be uploaded to the container
1082 Files uploaded via this block will be available in the container's input directory.
1083
1084 - `type: "container_upload"`
1085
1086 - `file_id: string`
1087
1088 - `cache_control: optional CacheControlEphemeral or null`
1089
1090 Create a cache control breakpoint at this content block.
1091
1092 - `role: "user"`
1093
1094 - `AssistantMessageParam object`
1095
1096 - `content: MessageContentParam`
1097
1098 - `role: "assistant"`
1099
1100 - `SystemMessageParam object`
1101
1102 - `content: string or array of TextBlockParam`
1103
1104 - `string`
1105
1106 - `Blocks = array of TextBlockParam`
1281107
1291108 - `type: "text"`
1301109
from line 1115
1361115
1371116 Create a cache control breakpoint at this content block.
1381117
139 - `type: "ephemeral"`
140
141 - `ttl: optional "5m" or "1h"`
142
143 The time-to-live for the cache control breakpoint.
144
145 This may be one the following values:
146
147 - `5m`: 5 minutes
148 - `1h`: 1 hour
149
150 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
151
152 - `"5m"`
153
154 - `"1h"`
155
1561118 - `citations: optional array of TextCitationParam or null`
1571119
158 - `CitationCharLocationParam object`
159
160 - `type: "char_location"`
161
162 - `cited_text: string`
163
164 - `document_index: number`
165
166 minimum: 0
167
168 - `document_title: string or null`
169
170 minLength: 1, maxLength: 500
171
172 - `end_char_index: number`
173
174 - `start_char_index: number`
175
176 minimum: 0
177
178 - `CitationPageLocationParam object`
179
180 - `type: "page_location"`
181
182 - `cited_text: string`
183
184 - `document_index: number`
185
186 minimum: 0
187
188 - `document_title: string or null`
189
190 minLength: 1, maxLength: 500
191
192 - `end_page_number: number`
193
194 - `start_page_number: number`
195
196 minimum: 1
197
198 - `CitationContentBlockLocationParam object`
199
200 - `type: "content_block_location"`
201
202 - `cited_text: string`
203
204 The full text of the cited block range, concatenated.
205
206 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
207
208 - `document_index: number`
209
210 minimum: 0
211
212 - `document_title: string or null`
213
214 minLength: 1, maxLength: 500
215
216 - `end_block_index: number`
217
218 Exclusive 0-based end index of the cited block range in the source's `content` array.
219
220 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
221
222 - `start_block_index: number`
223
224 0-based index of the first cited block in the source's `content` array.
225
226 minimum: 0
227
228 - `CitationWebSearchResultLocationParam object`
229
230 - `type: "web_search_result_location"`
231
232 - `cited_text: string`
233
234 - `encrypted_index: string`
235
236 - `title: string or null`
237
238 minLength: 1, maxLength: 512
239
240 - `url: string`
241
242 minLength: 1
243
244 - `CitationSearchResultLocationParam object`
245
246 - `type: "search_result_location"`
247
248 - `cited_text: string`
249
250 The full text of the cited block range, concatenated.
251
252 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
253
254 - `end_block_index: number`
255
256 Exclusive 0-based end index of the cited block range in the source's `content` array.
257
258 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
259
260 - `search_result_index: number`
261
262 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
263
264 Counted separately from `document_index`; server-side web search results are not included in this count.
265
266 minimum: 0
267
268 - `source: string`
269
270 - `start_block_index: number`
271
272 0-based index of the first cited block in the source's `content` array.
273
274 minimum: 0
275
276 - `title: string or null`
277
278 - `ImageBlockParam object`
279
280 - `type: "image"`
281
282 - `source: Base64ImageSource or URLImageSource or FileImageSource`
283
284 - `Base64ImageSource object`
285
286 - `type: "base64"`
287
288 - `data: string`
289
290 format: byte
291
292 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
293
294 - `"image/jpeg"`
295
296 - `"image/png"`
297
298 - `"image/gif"`
299
300 - `"image/webp"`
301
302 - `URLImageSource object`
303
304 - `type: "url"`
305
306 - `url: string`
307
308 - `FileImageSource object`
309
310 - `type: "file"`
311
312 - `file_id: string`
313
314 - `cache_control: optional CacheControlEphemeral or null`
315
316 Create a cache control breakpoint at this content block.
317
318 - `transformations: optional ImageTransformationsParam or null`
319
320 Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
321
322 - `oversized_image: optional "downsize" or "error"`
323
324 What the server does when this image exceeds the model's maximum image size. `"downsize"` (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. `"error"` instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
325
326 - `"downsize"`
327
328 - `"error"`
329
330 - `DocumentBlockParam object`
331
332 - `type: "document"`
333
334 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
335
336 - `Base64PDFSource object`
337
338 - `type: "base64"`
339
340 - `data: string`
341
342 format: byte
343
344 - `media_type: "application/pdf"`
345
346 - `PlainTextSource object`
347
348 - `type: "text"`
349
350 - `data: string`
351
352 - `media_type: "text/plain"`
353
354 - `ContentBlockSource object`
355
356 - `type: "content"`
357
358 - `content: string or array of ContentBlockSourceContent`
359
360 - `string`
361
362 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
363
364 - `TextBlockParam object`
365
366 - `ImageBlockParam object`
367
368 - `URLPDFSource object`
369
370 - `type: "url"`
371
372 - `url: string`
373
374 - `FileDocumentSource object`
375
376 - `type: "file"`
377
378 - `file_id: string`
379
380 - `cache_control: optional CacheControlEphemeral or null`
381
382 Create a cache control breakpoint at this content block.
383
384 - `citations: optional CitationsConfigParam or null`
385
386 - `enabled: optional boolean`
387
388 - `context: optional string or null`
389
390 minLength: 1
391
392 - `title: optional string or null`
393
394 minLength: 1, maxLength: 500
395
396 - `SearchResultBlockParam object`
397
398 - `type: "search_result"`
399
400 - `content: array of TextBlockParam`
401
402 - `type: "text"`
403
404 - `text: string`
405
406 minLength: 1
407
408 - `cache_control: optional CacheControlEphemeral or null`
409
410 Create a cache control breakpoint at this content block.
411
412 - `citations: optional array of TextCitationParam or null`
413
414 - `source: string`
415
416 - `title: string`
417
418 - `cache_control: optional CacheControlEphemeral or null`
419
420 Create a cache control breakpoint at this content block.
421
422 - `citations: optional CitationsConfigParam`
423
424 - `ThinkingBlockParam object`
425
426 - `type: "thinking"`
427
428 - `signature: string`
429
430 The `signature` value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
431
432 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
433
434 - `thinking: string`
435
436 The `thinking` text of this block as returned by the API.
437
438 - `RedactedThinkingBlockParam object`
439
440 - `type: "redacted_thinking"`
441
442 - `data: string`
443
444 The `data` value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.
445
446 - `ToolUseBlockParam object`
447
448 - `type: "tool_use"`
449
450 - `id: string`
451
452 pattern: ^[a-zA-Z0-9_-]+$
453
454 - `input: map[unknown]`
455
456 - `name: string`
457
458 minLength: 1, maxLength: 200
459
460 - `cache_control: optional CacheControlEphemeral or null`
461
462 Create a cache control breakpoint at this content block.
463
464 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
465
466 - `DirectCaller object`
467
468 Tool invocation directly from the model.
469
470 - `type: "direct"`
471
472 - `ServerToolCaller object`
473
474 Tool invocation generated by a server-side tool.
475
476 - `type: "code_execution_20250825"`
477
478 - `tool_id: string`
479
480 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
481
482 - `ServerToolCaller20260120 object`
483
484 - `type: "code_execution_20260120"`
485
486 - `tool_id: string`
487
488 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
489
490 - `toolset_name: optional string or null`
491
492 For a toolset member tool_use, the toolset family this member belongs to.
493
494 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
495
496 - `ToolResultBlockParam object`
497
498 - `type: "tool_result"`
499
500 - `tool_use_id: string`
501
502 pattern: ^[a-zA-Z0-9_-]+$
503
504 - `cache_control: optional CacheControlEphemeral or null`
505
506 Create a cache control breakpoint at this content block.
507
508 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
509
510 - `string`
511
512 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
513
514 - `TextBlockParam object`
515
516 - `ImageBlockParam object`
517
518 - `SearchResultBlockParam object`
519
520 - `DocumentBlockParam object`
521
522 - `ToolReferenceBlockParam object`
523
524 Tool reference block that can be included in tool_result content.
525
526 - `type: "tool_reference"`
527
528 - `tool_name: string`
529
530 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
531
532 - `cache_control: optional CacheControlEphemeral or null`
533
534 Create a cache control breakpoint at this content block.
535
536 - `BrowserStateBlockParam object`
537
538 The caller's browser state after a browser toolset member call —
539 the full inventory of open tabs, which tab is active, and any side
540 effects (tabs opened, download state changes) the call produced.
541
542 At most one per `tool_result`, only on a non-error result answering a
543 browser toolset member `tool_use`. The server renders the
544 model-visible text from it; the model never sees the raw fields.
545
546 - `type: "browser_state"`
547
548 - `tabs: array of BrowserStateTabEntry`
549
550 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`.
551
552 maxItems: 100
553
554 - `tab_id: string`
555
556 The caller-assigned identifier for this tab, unique within the inventory.
557
558 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
559
560 - `title: string`
561
562 The title of the page the tab is showing. May be empty.
563
564 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
565
566 - `url: string`
567
568 The URL of the page the tab is showing. May be empty.
569
570 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
571
572 - `active: optional boolean`
573
574 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
575
576 - `cache_control: optional CacheControlEphemeral or null`
577
578 Create a cache control breakpoint at this content block.
579
580 - `state_changes: optional array of BrowserStateChange or null`
581
582 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
583
584 minItems: 1, maxItems: 200
585
586 - `BrowserStateChangeTabOpened object`
587
588 A tab this call's execution opened that remains open at its end —
589 the creation delta of the `tabs` inventory, not an event log.
590
591 Carries only the `tab_id`; the tab's `title` and `url` live on its
592 `tabs` entry, which must include the same `tab_id`. A tab opened
593 during a failed call gets no deferred `tab_opened`; it simply appears
594 in the next result's `tabs` inventory.
595
596 - `type: "tab_opened"`
597
598 - `tab_id: string`
599
600 The `tab_id` of the opened tab, present in `tabs`.
601
602 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
603
604 - `BrowserStateChangeDownloadStarted object`
605
606 A file download that started during this call.
607
608 - `type: "download_started"`
609
610 - `download_id: string`
611
612 The caller-assigned identifier for this download, stable across the state changes reporting it.
613
614 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
615
616 - `url: string`
617
618 The final post-redirect URL the download was served from.
619
620 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
621
622 - `BrowserStateChangeDownloadCompleted object`
623
624 A file download that finished during this call, reported with the
625 same `download_id` as its `download_started` — or without a prior
626 `download_started`, when the download finished during the call that
627 started it (at most one state change per `download_id` per result).
628
629 - `type: "download_completed"`
630
631 - `download_id: string`
632
633 The caller-assigned identifier for this download, stable across the state changes reporting it.
634
635 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
636
637 - `url: string`
638
639 The final post-redirect URL the download was served from.
640
641 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
642
643 - `path: optional string or null`
644
645 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.
646
647 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
648
649 - `size_bytes: optional number or null`
650
651 The completed download's size.
652
653 minimum: 0
654
655 - `BrowserStateChangeDownloadFailed object`
656
657 A file download that failed — or was cancelled — during this call.
658
659 - `type: "download_failed"`
660
661 - `download_id: string`
662
663 The caller-assigned identifier for this download, stable across the state changes reporting it.
664
665 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
666
667 - `url: string`
668
669 The final post-redirect URL the download was served from.
670
671 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
672
673 - `error: optional string or null`
674
675 The failure or cancellation detail, when known.
676
677 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
678
679 - `is_error: optional boolean`
680
681 - `toolset_name: optional string or null`
682
683 For a toolset member tool_result, the toolset family of the paired tool_use.
684
685 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
686
687 - `ServerToolUseBlockParam object`
688
689 - `type: "server_tool_use"`
690
691 - `id: string`
692
693 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
694
695 - `input: map[unknown]`
696
697 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
698
699 - `"web_search"`
700
701 - `"web_fetch"`
702
703 - `"code_execution"`
704
705 - `"bash_code_execution"`
706
707 - `"text_editor_code_execution"`
708
709 - `"tool_search_tool_regex"`
710
711 - `"tool_search_tool_bm25"`
712
713 - `cache_control: optional CacheControlEphemeral or null`
714
715 Create a cache control breakpoint at this content block.
716
717 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
718
719 - `DirectCaller object`
720
721 Tool invocation directly from the model.
722
723 - `ServerToolCaller object`
724
725 Tool invocation generated by a server-side tool.
726
727 - `ServerToolCaller20260120 object`
728
729 - `WebSearchToolResultBlockParam object`
730
731 - `type: "web_search_tool_result"`
732
733 - `content: WebSearchToolResultBlockParamContent`
734
735 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
736
737 - `type: "web_search_result"`
738
739 - `encrypted_content: string`
740
741 - `title: string`
742
743 - `url: string`
744
745 - `page_age: optional string or null`
746
747 - `WebSearchToolRequestError object`
748
749 - `type: "web_search_tool_result_error"`
750
751 - `error_code: WebSearchToolResultErrorCode`
752
753 - `"invalid_tool_input"`
754
755 - `"unavailable"`
756
757 - `"max_uses_exceeded"`
758
759 - `"too_many_requests"`
760
761 - `"query_too_long"`
762
763 - `"request_too_large"`
764
765 - `tool_use_id: string`
766
767 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
768
769 - `cache_control: optional CacheControlEphemeral or null`
770
771 Create a cache control breakpoint at this content block.
772
773 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
774
775 - `DirectCaller object`
776
777 Tool invocation directly from the model.
778
779 - `ServerToolCaller object`
780
781 Tool invocation generated by a server-side tool.
782
783 - `ServerToolCaller20260120 object`
784
785 - `WebFetchToolResultBlockParam object`
786
787 - `type: "web_fetch_tool_result"`
788
789 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
790
791 - `WebFetchToolResultErrorBlockParam object`
792
793 - `type: "web_fetch_tool_result_error"`
794
795 - `error_code: WebFetchToolResultErrorCode`
796
797 - `"invalid_tool_input"`
798
799 - `"url_too_long"`
800
801 - `"url_not_allowed"`
802
803 - `"url_not_in_prior_context"`
804
805 - `"url_not_accessible"`
806
807 - `"unsupported_content_type"`
808
809 - `"too_many_requests"`
810
811 - `"max_uses_exceeded"`
812
813 - `"unavailable"`
814
815 - `"content_too_large"`
816
817 - `WebFetchBlockParam object`
818
819 - `type: "web_fetch_result"`
820
821 - `content: DocumentBlockParam`
822
823 - `url: string`
824
825 Fetched content URL
826
827 - `retrieved_at: optional string or null`
828
829 ISO 8601 timestamp when the content was retrieved
830
831 - `tool_use_id: string`
832
833 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
834
835 - `cache_control: optional CacheControlEphemeral or null`
836
837 Create a cache control breakpoint at this content block.
838
839 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
840
841 - `DirectCaller object`
842
843 Tool invocation directly from the model.
844
845 - `ServerToolCaller object`
846
847 Tool invocation generated by a server-side tool.
848
849 - `ServerToolCaller20260120 object`
850
851 - `CodeExecutionToolResultBlockParam object`
852
853 - `type: "code_execution_tool_result"`
854
855 - `content: CodeExecutionToolResultBlockParamContent`
856
857 - `CodeExecutionToolResultErrorParam object`
858
859 - `type: "code_execution_tool_result_error"`
860
861 - `error_code: CodeExecutionToolResultErrorCode`
862
863 - `"invalid_tool_input"`
864
865 - `"unavailable"`
866
867 - `"too_many_requests"`
868
869 - `"execution_time_exceeded"`
870
871 - `CodeExecutionResultBlockParam object`
872
873 - `type: "code_execution_result"`
874
875 - `content: array of CodeExecutionOutputBlockParam`
876
877 - `type: "code_execution_output"`
878
879 - `file_id: string`
880
881 - `return_code: number`
882
883 - `stderr: string`
884
885 - `stdout: string`
886
887 - `EncryptedCodeExecutionResultBlockParam object`
888
889 Code execution result with encrypted stdout for PFC + web_search results.
890
891 - `type: "encrypted_code_execution_result"`
892
893 - `content: array of CodeExecutionOutputBlockParam`
894
895 - `type: "code_execution_output"`
896
897 - `file_id: string`
898
899 - `encrypted_stdout: string`
900
901 - `return_code: number`
902
903 - `stderr: string`
904
905 - `tool_use_id: string`
906
907 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
908
909 - `cache_control: optional CacheControlEphemeral or null`
910
911 Create a cache control breakpoint at this content block.
912
913 - `BashCodeExecutionToolResultBlockParam object`
914
915 - `type: "bash_code_execution_tool_result"`
916
917 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
918
919 - `BashCodeExecutionToolResultErrorParam object`
920
921 - `type: "bash_code_execution_tool_result_error"`
922
923 - `error_code: BashCodeExecutionToolResultErrorCode`
924
925 - `"invalid_tool_input"`
926
927 - `"unavailable"`
928
929 - `"too_many_requests"`
930
931 - `"execution_time_exceeded"`
932
933 - `"output_file_too_large"`
934
935 - `BashCodeExecutionResultBlockParam object`
936
937 - `type: "bash_code_execution_result"`
938
939 - `content: array of BashCodeExecutionOutputBlockParam`
940
941 - `type: "bash_code_execution_output"`
942
943 - `file_id: string`
944
945 - `return_code: number`
946
947 - `stderr: string`
948
949 - `stdout: string`
950
951 - `tool_use_id: string`
952
953 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
954
955 - `cache_control: optional CacheControlEphemeral or null`
956
957 Create a cache control breakpoint at this content block.
958
959 - `TextEditorCodeExecutionToolResultBlockParam object`
960
961 - `type: "text_editor_code_execution_tool_result"`
962
963 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
964
965 - `TextEditorCodeExecutionToolResultErrorParam object`
966
967 - `type: "text_editor_code_execution_tool_result_error"`
968
969 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
970
971 - `"invalid_tool_input"`
972
973 - `"unavailable"`
974
975 - `"too_many_requests"`
976
977 - `"execution_time_exceeded"`
978
979 - `"file_not_found"`
980
981 - `error_message: optional string or null`
982
983 - `TextEditorCodeExecutionViewResultBlockParam object`
984
985 - `type: "text_editor_code_execution_view_result"`
986
987 - `content: string`
988
989 - `file_type: "text" or "image" or "pdf"`
990
991 - `"text"`
992
993 - `"image"`
994
995 - `"pdf"`
996
997 - `num_lines: optional number or null`
998
999 - `start_line: optional number or null`
1000
1001 - `total_lines: optional number or null`
1002
1003 - `TextEditorCodeExecutionCreateResultBlockParam object`
1004
1005 - `type: "text_editor_code_execution_create_result"`
1006
1007 - `is_file_update: boolean`
1008
1009 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1010
1011 - `type: "text_editor_code_execution_str_replace_result"`
1012
1013 - `lines: optional array of string or null`
1014
1015 - `new_lines: optional number or null`
1016
1017 - `new_start: optional number or null`
1018
1019 - `old_lines: optional number or null`
1020
1021 - `old_start: optional number or null`
1022
1023 - `tool_use_id: string`
1024
1025 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1026
1027 - `cache_control: optional CacheControlEphemeral or null`
1028
1029 Create a cache control breakpoint at this content block.
1030
1031 - `ToolSearchToolResultBlockParam object`
1032
1033 - `type: "tool_search_tool_result"`
1034
1035 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1036
1037 - `ToolSearchToolResultErrorParam object`
1038
1039 - `type: "tool_search_tool_result_error"`
1040
1041 - `error_code: ToolSearchToolResultErrorCode`
1042
1043 - `"invalid_tool_input"`
1044
1045 - `"unavailable"`
1046
1047 - `"too_many_requests"`
1048
1049 - `"execution_time_exceeded"`
1050
1051 - `error_message: optional string or null`
1052
1053 - `ToolSearchToolSearchResultBlockParam object`
1054
1055 - `type: "tool_search_tool_search_result"`
1056
1057 - `tool_references: array of ToolReferenceBlockParam`
1058
1059 - `type: "tool_reference"`
1060
1061 - `tool_name: string`
1062
1063 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1064
1065 - `cache_control: optional CacheControlEphemeral or null`
1066
1067 Create a cache control breakpoint at this content block.
1068
1069 - `tool_use_id: string`
1070
1071 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1072
1073 - `cache_control: optional CacheControlEphemeral or null`
1074
1075 Create a cache control breakpoint at this content block.
1076
1077 - `ContainerUploadBlockParam object`
1078
1079 A content block that represents a file to be uploaded to the container
1080 Files uploaded via this block will be available in the container's input directory.
1081
1082 - `type: "container_upload"`
1083
1084 - `file_id: string`
1085
1086 - `cache_control: optional CacheControlEphemeral or null`
1087
1088 Create a cache control breakpoint at this content block.
1089
1090 - `role: "user" or "assistant" or "system"`
1091
1092 - `"user"`
1093
1094 - `"assistant"`
1095
1096 - `"system"`
1120 - `role: "system"`
10971121
10981122 - `model: Model`
10991123
from line 3105
30813105
30823106 When true, guarantees schema validation on tool names and inputs
30833107
3084 - `temperature: optional number`
3085
3086 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
3087
3088 Amount of randomness injected into the response.
3089
3090 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.
3091
3092 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
3093
3094 minimum: 0, maximum: 1
3095
3096 - `top_k: optional number`
3097
3098 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
3099
3100 Only sample from the top K options for each subsequent token.
3101
3102 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
3103
3104 Recommended for advanced use cases only.
3105
3106 minimum: 0
3107
3108 - `top_p: optional number`
3109
3110 **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.
3111
3112 Use nucleus sampling.
3113
3114 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`.
3115
3116 Recommended for advanced use cases only.
3117
3118 minimum: 0, maximum: 1
3119
31203108### Returns
31213109
31223110- `MessageBatch object`
from line 3220
32323220```bash
32333221curl https://api.anthropic.com/v1/messages/batches \
32343222 -H 'Content-Type: application/json' \
3235 -H 'anthropic-version: 2023-06-01' \
3236 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
3223 -H 'anthropic-version: 2026-10-21' \
3224 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
32373225 -d '{
32383226 "requests": [
32393227 {
from line 3406
34183406
34193407```bash
34203408curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
3421 -H 'anthropic-version: 2023-06-01' \
3422 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3409 -H 'anthropic-version: 2026-10-21' \
3410 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
34233411```
34243412
34253413#### Response (200)
from line 3599
36113599
36123600```bash
36133601curl https://api.anthropic.com/v1/messages/batches \
3614 -H 'anthropic-version: 2023-06-01' \
3615 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3602 -H 'anthropic-version: 2026-10-21' \
3603 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
36163604```
36173605
36183606#### Response (200)
from line 3778
37903778```bash
37913779curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \
37923780 -X POST \
3793 -H 'anthropic-version: 2023-06-01' \
3794 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3781 -H 'anthropic-version: 2026-10-21' \
3782 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
37953783```
37963784
37973785#### Response (200)
from line 3856
38683856```bash
38693857curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
38703858 -X DELETE \
3871 -H 'anthropic-version: 2023-06-01' \
3872 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3859 -H 'anthropic-version: 2026-10-21' \
3860 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
38733861```
38743862
38753863#### Response (200)
from line 5192
52045192
52055193```bash
52065194curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/results \
5207 -H 'anthropic-version: 2023-06-01' \
5208 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5195 -H 'anthropic-version: 2026-10-21' \
5196 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
52095197```
52105198
52115199## Domain types
52125200
No line in this hunk matches that.