The whole hunk
from line 1, old and new numbered
/
lines
The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.
from line 1
1---
2title: Create a Message Batch
3url: https://platform.claude.com/docs/en/api/messages/batches/create
4---
5
16# Create a Message Batch
27
38**POST** `/v1/messages/batches`
from line 18
1318- `"anthropic-user-profile-id": optional string`
1419
1520 The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.
21
22- `"anthropic-workspace-id": optional string`
1623
1724## Body parameters
1825
from line 114
107114
108115 - `TextBlockParam object`
109116
117 - `type: "text"`
118
110119 - `text: string`
111120
112121 minLength: 1
113
114 - `type: "text"`
115122
116123 - `cache_control: optional CacheControlEphemeral or null`
117124
from line 145
138145
139146 - `CitationCharLocationParam object`
140147
148 - `type: "char_location"`
149
141150 - `cited_text: string`
142151
143152 - `document_index: number`
from line 163
154163
155164 minimum: 0
156165
157 - `type: "char_location"`
158
159166 - `CitationPageLocationParam object`
160167
168 - `type: "page_location"`
169
161170 - `cited_text: string`
162171
163172 - `document_index: number`
from line 183
174183
175184 minimum: 1
176185
177 - `type: "page_location"`
178
179186 - `CitationContentBlockLocationParam object`
180187
188 - `type: "content_block_location"`
189
181190 - `cited_text: string`
182191
183192 The full text of the cited block range, concatenated.
from line 213
204213
205214 minimum: 0
206215
207 - `type: "content_block_location"`
208
209216 - `CitationWebSearchResultLocationParam object`
210217
218 - `type: "web_search_result_location"`
219
211220 - `cited_text: string`
212221
213222 - `encrypted_index: string`
from line 225
216225
217226 maxLength: 512, minLength: 1
218227
219 - `type: "web_search_result_location"`
220
221228 - `url: string`
222229
223230 minLength: 1
224231
225232 - `CitationSearchResultLocationParam object`
226233
234 - `type: "search_result_location"`
235
227236 - `cited_text: string`
228237
229238 The full text of the cited block range, concatenated.
from line 263
254263
255264 - `title: string or null`
256265
257 - `type: "search_result_location"`
258
259266 - `ImageBlockParam object`
260267
268 - `type: "image"`
269
261270 - `source: Base64ImageSource or URLImageSource or FileImageSource`
262271
263272 - `Base64ImageSource object`
264273
274 - `type: "base64"`
275
265276 - `data: string`
266277
267278 format: byte
from line 287
276287
277288 - `"image/webp"`
278289
290 - `URLImageSource object`
291
292 - `type: "url"`
293
294 - `url: string`
295
296 - `FileImageSource object`
297
298 - `type: "file"`
299
300 - `file_id: string`
301
302 - `cache_control: optional CacheControlEphemeral or null`
303
304 Create a cache control breakpoint at this content block.
305
306 - `transformations: optional ImageTransformationsParam or null`
307
308 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.
309
310 - `oversized_image: optional "downsize" or "error"`
311
312 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.
313
314 - `"downsize"`
315
316 - `"error"`
317
318 - `DocumentBlockParam object`
319
320 - `type: "document"`
321
322 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
323
324 - `Base64PDFSource object`
325
279326 - `type: "base64"`
280327
281 - `URLImageSource object`
328 - `data: string`
329
330 format: byte
331
332 - `media_type: "application/pdf"`
333
334 - `PlainTextSource object`
335
336 - `type: "text"`
337
338 - `data: string`
339
340 - `media_type: "text/plain"`
341
342 - `ContentBlockSource object`
343
344 - `type: "content"`
345
346 - `content: string or array of ContentBlockSourceContent`
347
348 - `string`
349
350 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
351
352 - `TextBlockParam object`
353
354 - `ImageBlockParam object`
355
356 - `URLPDFSource object`
282357
283358 - `type: "url"`
284359
285360 - `url: string`
286361
287 - `FileImageSource object`
362 - `FileDocumentSource object`
363
364 - `type: "file"`
288365
289366 - `file_id: string`
290367
291 - `type: "file"`
292
293 - `type: "image"`
294
295368 - `cache_control: optional CacheControlEphemeral or null`
296369
297370 Create a cache control breakpoint at this content block.
298371
299 - `transformations: optional ImageTransformationsParam or null`
300
301 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.
302
303 - `oversized_image: optional "downsize" or "error"`
304
305 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.
306
307 - `"downsize"`
308
309 - `"error"`
310
311 - `DocumentBlockParam object`
312
313 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
314
315 - `Base64PDFSource object`
316
317 - `data: string`
318
319 format: byte
320
321 - `media_type: "application/pdf"`
322
323 - `type: "base64"`
324
325 - `PlainTextSource object`
326
327 - `data: string`
328
329 - `media_type: "text/plain"`
330
331 - `type: "text"`
332
333 - `ContentBlockSource object`
334
335 - `content: string or array of ContentBlockSourceContent`
336
337 - `string`
338
339 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
340
341 - `TextBlockParam object`
342
343 - `ImageBlockParam object`
344
345 - `type: "content"`
346
347 - `URLPDFSource object`
348
349 - `type: "url"`
350
351 - `url: string`
352
353 - `FileDocumentSource object`
354
355 - `file_id: string`
356
357 - `type: "file"`
358
359 - `type: "document"`
372 - `citations: optional CitationsConfigParam or null`
373
374 - `enabled: optional boolean`
375
376 - `context: optional string or null`
377
378 minLength: 1
379
380 - `title: optional string or null`
381
382 maxLength: 500, minLength: 1
383
384 - `SearchResultBlockParam object`
385
386 - `type: "search_result"`
387
388 - `content: array of TextBlockParam`
389
390 - `type: "text"`
391
392 - `text: string`
393
394 minLength: 1
395
396 - `cache_control: optional CacheControlEphemeral or null`
397
398 Create a cache control breakpoint at this content block.
399
400 - `citations: optional array of TextCitationParam or null`
401
402 - `source: string`
403
404 - `title: string`
360405
361406 - `cache_control: optional CacheControlEphemeral or null`
362407
363408 Create a cache control breakpoint at this content block.
364409
365 - `citations: optional CitationsConfigParam or null`
366
367 - `enabled: optional boolean`
368
369 - `context: optional string or null`
370
371 minLength: 1
372
373 - `title: optional string or null`
374
375 maxLength: 500, minLength: 1
376
377 - `SearchResultBlockParam object`
378
379 - `content: array of TextBlockParam`
380
381 - `text: string`
382
383 minLength: 1
384
385 - `type: "text"`
386
387 - `cache_control: optional CacheControlEphemeral or null`
388
389 Create a cache control breakpoint at this content block.
390
391 - `citations: optional array of TextCitationParam or null`
392
393 - `source: string`
394
395 - `title: string`
396
397 - `type: "search_result"`
410 - `citations: optional CitationsConfigParam`
411
412 - `ThinkingBlockParam object`
413
414 - `type: "thinking"`
415
416 - `signature: string`
417
418 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.
419
420 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
421
422 - `thinking: string`
423
424 The `thinking` text of this block as returned by the API.
425
426 - `RedactedThinkingBlockParam object`
427
428 - `type: "redacted_thinking"`
429
430 - `data: string`
431
432 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.
433
434 - `ToolUseBlockParam object`
435
436 - `type: "tool_use"`
437
438 - `id: string`
439
440 pattern: ^[a-zA-Z0-9_-]+$
441
442 - `input: map[unknown]`
443
444 - `name: string`
445
446 maxLength: 200, minLength: 1
398447
399448 - `cache_control: optional CacheControlEphemeral or null`
400449
401450 Create a cache control breakpoint at this content block.
402451
403 - `citations: optional CitationsConfigParam`
404
405 - `ThinkingBlockParam object`
406
407 - `signature: string`
408
409 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.
410
411 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
412
413 - `thinking: string`
414
415 The `thinking` text of this block as returned by the API.
416
417 - `type: "thinking"`
418
419 - `RedactedThinkingBlockParam object`
420
421 - `data: string`
422
423 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.
424
425 - `type: "redacted_thinking"`
426
427 - `ToolUseBlockParam object`
428
429 - `id: string`
452 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
453
454 Tool invocation directly from the model.
455
456 - `DirectCaller object`
457
458 Tool invocation directly from the model.
459
460 - `type: "direct"`
461
462 - `ServerToolCaller object`
463
464 Tool invocation generated by a server-side tool.
465
466 - `type: "code_execution_20250825"`
467
468 - `tool_id: string`
469
470 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
471
472 - `ServerToolCaller20260120 object`
473
474 - `type: "code_execution_20260120"`
475
476 - `tool_id: string`
477
478 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
479
480 - `toolset_name: optional string or null`
481
482 For a toolset member tool_use, the toolset family this member belongs to.
483
484 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
485
486 - `ToolResultBlockParam object`
487
488 - `type: "tool_result"`
489
490 - `tool_use_id: string`
430491
431492 pattern: ^[a-zA-Z0-9_-]+$
432493
433 - `input: map[unknown]`
434
435 - `name: string`
436
437 maxLength: 200, minLength: 1
438
439 - `type: "tool_use"`
440
441494 - `cache_control: optional CacheControlEphemeral or null`
442495
443496 Create a cache control breakpoint at this content block.
444497
445 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
446
447 Tool invocation directly from the model.
448
449 - `DirectCaller object`
450
451 Tool invocation directly from the model.
452
453 - `type: "direct"`
454
455 - `ServerToolCaller object`
456
457 Tool invocation generated by a server-side tool.
458
459 - `tool_id: string`
460
461 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
462
463 - `type: "code_execution_20250825"`
464
465 - `ServerToolCaller20260120 object`
466
467 - `tool_id: string`
468
469 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
470
471 - `type: "code_execution_20260120"`
472
473 - `toolset_name: optional string or null`
474
475 For a toolset member tool_use, the toolset family this member belongs to.
476
477 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
478
479 - `ToolResultBlockParam object`
480
481 - `tool_use_id: string`
482
483 pattern: ^[a-zA-Z0-9_-]+$
484
485 - `type: "tool_result"`
486
487 - `cache_control: optional CacheControlEphemeral or null`
488
489 Create a cache control breakpoint at this content block.
490
491498 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
492499
493500 - `string`
from line 513
506513
507514 Tool reference block that can be included in tool_result content.
508515
516 - `type: "tool_reference"`
517
509518 - `tool_name: string`
510519
511520 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
512
513 - `type: "tool_reference"`
514521
515522 - `cache_control: optional CacheControlEphemeral or null`
516523
from line 533
526533 browser toolset member `tool_use`. The server renders the
527534 model-visible text from it; the model never sees the raw fields.
528535
536 - `type: "browser_state"`
537
529538 - `tabs: array of BrowserStateTabEntry`
530539
531540 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`.
from line 562
553562 - `active: optional boolean`
554563
555564 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
556
557 - `type: "browser_state"`
558565
559566 - `cache_control: optional CacheControlEphemeral or null`
560567
from line 583
576583 during a failed call gets no deferred `tab_opened`; it simply appears
577584 in the next result's `tabs` inventory.
578585
586 - `type: "tab_opened"`
587
579588 - `tab_id: string`
580589
581590 The `tab_id` of the opened tab, present in `tabs`.
582591
583592 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
584593
585 - `type: "tab_opened"`
586
587594 - `BrowserStateChangeDownloadStarted object`
588595
589596 A file download that started during this call.
590597
598 - `type: "download_started"`
599
591600 - `download_id: string`
592601
593602 The caller-assigned identifier for this download, stable across the state changes reporting it.
594603
595604 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
596
597 - `type: "download_started"`
598605
599606 - `url: string`
600607
from line 616
609616 `download_started`, when the download finished during the call that
610617 started it (at most one state change per `download_id` per result).
611618
619 - `type: "download_completed"`
620
612621 - `download_id: string`
613622
614623 The caller-assigned identifier for this download, stable across the state changes reporting it.
615624
616625 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
617626
618 - `type: "download_completed"`
619
620627 - `url: string`
621628
622629 The final post-redirect URL the download was served from.
from line 646
639646
640647 A file download that failed — or was cancelled — during this call.
641648
649 - `type: "download_failed"`
650
642651 - `download_id: string`
643652
644653 The caller-assigned identifier for this download, stable across the state changes reporting it.
645654
646655 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
647656
648 - `type: "download_failed"`
649
650657 - `url: string`
651658
652659 The final post-redirect URL the download was served from.
from line 676
669676
670677 - `ServerToolUseBlockParam object`
671678
679 - `type: "server_tool_use"`
680
672681 - `id: string`
673682
674683 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 700
691700
692701 - `"tool_search_tool_bm25"`
693702
694 - `type: "server_tool_use"`
695
696703 - `cache_control: optional CacheControlEphemeral or null`
697704
698705 Create a cache control breakpoint at this content block.
from line 720
713720
714721 - `WebSearchToolResultBlockParam object`
715722
723 - `type: "web_search_tool_result"`
724
716725 - `content: WebSearchToolResultBlockParamContent`
717726
718727 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
719728
729 - `type: "web_search_result"`
730
720731 - `encrypted_content: string`
721732
722733 - `title: string`
723734
724 - `type: "web_search_result"`
725
726735 - `url: string`
727736
728737 - `page_age: optional string or null`
729738
730739 - `WebSearchToolRequestError object`
731740
741 - `type: "web_search_tool_result_error"`
742
732743 - `error_code: WebSearchToolResultErrorCode`
733744
734745 - `"invalid_tool_input"`
from line 754
743754
744755 - `"request_too_large"`
745756
746 - `type: "web_search_tool_result_error"`
747
748757 - `tool_use_id: string`
749758
750759 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
751760
752 - `type: "web_search_tool_result"`
753
754761 - `cache_control: optional CacheControlEphemeral or null`
755762
756763 Create a cache control breakpoint at this content block.
from line 778
771778
772779 - `WebFetchToolResultBlockParam object`
773780
781 - `type: "web_fetch_tool_result"`
782
774783 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
775784
776785 - `WebFetchToolResultErrorBlockParam object`
777786
787 - `type: "web_fetch_tool_result_error"`
788
778789 - `error_code: WebFetchToolResultErrorCode`
779790
780791 - `"invalid_tool_input"`
from line 806
795806
796807 - `"unavailable"`
797808
798 - `type: "web_fetch_tool_result_error"`
809 - `"content_too_large"`
799810
800811 - `WebFetchBlockParam object`
801812
813 - `type: "web_fetch_result"`
814
802815 - `content: DocumentBlockParam`
803816
804 - `type: "web_fetch_result"`
805
806817 - `url: string`
807818
808819 Fetched content URL
from line 826
815826
816827 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
817828
818 - `type: "web_fetch_tool_result"`
819
820829 - `cache_control: optional CacheControlEphemeral or null`
821830
822831 Create a cache control breakpoint at this content block.
from line 846
837846
838847 - `CodeExecutionToolResultBlockParam object`
839848
849 - `type: "code_execution_tool_result"`
850
840851 - `content: CodeExecutionToolResultBlockParamContent`
841852
842853 Code execution result with encrypted stdout for PFC + web_search results.
843854
844855 - `CodeExecutionToolResultErrorParam object`
845856
857 - `type: "code_execution_tool_result_error"`
858
846859 - `error_code: CodeExecutionToolResultErrorCode`
847860
848861 - `"invalid_tool_input"`
from line 866
853866
854867 - `"execution_time_exceeded"`
855868
856 - `type: "code_execution_tool_result_error"`
857
858869 - `CodeExecutionResultBlockParam object`
859870
871 - `type: "code_execution_result"`
872
860873 - `content: array of CodeExecutionOutputBlockParam`
861874
875 - `type: "code_execution_output"`
876
862877 - `file_id: string`
863878
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
864893 - `type: "code_execution_output"`
865894
895 - `file_id: string`
896
897 - `encrypted_stdout: string`
898
866899 - `return_code: number`
867900
868901 - `stderr: string`
869902
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
870947 - `stdout: string`
871948
872 - `type: "code_execution_result"`
873
874 - `EncryptedCodeExecutionResultBlockParam object`
875
876 Code execution result with encrypted stdout for PFC + web_search results.
877
878 - `content: array of CodeExecutionOutputBlockParam`
879
880 - `file_id: string`
881
882 - `type: "code_execution_output"`
883
884 - `encrypted_stdout: string`
885
886 - `return_code: number`
887
888 - `stderr: string`
889
890 - `type: "encrypted_code_execution_result"`
891
892949 - `tool_use_id: string`
893950
894951 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
895952
896 - `type: "code_execution_tool_result"`
897
898953 - `cache_control: optional CacheControlEphemeral or null`
899954
900955 Create a cache control breakpoint at this content block.
901956
902 - `BashCodeExecutionToolResultBlockParam object`
903
904 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
905
906 - `BashCodeExecutionToolResultErrorParam object`
907
908 - `error_code: BashCodeExecutionToolResultErrorCode`
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`
909968
910969 - `"invalid_tool_input"`
911970
from line 974
915974
916975 - `"execution_time_exceeded"`
917976
918 - `"output_file_too_large"`
919
920 - `type: "bash_code_execution_tool_result_error"`
921
922 - `BashCodeExecutionResultBlockParam object`
923
924 - `content: array of BashCodeExecutionOutputBlockParam`
925
926 - `file_id: string`
927
928 - `type: "bash_code_execution_output"`
929
930 - `return_code: number`
931
932 - `stderr: string`
933
934 - `stdout: string`
935
936 - `type: "bash_code_execution_result"`
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`
9371020
9381021 - `tool_use_id: string`
9391022
9401023 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
9411024
942 - `type: "bash_code_execution_tool_result"`
943
9441025 - `cache_control: optional CacheControlEphemeral or null`
9451026
9461027 Create a cache control breakpoint at this content block.
9471028
948 - `TextEditorCodeExecutionToolResultBlockParam object`
949
950 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
951
952 - `TextEditorCodeExecutionToolResultErrorParam object`
953
954 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
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`
9551040
9561041 - `"invalid_tool_input"`
9571042
from line 1046
9611046
9621047 - `"execution_time_exceeded"`
9631048
964 - `"file_not_found"`
965
966 - `type: "text_editor_code_execution_tool_result_error"`
967
9681049 - `error_message: optional string or null`
9691050
970 - `TextEditorCodeExecutionViewResultBlockParam object`
971
972 - `content: string`
973
974 - `file_type: "text" or "image" or "pdf"`
975
976 - `"text"`
977
978 - `"image"`
979
980 - `"pdf"`
981
982 - `type: "text_editor_code_execution_view_result"`
983
984 - `num_lines: optional number or null`
985
986 - `start_line: optional number or null`
987
988 - `total_lines: optional number or null`
989
990 - `TextEditorCodeExecutionCreateResultBlockParam object`
991
992 - `is_file_update: boolean`
993
994 - `type: "text_editor_code_execution_create_result"`
995
996 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
997
998 - `type: "text_editor_code_execution_str_replace_result"`
999
1000 - `lines: optional array of string or null`
1001
1002 - `new_lines: optional number or null`
1003
1004 - `new_start: optional number or null`
1005
1006 - `old_lines: optional number or null`
1007
1008 - `old_start: optional number or null`
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 maxLength: 256, minLength: 1, 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.
10091066
10101067 - `tool_use_id: string`
10111068
10121069 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1013
1014 - `type: "text_editor_code_execution_tool_result"`
1015
1016 - `cache_control: optional CacheControlEphemeral or null`
1017
1018 Create a cache control breakpoint at this content block.
1019
1020 - `ToolSearchToolResultBlockParam object`
1021
1022 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1023
1024 - `ToolSearchToolResultErrorParam object`
1025
1026 - `error_code: ToolSearchToolResultErrorCode`
1027
1028 - `"invalid_tool_input"`
1029
1030 - `"unavailable"`
1031
1032 - `"too_many_requests"`
1033
1034 - `"execution_time_exceeded"`
1035
1036 - `type: "tool_search_tool_result_error"`
1037
1038 - `error_message: optional string or null`
1039
1040 - `ToolSearchToolSearchResultBlockParam object`
1041
1042 - `tool_references: array of ToolReferenceBlockParam`
1043
1044 - `tool_name: string`
1045
1046 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1047
1048 - `type: "tool_reference"`
1049
1050 - `cache_control: optional CacheControlEphemeral or null`
1051
1052 Create a cache control breakpoint at this content block.
1053
1054 - `type: "tool_search_tool_search_result"`
1055
1056 - `tool_use_id: string`
1057
1058 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1059
1060 - `type: "tool_search_tool_result"`
10611070
10621071 - `cache_control: optional CacheControlEphemeral or null`
10631072
from line 1077
10681077 A content block that represents a file to be uploaded to the container
10691078 Files uploaded via this block will be available in the container's input directory.
10701079
1080 - `type: "container_upload"`
1081
10711082 - `file_id: string`
10721083
1073 - `type: "container_upload"`
1074
10751084 - `cache_control: optional CacheControlEphemeral or null`
10761085
10771086 Create a cache control breakpoint at this content block.
from line 1197
11881197
11891198 maxItems: 20
11901199
1200 - `type: "anthropic" or "custom"`
1201
1202 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1203
1204 - `"anthropic"`
1205
1206 - `"custom"`
1207
11911208 - `skill_id: string`
11921209
11931210 Skill ID
11941211
11951212 maxLength: 64, minLength: 1
11961213
1197 - `type: "anthropic" or "custom"`
1198
1199 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1200
1201 - `"anthropic"`
1202
1203 - `"custom"`
1204
12051214 - `version: optional string`
12061215
12071216 Skill version or 'latest' for most recent version
from line 1257
12481257
12491258 A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
12501259
1260 - `type: "json_schema"`
1261
12511262 - `schema: map[unknown]`
12521263
12531264 The JSON schema of the format
12541265
1255 - `type: "json_schema"`
1256
12571266 - `service_tier: optional "auto" or "standard_only"`
12581267
12591268 Determines whether to use priority capacity (if available) or standard capacity for this request.
from line 1297
12881297
12891298 - `array of TextBlockParam`
12901299
1300 - `type: "text"`
1301
12911302 - `text: string`
12921303
12931304 minLength: 1
12941305
1295 - `type: "text"`
1296
12971306 - `cache_control: optional CacheControlEphemeral or null`
12981307
12991308 Create a cache control breakpoint at this content block.
from line 1319
13101319
13111320 - `ThinkingConfigEnabled object`
13121321
1322 - `type: "enabled"`
1323
13131324 - `budget_tokens: number`
13141325
13151326 Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
from line 1331
13201331
13211332 minimum: 1024
13221333
1323 - `type: "enabled"`
1324
13251334 - `display: optional "summarized" or "omitted" or null`
13261335
13271336 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1387
13781387
13791388 The model will use the specified tool with `tool_choice.name`.
13801389
1390 - `type: "tool"`
1391
13811392 - `name: string`
13821393
13831394 The name of the tool to use.
1384
1385 - `type: "tool"`
13861395
13871396 - `disable_parallel_tool_use: optional boolean`
13881397
from line 1471
14621471
14631472 - `Tool object`
14641473
1474 - `type: optional "custom" or null`
1475
14651476 - `input_schema: object`
14661477
14671478 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
from line 1527
15161527
15171528 When true, guarantees schema validation on tool names and inputs
15181529
1519 - `type: optional "custom" or null`
1520
15211530 - `ToolBash20250124 object`
15221531
1532 - `type: "bash_20250124"`
1533
15231534 - `name: "bash"`
15241535
15251536 Name of the tool.
15261537
15271538 This is how the tool will be called by the model and in `tool_use` blocks.
15281539
1529 - `type: "bash_20250124"`
1530
15311540 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15321541
15331542 - `"direct"`
from line 1563
15541563
15551564 - `CodeExecutionTool20250522 object`
15561565
1566 - `type: "code_execution_20250522"`
1567
15571568 - `name: "code_execution"`
15581569
15591570 Name of the tool.
15601571
15611572 This is how the tool will be called by the model and in `tool_use` blocks.
15621573
1563 - `type: "code_execution_20250522"`
1564
15651574 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15661575
15671576 - `"direct"`
from line 1595
15861595
15871596 - `CodeExecutionTool20250825 object`
15881597
1598 - `type: "code_execution_20250825"`
1599
15891600 - `name: "code_execution"`
15901601
15911602 Name of the tool.
15921603
15931604 This is how the tool will be called by the model and in `tool_use` blocks.
15941605
1595 - `type: "code_execution_20250825"`
1596
15971606 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15981607
15991608 - `"direct"`
from line 1629
16201629
16211630 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
16221631
1632 - `type: "code_execution_20260120"`
1633
16231634 - `name: "code_execution"`
16241635
16251636 Name of the tool.
16261637
16271638 This is how the tool will be called by the model and in `tool_use` blocks.
16281639
1629 - `type: "code_execution_20260120"`
1630
16311640 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16321641
16331642 - `"direct"`
from line 1663
16541663
16551664 Code execution tool with REPL state persistence.
16561665
1666 - `type: "code_execution_20260521"`
1667
16571668 - `name: "code_execution"`
16581669
16591670 Name of the tool.
16601671
16611672 This is how the tool will be called by the model and in `tool_use` blocks.
1662
1663 - `type: "code_execution_20260521"`
16641673
16651674 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16661675
from line 1715
17061715 absent. Unknown keys are rejected: the field set is this toolset
17071716 version's complete member set.
17081717
1718 - `type: optional BrowserTypeConfig or null`
1719
1720 `type`'s config overrides.
1721
1722 - `defer_loading: optional boolean or null`
1723
1724 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
1725
1726 - `enabled: optional boolean or null`
1727
1728 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
1729
17091730 - `close_tab: optional BrowserCloseTabConfig or null`
17101731
17111732 `close_tab`'s config overrides.
from line 2063
20422063
20432064 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
20442065
2045 - `type: optional BrowserTypeConfig or null`
2046
2047 `type`'s config overrides.
2048
2049 - `defer_loading: optional boolean or null`
2050
2051 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2052
2053 - `enabled: optional boolean or null`
2054
2055 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
2056
20572066 - `wait: optional BrowserWaitConfig or null`
20582067
20592068 `wait`'s config overrides.
from line 2089
20802089
20812090 - `MemoryTool20250818 object`
20822091
2092 - `type: "memory_20250818"`
2093
20832094 - `name: "memory"`
20842095
20852096 Name of the tool.
20862097
20872098 This is how the tool will be called by the model and in `tool_use` blocks.
2088
2089 - `type: "memory_20250818"`
20902099
20912100 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
20922101
from line 2147
21382147 absent. Unknown keys are rejected: the field set is this toolset
21392148 version's complete member set.
21402149
2150 - `type: optional ComputerTypeConfig or null`
2151
2152 `type`'s config overrides.
2153
2154 - `defer_loading: optional boolean or null`
2155
2156 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2157
2158 - `enabled: optional boolean or null`
2159
2160 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
2161
21412162 - `cursor_position: optional ComputerCursorPositionConfig or null`
21422163
21432164 `cursor_position`'s config overrides.
from line 2327
23062327
23072328 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
23082329
2309 - `type: optional ComputerTypeConfig or null`
2310
2311 `type`'s config overrides.
2312
2313 - `defer_loading: optional boolean or null`
2314
2315 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2316
2317 - `enabled: optional boolean or null`
2318
2319 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
2320
23212330 - `wait: optional ComputerWaitConfig or null`
23222331
23232332 `wait`'s config overrides.
from line 2353
23442353
23452354 - `ToolTextEditor20250124 object`
23462355
2356 - `type: "text_editor_20250124"`
2357
23472358 - `name: "str_replace_editor"`
23482359
23492360 Name of the tool.
23502361
23512362 This is how the tool will be called by the model and in `tool_use` blocks.
23522363
2353 - `type: "text_editor_20250124"`
2354
23552364 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23562365
23572366 - `"direct"`
from line 2387
23782387
23792388 - `ToolTextEditor20250429 object`
23802389
2390 - `type: "text_editor_20250429"`
2391
23812392 - `name: "str_replace_based_edit_tool"`
23822393
23832394 Name of the tool.
23842395
23852396 This is how the tool will be called by the model and in `tool_use` blocks.
23862397
2387 - `type: "text_editor_20250429"`
2388
23892398 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23902399
23912400 - `"direct"`
from line 2421
24122421
24132422 - `ToolTextEditor20250728 object`
24142423
2424 - `type: "text_editor_20250728"`
2425
24152426 - `name: "str_replace_based_edit_tool"`
24162427
24172428 Name of the tool.
24182429
24192430 This is how the tool will be called by the model and in `tool_use` blocks.
24202431
2421 - `type: "text_editor_20250728"`
2422
24232432 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24242433
24252434 - `"direct"`
from line 2461
24522461
24532462 - `WebSearchTool20250305 object`
24542463
2464 - `type: "web_search_20250305"`
2465
24552466 - `name: "web_search"`
24562467
24572468 Name of the tool.
24582469
24592470 This is how the tool will be called by the model and in `tool_use` blocks.
24602471
2461 - `type: "web_search_20250305"`
2462
24632472 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24642473
24652474 - `"direct"`
from line 2537
25282537
25292538 - `WebFetchTool20250910 object`
25302539
2540 - `type: "web_fetch_20250910"`
2541
25312542 - `name: "web_fetch"`
25322543
25332544 Name of the tool.
25342545
25352546 This is how the tool will be called by the model and in `tool_use` blocks.
25362547
2537 - `type: "web_fetch_20250910"`
2538
25392548 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25402549
25412550 - `"direct"`
from line 2593
25842593
25852594 - `WebSearchTool20260209 object`
25862595
2596 - `type: "web_search_20260209"`
2597
25872598 - `name: "web_search"`
25882599
25892600 Name of the tool.
25902601
25912602 This is how the tool will be called by the model and in `tool_use` blocks.
25922603
2593 - `type: "web_search_20260209"`
2594
25952604 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25962605
25972606 - `"direct"`
from line 2643
26342643
26352644 - `WebFetchTool20260209 object`
26362645
2646 - `type: "web_fetch_20260209"`
2647
26372648 - `name: "web_fetch"`
26382649
26392650 Name of the tool.
26402651
26412652 This is how the tool will be called by the model and in `tool_use` blocks.
26422653
2643 - `type: "web_fetch_20260209"`
2644
26452654 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26462655
26472656 - `"direct"`
from line 2701
26922701
26932702 Web fetch tool with use_cache parameter for bypassing cached content.
26942703
2704 - `type: "web_fetch_20260309"`
2705
26952706 - `name: "web_fetch"`
26962707
26972708 Name of the tool.
26982709
26992710 This is how the tool will be called by the model and in `tool_use` blocks.
27002711
2701 - `type: "web_fetch_20260309"`
2702
27032712 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27042713
27052714 - `"direct"`
from line 2761
27522761
27532762 - `WebSearchTool20260318 object`
27542763
2764 - `type: "web_search_20260318"`
2765
27552766 - `name: "web_search"`
27562767
27572768 Name of the tool.
27582769
27592770 This is how the tool will be called by the model and in `tool_use` blocks.
27602771
2761 - `type: "web_search_20260318"`
2762
27632772 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27642773
27652774 - `"direct"`
from line 2819
28102819
28112820 - `WebFetchTool20260318 object`
28122821
2822 - `type: "web_fetch_20260318"`
2823
28132824 - `name: "web_fetch"`
28142825
28152826 Name of the tool.
28162827
28172828 This is how the tool will be called by the model and in `tool_use` blocks.
28182829
2819 - `type: "web_fetch_20260318"`
2820
28212830 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28222831
28232832 - `"direct"`
from line 2887
28782887
28792888 - `ToolSearchToolBm25_20251119 object`
28802889
2890 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2891
2892 - `"tool_search_tool_bm25_20251119"`
2893
2894 - `"tool_search_tool_bm25"`
2895
28812896 - `name: "tool_search_tool_bm25"`
28822897
28832898 Name of the tool.
28842899
28852900 This is how the tool will be called by the model and in `tool_use` blocks.
28862901
2887 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2888
2889 - `"tool_search_tool_bm25_20251119"`
2890
2891 - `"tool_search_tool_bm25"`
2892
28932902 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28942903
28952904 - `"direct"`
from line 2923
29142923
29152924 - `ToolSearchToolRegex20251119 object`
29162925
2926 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2927
2928 - `"tool_search_tool_regex_20251119"`
2929
2930 - `"tool_search_tool_regex"`
2931
29172932 - `name: "tool_search_tool_regex"`
29182933
29192934 Name of the tool.
29202935
29212936 This is how the tool will be called by the model and in `tool_use` blocks.
29222937
2923 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2924
2925 - `"tool_search_tool_regex_20251119"`
2926
2927 - `"tool_search_tool_regex"`
2928
29292938 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29302939
29312940 - `"direct"`
from line 2997
29882997
29892998- `MessageBatch object`
29902999
3000 - `type: "message_batch"`
3001
3002 Object type.
3003
3004 For Message Batches, this is always `"message_batch"`.
3005
3006 default: message_batch
3007
29913008 - `id: string`
29923009
29933010 Unique object identifier.
from line 3102
30853102 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
30863103
30873104 Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
3088
3089 - `type: "message_batch"`
3090
3091 Object type.
3092
3093 For Message Batches, this is always `"message_batch"`.
3094
3095 default: message_batch
30963105
30973106## Example
30983107
30993108