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