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/beta/messages/batches/create
4---
5
6## Create a Message Batch
7
8**post** `/v1/messages/batches`
1# Create a Message Batch
2
3**POST** `/v1/messages/batches`
94
105Send a batch of Message creation requests.
116
from line 8
138
149Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
1510
16### Header Parameters
11## Headers
1712
1813- `"anthropic-beta": optional array of AnthropicBeta`
1914
from line 90
9590
9691 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.
9792
98### Body Parameters
99
100- `requests: array of object { custom_id, params }`
93## Body parameters
94
95- `requests: array of object`
10196
10297 List of requests for prompt completion. Each is an individual request to create a Message.
10398
99 maxItems: 100000, minItems: 1
100
104101 - `custom_id: string`
105102
106103 Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
107104
108105 Must be unique for each request within the Message Batch.
109106
110 - `params: object { max_tokens, messages, model, 22 more }`
107 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,64}$
108
109 - `params: object`
111110
112111 Messages API creation parameters for the individual request.
113112
from line 121
122121 Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.
123122
124123 Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
124
125 minimum: 0
125126
126127 - `messages: array of BetaMessageParam`
127128
from line 181
180181
181182 - `array of BetaContentBlockParam`
182183
183 - `BetaTextBlockParam object { text, type, cache_control, citations }`
184 - `BetaTextBlockParam object`
184185
185186 - `text: string`
186187
188 minLength: 1
189
187190 - `type: "text"`
188191
189 - `"text"`
190
191192 - `cache_control: optional BetaCacheControlEphemeral or null`
192193
193194 Create a cache control breakpoint at this content block.
194195
195196 - `type: "ephemeral"`
196
197 - `"ephemeral"`
198197
199198 - `ttl: optional "5m" or "1h"`
200199
from line 212
213212
214213 - `citations: optional array of BetaTextCitationParam or null`
215214
216 - `BetaCitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
215 - `BetaCitationCharLocationParam object`
217216
218217 - `cited_text: string`
219218
220219 - `document_index: number`
221220
221 minimum: 0
222
222223 - `document_title: string or null`
223224
225 maxLength: 500, minLength: 1
226
224227 - `end_char_index: number`
225228
226229 - `start_char_index: number`
227230
231 minimum: 0
232
228233 - `type: "char_location"`
229234
230 - `"char_location"`
231
232 - `BetaCitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
235 - `BetaCitationPageLocationParam object`
233236
234237 - `cited_text: string`
235238
236239 - `document_index: number`
237240
241 minimum: 0
242
238243 - `document_title: string or null`
239244
245 maxLength: 500, minLength: 1
246
240247 - `end_page_number: number`
241248
242249 - `start_page_number: number`
243250
251 minimum: 1
252
244253 - `type: "page_location"`
245254
246 - `"page_location"`
247
248 - `BetaCitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
255 - `BetaCitationContentBlockLocationParam object`
249256
250257 - `cited_text: string`
251258
from line 262
255262
256263 - `document_index: number`
257264
265 minimum: 0
266
258267 - `document_title: string or null`
259268
269 maxLength: 500, minLength: 1
270
260271 - `end_block_index: number`
261272
262273 Exclusive 0-based end index of the cited block range in the source's `content` array.
from line 278
267278
268279 0-based index of the first cited block in the source's `content` array.
269280
281 minimum: 0
282
270283 - `type: "content_block_location"`
271284
272 - `"content_block_location"`
273
274 - `BetaCitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
285 - `BetaCitationWebSearchResultLocationParam object`
275286
276287 - `cited_text: string`
277288
from line 290
279290
280291 - `title: string or null`
281292
293 maxLength: 512, minLength: 1
294
282295 - `type: "web_search_result_location"`
283296
284 - `"web_search_result_location"`
285
286297 - `url: string`
287298
288 - `BetaCitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
299 minLength: 1
300
301 - `BetaCitationSearchResultLocationParam object`
289302
290303 - `cited_text: string`
291304
from line 318
305318
306319 Counted separately from `document_index`; server-side web search results are not included in this count.
307320
321 minimum: 0
322
308323 - `source: string`
309324
310325 - `start_block_index: number`
311326
312327 0-based index of the first cited block in the source's `content` array.
313328
329 minimum: 0
330
314331 - `title: string or null`
315332
316333 - `type: "search_result_location"`
317334
318 - `"search_result_location"`
319
320 - `BetaImageBlockParam object { source, type, cache_control, transformations }`
335 - `BetaImageBlockParam object`
321336
322337 - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
323338
324 - `BetaBase64ImageSource object { data, media_type, type }`
339 - `BetaBase64ImageSource object`
325340
326341 - `data: string`
327342
343 format: byte
344
328345 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
329346
330347 - `"image/jpeg"`
from line 354
337354
338355 - `type: "base64"`
339356
340 - `"base64"`
341
342 - `BetaURLImageSource object { type, url }`
357 - `BetaURLImageSource object`
343358
344359 - `type: "url"`
345360
346 - `"url"`
347
348361 - `url: string`
349362
350 - `BetaFileImageSource object { file_id, type }`
363 - `BetaFileImageSource object`
351364
352365 - `file_id: string`
353366
354367 - `type: "file"`
355368
356 - `"file"`
357
358369 - `type: "image"`
359370
360 - `"image"`
361
362371 - `cache_control: optional BetaCacheControlEphemeral or null`
363372
364373 Create a cache control breakpoint at this content block.
from line 384
375384
376385 - `"error"`
377386
378 - `BetaRequestDocumentBlock object { source, type, cache_control, 3 more }`
387 - `BetaRequestDocumentBlock object`
379388
380389 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
381390
382 - `BetaBase64PDFSource object { data, media_type, type }`
391 - `BetaBase64PDFSource object`
383392
384393 - `data: string`
385394
395 format: byte
396
386397 - `media_type: "application/pdf"`
387398
388 - `"application/pdf"`
389
390399 - `type: "base64"`
391400
392 - `"base64"`
393
394 - `BetaPlainTextSource object { data, media_type, type }`
401 - `BetaPlainTextSource object`
395402
396403 - `data: string`
397404
398405 - `media_type: "text/plain"`
399406
400 - `"text/plain"`
401
402407 - `type: "text"`
403408
404 - `"text"`
405
406 - `BetaContentBlockSource object { content, type }`
409 - `BetaContentBlockSource object`
407410
408411 - `content: string or array of BetaContentBlockSourceContent`
409412
from line 414
411414
412415 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
413416
414 - `BetaTextBlockParam object { text, type, cache_control, citations }`
415
416 - `BetaImageBlockParam object { source, type, cache_control, transformations }`
417 - `BetaTextBlockParam object`
418
419 - `BetaImageBlockParam object`
417420
418421 - `type: "content"`
419422
420 - `"content"`
421
422 - `BetaURLPDFSource object { type, url }`
423 - `BetaURLPDFSource object`
423424
424425 - `type: "url"`
425426
426 - `"url"`
427
428427 - `url: string`
429428
430 - `BetaFileDocumentSource object { file_id, type }`
429 - `BetaFileDocumentSource object`
431430
432431 - `file_id: string`
433432
434433 - `type: "file"`
435434
436 - `"file"`
437
438435 - `type: "document"`
439436
440 - `"document"`
441
442437 - `cache_control: optional BetaCacheControlEphemeral or null`
443438
444439 Create a cache control breakpoint at this content block.
from line 444
449444
450445 - `context: optional string or null`
451446
447 minLength: 1
448
452449 - `title: optional string or null`
453450
454 - `BetaSearchResultBlockParam object { content, source, title, 3 more }`
451 maxLength: 500, minLength: 1
452
453 - `BetaSearchResultBlockParam object`
455454
456455 - `content: array of BetaTextBlockParam`
457456
458457 - `text: string`
459458
459 minLength: 1
460
460461 - `type: "text"`
461462
462463 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 472
471472
472473 - `type: "search_result"`
473474
474 - `"search_result"`
475
476475 - `cache_control: optional BetaCacheControlEphemeral or null`
477476
478477 Create a cache control breakpoint at this content block.
479478
480479 - `citations: optional BetaCitationsConfigParam`
481480
482 - `BetaThinkingBlockParam object { signature, thinking, type }`
481 - `BetaThinkingBlockParam object`
483482
484483 - `signature: string`
485484
from line 492
493492
494493 - `type: "thinking"`
495494
496 - `"thinking"`
497
498 - `BetaRedactedThinkingBlockParam object { data, type }`
495 - `BetaRedactedThinkingBlockParam object`
499496
500497 - `data: string`
501498
from line 500
503500
504501 - `type: "redacted_thinking"`
505502
506 - `"redacted_thinking"`
507
508 - `BetaToolUseBlockParam object { id, input, name, 4 more }`
503 - `BetaToolUseBlockParam object`
509504
510505 - `id: string`
511506
507 pattern: ^[a-zA-Z0-9_-]+$
508
512509 - `input: map[unknown]`
513510
514511 - `name: string`
515512
513 maxLength: 200, minLength: 1
514
516515 - `type: "tool_use"`
517516
518 - `"tool_use"`
519
520517 - `cache_control: optional BetaCacheControlEphemeral or null`
521518
522519 Create a cache control breakpoint at this content block.
from line 522
525522
526523 Tool invocation directly from the model.
527524
528 - `BetaDirectCaller object { type }`
525 - `BetaDirectCaller object`
529526
530527 Tool invocation directly from the model.
531528
532529 - `type: "direct"`
533530
534 - `"direct"`
535
536 - `BetaServerToolCaller object { tool_id, type }`
531 - `BetaServerToolCaller object`
537532
538533 Tool invocation generated by a server-side tool.
539534
540535 - `tool_id: string`
541536
537 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
538
542539 - `type: "code_execution_20250825"`
543540
544 - `"code_execution_20250825"`
545
546 - `BetaServerToolCaller20260120 object { tool_id, type }`
541 - `BetaServerToolCaller20260120 object`
547542
548543 - `tool_id: string`
549544
545 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
546
550547 - `type: "code_execution_20260120"`
551548
552 - `"code_execution_20260120"`
553
554549 - `toolset_name: optional string or null`
555550
556551 For a toolset member tool_use, the toolset family this member belongs to.
557552
558 - `BetaToolResultBlockParam object { tool_use_id, type, cache_control, 3 more }`
553 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
554
555 - `BetaToolResultBlockParam object`
559556
560557 - `tool_use_id: string`
561558
559 pattern: ^[a-zA-Z0-9_-]+$
560
562561 - `type: "tool_result"`
563562
564 - `"tool_result"`
565
566563 - `cache_control: optional BetaCacheControlEphemeral or null`
567564
568565 Create a cache control breakpoint at this content block.
from line 570
573570
574571 - `array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 3 more`
575572
576 - `BetaTextBlockParam object { text, type, cache_control, citations }`
577
578 - `BetaImageBlockParam object { source, type, cache_control, transformations }`
579
580 - `BetaSearchResultBlockParam object { content, source, title, 3 more }`
581
582 - `BetaRequestDocumentBlock object { source, type, cache_control, 3 more }`
583
584 - `BetaToolReferenceBlockParam object { tool_name, type, cache_control }`
573 - `BetaTextBlockParam object`
574
575 - `BetaImageBlockParam object`
576
577 - `BetaSearchResultBlockParam object`
578
579 - `BetaRequestDocumentBlock object`
580
581 - `BetaToolReferenceBlockParam object`
585582
586583 Tool reference block that can be included in tool_result content.
587584
588585 - `tool_name: string`
589586
587 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
588
590589 - `type: "tool_reference"`
591590
592 - `"tool_reference"`
593
594591 - `cache_control: optional BetaCacheControlEphemeral or null`
595592
596593 Create a cache control breakpoint at this content block.
597594
598 - `BetaBrowserStateBlockParam object { tabs, type, cache_control, state_changes }`
595 - `BetaBrowserStateBlockParam object`
599596
600597 The caller's browser state after a browser toolset member call —
601598 the full inventory of open tabs, which tab is active, and any side
from line 606
609606
610607 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`.
611608
609 maxItems: 100
610
612611 - `tab_id: string`
613612
614613 The caller-assigned identifier for this tab, unique within the inventory.
615614
615 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
616
616617 - `title: string`
617618
618619 The title of the page the tab is showing. May be empty.
619620
621 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
622
620623 - `url: string`
621624
622625 The URL of the page the tab is showing. May be empty.
623626
627 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
628
624629 - `active: optional boolean`
625630
626631 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
627632
628633 - `type: "browser_state"`
629634
630 - `"browser_state"`
631
632635 - `cache_control: optional BetaCacheControlEphemeral or null`
633636
634637 Create a cache control breakpoint at this content block.
from line 640
637640
638641 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
639642
640 - `BetaBrowserStateChangeTabOpened object { tab_id, type }`
643 maxItems: 200, minItems: 1
644
645 - `BetaBrowserStateChangeTabOpened object`
641646
642647 A tab this call's execution opened that remains open at its end —
643648 the creation delta of the `tabs` inventory, not an event log.
from line 656
651656
652657 The `tab_id` of the opened tab, present in `tabs`.
653658
659 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
660
654661 - `type: "tab_opened"`
655662
656 - `"tab_opened"`
657
658 - `BetaBrowserStateChangeDownloadStarted object { download_id, type, url }`
663 - `BetaBrowserStateChangeDownloadStarted object`
659664
660665 A file download that started during this call.
661666
from line 668
663668
664669 The caller-assigned identifier for this download, stable across the state changes reporting it.
665670
671 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
672
666673 - `type: "download_started"`
667674
668 - `"download_started"`
669
670675 - `url: string`
671676
672677 The final post-redirect URL the download was served from.
673678
674 - `BetaBrowserStateChangeDownloadCompleted object { download_id, type, url, 2 more }`
679 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
680
681 - `BetaBrowserStateChangeDownloadCompleted object`
675682
676683 A file download that finished during this call, reported with the
677684 same `download_id` as its `download_started` — or without a prior
from line 689
682689
683690 The caller-assigned identifier for this download, stable across the state changes reporting it.
684691
692 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
693
685694 - `type: "download_completed"`
686695
687 - `"download_completed"`
688
689696 - `url: string`
690697
691698 The final post-redirect URL the download was served from.
692699
700 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
701
693702 - `path: optional string or null`
694703
695704 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.
696705
706 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
707
697708 - `size_bytes: optional number or null`
698709
699710 The completed download's size.
700711
701 - `BetaBrowserStateChangeDownloadFailed object { download_id, type, url, error }`
712 minimum: 0
713
714 - `BetaBrowserStateChangeDownloadFailed object`
702715
703716 A file download that failed — or was cancelled — during this call.
704717
from line 719
706719
707720 The caller-assigned identifier for this download, stable across the state changes reporting it.
708721
722 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
723
709724 - `type: "download_failed"`
710725
711 - `"download_failed"`
712
713726 - `url: string`
714727
715728 The final post-redirect URL the download was served from.
716729
730 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
731
717732 - `error: optional string or null`
718733
719734 The failure or cancellation detail, when known.
720735
736 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
737
721738 - `is_error: optional boolean`
722739
723740 - `toolset_name: optional string or null`
724741
725742 For a toolset member tool_result, the toolset family of the paired tool_use.
726743
727 - `BetaServerToolUseBlockParam object { id, input, name, 3 more }`
744 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
745
746 - `BetaServerToolUseBlockParam object`
728747
729748 - `id: string`
730749
750 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
751
731752 - `input: map[unknown]`
732753
733754 - `name: "advisor" or "web_search" or "web_fetch" or 5 more`
from line 771
750771
751772 - `type: "server_tool_use"`
752773
753 - `"server_tool_use"`
754
755774 - `cache_control: optional BetaCacheControlEphemeral or null`
756775
757776 Create a cache control breakpoint at this content block.
from line 779
760779
761780 Tool invocation directly from the model.
762781
763 - `BetaDirectCaller object { type }`
782 - `BetaDirectCaller object`
764783
765784 Tool invocation directly from the model.
766785
767 - `BetaServerToolCaller object { tool_id, type }`
786 - `BetaServerToolCaller object`
768787
769788 Tool invocation generated by a server-side tool.
770789
771 - `BetaServerToolCaller20260120 object { tool_id, type }`
772
773 - `BetaWebSearchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
790 - `BetaServerToolCaller20260120 object`
791
792 - `BetaWebSearchToolResultBlockParam object`
774793
775794 - `content: BetaWebSearchToolResultBlockParamContent`
776795
from line 801
782801
783802 - `type: "web_search_result"`
784803
785 - `"web_search_result"`
786
787804 - `url: string`
788805
789806 - `page_age: optional string or null`
790807
791 - `BetaWebSearchToolRequestError object { error_code, type }`
808 - `BetaWebSearchToolRequestError object`
792809
793810 - `error_code: BetaWebSearchToolResultErrorCode`
794811
from line 823
806823
807824 - `type: "web_search_tool_result_error"`
808825
809 - `"web_search_tool_result_error"`
810
811826 - `tool_use_id: string`
812827
828 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
829
813830 - `type: "web_search_tool_result"`
814831
815 - `"web_search_tool_result"`
816
817832 - `cache_control: optional BetaCacheControlEphemeral or null`
818833
819834 Create a cache control breakpoint at this content block.
from line 837
822837
823838 Tool invocation directly from the model.
824839
825 - `BetaDirectCaller object { type }`
840 - `BetaDirectCaller object`
826841
827842 Tool invocation directly from the model.
828843
829 - `BetaServerToolCaller object { tool_id, type }`
844 - `BetaServerToolCaller object`
830845
831846 Tool invocation generated by a server-side tool.
832847
833 - `BetaServerToolCaller20260120 object { tool_id, type }`
834
835 - `BetaWebFetchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
848 - `BetaServerToolCaller20260120 object`
849
850 - `BetaWebFetchToolResultBlockParam object`
836851
837852 - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
838853
839 - `BetaWebFetchToolResultErrorBlockParam object { error_code, type }`
854 - `BetaWebFetchToolResultErrorBlockParam object`
840855
841856 - `error_code: BetaWebFetchToolResultErrorCode`
842857
from line 875
860875
861876 - `type: "web_fetch_tool_result_error"`
862877
863 - `"web_fetch_tool_result_error"`
864
865 - `BetaWebFetchBlockParam object { content, type, url, retrieved_at }`
878 - `BetaWebFetchBlockParam object`
866879
867880 - `content: BetaRequestDocumentBlock`
868881
869882 - `type: "web_fetch_result"`
870883
871 - `"web_fetch_result"`
872
873884 - `url: string`
874885
875886 Fetched content URL
from line 891
880891
881892 - `tool_use_id: string`
882893
894 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
895
883896 - `type: "web_fetch_tool_result"`
884897
885 - `"web_fetch_tool_result"`
886
887898 - `cache_control: optional BetaCacheControlEphemeral or null`
888899
889900 Create a cache control breakpoint at this content block.
from line 903
892903
893904 Tool invocation directly from the model.
894905
895 - `BetaDirectCaller object { type }`
906 - `BetaDirectCaller object`
896907
897908 Tool invocation directly from the model.
898909
899 - `BetaServerToolCaller object { tool_id, type }`
910 - `BetaServerToolCaller object`
900911
901912 Tool invocation generated by a server-side tool.
902913
903 - `BetaServerToolCaller20260120 object { tool_id, type }`
904
905 - `BetaAdvisorToolResultBlockParam object { content, tool_use_id, type, cache_control }`
914 - `BetaServerToolCaller20260120 object`
915
916 - `BetaAdvisorToolResultBlockParam object`
906917
907918 - `content: BetaAdvisorToolResultErrorParam or BetaAdvisorResultBlockParam or BetaAdvisorRedactedResultBlockParam`
908919
909 - `BetaAdvisorToolResultErrorParam object { error_code, type }`
920 - `BetaAdvisorToolResultErrorParam object`
910921
911922 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
912923
from line 937
926937
927938 - `type: "advisor_tool_result_error"`
928939
929 - `"advisor_tool_result_error"`
930
931 - `BetaAdvisorResultBlockParam object { text, type, stop_reason }`
940 - `BetaAdvisorResultBlockParam object`
932941
933942 - `text: string`
934943
935944 - `type: "advisor_result"`
936945
937 - `"advisor_result"`
938
939946 - `stop_reason: optional string or null`
940947
941 - `BetaAdvisorRedactedResultBlockParam object { encrypted_content, type, stop_reason }`
948 - `BetaAdvisorRedactedResultBlockParam object`
942949
943950 - `encrypted_content: string`
944951
from line 953
946953
947954 - `type: "advisor_redacted_result"`
948955
949 - `"advisor_redacted_result"`
950
951956 - `stop_reason: optional string or null`
952957
953958 - `tool_use_id: string`
954959
960 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
961
955962 - `type: "advisor_tool_result"`
956963
957 - `"advisor_tool_result"`
958
959964 - `cache_control: optional BetaCacheControlEphemeral or null`
960965
961966 Create a cache control breakpoint at this content block.
962967
963 - `BetaCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
968 - `BetaCodeExecutionToolResultBlockParam object`
964969
965970 - `content: BetaCodeExecutionToolResultBlockParamContent`
966971
967972 Code execution result with encrypted stdout for PFC + web_search results.
968973
969 - `BetaCodeExecutionToolResultErrorParam object { error_code, type }`
974 - `BetaCodeExecutionToolResultErrorParam object`
970975
971976 - `error_code: BetaCodeExecutionToolResultErrorCode`
972977
from line 985
980985
981986 - `type: "code_execution_tool_result_error"`
982987
983 - `"code_execution_tool_result_error"`
984
985 - `BetaCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
988 - `BetaCodeExecutionResultBlockParam object`
986989
987990 - `content: array of BetaCodeExecutionOutputBlockParam`
988991
from line 993
990993
991994 - `type: "code_execution_output"`
992995
993 - `"code_execution_output"`
994
995996 - `return_code: number`
996997
997998 - `stderr: string`
from line 1001
10001001
10011002 - `type: "code_execution_result"`
10021003
1003 - `"code_execution_result"`
1004
1005 - `BetaEncryptedCodeExecutionResultBlockParam object { content, encrypted_stdout, return_code, 2 more }`
1004 - `BetaEncryptedCodeExecutionResultBlockParam object`
10061005
10071006 Code execution result with encrypted stdout for PFC + web_search results.
10081007
from line 1019
10201019
10211020 - `type: "encrypted_code_execution_result"`
10221021
1023 - `"encrypted_code_execution_result"`
1024
10251022 - `tool_use_id: string`
10261023
1024 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1025
10271026 - `type: "code_execution_tool_result"`
10281027
1029 - `"code_execution_tool_result"`
1030
10311028 - `cache_control: optional BetaCacheControlEphemeral or null`
10321029
10331030 Create a cache control breakpoint at this content block.
10341031
1035 - `BetaBashCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1032 - `BetaBashCodeExecutionToolResultBlockParam object`
10361033
10371034 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
10381035
1039 - `BetaBashCodeExecutionToolResultErrorParam object { error_code, type }`
1036 - `BetaBashCodeExecutionToolResultErrorParam object`
10401037
10411038 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10421039
from line 1049
10521049
10531050 - `type: "bash_code_execution_tool_result_error"`
10541051
1055 - `"bash_code_execution_tool_result_error"`
1056
1057 - `BetaBashCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
1052 - `BetaBashCodeExecutionResultBlockParam object`
10581053
10591054 - `content: array of BetaBashCodeExecutionOutputBlockParam`
10601055
from line 1057
10621057
10631058 - `type: "bash_code_execution_output"`
10641059
1065 - `"bash_code_execution_output"`
1066
10671060 - `return_code: number`
10681061
10691062 - `stderr: string`
from line 1065
10721065
10731066 - `type: "bash_code_execution_result"`
10741067
1075 - `"bash_code_execution_result"`
1076
10771068 - `tool_use_id: string`
10781069
1070 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1071
10791072 - `type: "bash_code_execution_tool_result"`
10801073
1081 - `"bash_code_execution_tool_result"`
1082
10831074 - `cache_control: optional BetaCacheControlEphemeral or null`
10841075
10851076 Create a cache control breakpoint at this content block.
10861077
1087 - `BetaTextEditorCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1078 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
10881079
10891080 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
10901081
1091 - `BetaTextEditorCodeExecutionToolResultErrorParam object { error_code, type, error_message }`
1082 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
10921083
10931084 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10941085
from line 1095
11041095
11051096 - `type: "text_editor_code_execution_tool_result_error"`
11061097
1107 - `"text_editor_code_execution_tool_result_error"`
1108
11091098 - `error_message: optional string or null`
11101099
1111 - `BetaTextEditorCodeExecutionViewResultBlockParam object { content, file_type, type, 3 more }`
1100 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
11121101
11131102 - `content: string`
11141103
from line 1111
11221111
11231112 - `type: "text_editor_code_execution_view_result"`
11241113
1125 - `"text_editor_code_execution_view_result"`
1126
11271114 - `num_lines: optional number or null`
11281115
11291116 - `start_line: optional number or null`
11301117
11311118 - `total_lines: optional number or null`
11321119
1133 - `BetaTextEditorCodeExecutionCreateResultBlockParam object { is_file_update, type }`
1120 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
11341121
11351122 - `is_file_update: boolean`
11361123
11371124 - `type: "text_editor_code_execution_create_result"`
11381125
1139 - `"text_editor_code_execution_create_result"`
1140
1141 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object { type, lines, new_lines, 3 more }`
1126 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
11421127
11431128 - `type: "text_editor_code_execution_str_replace_result"`
11441129
1145 - `"text_editor_code_execution_str_replace_result"`
1146
11471130 - `lines: optional array of string or null`
11481131
11491132 - `new_lines: optional number or null`
from line 1139
11561139
11571140 - `tool_use_id: string`
11581141
1142 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1143
11591144 - `type: "text_editor_code_execution_tool_result"`
11601145
1161 - `"text_editor_code_execution_tool_result"`
1162
11631146 - `cache_control: optional BetaCacheControlEphemeral or null`
11641147
11651148 Create a cache control breakpoint at this content block.
11661149
1167 - `BetaToolSearchToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1150 - `BetaToolSearchToolResultBlockParam object`
11681151
11691152 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
11701153
1171 - `BetaToolSearchToolResultErrorParam object { error_code, type, error_message }`
1154 - `BetaToolSearchToolResultErrorParam object`
11721155
11731156 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
11741157
from line 1165
11821165
11831166 - `type: "tool_search_tool_result_error"`
11841167
1185 - `"tool_search_tool_result_error"`
1186
11871168 - `error_message: optional string or null`
11881169
1189 - `BetaToolSearchToolSearchResultBlockParam object { tool_references, type }`
1170 - `BetaToolSearchToolSearchResultBlockParam object`
11901171
11911172 - `tool_references: array of BetaToolReferenceBlockParam`
11921173
11931174 - `tool_name: string`
11941175
1176 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1177
11951178 - `type: "tool_reference"`
11961179
11971180 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 1183
12001183
12011184 - `type: "tool_search_tool_search_result"`
12021185
1203 - `"tool_search_tool_search_result"`
1204
12051186 - `tool_use_id: string`
12061187
1188 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1189
12071190 - `type: "tool_search_tool_result"`
12081191
1209 - `"tool_search_tool_result"`
1210
12111192 - `cache_control: optional BetaCacheControlEphemeral or null`
12121193
12131194 Create a cache control breakpoint at this content block.
12141195
1215 - `BetaMCPToolUseBlockParam object { id, input, name, 3 more }`
1196 - `BetaMCPToolUseBlockParam object`
12161197
12171198 - `id: string`
12181199
1200 pattern: ^[a-zA-Z0-9_-]+$
1201
12191202 - `input: map[unknown]`
12201203
12211204 - `name: string`
from line 1209
12261209
12271210 - `type: "mcp_tool_use"`
12281211
1229 - `"mcp_tool_use"`
1230
12311212 - `cache_control: optional BetaCacheControlEphemeral or null`
12321213
12331214 Create a cache control breakpoint at this content block.
12341215
1235 - `BetaRequestMCPToolResultBlockParam object { tool_use_id, type, cache_control, 2 more }`
1216 - `BetaRequestMCPToolResultBlockParam object`
12361217
12371218 - `tool_use_id: string`
12381219
1220 pattern: ^[a-zA-Z0-9_-]+$
1221
12391222 - `type: "mcp_tool_result"`
12401223
1241 - `"mcp_tool_result"`
1242
12431224 - `cache_control: optional BetaCacheControlEphemeral or null`
12441225
12451226 Create a cache control breakpoint at this content block.
from line 1233
12521233
12531234 - `text: string`
12541235
1236 minLength: 1
1237
12551238 - `type: "text"`
12561239
12571240 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 1245
12621245
12631246 - `is_error: optional boolean`
12641247
1265 - `BetaContainerUploadBlockParam object { file_id, type, cache_control }`
1248 - `BetaContainerUploadBlockParam object`
12661249
12671250 A content block that represents a file to be uploaded to the container
12681251 Files uploaded via this block will be available in the container's input directory.
from line 1254
12711254
12721255 - `type: "container_upload"`
12731256
1274 - `"container_upload"`
1275
12761257 - `cache_control: optional BetaCacheControlEphemeral or null`
12771258
12781259 Create a cache control breakpoint at this content block.
12791260
1280 - `BetaCompactionBlockParam object { type, cache_control, content, encrypted_content }`
1261 - `BetaCompactionBlockParam object`
12811262
12821263 A compaction block containing summary of previous context.
12831264
from line 1270
12891270
12901271 - `type: "compaction"`
12911272
1292 - `"compaction"`
1293
12941273 - `cache_control: optional BetaCacheControlEphemeral or null`
12951274
12961275 Create a cache control breakpoint at this content block.
from line 1282
13031282
13041283 Opaque metadata from prior compaction, to be round-tripped verbatim
13051284
1306 - `BetaRequestToolAdditionBlock object { tool, type, cache_control }`
1285 - `BetaRequestToolAdditionBlock object`
13071286
13081287 Mid-conversation directive to surface a declared tool.
13091288
from line 1297
13181297 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13191298 `mcp_toolset_reference` for those.
13201299
1321 - `BetaToolChangeToolReference object { name, type }`
1300 - `BetaToolChangeToolReference object`
13221301
13231302 Reference to a single tool the caller declared directly in
13241303 `tools[]`. Does not accept the composed `{server}_{name}` form the
from line 1306
13271306
13281307 - `name: string`
13291308
1309 pattern: ^[a-zA-Z0-9_-]{1,128}$
1310
13301311 - `type: "tool_reference"`
13311312
1332 - `"tool_reference"`
1333
1334 - `BetaToolChangeMCPToolReference object { name, server_name, type }`
1313 - `BetaToolChangeMCPToolReference object`
13351314
13361315 Reference to a single MCP tool by its server and remote name — the
13371316 same `server_name`/`name` pair `mcp_tool_use` carries.
from line 1321
13421321
13431322 - `type: "mcp_tool_reference"`
13441323
1345 - `"mcp_tool_reference"`
1346
1347 - `BetaToolChangeMCPToolsetReference object { server_name, type }`
1324 - `BetaToolChangeMCPToolsetReference object`
13481325
13491326 Reference to every tool in the named MCP server's toolset.
13501327
from line 1329
13521329
13531330 - `type: "mcp_toolset_reference"`
13541331
1355 - `"mcp_toolset_reference"`
1356
13571332 - `type: "tool_addition"`
13581333
1359 - `"tool_addition"`
1360
13611334 - `cache_control: optional BetaCacheControlEphemeral or null`
13621335
13631336 Create a cache control breakpoint at this content block.
13641337
1365 - `BetaRequestToolRemovalBlock object { tool, type, cache_control }`
1338 - `BetaRequestToolRemovalBlock object`
13661339
13671340 Mid-conversation directive to withdraw a tool.
13681341
from line 1350
13771350 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13781351 `mcp_toolset_reference` for those.
13791352
1380 - `BetaToolChangeToolReference object { name, type }`
1353 - `BetaToolChangeToolReference object`
13811354
13821355 Reference to a single tool the caller declared directly in
13831356 `tools[]`. Does not accept the composed `{server}_{name}` form the
13841357 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13851358 `mcp_toolset_reference` for those.
13861359
1387 - `BetaToolChangeMCPToolReference object { name, server_name, type }`
1360 - `BetaToolChangeMCPToolReference object`
13881361
13891362 Reference to a single MCP tool by its server and remote name — the
13901363 same `server_name`/`name` pair `mcp_tool_use` carries.
13911364
1392 - `BetaToolChangeMCPToolsetReference object { server_name, type }`
1365 - `BetaToolChangeMCPToolsetReference object`
13931366
13941367 Reference to every tool in the named MCP server's toolset.
13951368
13961369 - `type: "tool_removal"`
13971370
1398 - `"tool_removal"`
1399
14001371 - `cache_control: optional BetaCacheControlEphemeral or null`
14011372
14021373 Create a cache control breakpoint at this content block.
14031374
1404 - `BetaFallbackBlockParam object { from, to, type, trigger }`
1375 - `BetaFallbackBlockParam object`
14051376
14061377 A `fallback` block echoed back from a prior response.
14071378
from line 1472
15011472
15021473 - `type: "fallback"`
15031474
1504 - `"fallback"`
1505
15061475 - `trigger: optional unknown`
15071476
15081477 The response block's `trigger`, echoed verbatim. Accepted and ignored by the server; any object or `null` is allowed.
from line 1498
15291498
15301499 Container identifier for reuse across requests.
15311500
1532 - `BetaContainerParams object { id, skills }`
1501 - `BetaContainerParams object`
15331502
15341503 Container parameters with skills to be loaded.
15351504
from line 1510
15411510
15421511 List of skills to load in the container
15431512
1513 maxItems: 20
1514
15441515 - `skill_id: string`
15451516
15461517 Skill ID
15471518
1519 maxLength: 64, minLength: 1
1520
15481521 - `type: "anthropic" or "custom"`
15491522
15501523 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 1530
15571530
15581531 Skill version or 'latest' for most recent version
15591532
1533 maxLength: 64, minLength: 1
1534
15601535 - `string`
15611536
15621537 - `context_management: optional BetaContextManagementConfig or null`
from line 1544
15691544
15701545 List of context management edits to apply
15711546
1572 - `BetaClearToolUses20250919Edit object { type, clear_at_least, clear_tool_inputs, 3 more }`
1547 minItems: 0
1548
1549 - `BetaClearToolUses20250919Edit object`
15731550
15741551 - `type: "clear_tool_uses_20250919"`
15751552
1576 - `"clear_tool_uses_20250919"`
1577
15781553 - `clear_at_least: optional BetaInputTokensClearAtLeast or null`
15791554
15801555 Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
15811556
15821557 - `type: "input_tokens"`
15831558
1584 - `"input_tokens"`
1585
15861559 - `value: number`
15871560
1561 minimum: 0
1562
15881563 - `clear_tool_inputs: optional boolean or array of string or null`
15891564
15901565 Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
from line 1578
16031578
16041579 - `type: "tool_uses"`
16051580
1606 - `"tool_uses"`
1607
16081581 - `value: number`
16091582
1583 minimum: 0
1584
16101585 - `trigger: optional BetaInputTokensTrigger or BetaToolUsesTrigger`
16111586
16121587 Condition that triggers the context management strategy
16131588
1614 - `BetaInputTokensTrigger object { type, value }`
1589 - `BetaInputTokensTrigger object`
16151590
16161591 - `type: "input_tokens"`
16171592
1618 - `"input_tokens"`
1619
16201593 - `value: number`
16211594
1622 - `BetaToolUsesTrigger object { type, value }`
1595 minimum: 1
1596
1597 - `BetaToolUsesTrigger object`
16231598
16241599 - `type: "tool_uses"`
16251600
1626 - `"tool_uses"`
1627
16281601 - `value: number`
16291602
1630 - `BetaClearThinking20251015Edit object { type, keep }`
1603 minimum: 1
1604
1605 - `BetaClearThinking20251015Edit object`
16311606
16321607 - `type: "clear_thinking_20251015"`
16331608
1634 - `"clear_thinking_20251015"`
1635
16361609 - `keep: optional BetaThinkingTurns or BetaAllThinkingTurns or "all"`
16371610
16381611 Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
16391612
1640 - `BetaThinkingTurns object { type, value }`
1613 - `BetaThinkingTurns object`
16411614
16421615 - `type: "thinking_turns"`
16431616
1644 - `"thinking_turns"`
1645
16461617 - `value: number`
16471618
1648 - `BetaAllThinkingTurns object { type }`
1619 minimum: 1
1620
1621 - `BetaAllThinkingTurns object`
16491622
16501623 - `type: "all"`
16511624
1652 - `"all"`
1653
16541625 - `"all"`
16551626
1656 - `"all"`
1657
1658 - `BetaCompact20260112Edit object { type, instructions, pause_after_compaction, trigger }`
1627 - `BetaCompact20260112Edit object`
16591628
16601629 Automatically compact older context when reaching the configured trigger threshold.
16611630
16621631 - `type: "compact_20260112"`
1663
1664 - `"compact_20260112"`
16651632
16661633 - `instructions: optional string or null`
16671634
from line 1650
16831650 - `previous_message_id: optional string or null`
16841651
16851652 The `id` (`msg_...`) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns `diagnostics.cache_miss_reason` when the prompt-cache prefix could not be reused. Pass `null` on the first turn to opt in without a prior message to compare.
1653
1654 maxLength: 256
16861655
16871656 - `fallback_credit_token: optional string or BetaFallbackCreditTokenParam or null`
16881657
from line 1678
17091678
17101679 - `string`
17111680
1712 - `BetaFallbackCreditTokenParam object { token, mode }`
1681 - `BetaFallbackCreditTokenParam object`
17131682
17141683 Object form of `fallback_credit_token`: the token plus a redemption
17151684 mode.
from line 1692
17231692
17241693 The opaque `fallback_credit_token` from a prior refusal's `stop_details` — the same string the bare-string form carries.
17251694
1695 maxLength: 2048, minLength: 1
1696
17261697 - `mode: optional "strict" or "best_effort"`
17271698
17281699 How a failing token affects the retry. `strict` (the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served. `best_effort`: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response's `usage.fallback_credit`. Two failures stay hard in both modes: a malformed token, and combining `fallback_credit_token` with `fallbacks`.
from line 1742
17711742
17721743 - `type: "json_schema"`
17731744
1774 - `"json_schema"`
1775
17761745 - `task_budget: optional BetaTokenTaskBudget or null`
17771746
17781747 User-configurable total token budget across contexts.
from line 1750
17811750
17821751 Total token budget across all contexts in the session.
17831752
1753 minimum: 1024
1754
17841755 - `type: "tokens"`
17851756
17861757 The budget type. Currently only 'tokens' is supported.
17871758
1788 - `"tokens"`
1789
17901759 - `remaining: optional number or null`
17911760
17921761 Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.
17931762
1763 minimum: 0
1764
17941765 - `speed: optional "standard" or "fast" or null`
17951766
17961767 Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.
from line 1772
18011772
18021773 - `thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive or null`
18031774
1804 - `BetaThinkingConfigEnabled object { budget_tokens, type, display }`
1775 - `BetaThinkingConfigEnabled object`
18051776
18061777 - `budget_tokens: number`
18071778
from line 1782
18111782
18121783 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
18131784
1785 minimum: 1024
1786
18141787 - `type: "enabled"`
18151788
1816 - `"enabled"`
1817
18181789 - `display: optional "summarized" or "omitted" or null`
18191790
18201791 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 1794
18231794
18241795 - `"omitted"`
18251796
1826 - `BetaThinkingConfigDisabled object { type }`
1797 - `BetaThinkingConfigDisabled object`
18271798
18281799 - `type: "disabled"`
18291800
1830 - `"disabled"`
1831
1832 - `BetaThinkingConfigAdaptive object { type, display }`
1801 - `BetaThinkingConfigAdaptive object`
18331802
18341803 - `type: "adaptive"`
18351804
1836 - `"adaptive"`
1837
18381805 - `display: optional "summarized" or "omitted" or null`
18391806
18401807 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 1812
18451812
18461813 - `Default = "default"`
18471814
1848 - `"default"`
1849
18501815 - `inference_geo: optional string or null`
18511816
18521817 Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.
from line 1820
18551820
18561821 MCP servers to be utilized in this request
18571822
1823 maxItems: 20
1824
18581825 - `name: string`
18591826
18601827 - `type: "url"`
18611828
1862 - `"url"`
1863
18641829 - `url: string`
18651830
18661831 - `authorization_token: optional string or null`
from line 1846
18811846
18821847 This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
18831848
1849 maxLength: 512
1850
18841851 - `output_config: optional BetaOutputConfig`
18851852
18861853 Configuration options for the model's output, such as the output format.
18871854
1888 - `output_format: optional BetaJSONOutputFormat or null`
1889
1890 Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
1891
1892 A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
1893
18941855 - `service_tier: optional "auto" or "standard_only"`
18951856
18961857 Determines whether to use priority capacity (if available) or standard capacity for this request.
from line 1896
19351896
19361897 - `text: string`
19371898
1899 minLength: 1
1900
19381901 - `type: "text"`
19391902
19401903 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 1906
19431906
19441907 - `citations: optional array of BetaTextCitationParam or null`
19451908
1946 - `temperature: optional number`
1947
1948 Amount of randomness injected into the response.
1949
1950 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.
1951
1952 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
1953
19541909 - `thinking: optional BetaThinkingConfigParam`
19551910
19561911 Configuration for enabling Claude's extended thinking.
from line 1914
19591914
19601915 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
19611916
1962 - `BetaThinkingConfigEnabled object { budget_tokens, type, display }`
1963
1964 - `BetaThinkingConfigDisabled object { type }`
1965
1966 - `BetaThinkingConfigAdaptive object { type, display }`
1917 - `BetaThinkingConfigEnabled object`
1918
1919 - `BetaThinkingConfigDisabled object`
1920
1921 - `BetaThinkingConfigAdaptive object`
19671922
19681923 - `tool_choice: optional BetaToolChoice`
19691924
19701925 How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
19711926
1972 - `BetaToolChoiceAuto object { type, disable_parallel_tool_use }`
1927 - `BetaToolChoiceAuto object`
19731928
19741929 The model will automatically decide whether to use tools.
19751930
19761931 - `type: "auto"`
19771932
1978 - `"auto"`
1979
19801933 - `disable_parallel_tool_use: optional boolean`
19811934
19821935 Whether to disable parallel tool use.
19831936
19841937 Defaults to `false`. If set to `true`, the model will output at most one tool use.
19851938
1986 - `BetaToolChoiceAny object { type, disable_parallel_tool_use }`
1939 - `BetaToolChoiceAny object`
19871940
19881941 The model will use any available tools.
19891942
19901943 - `type: "any"`
19911944
1992 - `"any"`
1993
19941945 - `disable_parallel_tool_use: optional boolean`
19951946
19961947 Whether to disable parallel tool use.
19971948
19981949 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
19991950
2000 - `BetaToolChoiceTool object { name, type, disable_parallel_tool_use }`
1951 - `BetaToolChoiceTool object`
20011952
20021953 The model will use the specified tool with `tool_choice.name`.
20031954
from line 1958
20071958
20081959 - `type: "tool"`
20091960
2010 - `"tool"`
2011
20121961 - `disable_parallel_tool_use: optional boolean`
20131962
20141963 Whether to disable parallel tool use.
20151964
20161965 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
20171966
2018 - `BetaToolChoiceNone object { type }`
1967 - `BetaToolChoiceNone object`
20191968
20201969 The model will not be allowed to use tools.
20211970
20221971 - `type: "none"`
2023
2024 - `"none"`
20251972
20261973 - `tools: optional array of BetaToolUnion`
20271974
from line 2034
20872034
20882035 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
20892036
2090 - `BetaTool object { input_schema, name, allowed_callers, 7 more }`
2091
2092 - `input_schema: object { type, properties, required }`
2037 - `BetaTool object`
2038
2039 - `input_schema: object`
20932040
20942041 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
20952042
from line 2044
20972044
20982045 - `type: "object"`
20992046
2100 - `"object"`
2101
21022047 - `properties: optional map[unknown] or null`
21032048
21042049 - `required: optional array of string or null`
from line 2054
21092054
21102055 This is how the tool will be called by the model and in `tool_use` blocks.
21112056
2057 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$
2058
21122059 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21132060
21142061 - `"direct"`
from line 2092
21452092
21462093 - `type: optional "custom" or null`
21472094
2148 - `"custom"`
2149
2150 - `BetaToolBash20241022 object { name, type, allowed_callers, 4 more }`
2095 - `BetaToolBash20241022 object`
21512096
21522097 - `name: "bash"`
21532098
from line 2100
21552100
21562101 This is how the tool will be called by the model and in `tool_use` blocks.
21572102
2158 - `"bash"`
2159
21602103 - `type: "bash_20241022"`
21612104
2162 - `"bash_20241022"`
2163
21642105 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21652106
21662107 - `"direct"`
from line 2126
21852126
21862127 When true, guarantees schema validation on tool names and inputs
21872128
2188 - `BetaToolBash20250124 object { name, type, allowed_callers, 4 more }`
2129 - `BetaToolBash20250124 object`
21892130
21902131 - `name: "bash"`
21912132
from line 2134
21932134
21942135 This is how the tool will be called by the model and in `tool_use` blocks.
21952136
2196 - `"bash"`
2197
21982137 - `type: "bash_20250124"`
21992138
2200 - `"bash_20250124"`
2201
22022139 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22032140
22042141 - `"direct"`
from line 2160
22232160
22242161 When true, guarantees schema validation on tool names and inputs
22252162
2226 - `BetaCodeExecutionTool20250522 object { name, type, allowed_callers, 3 more }`
2163 - `BetaCodeExecutionTool20250522 object`
22272164
22282165 - `name: "code_execution"`
22292166
from line 2168
22312168
22322169 This is how the tool will be called by the model and in `tool_use` blocks.
22332170
2234 - `"code_execution"`
2235
22362171 - `type: "code_execution_20250522"`
22372172
2238 - `"code_execution_20250522"`
2239
22402173 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22412174
22422175 - `"direct"`
from line 2192
22592192
22602193 When true, guarantees schema validation on tool names and inputs
22612194
2262 - `BetaCodeExecutionTool20250825 object { name, type, allowed_callers, 3 more }`
2195 - `BetaCodeExecutionTool20250825 object`
22632196
22642197 - `name: "code_execution"`
22652198
from line 2200
22672200
22682201 This is how the tool will be called by the model and in `tool_use` blocks.
22692202
2270 - `"code_execution"`
2271
22722203 - `type: "code_execution_20250825"`
22732204
2205 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
2206
2207 - `"direct"`
2208
22742209 - `"code_execution_20250825"`
22752210
2211 - `"code_execution_20260120"`
2212
2213 - `"code_execution_20260521"`
2214
2215 - `cache_control: optional BetaCacheControlEphemeral or null`
2216
2217 Create a cache control breakpoint at this content block.
2218
2219 - `defer_loading: optional boolean`
2220
2221 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
2222
2223 - `strict: optional boolean`
2224
2225 When true, guarantees schema validation on tool names and inputs
2226
2227 - `BetaCodeExecutionTool20260120 object`
2228
2229 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
2230
2231 - `name: "code_execution"`
2232
2233 Name of the tool.
2234
2235 This is how the tool will be called by the model and in `tool_use` blocks.
2236
2237 - `type: "code_execution_20260120"`
2238
22762239 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22772240
22782241 - `"direct"`
from line 2258
22952258
22962259 When true, guarantees schema validation on tool names and inputs
22972260
2298 - `BetaCodeExecutionTool20260120 object { name, type, allowed_callers, 3 more }`
2299
2300 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
2261 - `BetaCodeExecutionTool20260521 object`
2262
2263 Code execution tool with REPL state persistence.
23012264
23022265 - `name: "code_execution"`
23032266
from line 2268
23052268
23062269 This is how the tool will be called by the model and in `tool_use` blocks.
23072270
2308 - `"code_execution"`
2309
2310 - `type: "code_execution_20260120"`
2271 - `type: "code_execution_20260521"`
2272
2273 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
2274
2275 - `"direct"`
2276
2277 - `"code_execution_20250825"`
23112278
23122279 - `"code_execution_20260120"`
23132280
2314 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
2315
2316 - `"direct"`
2317
2318 - `"code_execution_20250825"`
2319
2320 - `"code_execution_20260120"`
2321
23222281 - `"code_execution_20260521"`
23232282
23242283 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 2292
23332292
23342293 When true, guarantees schema validation on tool names and inputs
23352294
2336 - `BetaCodeExecutionTool20260521 object { name, type, allowed_callers, 3 more }`
2337
2338 Code execution tool with REPL state persistence.
2339
2340 - `name: "code_execution"`
2341
2342 Name of the tool.
2343
2344 This is how the tool will be called by the model and in `tool_use` blocks.
2345
2346 - `"code_execution"`
2347
2348 - `type: "code_execution_20260521"`
2349
2350 - `"code_execution_20260521"`
2351
2352 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
2353
2354 - `"direct"`
2355
2356 - `"code_execution_20250825"`
2357
2358 - `"code_execution_20260120"`
2359
2360 - `"code_execution_20260521"`
2361
2362 - `cache_control: optional BetaCacheControlEphemeral or null`
2363
2364 Create a cache control breakpoint at this content block.
2365
2366 - `defer_loading: optional boolean`
2367
2368 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
2369
2370 - `strict: optional boolean`
2371
2372 When true, guarantees schema validation on tool names and inputs
2373
2374 - `BetaBrowserToolset20260801 object { type, allowed_callers, cache_control, configs }`
2295 - `BetaBrowserToolset20260801 object`
23752296
23762297 The browser toolset: a single `tools[]` entry (carrying no
23772298 `name`) that declares the browser tool family. The model is served
from line 2300
23792300 from its schema.
23802301
23812302 - `type: "browser_toolset_20260801"`
2382
2383 - `"browser_toolset_20260801"`
23842303
23852304 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23862305
from line 2696
27772696
27782697 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.
27792698
2780 - `BetaToolComputerUse20241022 object { display_height_px, display_width_px, name, 7 more }`
2699 - `BetaToolComputerUse20241022 object`
27812700
27822701 - `display_height_px: number`
27832702
27842703 The height of the display in pixels.
27852704
2705 minimum: 1
2706
27862707 - `display_width_px: number`
27872708
27882709 The width of the display in pixels.
27892710
2711 minimum: 1
2712
27902713 - `name: "computer"`
27912714
27922715 Name of the tool.
27932716
27942717 This is how the tool will be called by the model and in `tool_use` blocks.
27952718
2796 - `"computer"`
2797
27982719 - `type: "computer_20241022"`
27992720
2800 - `"computer_20241022"`
2801
28022721 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28032722
28042723 - `"direct"`
from line 2740
28212740
28222741 The X11 display number (e.g. 0, 1) for the display.
28232742
2743 minimum: 0
2744
28242745 - `input_examples: optional array of map[unknown]`
28252746
28262747 - `strict: optional boolean`
28272748
28282749 When true, guarantees schema validation on tool names and inputs
28292750
2830 - `BetaMemoryTool20250818 object { name, type, allowed_callers, 4 more }`
2751 - `BetaMemoryTool20250818 object`
28312752
28322753 - `name: "memory"`
28332754
from line 2756
28352756
28362757 This is how the tool will be called by the model and in `tool_use` blocks.
28372758
2838 - `"memory"`
2839
28402759 - `type: "memory_20250818"`
28412760
2842 - `"memory_20250818"`
2843
28442761 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28452762
28462763 - `"direct"`
from line 2782
28652782
28662783 When true, guarantees schema validation on tool names and inputs
28672784
2868 - `BetaToolComputerUse20250124 object { display_height_px, display_width_px, name, 7 more }`
2785 - `BetaToolComputerUse20250124 object`
28692786
28702787 - `display_height_px: number`
28712788
28722789 The height of the display in pixels.
28732790
2791 minimum: 1
2792
28742793 - `display_width_px: number`
28752794
28762795 The width of the display in pixels.
28772796
2797 minimum: 1
2798
28782799 - `name: "computer"`
28792800
28802801 Name of the tool.
28812802
28822803 This is how the tool will be called by the model and in `tool_use` blocks.
28832804
2884 - `"computer"`
2885
28862805 - `type: "computer_20250124"`
28872806
2888 - `"computer_20250124"`
2889
28902807 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28912808
28922809 - `"direct"`
from line 2826
29092826
29102827 The X11 display number (e.g. 0, 1) for the display.
29112828
2829 minimum: 0
2830
29122831 - `input_examples: optional array of map[unknown]`
29132832
29142833 - `strict: optional boolean`
29152834
29162835 When true, guarantees schema validation on tool names and inputs
29172836
2918 - `BetaToolTextEditor20241022 object { name, type, allowed_callers, 4 more }`
2837 - `BetaToolTextEditor20241022 object`
29192838
29202839 - `name: "str_replace_editor"`
29212840
from line 2842
29232842
29242843 This is how the tool will be called by the model and in `tool_use` blocks.
29252844
2926 - `"str_replace_editor"`
2927
29282845 - `type: "text_editor_20241022"`
29292846
2930 - `"text_editor_20241022"`
2931
29322847 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29332848
29342849 - `"direct"`
from line 2868
29532868
29542869 When true, guarantees schema validation on tool names and inputs
29552870
2956 - `BetaToolComputerUse20251124 object { display_height_px, display_width_px, name, 8 more }`
2871 - `BetaToolComputerUse20251124 object`
29572872
29582873 - `display_height_px: number`
29592874
29602875 The height of the display in pixels.
29612876
2877 minimum: 1
2878
29622879 - `display_width_px: number`
29632880
29642881 The width of the display in pixels.
29652882
2883 minimum: 1
2884
29662885 - `name: "computer"`
29672886
29682887 Name of the tool.
29692888
29702889 This is how the tool will be called by the model and in `tool_use` blocks.
29712890
2972 - `"computer"`
2973
29742891 - `type: "computer_20251124"`
29752892
2976 - `"computer_20251124"`
2977
29782893 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29792894
29802895 - `"direct"`
from line 2912
29972912
29982913 The X11 display number (e.g. 0, 1) for the display.
29992914
2915 minimum: 0
2916
30002917 - `enable_zoom: optional boolean`
30012918
30022919 Whether to enable an action to take a zoomed-in screenshot of the screen.
from line 2924
30072924
30082925 When true, guarantees schema validation on tool names and inputs
30092926
3010 - `BetaComputerToolset20260801 object { type, allowed_callers, cache_control, configs }`
2927 - `BetaComputerToolset20260801 object`
30112928
30122929 The computer toolset: a single `tools[]` entry (carrying no
30132930 `name`) that declares the computer tool family. The model is
from line 2937
30202937
30212938 - `type: "computer_toolset_20260801"`
30222939
3023 - `"computer_toolset_20260801"`
3024
30252940 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
30262941
30272942 - `"direct"`
from line 3164
32493164
32503165 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.
32513166
3252 - `BetaToolTextEditor20250124 object { name, type, allowed_callers, 4 more }`
3167 - `BetaToolTextEditor20250124 object`
32533168
32543169 - `name: "str_replace_editor"`
32553170
from line 3172
32573172
32583173 This is how the tool will be called by the model and in `tool_use` blocks.
32593174
3260 - `"str_replace_editor"`
3261
32623175 - `type: "text_editor_20250124"`
32633176
3264 - `"text_editor_20250124"`
3265
32663177 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32673178
32683179 - `"direct"`
from line 3198
32873198
32883199 When true, guarantees schema validation on tool names and inputs
32893200
3290 - `BetaToolTextEditor20250429 object { name, type, allowed_callers, 4 more }`
3201 - `BetaToolTextEditor20250429 object`
32913202
32923203 - `name: "str_replace_based_edit_tool"`
32933204
from line 3206
32953206
32963207 This is how the tool will be called by the model and in `tool_use` blocks.
32973208
3298 - `"str_replace_based_edit_tool"`
3299
33003209 - `type: "text_editor_20250429"`
33013210
3302 - `"text_editor_20250429"`
3303
33043211 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33053212
33063213 - `"direct"`
from line 3232
33253232
33263233 When true, guarantees schema validation on tool names and inputs
33273234
3328 - `BetaToolTextEditor20250728 object { name, type, allowed_callers, 5 more }`
3235 - `BetaToolTextEditor20250728 object`
33293236
33303237 - `name: "str_replace_based_edit_tool"`
33313238
from line 3240
33333240
33343241 This is how the tool will be called by the model and in `tool_use` blocks.
33353242
3336 - `"str_replace_based_edit_tool"`
3337
33383243 - `type: "text_editor_20250728"`
33393244
3340 - `"text_editor_20250728"`
3341
33423245 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33433246
33443247 - `"direct"`
from line 3266
33633266
33643267 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
33653268
3269 minimum: 1
3270
33663271 - `strict: optional boolean`
33673272
33683273 When true, guarantees schema validation on tool names and inputs
33693274
3370 - `BetaWebSearchTool20250305 object { name, type, allowed_callers, 7 more }`
3275 - `BetaWebSearchTool20250305 object`
33713276
33723277 - `name: "web_search"`
33733278
from line 3280
33753280
33763281 This is how the tool will be called by the model and in `tool_use` blocks.
33773282
3378 - `"web_search"`
3379
33803283 - `type: "web_search_20250305"`
33813284
3382 - `"web_search_20250305"`
3383
33843285 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33853286
33863287 - `"direct"`
from line 3312
34113312
34123313 Maximum number of times the tool can be used in the API request.
34133314
3315 exclusiveMinimum: 0
3316
34143317 - `strict: optional boolean`
34153318
34163319 When true, guarantees schema validation on tool names and inputs
from line 3324
34213324
34223325 - `type: "approximate"`
34233326
3424 - `"approximate"`
3425
34263327 - `city: optional string or null`
34273328
34283329 The city of the user.
34293330
3331 maxLength: 255, minLength: 1
3332
34303333 - `country: optional string or null`
34313334
34323335 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
34333336
3337 maxLength: 2, minLength: 2
3338
34343339 - `region: optional string or null`
34353340
34363341 The region of the user.
34373342
3343 maxLength: 255, minLength: 1
3344
34383345 - `timezone: optional string or null`
34393346
34403347 The [IANA timezone](https://nodatime.org/TimeZones) of the user.
34413348
3442 - `BetaWebFetchTool20250910 object { name, type, allowed_callers, 8 more }`
3349 maxLength: 255, minLength: 1
3350
3351 - `BetaWebFetchTool20250910 object`
34433352
34443353 - `name: "web_fetch"`
34453354
from line 3356
34473356
34483357 This is how the tool will be called by the model and in `tool_use` blocks.
34493358
3450 - `"web_fetch"`
3451
34523359 - `type: "web_fetch_20250910"`
34533360
3454 - `"web_fetch_20250910"`
3455
34563361 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34573362
34583363 - `"direct"`
from line 3392
34873392
34883393 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
34893394
3395 exclusiveMinimum: 0
3396
34903397 - `max_uses: optional number or null`
34913398
34923399 Maximum number of times the tool can be used in the API request.
34933400
3401 exclusiveMinimum: 0
3402
34943403 - `strict: optional boolean`
34953404
34963405 When true, guarantees schema validation on tool names and inputs
34973406
3498 - `BetaWebSearchTool20260209 object { name, type, allowed_callers, 7 more }`
3407 - `BetaWebSearchTool20260209 object`
34993408
35003409 - `name: "web_search"`
35013410
from line 3412
35033412
35043413 This is how the tool will be called by the model and in `tool_use` blocks.
35053414
3506 - `"web_search"`
3507
35083415 - `type: "web_search_20260209"`
35093416
3510 - `"web_search_20260209"`
3511
35123417 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35133418
35143419 - `"direct"`
from line 3444
35393444
35403445 Maximum number of times the tool can be used in the API request.
35413446
3447 exclusiveMinimum: 0
3448
35423449 - `strict: optional boolean`
35433450
35443451 When true, guarantees schema validation on tool names and inputs
from line 3454
35473454
35483455 Parameters for the user's location. Used to provide more relevant search results.
35493456
3550 - `BetaWebFetchTool20260209 object { name, type, allowed_callers, 8 more }`
3457 - `BetaWebFetchTool20260209 object`
35513458
35523459 - `name: "web_fetch"`
35533460
from line 3462
35553462
35563463 This is how the tool will be called by the model and in `tool_use` blocks.
35573464
3558 - `"web_fetch"`
3559
35603465 - `type: "web_fetch_20260209"`
35613466
3562 - `"web_fetch_20260209"`
3563
35643467 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35653468
35663469 - `"direct"`
from line 3498
35953498
35963499 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
35973500
3501 exclusiveMinimum: 0
3502
35983503 - `max_uses: optional number or null`
35993504
36003505 Maximum number of times the tool can be used in the API request.
36013506
3507 exclusiveMinimum: 0
3508
36023509 - `strict: optional boolean`
36033510
36043511 When true, guarantees schema validation on tool names and inputs
36053512
3606 - `BetaWebFetchTool20260309 object { name, type, allowed_callers, 9 more }`
3513 - `BetaWebFetchTool20260309 object`
36073514
36083515 Web fetch tool with use_cache parameter for bypassing cached content.
36093516
from line 3520
36133520
36143521 This is how the tool will be called by the model and in `tool_use` blocks.
36153522
3616 - `"web_fetch"`
3617
36183523 - `type: "web_fetch_20260309"`
36193524
3620 - `"web_fetch_20260309"`
3621
36223525 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36233526
36243527 - `"direct"`
from line 3556
36533556
36543557 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
36553558
3559 exclusiveMinimum: 0
3560
36563561 - `max_uses: optional number or null`
36573562
36583563 Maximum number of times the tool can be used in the API request.
36593564
3565 exclusiveMinimum: 0
3566
36603567 - `strict: optional boolean`
36613568
36623569 When true, guarantees schema validation on tool names and inputs
from line 3572
36653572
36663573 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
36673574
3668 - `BetaWebSearchTool20260318 object { name, type, allowed_callers, 8 more }`
3575 - `BetaWebSearchTool20260318 object`
36693576
36703577 - `name: "web_search"`
36713578
from line 3580
36733580
36743581 This is how the tool will be called by the model and in `tool_use` blocks.
36753582
3676 - `"web_search"`
3677
36783583 - `type: "web_search_20260318"`
36793584
3680 - `"web_search_20260318"`
3681
36823585 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36833586
36843587 - `"direct"`
from line 3612
37093612
37103613 Maximum number of times the tool can be used in the API request.
37113614
3615 exclusiveMinimum: 0
3616
37123617 - `response_inclusion: optional "full" or "excluded"`
37133618
37143619 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 3630
37253630
37263631 Parameters for the user's location. Used to provide more relevant search results.
37273632
3728 - `BetaWebFetchTool20260318 object { name, type, allowed_callers, 10 more }`
3633 - `BetaWebFetchTool20260318 object`
37293634
37303635 - `name: "web_fetch"`
37313636
from line 3638
37333638
37343639 This is how the tool will be called by the model and in `tool_use` blocks.
37353640
3736 - `"web_fetch"`
3737
37383641 - `type: "web_fetch_20260318"`
37393642
3740 - `"web_fetch_20260318"`
3741
37423643 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
37433644
37443645 - `"direct"`
from line 3674
37733674
37743675 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
37753676
3677 exclusiveMinimum: 0
3678
37763679 - `max_uses: optional number or null`
37773680
37783681 Maximum number of times the tool can be used in the API request.
37793682
3683 exclusiveMinimum: 0
3684
37803685 - `response_inclusion: optional "full" or "excluded"`
37813686
37823687 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 3698
37933698
37943699 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
37953700
3796 - `BetaAdvisorTool20260301 object { model, name, type, 7 more }`
3701 - `BetaAdvisorTool20260301 object`
37973702
37983703 - `model: Model`
37993704
from line 3712
38073712
38083713 This is how the tool will be called by the model and in `tool_use` blocks.
38093714
3810 - `"advisor"`
3811
38123715 - `type: "advisor_20260301"`
38133716
3814 - `"advisor_20260301"`
3815
38163717 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38173718
38183719 - `"direct"`
from line 3740
38393740
38403741 Bounds the advisor's total output (thinking + text) per call. When the advisor hits this cap, the returned advisor_result or advisor_redacted_result block carries stop_reason='max_tokens', and a truncation note is appended to the advice text the worker model sees (inside the encrypted blob in redacted mode). When set, the server also emits a remaining-tokens budget block in the advisor's prompt so the advisor self-shapes toward the cap. When omitted, the advisor model's default output cap applies and no budget block is emitted.
38413742
3743 minimum: 1024
3744
38423745 - `max_uses: optional number or null`
38433746
38443747 Maximum number of times the tool can be used in the API request.
38453748
3749 exclusiveMinimum: 0
3750
38463751 - `strict: optional boolean`
38473752
38483753 When true, guarantees schema validation on tool names and inputs
38493754
3850 - `BetaToolSearchToolBm25_20251119 object { name, type, allowed_callers, 3 more }`
3755 - `BetaToolSearchToolBm25_20251119 object`
38513756
38523757 - `name: "tool_search_tool_bm25"`
38533758
from line 3760
38553760
38563761 This is how the tool will be called by the model and in `tool_use` blocks.
38573762
3763 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3764
3765 - `"tool_search_tool_bm25_20251119"`
3766
38583767 - `"tool_search_tool_bm25"`
38593768
3860 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3861
3862 - `"tool_search_tool_bm25_20251119"`
3863
3864 - `"tool_search_tool_bm25"`
3865
38663769 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38673770
38683771 - `"direct"`
from line 3788
38853788
38863789 When true, guarantees schema validation on tool names and inputs
38873790
3888 - `BetaToolSearchToolRegex20251119 object { name, type, allowed_callers, 3 more }`
3791 - `BetaToolSearchToolRegex20251119 object`
38893792
38903793 - `name: "tool_search_tool_regex"`
38913794
from line 3796
38933796
38943797 This is how the tool will be called by the model and in `tool_use` blocks.
38953798
3799 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3800
3801 - `"tool_search_tool_regex_20251119"`
3802
38963803 - `"tool_search_tool_regex"`
38973804
3898 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3899
3900 - `"tool_search_tool_regex_20251119"`
3901
3902 - `"tool_search_tool_regex"`
3903
39043805 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
39053806
39063807 - `"direct"`
from line 3824
39233824
39243825 When true, guarantees schema validation on tool names and inputs
39253826
3926 - `BetaMCPToolset object { mcp_server_name, type, cache_control, 2 more }`
3827 - `BetaMCPToolset object`
39273828
39283829 Configuration for a group of tools from an MCP server.
39293830
from line 3835
39343835
39353836 Name of the MCP server to configure tools for
39363837
3838 maxLength: 255, minLength: 1
3839
39373840 - `type: "mcp_toolset"`
39383841
3939 - `"mcp_toolset"`
3940
39413842 - `cache_control: optional BetaCacheControlEphemeral or null`
39423843
39433844 Create a cache control breakpoint at this content block.
from line 3859
39583859
39593860 - `enabled: optional boolean`
39603861
3862 - `output_format: optional BetaJSONOutputFormat or null`
3863
3864 **Deprecated**
3865
3866 Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
3867
3868 A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
3869
3870 - `temperature: optional number`
3871
3872 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
3873
3874 Amount of randomness injected into the response.
3875
3876 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.
3877
3878 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
3879
3880 maximum: 1, minimum: 0
3881
39613882 - `top_k: optional number`
39623883
3884 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
3885
39633886 Only sample from the top K options for each subsequent token.
39643887
39653888 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
39663889
39673890 Recommended for advanced use cases only.
39683891
3892 minimum: 0
3893
39693894 - `top_p: optional number`
39703895
3896 **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.
3897
39713898 Use nucleus sampling.
39723899
39733900 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`.
39743901
39753902 Recommended for advanced use cases only.
39763903
3977### Returns
3978
3979- `BetaMessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
3904 maximum: 1, minimum: 0
3905
3906## Returns
3907
3908- `BetaMessageBatch object`
39803909
39813910 - `id: string`
39823911
from line 3917
39883917
39893918 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
39903919
3920 format: date-time
3921
39913922 - `cancel_initiated_at: string or null`
39923923
39933924 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
39943925
3926 format: date-time
3927
39953928 - `created_at: string`
39963929
39973930 RFC 3339 datetime string representing the time at which the Message Batch was created.
39983931
3932 format: date-time
3933
39993934 - `ended_at: string or null`
40003935
40013936 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
40023937
40033938 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
40043939
3940 format: date-time
3941
40053942 - `expires_at: string`
40063943
40073944 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
40083945
3946 format: date-time
3947
40093948 - `processing_status: "in_progress" or "canceling" or "ended"`
40103949
40113950 Processing status of the Message Batch.
from line 3967
40283967
40293968 This is zero until processing of the entire Message Batch has ended.
40303969
3970 default: 0
3971
40313972 - `errored: number`
40323973
40333974 Number of requests in the Message Batch that encountered an error.
40343975
40353976 This is zero until processing of the entire Message Batch has ended.
40363977
3978 default: 0
3979
40373980 - `expired: number`
40383981
40393982 Number of requests in the Message Batch that have expired.
40403983
40413984 This is zero until processing of the entire Message Batch has ended.
40423985
3986 default: 0
3987
40433988 - `processing: number`
40443989
40453990 Number of requests in the Message Batch that are processing.
40463991
3992 default: 0
3993
40473994 - `succeeded: number`
40483995
40493996 Number of requests in the Message Batch that have completed successfully.
40503997
40513998 This is zero until processing of the entire Message Batch has ended.
40523999
4000 default: 0
4001
40534002 - `results_url: string or null`
40544003
40554004 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 4011
40624011
40634012 For Message Batches, this is always `"message_batch"`.
40644013
4065 - `"message_batch"`
4066
4067### Example
4068
4069```http
4014 default: message_batch
4015
4016## Example
4017
4018```bash
40704019curl https://api.anthropic.com/v1/messages/batches \
40714020 -H 'Content-Type: application/json' \
40724021 -H 'anthropic-version: 2023-06-01' \
from line 4040
40914040 }'
40924041```
40934042
4094#### Response
4043### Response (200)
40954044
40964045```json
40974046{
40984047
No line in this hunk matches that.