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
3url: https://platform.claude.com/docs/en/api/beta/messages/create
4---
5
6## Create a Message
7
8**post** `/v1/messages`
1# Create a Message
2
3**POST** `/v1/messages`
94
105Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
116
from line 8
138
149Learn more about the Messages API in our [user guide](https://platform.claude.com/docs/en/get-started)
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 this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.
9792
98### Body Parameters
93## Body parameters
9994
10095- `max_tokens: number`
10196
from line 101
106101 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.
107102
108103 Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
104
105 minimum: 0
109106
110107- `messages: array of BetaMessageParam`
111108
from line 161
164161
165162 - `array of BetaContentBlockParam`
166163
167 - `BetaTextBlockParam object { text, type, cache_control, citations }`
164 - `BetaTextBlockParam object`
168165
169166 - `text: string`
170167
168 minLength: 1
169
171170 - `type: "text"`
172171
173 - `"text"`
174
175172 - `cache_control: optional BetaCacheControlEphemeral or null`
176173
177174 Create a cache control breakpoint at this content block.
178175
179176 - `type: "ephemeral"`
180
181 - `"ephemeral"`
182177
183178 - `ttl: optional "5m" or "1h"`
184179
from line 192
197192
198193 - `citations: optional array of BetaTextCitationParam or null`
199194
200 - `BetaCitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
195 - `BetaCitationCharLocationParam object`
201196
202197 - `cited_text: string`
203198
204199 - `document_index: number`
205200
201 minimum: 0
202
206203 - `document_title: string or null`
207204
205 maxLength: 500, minLength: 1
206
208207 - `end_char_index: number`
209208
210209 - `start_char_index: number`
211210
211 minimum: 0
212
212213 - `type: "char_location"`
213214
214 - `"char_location"`
215
216 - `BetaCitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
215 - `BetaCitationPageLocationParam 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_page_number: number`
225228
226229 - `start_page_number: number`
227230
231 minimum: 1
232
228233 - `type: "page_location"`
229234
230 - `"page_location"`
231
232 - `BetaCitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
235 - `BetaCitationContentBlockLocationParam object`
233236
234237 - `cited_text: string`
235238
from line 242
239242
240243 - `document_index: number`
241244
245 minimum: 0
246
242247 - `document_title: string or null`
243248
249 maxLength: 500, minLength: 1
250
244251 - `end_block_index: number`
245252
246253 Exclusive 0-based end index of the cited block range in the source's `content` array.
from line 258
251258
252259 0-based index of the first cited block in the source's `content` array.
253260
261 minimum: 0
262
254263 - `type: "content_block_location"`
255264
256 - `"content_block_location"`
257
258 - `BetaCitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
265 - `BetaCitationWebSearchResultLocationParam object`
259266
260267 - `cited_text: string`
261268
from line 270
263270
264271 - `title: string or null`
265272
273 maxLength: 512, minLength: 1
274
266275 - `type: "web_search_result_location"`
267276
268 - `"web_search_result_location"`
269
270277 - `url: string`
271278
272 - `BetaCitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
279 minLength: 1
280
281 - `BetaCitationSearchResultLocationParam object`
273282
274283 - `cited_text: string`
275284
from line 298
289298
290299 Counted separately from `document_index`; server-side web search results are not included in this count.
291300
301 minimum: 0
302
292303 - `source: string`
293304
294305 - `start_block_index: number`
295306
296307 0-based index of the first cited block in the source's `content` array.
297308
309 minimum: 0
310
298311 - `title: string or null`
299312
300313 - `type: "search_result_location"`
301314
302 - `"search_result_location"`
303
304 - `BetaImageBlockParam object { source, type, cache_control, transformations }`
315 - `BetaImageBlockParam object`
305316
306317 - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
307318
308 - `BetaBase64ImageSource object { data, media_type, type }`
319 - `BetaBase64ImageSource object`
309320
310321 - `data: string`
311322
323 format: byte
324
312325 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
313326
314327 - `"image/jpeg"`
from line 334
321334
322335 - `type: "base64"`
323336
324 - `"base64"`
325
326 - `BetaURLImageSource object { type, url }`
337 - `BetaURLImageSource object`
327338
328339 - `type: "url"`
329340
330 - `"url"`
331
332341 - `url: string`
333342
334 - `BetaFileImageSource object { file_id, type }`
343 - `BetaFileImageSource object`
335344
336345 - `file_id: string`
337346
338347 - `type: "file"`
339348
340 - `"file"`
341
342349 - `type: "image"`
343350
344 - `"image"`
345
346351 - `cache_control: optional BetaCacheControlEphemeral or null`
347352
348353 Create a cache control breakpoint at this content block.
from line 364
359364
360365 - `"error"`
361366
362 - `BetaRequestDocumentBlock object { source, type, cache_control, 3 more }`
367 - `BetaRequestDocumentBlock object`
363368
364369 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
365370
366 - `BetaBase64PDFSource object { data, media_type, type }`
371 - `BetaBase64PDFSource object`
367372
368373 - `data: string`
369374
375 format: byte
376
370377 - `media_type: "application/pdf"`
371378
372 - `"application/pdf"`
373
374379 - `type: "base64"`
375380
376 - `"base64"`
377
378 - `BetaPlainTextSource object { data, media_type, type }`
381 - `BetaPlainTextSource object`
379382
380383 - `data: string`
381384
382385 - `media_type: "text/plain"`
383386
384 - `"text/plain"`
385
386387 - `type: "text"`
387388
388 - `"text"`
389
390 - `BetaContentBlockSource object { content, type }`
389 - `BetaContentBlockSource object`
391390
392391 - `content: string or array of BetaContentBlockSourceContent`
393392
from line 394
395394
396395 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
397396
398 - `BetaTextBlockParam object { text, type, cache_control, citations }`
399
400 - `BetaImageBlockParam object { source, type, cache_control, transformations }`
397 - `BetaTextBlockParam object`
398
399 - `BetaImageBlockParam object`
401400
402401 - `type: "content"`
403402
404 - `"content"`
405
406 - `BetaURLPDFSource object { type, url }`
403 - `BetaURLPDFSource object`
407404
408405 - `type: "url"`
409406
410 - `"url"`
411
412407 - `url: string`
413408
414 - `BetaFileDocumentSource object { file_id, type }`
409 - `BetaFileDocumentSource object`
415410
416411 - `file_id: string`
417412
418413 - `type: "file"`
419414
420 - `"file"`
421
422415 - `type: "document"`
423416
424 - `"document"`
425
426417 - `cache_control: optional BetaCacheControlEphemeral or null`
427418
428419 Create a cache control breakpoint at this content block.
from line 424
433424
434425 - `context: optional string or null`
435426
427 minLength: 1
428
436429 - `title: optional string or null`
437430
438 - `BetaSearchResultBlockParam object { content, source, title, 3 more }`
431 maxLength: 500, minLength: 1
432
433 - `BetaSearchResultBlockParam object`
439434
440435 - `content: array of BetaTextBlockParam`
441436
442437 - `text: string`
443438
439 minLength: 1
440
444441 - `type: "text"`
445442
446443 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 452
455452
456453 - `type: "search_result"`
457454
458 - `"search_result"`
459
460455 - `cache_control: optional BetaCacheControlEphemeral or null`
461456
462457 Create a cache control breakpoint at this content block.
463458
464459 - `citations: optional BetaCitationsConfigParam`
465460
466 - `BetaThinkingBlockParam object { signature, thinking, type }`
461 - `BetaThinkingBlockParam object`
467462
468463 - `signature: string`
469464
from line 472
477472
478473 - `type: "thinking"`
479474
480 - `"thinking"`
481
482 - `BetaRedactedThinkingBlockParam object { data, type }`
475 - `BetaRedactedThinkingBlockParam object`
483476
484477 - `data: string`
485478
from line 480
487480
488481 - `type: "redacted_thinking"`
489482
490 - `"redacted_thinking"`
491
492 - `BetaToolUseBlockParam object { id, input, name, 4 more }`
483 - `BetaToolUseBlockParam object`
493484
494485 - `id: string`
495486
487 pattern: ^[a-zA-Z0-9_-]+$
488
496489 - `input: map[unknown]`
497490
498491 - `name: string`
499492
493 maxLength: 200, minLength: 1
494
500495 - `type: "tool_use"`
501496
502 - `"tool_use"`
503
504497 - `cache_control: optional BetaCacheControlEphemeral or null`
505498
506499 Create a cache control breakpoint at this content block.
from line 502
509502
510503 Tool invocation directly from the model.
511504
512 - `BetaDirectCaller object { type }`
505 - `BetaDirectCaller object`
513506
514507 Tool invocation directly from the model.
515508
516509 - `type: "direct"`
517510
518 - `"direct"`
519
520 - `BetaServerToolCaller object { tool_id, type }`
511 - `BetaServerToolCaller object`
521512
522513 Tool invocation generated by a server-side tool.
523514
524515 - `tool_id: string`
525516
517 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
518
526519 - `type: "code_execution_20250825"`
527520
528 - `"code_execution_20250825"`
529
530 - `BetaServerToolCaller20260120 object { tool_id, type }`
521 - `BetaServerToolCaller20260120 object`
531522
532523 - `tool_id: string`
533524
525 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
526
534527 - `type: "code_execution_20260120"`
535528
536 - `"code_execution_20260120"`
537
538529 - `toolset_name: optional string or null`
539530
540531 For a toolset member tool_use, the toolset family this member belongs to.
541532
542 - `BetaToolResultBlockParam object { tool_use_id, type, cache_control, 3 more }`
533 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
534
535 - `BetaToolResultBlockParam object`
543536
544537 - `tool_use_id: string`
545538
539 pattern: ^[a-zA-Z0-9_-]+$
540
546541 - `type: "tool_result"`
547542
548 - `"tool_result"`
549
550543 - `cache_control: optional BetaCacheControlEphemeral or null`
551544
552545 Create a cache control breakpoint at this content block.
from line 550
557550
558551 - `array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 3 more`
559552
560 - `BetaTextBlockParam object { text, type, cache_control, citations }`
561
562 - `BetaImageBlockParam object { source, type, cache_control, transformations }`
563
564 - `BetaSearchResultBlockParam object { content, source, title, 3 more }`
565
566 - `BetaRequestDocumentBlock object { source, type, cache_control, 3 more }`
567
568 - `BetaToolReferenceBlockParam object { tool_name, type, cache_control }`
553 - `BetaTextBlockParam object`
554
555 - `BetaImageBlockParam object`
556
557 - `BetaSearchResultBlockParam object`
558
559 - `BetaRequestDocumentBlock object`
560
561 - `BetaToolReferenceBlockParam object`
569562
570563 Tool reference block that can be included in tool_result content.
571564
572565 - `tool_name: string`
573566
567 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
568
574569 - `type: "tool_reference"`
575570
576 - `"tool_reference"`
577
578571 - `cache_control: optional BetaCacheControlEphemeral or null`
579572
580573 Create a cache control breakpoint at this content block.
581574
582 - `BetaBrowserStateBlockParam object { tabs, type, cache_control, state_changes }`
575 - `BetaBrowserStateBlockParam object`
583576
584577 The caller's browser state after a browser toolset member call —
585578 the full inventory of open tabs, which tab is active, and any side
from line 586
593586
594587 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`.
595588
589 maxItems: 100
590
596591 - `tab_id: string`
597592
598593 The caller-assigned identifier for this tab, unique within the inventory.
599594
595 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
596
600597 - `title: string`
601598
602599 The title of the page the tab is showing. May be empty.
603600
601 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
602
604603 - `url: string`
605604
606605 The URL of the page the tab is showing. May be empty.
607606
607 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
608
608609 - `active: optional boolean`
609610
610611 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
611612
612613 - `type: "browser_state"`
613614
614 - `"browser_state"`
615
616615 - `cache_control: optional BetaCacheControlEphemeral or null`
617616
618617 Create a cache control breakpoint at this content block.
from line 620
621620
622621 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
623622
624 - `BetaBrowserStateChangeTabOpened object { tab_id, type }`
623 maxItems: 200, minItems: 1
624
625 - `BetaBrowserStateChangeTabOpened object`
625626
626627 A tab this call's execution opened that remains open at its end —
627628 the creation delta of the `tabs` inventory, not an event log.
from line 636
635636
636637 The `tab_id` of the opened tab, present in `tabs`.
637638
639 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
640
638641 - `type: "tab_opened"`
639642
640 - `"tab_opened"`
641
642 - `BetaBrowserStateChangeDownloadStarted object { download_id, type, url }`
643 - `BetaBrowserStateChangeDownloadStarted object`
643644
644645 A file download that started during this call.
645646
from line 648
647648
648649 The caller-assigned identifier for this download, stable across the state changes reporting it.
649650
651 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
652
650653 - `type: "download_started"`
651654
652 - `"download_started"`
653
654655 - `url: string`
655656
656657 The final post-redirect URL the download was served from.
657658
658 - `BetaBrowserStateChangeDownloadCompleted object { download_id, type, url, 2 more }`
659 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
660
661 - `BetaBrowserStateChangeDownloadCompleted object`
659662
660663 A file download that finished during this call, reported with the
661664 same `download_id` as its `download_started` — or without a prior
from line 669
666669
667670 The caller-assigned identifier for this download, stable across the state changes reporting it.
668671
672 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
673
669674 - `type: "download_completed"`
670675
671 - `"download_completed"`
672
673676 - `url: string`
674677
675678 The final post-redirect URL the download was served from.
676679
680 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
681
677682 - `path: optional string or null`
678683
679684 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.
680685
686 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
687
681688 - `size_bytes: optional number or null`
682689
683690 The completed download's size.
684691
685 - `BetaBrowserStateChangeDownloadFailed object { download_id, type, url, error }`
692 minimum: 0
693
694 - `BetaBrowserStateChangeDownloadFailed object`
686695
687696 A file download that failed — or was cancelled — during this call.
688697
from line 699
690699
691700 The caller-assigned identifier for this download, stable across the state changes reporting it.
692701
702 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
703
693704 - `type: "download_failed"`
694705
695 - `"download_failed"`
696
697706 - `url: string`
698707
699708 The final post-redirect URL the download was served from.
700709
710 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
711
701712 - `error: optional string or null`
702713
703714 The failure or cancellation detail, when known.
704715
716 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
717
705718 - `is_error: optional boolean`
706719
707720 - `toolset_name: optional string or null`
708721
709722 For a toolset member tool_result, the toolset family of the paired tool_use.
710723
711 - `BetaServerToolUseBlockParam object { id, input, name, 3 more }`
724 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
725
726 - `BetaServerToolUseBlockParam object`
712727
713728 - `id: string`
714729
730 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
731
715732 - `input: map[unknown]`
716733
717734 - `name: "advisor" or "web_search" or "web_fetch" or 5 more`
from line 751
734751
735752 - `type: "server_tool_use"`
736753
737 - `"server_tool_use"`
738
739754 - `cache_control: optional BetaCacheControlEphemeral or null`
740755
741756 Create a cache control breakpoint at this content block.
from line 759
744759
745760 Tool invocation directly from the model.
746761
747 - `BetaDirectCaller object { type }`
762 - `BetaDirectCaller object`
748763
749764 Tool invocation directly from the model.
750765
751 - `BetaServerToolCaller object { tool_id, type }`
766 - `BetaServerToolCaller object`
752767
753768 Tool invocation generated by a server-side tool.
754769
755 - `BetaServerToolCaller20260120 object { tool_id, type }`
756
757 - `BetaWebSearchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
770 - `BetaServerToolCaller20260120 object`
771
772 - `BetaWebSearchToolResultBlockParam object`
758773
759774 - `content: BetaWebSearchToolResultBlockParamContent`
760775
from line 781
766781
767782 - `type: "web_search_result"`
768783
769 - `"web_search_result"`
770
771784 - `url: string`
772785
773786 - `page_age: optional string or null`
774787
775 - `BetaWebSearchToolRequestError object { error_code, type }`
788 - `BetaWebSearchToolRequestError object`
776789
777790 - `error_code: BetaWebSearchToolResultErrorCode`
778791
from line 803
790803
791804 - `type: "web_search_tool_result_error"`
792805
793 - `"web_search_tool_result_error"`
794
795806 - `tool_use_id: string`
796807
808 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
809
797810 - `type: "web_search_tool_result"`
798811
799 - `"web_search_tool_result"`
800
801812 - `cache_control: optional BetaCacheControlEphemeral or null`
802813
803814 Create a cache control breakpoint at this content block.
from line 817
806817
807818 Tool invocation directly from the model.
808819
809 - `BetaDirectCaller object { type }`
820 - `BetaDirectCaller object`
810821
811822 Tool invocation directly from the model.
812823
813 - `BetaServerToolCaller object { tool_id, type }`
824 - `BetaServerToolCaller object`
814825
815826 Tool invocation generated by a server-side tool.
816827
817 - `BetaServerToolCaller20260120 object { tool_id, type }`
818
819 - `BetaWebFetchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
828 - `BetaServerToolCaller20260120 object`
829
830 - `BetaWebFetchToolResultBlockParam object`
820831
821832 - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
822833
823 - `BetaWebFetchToolResultErrorBlockParam object { error_code, type }`
834 - `BetaWebFetchToolResultErrorBlockParam object`
824835
825836 - `error_code: BetaWebFetchToolResultErrorCode`
826837
from line 855
844855
845856 - `type: "web_fetch_tool_result_error"`
846857
847 - `"web_fetch_tool_result_error"`
848
849 - `BetaWebFetchBlockParam object { content, type, url, retrieved_at }`
858 - `BetaWebFetchBlockParam object`
850859
851860 - `content: BetaRequestDocumentBlock`
852861
853862 - `type: "web_fetch_result"`
854863
855 - `"web_fetch_result"`
856
857864 - `url: string`
858865
859866 Fetched content URL
from line 871
864871
865872 - `tool_use_id: string`
866873
874 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
875
867876 - `type: "web_fetch_tool_result"`
868877
869 - `"web_fetch_tool_result"`
870
871878 - `cache_control: optional BetaCacheControlEphemeral or null`
872879
873880 Create a cache control breakpoint at this content block.
from line 883
876883
877884 Tool invocation directly from the model.
878885
879 - `BetaDirectCaller object { type }`
886 - `BetaDirectCaller object`
880887
881888 Tool invocation directly from the model.
882889
883 - `BetaServerToolCaller object { tool_id, type }`
890 - `BetaServerToolCaller object`
884891
885892 Tool invocation generated by a server-side tool.
886893
887 - `BetaServerToolCaller20260120 object { tool_id, type }`
888
889 - `BetaAdvisorToolResultBlockParam object { content, tool_use_id, type, cache_control }`
894 - `BetaServerToolCaller20260120 object`
895
896 - `BetaAdvisorToolResultBlockParam object`
890897
891898 - `content: BetaAdvisorToolResultErrorParam or BetaAdvisorResultBlockParam or BetaAdvisorRedactedResultBlockParam`
892899
893 - `BetaAdvisorToolResultErrorParam object { error_code, type }`
900 - `BetaAdvisorToolResultErrorParam object`
894901
895902 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
896903
from line 917
910917
911918 - `type: "advisor_tool_result_error"`
912919
913 - `"advisor_tool_result_error"`
914
915 - `BetaAdvisorResultBlockParam object { text, type, stop_reason }`
920 - `BetaAdvisorResultBlockParam object`
916921
917922 - `text: string`
918923
919924 - `type: "advisor_result"`
920925
921 - `"advisor_result"`
922
923926 - `stop_reason: optional string or null`
924927
925 - `BetaAdvisorRedactedResultBlockParam object { encrypted_content, type, stop_reason }`
928 - `BetaAdvisorRedactedResultBlockParam object`
926929
927930 - `encrypted_content: string`
928931
from line 933
930933
931934 - `type: "advisor_redacted_result"`
932935
933 - `"advisor_redacted_result"`
934
935936 - `stop_reason: optional string or null`
936937
937938 - `tool_use_id: string`
938939
940 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
941
939942 - `type: "advisor_tool_result"`
940943
941 - `"advisor_tool_result"`
942
943944 - `cache_control: optional BetaCacheControlEphemeral or null`
944945
945946 Create a cache control breakpoint at this content block.
946947
947 - `BetaCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
948 - `BetaCodeExecutionToolResultBlockParam object`
948949
949950 - `content: BetaCodeExecutionToolResultBlockParamContent`
950951
951952 Code execution result with encrypted stdout for PFC + web_search results.
952953
953 - `BetaCodeExecutionToolResultErrorParam object { error_code, type }`
954 - `BetaCodeExecutionToolResultErrorParam object`
954955
955956 - `error_code: BetaCodeExecutionToolResultErrorCode`
956957
from line 965
964965
965966 - `type: "code_execution_tool_result_error"`
966967
967 - `"code_execution_tool_result_error"`
968
969 - `BetaCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
968 - `BetaCodeExecutionResultBlockParam object`
970969
971970 - `content: array of BetaCodeExecutionOutputBlockParam`
972971
from line 973
974973
975974 - `type: "code_execution_output"`
976975
977 - `"code_execution_output"`
978
979976 - `return_code: number`
980977
981978 - `stderr: string`
from line 981
984981
985982 - `type: "code_execution_result"`
986983
987 - `"code_execution_result"`
988
989 - `BetaEncryptedCodeExecutionResultBlockParam object { content, encrypted_stdout, return_code, 2 more }`
984 - `BetaEncryptedCodeExecutionResultBlockParam object`
990985
991986 Code execution result with encrypted stdout for PFC + web_search results.
992987
from line 999
1004999
10051000 - `type: "encrypted_code_execution_result"`
10061001
1007 - `"encrypted_code_execution_result"`
1008
10091002 - `tool_use_id: string`
10101003
1004 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1005
10111006 - `type: "code_execution_tool_result"`
10121007
1013 - `"code_execution_tool_result"`
1014
10151008 - `cache_control: optional BetaCacheControlEphemeral or null`
10161009
10171010 Create a cache control breakpoint at this content block.
10181011
1019 - `BetaBashCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1012 - `BetaBashCodeExecutionToolResultBlockParam object`
10201013
10211014 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
10221015
1023 - `BetaBashCodeExecutionToolResultErrorParam object { error_code, type }`
1016 - `BetaBashCodeExecutionToolResultErrorParam object`
10241017
10251018 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10261019
from line 1029
10361029
10371030 - `type: "bash_code_execution_tool_result_error"`
10381031
1039 - `"bash_code_execution_tool_result_error"`
1040
1041 - `BetaBashCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
1032 - `BetaBashCodeExecutionResultBlockParam object`
10421033
10431034 - `content: array of BetaBashCodeExecutionOutputBlockParam`
10441035
from line 1037
10461037
10471038 - `type: "bash_code_execution_output"`
10481039
1049 - `"bash_code_execution_output"`
1050
10511040 - `return_code: number`
10521041
10531042 - `stderr: string`
from line 1045
10561045
10571046 - `type: "bash_code_execution_result"`
10581047
1059 - `"bash_code_execution_result"`
1060
10611048 - `tool_use_id: string`
10621049
1050 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1051
10631052 - `type: "bash_code_execution_tool_result"`
10641053
1065 - `"bash_code_execution_tool_result"`
1066
10671054 - `cache_control: optional BetaCacheControlEphemeral or null`
10681055
10691056 Create a cache control breakpoint at this content block.
10701057
1071 - `BetaTextEditorCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1058 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
10721059
10731060 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
10741061
1075 - `BetaTextEditorCodeExecutionToolResultErrorParam object { error_code, type, error_message }`
1062 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
10761063
10771064 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10781065
from line 1075
10881075
10891076 - `type: "text_editor_code_execution_tool_result_error"`
10901077
1091 - `"text_editor_code_execution_tool_result_error"`
1092
10931078 - `error_message: optional string or null`
10941079
1095 - `BetaTextEditorCodeExecutionViewResultBlockParam object { content, file_type, type, 3 more }`
1080 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
10961081
10971082 - `content: string`
10981083
from line 1091
11061091
11071092 - `type: "text_editor_code_execution_view_result"`
11081093
1109 - `"text_editor_code_execution_view_result"`
1110
11111094 - `num_lines: optional number or null`
11121095
11131096 - `start_line: optional number or null`
11141097
11151098 - `total_lines: optional number or null`
11161099
1117 - `BetaTextEditorCodeExecutionCreateResultBlockParam object { is_file_update, type }`
1100 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
11181101
11191102 - `is_file_update: boolean`
11201103
11211104 - `type: "text_editor_code_execution_create_result"`
11221105
1123 - `"text_editor_code_execution_create_result"`
1124
1125 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object { type, lines, new_lines, 3 more }`
1106 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
11261107
11271108 - `type: "text_editor_code_execution_str_replace_result"`
11281109
1129 - `"text_editor_code_execution_str_replace_result"`
1130
11311110 - `lines: optional array of string or null`
11321111
11331112 - `new_lines: optional number or null`
from line 1119
11401119
11411120 - `tool_use_id: string`
11421121
1122 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1123
11431124 - `type: "text_editor_code_execution_tool_result"`
11441125
1145 - `"text_editor_code_execution_tool_result"`
1146
11471126 - `cache_control: optional BetaCacheControlEphemeral or null`
11481127
11491128 Create a cache control breakpoint at this content block.
11501129
1151 - `BetaToolSearchToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1130 - `BetaToolSearchToolResultBlockParam object`
11521131
11531132 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
11541133
1155 - `BetaToolSearchToolResultErrorParam object { error_code, type, error_message }`
1134 - `BetaToolSearchToolResultErrorParam object`
11561135
11571136 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
11581137
from line 1145
11661145
11671146 - `type: "tool_search_tool_result_error"`
11681147
1169 - `"tool_search_tool_result_error"`
1170
11711148 - `error_message: optional string or null`
11721149
1173 - `BetaToolSearchToolSearchResultBlockParam object { tool_references, type }`
1150 - `BetaToolSearchToolSearchResultBlockParam object`
11741151
11751152 - `tool_references: array of BetaToolReferenceBlockParam`
11761153
11771154 - `tool_name: string`
11781155
1156 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1157
11791158 - `type: "tool_reference"`
11801159
11811160 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 1163
11841163
11851164 - `type: "tool_search_tool_search_result"`
11861165
1187 - `"tool_search_tool_search_result"`
1188
11891166 - `tool_use_id: string`
11901167
1168 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1169
11911170 - `type: "tool_search_tool_result"`
11921171
1193 - `"tool_search_tool_result"`
1194
11951172 - `cache_control: optional BetaCacheControlEphemeral or null`
11961173
11971174 Create a cache control breakpoint at this content block.
11981175
1199 - `BetaMCPToolUseBlockParam object { id, input, name, 3 more }`
1176 - `BetaMCPToolUseBlockParam object`
12001177
12011178 - `id: string`
12021179
1180 pattern: ^[a-zA-Z0-9_-]+$
1181
12031182 - `input: map[unknown]`
12041183
12051184 - `name: string`
from line 1189
12101189
12111190 - `type: "mcp_tool_use"`
12121191
1213 - `"mcp_tool_use"`
1214
12151192 - `cache_control: optional BetaCacheControlEphemeral or null`
12161193
12171194 Create a cache control breakpoint at this content block.
12181195
1219 - `BetaRequestMCPToolResultBlockParam object { tool_use_id, type, cache_control, 2 more }`
1196 - `BetaRequestMCPToolResultBlockParam object`
12201197
12211198 - `tool_use_id: string`
12221199
1200 pattern: ^[a-zA-Z0-9_-]+$
1201
12231202 - `type: "mcp_tool_result"`
12241203
1225 - `"mcp_tool_result"`
1226
12271204 - `cache_control: optional BetaCacheControlEphemeral or null`
12281205
12291206 Create a cache control breakpoint at this content block.
from line 1213
12361213
12371214 - `text: string`
12381215
1216 minLength: 1
1217
12391218 - `type: "text"`
12401219
12411220 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 1225
12461225
12471226 - `is_error: optional boolean`
12481227
1249 - `BetaContainerUploadBlockParam object { file_id, type, cache_control }`
1228 - `BetaContainerUploadBlockParam object`
12501229
12511230 A content block that represents a file to be uploaded to the container
12521231 Files uploaded via this block will be available in the container's input directory.
from line 1234
12551234
12561235 - `type: "container_upload"`
12571236
1258 - `"container_upload"`
1259
12601237 - `cache_control: optional BetaCacheControlEphemeral or null`
12611238
12621239 Create a cache control breakpoint at this content block.
12631240
1264 - `BetaCompactionBlockParam object { type, cache_control, content, encrypted_content }`
1241 - `BetaCompactionBlockParam object`
12651242
12661243 A compaction block containing summary of previous context.
12671244
from line 1250
12731250
12741251 - `type: "compaction"`
12751252
1276 - `"compaction"`
1277
12781253 - `cache_control: optional BetaCacheControlEphemeral or null`
12791254
12801255 Create a cache control breakpoint at this content block.
from line 1262
12871262
12881263 Opaque metadata from prior compaction, to be round-tripped verbatim
12891264
1290 - `BetaRequestToolAdditionBlock object { tool, type, cache_control }`
1265 - `BetaRequestToolAdditionBlock object`
12911266
12921267 Mid-conversation directive to surface a declared tool.
12931268
from line 1277
13021277 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13031278 `mcp_toolset_reference` for those.
13041279
1305 - `BetaToolChangeToolReference object { name, type }`
1280 - `BetaToolChangeToolReference object`
13061281
13071282 Reference to a single tool the caller declared directly in
13081283 `tools[]`. Does not accept the composed `{server}_{name}` form the
from line 1286
13111286
13121287 - `name: string`
13131288
1289 pattern: ^[a-zA-Z0-9_-]{1,128}$
1290
13141291 - `type: "tool_reference"`
13151292
1316 - `"tool_reference"`
1317
1318 - `BetaToolChangeMCPToolReference object { name, server_name, type }`
1293 - `BetaToolChangeMCPToolReference object`
13191294
13201295 Reference to a single MCP tool by its server and remote name — the
13211296 same `server_name`/`name` pair `mcp_tool_use` carries.
from line 1301
13261301
13271302 - `type: "mcp_tool_reference"`
13281303
1329 - `"mcp_tool_reference"`
1330
1331 - `BetaToolChangeMCPToolsetReference object { server_name, type }`
1304 - `BetaToolChangeMCPToolsetReference object`
13321305
13331306 Reference to every tool in the named MCP server's toolset.
13341307
from line 1309
13361309
13371310 - `type: "mcp_toolset_reference"`
13381311
1339 - `"mcp_toolset_reference"`
1340
13411312 - `type: "tool_addition"`
13421313
1343 - `"tool_addition"`
1344
13451314 - `cache_control: optional BetaCacheControlEphemeral or null`
13461315
13471316 Create a cache control breakpoint at this content block.
13481317
1349 - `BetaRequestToolRemovalBlock object { tool, type, cache_control }`
1318 - `BetaRequestToolRemovalBlock object`
13501319
13511320 Mid-conversation directive to withdraw a tool.
13521321
from line 1330
13611330 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13621331 `mcp_toolset_reference` for those.
13631332
1364 - `BetaToolChangeToolReference object { name, type }`
1333 - `BetaToolChangeToolReference object`
13651334
13661335 Reference to a single tool the caller declared directly in
13671336 `tools[]`. Does not accept the composed `{server}_{name}` form the
13681337 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13691338 `mcp_toolset_reference` for those.
13701339
1371 - `BetaToolChangeMCPToolReference object { name, server_name, type }`
1340 - `BetaToolChangeMCPToolReference object`
13721341
13731342 Reference to a single MCP tool by its server and remote name — the
13741343 same `server_name`/`name` pair `mcp_tool_use` carries.
13751344
1376 - `BetaToolChangeMCPToolsetReference object { server_name, type }`
1345 - `BetaToolChangeMCPToolsetReference object`
13771346
13781347 Reference to every tool in the named MCP server's toolset.
13791348
13801349 - `type: "tool_removal"`
13811350
1382 - `"tool_removal"`
1383
13841351 - `cache_control: optional BetaCacheControlEphemeral or null`
13851352
13861353 Create a cache control breakpoint at this content block.
13871354
1388 - `BetaFallbackBlockParam object { from, to, type, trigger }`
1355 - `BetaFallbackBlockParam object`
13891356
13901357 A `fallback` block echoed back from a prior response.
13911358
from line 1452
14851452
14861453 - `type: "fallback"`
14871454
1488 - `"fallback"`
1489
14901455 - `trigger: optional unknown`
14911456
14921457 The response block's `trigger`, echoed verbatim. Accepted and ignored by the server; any object or `null` is allowed.
from line 1478
15131478
15141479 Container identifier for reuse across requests.
15151480
1516 - `BetaContainerParams object { id, skills }`
1481 - `BetaContainerParams object`
15171482
15181483 Container parameters with skills to be loaded.
15191484
from line 1490
15251490
15261491 List of skills to load in the container
15271492
1493 maxItems: 20
1494
15281495 - `skill_id: string`
15291496
15301497 Skill ID
15311498
1499 maxLength: 64, minLength: 1
1500
15321501 - `type: "anthropic" or "custom"`
15331502
15341503 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 1510
15411510
15421511 Skill version or 'latest' for most recent version
15431512
1513 maxLength: 64, minLength: 1
1514
15441515 - `string`
15451516
15461517- `context_management: optional BetaContextManagementConfig or null`
from line 1524
15531524
15541525 List of context management edits to apply
15551526
1556 - `BetaClearToolUses20250919Edit object { type, clear_at_least, clear_tool_inputs, 3 more }`
1527 minItems: 0
1528
1529 - `BetaClearToolUses20250919Edit object`
15571530
15581531 - `type: "clear_tool_uses_20250919"`
15591532
1560 - `"clear_tool_uses_20250919"`
1561
15621533 - `clear_at_least: optional BetaInputTokensClearAtLeast or null`
15631534
15641535 Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
15651536
15661537 - `type: "input_tokens"`
15671538
1568 - `"input_tokens"`
1569
15701539 - `value: number`
15711540
1541 minimum: 0
1542
15721543 - `clear_tool_inputs: optional boolean or array of string or null`
15731544
15741545 Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
from line 1558
15871558
15881559 - `type: "tool_uses"`
15891560
1590 - `"tool_uses"`
1591
15921561 - `value: number`
15931562
1563 minimum: 0
1564
15941565 - `trigger: optional BetaInputTokensTrigger or BetaToolUsesTrigger`
15951566
15961567 Condition that triggers the context management strategy
15971568
1598 - `BetaInputTokensTrigger object { type, value }`
1569 - `BetaInputTokensTrigger object`
15991570
16001571 - `type: "input_tokens"`
16011572
1602 - `"input_tokens"`
1603
16041573 - `value: number`
16051574
1606 - `BetaToolUsesTrigger object { type, value }`
1575 minimum: 1
1576
1577 - `BetaToolUsesTrigger object`
16071578
16081579 - `type: "tool_uses"`
16091580
1610 - `"tool_uses"`
1611
16121581 - `value: number`
16131582
1614 - `BetaClearThinking20251015Edit object { type, keep }`
1583 minimum: 1
1584
1585 - `BetaClearThinking20251015Edit object`
16151586
16161587 - `type: "clear_thinking_20251015"`
16171588
1618 - `"clear_thinking_20251015"`
1619
16201589 - `keep: optional BetaThinkingTurns or BetaAllThinkingTurns or "all"`
16211590
16221591 Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
16231592
1624 - `BetaThinkingTurns object { type, value }`
1593 - `BetaThinkingTurns object`
16251594
16261595 - `type: "thinking_turns"`
16271596
1628 - `"thinking_turns"`
1629
16301597 - `value: number`
16311598
1632 - `BetaAllThinkingTurns object { type }`
1599 minimum: 1
1600
1601 - `BetaAllThinkingTurns object`
16331602
16341603 - `type: "all"`
16351604
1636 - `"all"`
1637
16381605 - `"all"`
16391606
1640 - `"all"`
1641
1642 - `BetaCompact20260112Edit object { type, instructions, pause_after_compaction, trigger }`
1607 - `BetaCompact20260112Edit object`
16431608
16441609 Automatically compact older context when reaching the configured trigger threshold.
16451610
16461611 - `type: "compact_20260112"`
1647
1648 - `"compact_20260112"`
16491612
16501613 - `instructions: optional string or null`
16511614
from line 1630
16671630 - `previous_message_id: optional string or null`
16681631
16691632 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.
1633
1634 maxLength: 256
16701635
16711636- `fallback_credit_token: optional string or BetaFallbackCreditTokenParam or null`
16721637
from line 1658
16931658
16941659 - `string`
16951660
1696 - `BetaFallbackCreditTokenParam object { token, mode }`
1661 - `BetaFallbackCreditTokenParam object`
16971662
16981663 Object form of `fallback_credit_token`: the token plus a redemption
16991664 mode.
from line 1672
17071672
17081673 The opaque `fallback_credit_token` from a prior refusal's `stop_details` — the same string the bare-string form carries.
17091674
1675 maxLength: 2048, minLength: 1
1676
17101677 - `mode: optional "strict" or "best_effort"`
17111678
17121679 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 1722
17551722
17561723 - `type: "json_schema"`
17571724
1758 - `"json_schema"`
1759
17601725 - `task_budget: optional BetaTokenTaskBudget or null`
17611726
17621727 User-configurable total token budget across contexts.
from line 1730
17651730
17661731 Total token budget across all contexts in the session.
17671732
1733 minimum: 1024
1734
17681735 - `type: "tokens"`
17691736
17701737 The budget type. Currently only 'tokens' is supported.
17711738
1772 - `"tokens"`
1773
17741739 - `remaining: optional number or null`
17751740
17761741 Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.
17771742
1743 minimum: 0
1744
17781745 - `speed: optional "standard" or "fast" or null`
17791746
17801747 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 1752
17851752
17861753 - `thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive or null`
17871754
1788 - `BetaThinkingConfigEnabled object { budget_tokens, type, display }`
1755 - `BetaThinkingConfigEnabled object`
17891756
17901757 - `budget_tokens: number`
17911758
from line 1762
17951762
17961763 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
17971764
1765 minimum: 1024
1766
17981767 - `type: "enabled"`
17991768
1800 - `"enabled"`
1801
18021769 - `display: optional "summarized" or "omitted" or null`
18031770
18041771 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 1774
18071774
18081775 - `"omitted"`
18091776
1810 - `BetaThinkingConfigDisabled object { type }`
1777 - `BetaThinkingConfigDisabled object`
18111778
18121779 - `type: "disabled"`
18131780
1814 - `"disabled"`
1815
1816 - `BetaThinkingConfigAdaptive object { type, display }`
1781 - `BetaThinkingConfigAdaptive object`
18171782
18181783 - `type: "adaptive"`
18191784
1820 - `"adaptive"`
1821
18221785 - `display: optional "summarized" or "omitted" or null`
18231786
18241787 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 1792
18291792
18301793 - `Default = "default"`
18311794
1832 - `"default"`
1833
18341795- `inference_geo: optional string or null`
18351796
18361797 Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.
from line 1800
18391800
18401801 MCP servers to be utilized in this request
18411802
1803 maxItems: 20
1804
18421805 - `name: string`
18431806
18441807 - `type: "url"`
18451808
1846 - `"url"`
1847
18481809 - `url: string`
18491810
18501811 - `authorization_token: optional string or null`
from line 1826
18651826
18661827 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.
18671828
1829 maxLength: 512
1830
18681831- `output_config: optional BetaOutputConfig`
18691832
18701833 Configuration options for the model's output, such as the output format.
18711834
1872- `output_format: optional BetaJSONOutputFormat or null`
1873
1874 Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
1875
1876 A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
1877
18781835- `service_tier: optional "auto" or "standard_only"`
18791836
18801837 Determines whether to use priority capacity (if available) or standard capacity for this request.
from line 1876
19191876
19201877 - `text: string`
19211878
1879 minLength: 1
1880
19221881 - `type: "text"`
19231882
19241883 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 1886
19271886
19281887 - `citations: optional array of BetaTextCitationParam or null`
19291888
1930- `temperature: optional number`
1931
1932 Amount of randomness injected into the response.
1933
1934 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.
1935
1936 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
1937
19381889- `thinking: optional BetaThinkingConfigParam`
19391890
19401891 Configuration for enabling Claude's extended thinking.
from line 1894
19431894
19441895 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
19451896
1946 - `BetaThinkingConfigEnabled object { budget_tokens, type, display }`
1947
1948 - `BetaThinkingConfigDisabled object { type }`
1949
1950 - `BetaThinkingConfigAdaptive object { type, display }`
1897 - `BetaThinkingConfigEnabled object`
1898
1899 - `BetaThinkingConfigDisabled object`
1900
1901 - `BetaThinkingConfigAdaptive object`
19511902
19521903- `tool_choice: optional BetaToolChoice`
19531904
19541905 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.
19551906
1956 - `BetaToolChoiceAuto object { type, disable_parallel_tool_use }`
1907 - `BetaToolChoiceAuto object`
19571908
19581909 The model will automatically decide whether to use tools.
19591910
19601911 - `type: "auto"`
19611912
1962 - `"auto"`
1963
19641913 - `disable_parallel_tool_use: optional boolean`
19651914
19661915 Whether to disable parallel tool use.
19671916
19681917 Defaults to `false`. If set to `true`, the model will output at most one tool use.
19691918
1970 - `BetaToolChoiceAny object { type, disable_parallel_tool_use }`
1919 - `BetaToolChoiceAny object`
19711920
19721921 The model will use any available tools.
19731922
19741923 - `type: "any"`
19751924
1976 - `"any"`
1977
19781925 - `disable_parallel_tool_use: optional boolean`
19791926
19801927 Whether to disable parallel tool use.
19811928
19821929 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
19831930
1984 - `BetaToolChoiceTool object { name, type, disable_parallel_tool_use }`
1931 - `BetaToolChoiceTool object`
19851932
19861933 The model will use the specified tool with `tool_choice.name`.
19871934
from line 1938
19911938
19921939 - `type: "tool"`
19931940
1994 - `"tool"`
1995
19961941 - `disable_parallel_tool_use: optional boolean`
19971942
19981943 Whether to disable parallel tool use.
19991944
20001945 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
20011946
2002 - `BetaToolChoiceNone object { type }`
1947 - `BetaToolChoiceNone object`
20031948
20041949 The model will not be allowed to use tools.
20051950
20061951 - `type: "none"`
2007
2008 - `"none"`
20091952
20101953- `tools: optional array of BetaToolUnion`
20111954
from line 2014
20712014
20722015 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
20732016
2074 - `BetaTool object { input_schema, name, allowed_callers, 7 more }`
2075
2076 - `input_schema: object { type, properties, required }`
2017 - `BetaTool object`
2018
2019 - `input_schema: object`
20772020
20782021 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
20792022
from line 2024
20812024
20822025 - `type: "object"`
20832026
2084 - `"object"`
2085
20862027 - `properties: optional map[unknown] or null`
20872028
20882029 - `required: optional array of string or null`
from line 2034
20932034
20942035 This is how the tool will be called by the model and in `tool_use` blocks.
20952036
2037 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$
2038
20962039 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
20972040
20982041 - `"direct"`
from line 2072
21292072
21302073 - `type: optional "custom" or null`
21312074
2132 - `"custom"`
2133
2134 - `BetaToolBash20241022 object { name, type, allowed_callers, 4 more }`
2075 - `BetaToolBash20241022 object`
21352076
21362077 - `name: "bash"`
21372078
from line 2080
21392080
21402081 This is how the tool will be called by the model and in `tool_use` blocks.
21412082
2142 - `"bash"`
2143
21442083 - `type: "bash_20241022"`
21452084
2146 - `"bash_20241022"`
2147
21482085 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21492086
21502087 - `"direct"`
from line 2106
21692106
21702107 When true, guarantees schema validation on tool names and inputs
21712108
2172 - `BetaToolBash20250124 object { name, type, allowed_callers, 4 more }`
2109 - `BetaToolBash20250124 object`
21732110
21742111 - `name: "bash"`
21752112
from line 2114
21772114
21782115 This is how the tool will be called by the model and in `tool_use` blocks.
21792116
2180 - `"bash"`
2181
21822117 - `type: "bash_20250124"`
21832118
2184 - `"bash_20250124"`
2185
21862119 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21872120
21882121 - `"direct"`
from line 2140
22072140
22082141 When true, guarantees schema validation on tool names and inputs
22092142
2210 - `BetaCodeExecutionTool20250522 object { name, type, allowed_callers, 3 more }`
2143 - `BetaCodeExecutionTool20250522 object`
22112144
22122145 - `name: "code_execution"`
22132146
from line 2148
22152148
22162149 This is how the tool will be called by the model and in `tool_use` blocks.
22172150
2218 - `"code_execution"`
2219
22202151 - `type: "code_execution_20250522"`
22212152
2222 - `"code_execution_20250522"`
2223
22242153 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22252154
22262155 - `"direct"`
from line 2172
22432172
22442173 When true, guarantees schema validation on tool names and inputs
22452174
2246 - `BetaCodeExecutionTool20250825 object { name, type, allowed_callers, 3 more }`
2175 - `BetaCodeExecutionTool20250825 object`
22472176
22482177 - `name: "code_execution"`
22492178
from line 2180
22512180
22522181 This is how the tool will be called by the model and in `tool_use` blocks.
22532182
2254 - `"code_execution"`
2255
22562183 - `type: "code_execution_20250825"`
22572184
2185 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
2186
2187 - `"direct"`
2188
22582189 - `"code_execution_20250825"`
22592190
2191 - `"code_execution_20260120"`
2192
2193 - `"code_execution_20260521"`
2194
2195 - `cache_control: optional BetaCacheControlEphemeral or null`
2196
2197 Create a cache control breakpoint at this content block.
2198
2199 - `defer_loading: optional boolean`
2200
2201 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
2202
2203 - `strict: optional boolean`
2204
2205 When true, guarantees schema validation on tool names and inputs
2206
2207 - `BetaCodeExecutionTool20260120 object`
2208
2209 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
2210
2211 - `name: "code_execution"`
2212
2213 Name of the tool.
2214
2215 This is how the tool will be called by the model and in `tool_use` blocks.
2216
2217 - `type: "code_execution_20260120"`
2218
22602219 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22612220
22622221 - `"direct"`
from line 2238
22792238
22802239 When true, guarantees schema validation on tool names and inputs
22812240
2282 - `BetaCodeExecutionTool20260120 object { name, type, allowed_callers, 3 more }`
2283
2284 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
2241 - `BetaCodeExecutionTool20260521 object`
2242
2243 Code execution tool with REPL state persistence.
22852244
22862245 - `name: "code_execution"`
22872246
from line 2248
22892248
22902249 This is how the tool will be called by the model and in `tool_use` blocks.
22912250
2292 - `"code_execution"`
2293
2294 - `type: "code_execution_20260120"`
2251 - `type: "code_execution_20260521"`
2252
2253 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
2254
2255 - `"direct"`
2256
2257 - `"code_execution_20250825"`
22952258
22962259 - `"code_execution_20260120"`
22972260
2298 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
2299
2300 - `"direct"`
2301
2302 - `"code_execution_20250825"`
2303
2304 - `"code_execution_20260120"`
2305
23062261 - `"code_execution_20260521"`
23072262
23082263 - `cache_control: optional BetaCacheControlEphemeral or null`
from line 2272
23172272
23182273 When true, guarantees schema validation on tool names and inputs
23192274
2320 - `BetaCodeExecutionTool20260521 object { name, type, allowed_callers, 3 more }`
2321
2322 Code execution tool with REPL state persistence.
2323
2324 - `name: "code_execution"`
2325
2326 Name of the tool.
2327
2328 This is how the tool will be called by the model and in `tool_use` blocks.
2329
2330 - `"code_execution"`
2331
2332 - `type: "code_execution_20260521"`
2333
2334 - `"code_execution_20260521"`
2335
2336 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
2337
2338 - `"direct"`
2339
2340 - `"code_execution_20250825"`
2341
2342 - `"code_execution_20260120"`
2343
2344 - `"code_execution_20260521"`
2345
2346 - `cache_control: optional BetaCacheControlEphemeral or null`
2347
2348 Create a cache control breakpoint at this content block.
2349
2350 - `defer_loading: optional boolean`
2351
2352 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
2353
2354 - `strict: optional boolean`
2355
2356 When true, guarantees schema validation on tool names and inputs
2357
2358 - `BetaBrowserToolset20260801 object { type, allowed_callers, cache_control, configs }`
2275 - `BetaBrowserToolset20260801 object`
23592276
23602277 The browser toolset: a single `tools[]` entry (carrying no
23612278 `name`) that declares the browser tool family. The model is served
from line 2280
23632280 from its schema.
23642281
23652282 - `type: "browser_toolset_20260801"`
2366
2367 - `"browser_toolset_20260801"`
23682283
23692284 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23702285
from line 2676
27612676
27622677 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.
27632678
2764 - `BetaToolComputerUse20241022 object { display_height_px, display_width_px, name, 7 more }`
2679 - `BetaToolComputerUse20241022 object`
27652680
27662681 - `display_height_px: number`
27672682
27682683 The height of the display in pixels.
27692684
2685 minimum: 1
2686
27702687 - `display_width_px: number`
27712688
27722689 The width of the display in pixels.
27732690
2691 minimum: 1
2692
27742693 - `name: "computer"`
27752694
27762695 Name of the tool.
27772696
27782697 This is how the tool will be called by the model and in `tool_use` blocks.
27792698
2780 - `"computer"`
2781
27822699 - `type: "computer_20241022"`
27832700
2784 - `"computer_20241022"`
2785
27862701 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27872702
27882703 - `"direct"`
from line 2720
28052720
28062721 The X11 display number (e.g. 0, 1) for the display.
28072722
2723 minimum: 0
2724
28082725 - `input_examples: optional array of map[unknown]`
28092726
28102727 - `strict: optional boolean`
28112728
28122729 When true, guarantees schema validation on tool names and inputs
28132730
2814 - `BetaMemoryTool20250818 object { name, type, allowed_callers, 4 more }`
2731 - `BetaMemoryTool20250818 object`
28152732
28162733 - `name: "memory"`
28172734
from line 2736
28192736
28202737 This is how the tool will be called by the model and in `tool_use` blocks.
28212738
2822 - `"memory"`
2823
28242739 - `type: "memory_20250818"`
28252740
2826 - `"memory_20250818"`
2827
28282741 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28292742
28302743 - `"direct"`
from line 2762
28492762
28502763 When true, guarantees schema validation on tool names and inputs
28512764
2852 - `BetaToolComputerUse20250124 object { display_height_px, display_width_px, name, 7 more }`
2765 - `BetaToolComputerUse20250124 object`
28532766
28542767 - `display_height_px: number`
28552768
28562769 The height of the display in pixels.
28572770
2771 minimum: 1
2772
28582773 - `display_width_px: number`
28592774
28602775 The width of the display in pixels.
28612776
2777 minimum: 1
2778
28622779 - `name: "computer"`
28632780
28642781 Name of the tool.
28652782
28662783 This is how the tool will be called by the model and in `tool_use` blocks.
28672784
2868 - `"computer"`
2869
28702785 - `type: "computer_20250124"`
28712786
2872 - `"computer_20250124"`
2873
28742787 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28752788
28762789 - `"direct"`
from line 2806
28932806
28942807 The X11 display number (e.g. 0, 1) for the display.
28952808
2809 minimum: 0
2810
28962811 - `input_examples: optional array of map[unknown]`
28972812
28982813 - `strict: optional boolean`
28992814
29002815 When true, guarantees schema validation on tool names and inputs
29012816
2902 - `BetaToolTextEditor20241022 object { name, type, allowed_callers, 4 more }`
2817 - `BetaToolTextEditor20241022 object`
29032818
29042819 - `name: "str_replace_editor"`
29052820
from line 2822
29072822
29082823 This is how the tool will be called by the model and in `tool_use` blocks.
29092824
2910 - `"str_replace_editor"`
2911
29122825 - `type: "text_editor_20241022"`
29132826
2914 - `"text_editor_20241022"`
2915
29162827 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29172828
29182829 - `"direct"`
from line 2848
29372848
29382849 When true, guarantees schema validation on tool names and inputs
29392850
2940 - `BetaToolComputerUse20251124 object { display_height_px, display_width_px, name, 8 more }`
2851 - `BetaToolComputerUse20251124 object`
29412852
29422853 - `display_height_px: number`
29432854
29442855 The height of the display in pixels.
29452856
2857 minimum: 1
2858
29462859 - `display_width_px: number`
29472860
29482861 The width of the display in pixels.
29492862
2863 minimum: 1
2864
29502865 - `name: "computer"`
29512866
29522867 Name of the tool.
29532868
29542869 This is how the tool will be called by the model and in `tool_use` blocks.
29552870
2956 - `"computer"`
2957
29582871 - `type: "computer_20251124"`
29592872
2960 - `"computer_20251124"`
2961
29622873 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29632874
29642875 - `"direct"`
from line 2892
29812892
29822893 The X11 display number (e.g. 0, 1) for the display.
29832894
2895 minimum: 0
2896
29842897 - `enable_zoom: optional boolean`
29852898
29862899 Whether to enable an action to take a zoomed-in screenshot of the screen.
from line 2904
29912904
29922905 When true, guarantees schema validation on tool names and inputs
29932906
2994 - `BetaComputerToolset20260801 object { type, allowed_callers, cache_control, configs }`
2907 - `BetaComputerToolset20260801 object`
29952908
29962909 The computer toolset: a single `tools[]` entry (carrying no
29972910 `name`) that declares the computer tool family. The model is
from line 2917
30042917
30052918 - `type: "computer_toolset_20260801"`
30062919
3007 - `"computer_toolset_20260801"`
3008
30092920 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
30102921
30112922 - `"direct"`
from line 3144
32333144
32343145 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.
32353146
3236 - `BetaToolTextEditor20250124 object { name, type, allowed_callers, 4 more }`
3147 - `BetaToolTextEditor20250124 object`
32373148
32383149 - `name: "str_replace_editor"`
32393150
from line 3152
32413152
32423153 This is how the tool will be called by the model and in `tool_use` blocks.
32433154
3244 - `"str_replace_editor"`
3245
32463155 - `type: "text_editor_20250124"`
32473156
3248 - `"text_editor_20250124"`
3249
32503157 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32513158
32523159 - `"direct"`
from line 3178
32713178
32723179 When true, guarantees schema validation on tool names and inputs
32733180
3274 - `BetaToolTextEditor20250429 object { name, type, allowed_callers, 4 more }`
3181 - `BetaToolTextEditor20250429 object`
32753182
32763183 - `name: "str_replace_based_edit_tool"`
32773184
from line 3186
32793186
32803187 This is how the tool will be called by the model and in `tool_use` blocks.
32813188
3282 - `"str_replace_based_edit_tool"`
3283
32843189 - `type: "text_editor_20250429"`
32853190
3286 - `"text_editor_20250429"`
3287
32883191 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32893192
32903193 - `"direct"`
from line 3212
33093212
33103213 When true, guarantees schema validation on tool names and inputs
33113214
3312 - `BetaToolTextEditor20250728 object { name, type, allowed_callers, 5 more }`
3215 - `BetaToolTextEditor20250728 object`
33133216
33143217 - `name: "str_replace_based_edit_tool"`
33153218
from line 3220
33173220
33183221 This is how the tool will be called by the model and in `tool_use` blocks.
33193222
3320 - `"str_replace_based_edit_tool"`
3321
33223223 - `type: "text_editor_20250728"`
33233224
3324 - `"text_editor_20250728"`
3325
33263225 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33273226
33283227 - `"direct"`
from line 3246
33473246
33483247 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
33493248
3249 minimum: 1
3250
33503251 - `strict: optional boolean`
33513252
33523253 When true, guarantees schema validation on tool names and inputs
33533254
3354 - `BetaWebSearchTool20250305 object { name, type, allowed_callers, 7 more }`
3255 - `BetaWebSearchTool20250305 object`
33553256
33563257 - `name: "web_search"`
33573258
from line 3260
33593260
33603261 This is how the tool will be called by the model and in `tool_use` blocks.
33613262
3362 - `"web_search"`
3363
33643263 - `type: "web_search_20250305"`
33653264
3366 - `"web_search_20250305"`
3367
33683265 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33693266
33703267 - `"direct"`
from line 3292
33953292
33963293 Maximum number of times the tool can be used in the API request.
33973294
3295 exclusiveMinimum: 0
3296
33983297 - `strict: optional boolean`
33993298
34003299 When true, guarantees schema validation on tool names and inputs
from line 3304
34053304
34063305 - `type: "approximate"`
34073306
3408 - `"approximate"`
3409
34103307 - `city: optional string or null`
34113308
34123309 The city of the user.
34133310
3311 maxLength: 255, minLength: 1
3312
34143313 - `country: optional string or null`
34153314
34163315 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
34173316
3317 maxLength: 2, minLength: 2
3318
34183319 - `region: optional string or null`
34193320
34203321 The region of the user.
34213322
3323 maxLength: 255, minLength: 1
3324
34223325 - `timezone: optional string or null`
34233326
34243327 The [IANA timezone](https://nodatime.org/TimeZones) of the user.
34253328
3426 - `BetaWebFetchTool20250910 object { name, type, allowed_callers, 8 more }`
3329 maxLength: 255, minLength: 1
3330
3331 - `BetaWebFetchTool20250910 object`
34273332
34283333 - `name: "web_fetch"`
34293334
from line 3336
34313336
34323337 This is how the tool will be called by the model and in `tool_use` blocks.
34333338
3434 - `"web_fetch"`
3435
34363339 - `type: "web_fetch_20250910"`
34373340
3438 - `"web_fetch_20250910"`
3439
34403341 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34413342
34423343 - `"direct"`
from line 3372
34713372
34723373 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.
34733374
3375 exclusiveMinimum: 0
3376
34743377 - `max_uses: optional number or null`
34753378
34763379 Maximum number of times the tool can be used in the API request.
34773380
3381 exclusiveMinimum: 0
3382
34783383 - `strict: optional boolean`
34793384
34803385 When true, guarantees schema validation on tool names and inputs
34813386
3482 - `BetaWebSearchTool20260209 object { name, type, allowed_callers, 7 more }`
3387 - `BetaWebSearchTool20260209 object`
34833388
34843389 - `name: "web_search"`
34853390
from line 3392
34873392
34883393 This is how the tool will be called by the model and in `tool_use` blocks.
34893394
3490 - `"web_search"`
3491
34923395 - `type: "web_search_20260209"`
34933396
3494 - `"web_search_20260209"`
3495
34963397 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34973398
34983399 - `"direct"`
from line 3424
35233424
35243425 Maximum number of times the tool can be used in the API request.
35253426
3427 exclusiveMinimum: 0
3428
35263429 - `strict: optional boolean`
35273430
35283431 When true, guarantees schema validation on tool names and inputs
from line 3434
35313434
35323435 Parameters for the user's location. Used to provide more relevant search results.
35333436
3534 - `BetaWebFetchTool20260209 object { name, type, allowed_callers, 8 more }`
3437 - `BetaWebFetchTool20260209 object`
35353438
35363439 - `name: "web_fetch"`
35373440
from line 3442
35393442
35403443 This is how the tool will be called by the model and in `tool_use` blocks.
35413444
3542 - `"web_fetch"`
3543
35443445 - `type: "web_fetch_20260209"`
35453446
3546 - `"web_fetch_20260209"`
3547
35483447 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35493448
35503449 - `"direct"`
from line 3478
35793478
35803479 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.
35813480
3481 exclusiveMinimum: 0
3482
35823483 - `max_uses: optional number or null`
35833484
35843485 Maximum number of times the tool can be used in the API request.
35853486
3487 exclusiveMinimum: 0
3488
35863489 - `strict: optional boolean`
35873490
35883491 When true, guarantees schema validation on tool names and inputs
35893492
3590 - `BetaWebFetchTool20260309 object { name, type, allowed_callers, 9 more }`
3493 - `BetaWebFetchTool20260309 object`
35913494
35923495 Web fetch tool with use_cache parameter for bypassing cached content.
35933496
from line 3500
35973500
35983501 This is how the tool will be called by the model and in `tool_use` blocks.
35993502
3600 - `"web_fetch"`
3601
36023503 - `type: "web_fetch_20260309"`
36033504
3604 - `"web_fetch_20260309"`
3605
36063505 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36073506
36083507 - `"direct"`
from line 3536
36373536
36383537 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.
36393538
3539 exclusiveMinimum: 0
3540
36403541 - `max_uses: optional number or null`
36413542
36423543 Maximum number of times the tool can be used in the API request.
36433544
3545 exclusiveMinimum: 0
3546
36443547 - `strict: optional boolean`
36453548
36463549 When true, guarantees schema validation on tool names and inputs
from line 3552
36493552
36503553 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.
36513554
3652 - `BetaWebSearchTool20260318 object { name, type, allowed_callers, 8 more }`
3555 - `BetaWebSearchTool20260318 object`
36533556
36543557 - `name: "web_search"`
36553558
from line 3560
36573560
36583561 This is how the tool will be called by the model and in `tool_use` blocks.
36593562
3660 - `"web_search"`
3661
36623563 - `type: "web_search_20260318"`
36633564
3664 - `"web_search_20260318"`
3665
36663565 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36673566
36683567 - `"direct"`
from line 3592
36933592
36943593 Maximum number of times the tool can be used in the API request.
36953594
3595 exclusiveMinimum: 0
3596
36963597 - `response_inclusion: optional "full" or "excluded"`
36973598
36983599 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 3610
37093610
37103611 Parameters for the user's location. Used to provide more relevant search results.
37113612
3712 - `BetaWebFetchTool20260318 object { name, type, allowed_callers, 10 more }`
3613 - `BetaWebFetchTool20260318 object`
37133614
37143615 - `name: "web_fetch"`
37153616
from line 3618
37173618
37183619 This is how the tool will be called by the model and in `tool_use` blocks.
37193620
3720 - `"web_fetch"`
3721
37223621 - `type: "web_fetch_20260318"`
37233622
3724 - `"web_fetch_20260318"`
3725
37263623 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
37273624
37283625 - `"direct"`
from line 3654
37573654
37583655 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.
37593656
3657 exclusiveMinimum: 0
3658
37603659 - `max_uses: optional number or null`
37613660
37623661 Maximum number of times the tool can be used in the API request.
37633662
3663 exclusiveMinimum: 0
3664
37643665 - `response_inclusion: optional "full" or "excluded"`
37653666
37663667 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 3678
37773678
37783679 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.
37793680
3780 - `BetaAdvisorTool20260301 object { model, name, type, 7 more }`
3681 - `BetaAdvisorTool20260301 object`
37813682
37823683 - `model: Model`
37833684
from line 3692
37913692
37923693 This is how the tool will be called by the model and in `tool_use` blocks.
37933694
3794 - `"advisor"`
3795
37963695 - `type: "advisor_20260301"`
37973696
3798 - `"advisor_20260301"`
3799
38003697 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38013698
38023699 - `"direct"`
from line 3720
38233720
38243721 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.
38253722
3723 minimum: 1024
3724
38263725 - `max_uses: optional number or null`
38273726
38283727 Maximum number of times the tool can be used in the API request.
38293728
3729 exclusiveMinimum: 0
3730
38303731 - `strict: optional boolean`
38313732
38323733 When true, guarantees schema validation on tool names and inputs
38333734
3834 - `BetaToolSearchToolBm25_20251119 object { name, type, allowed_callers, 3 more }`
3735 - `BetaToolSearchToolBm25_20251119 object`
38353736
38363737 - `name: "tool_search_tool_bm25"`
38373738
from line 3740
38393740
38403741 This is how the tool will be called by the model and in `tool_use` blocks.
38413742
3743 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3744
3745 - `"tool_search_tool_bm25_20251119"`
3746
38423747 - `"tool_search_tool_bm25"`
38433748
3844 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3845
3846 - `"tool_search_tool_bm25_20251119"`
3847
3848 - `"tool_search_tool_bm25"`
3849
38503749 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38513750
38523751 - `"direct"`
from line 3768
38693768
38703769 When true, guarantees schema validation on tool names and inputs
38713770
3872 - `BetaToolSearchToolRegex20251119 object { name, type, allowed_callers, 3 more }`
3771 - `BetaToolSearchToolRegex20251119 object`
38733772
38743773 - `name: "tool_search_tool_regex"`
38753774
from line 3776
38773776
38783777 This is how the tool will be called by the model and in `tool_use` blocks.
38793778
3779 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3780
3781 - `"tool_search_tool_regex_20251119"`
3782
38803783 - `"tool_search_tool_regex"`
38813784
3882 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3883
3884 - `"tool_search_tool_regex_20251119"`
3885
3886 - `"tool_search_tool_regex"`
3887
38883785 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38893786
38903787 - `"direct"`
from line 3804
39073804
39083805 When true, guarantees schema validation on tool names and inputs
39093806
3910 - `BetaMCPToolset object { mcp_server_name, type, cache_control, 2 more }`
3807 - `BetaMCPToolset object`
39113808
39123809 Configuration for a group of tools from an MCP server.
39133810
from line 3815
39183815
39193816 Name of the MCP server to configure tools for
39203817
3818 maxLength: 255, minLength: 1
3819
39213820 - `type: "mcp_toolset"`
39223821
3923 - `"mcp_toolset"`
3924
39253822 - `cache_control: optional BetaCacheControlEphemeral or null`
39263823
39273824 Create a cache control breakpoint at this content block.
from line 3839
39423839
39433840 - `enabled: optional boolean`
39443841
3842- `output_format: optional BetaJSONOutputFormat or null`
3843
3844 **Deprecated**
3845
3846 Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
3847
3848 A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
3849
3850- `temperature: optional number`
3851
3852 **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.
3853
3854 Amount of randomness injected into the response.
3855
3856 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.
3857
3858 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
3859
3860 maximum: 1, minimum: 0
3861
39453862- `top_k: optional number`
39463863
3864 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
3865
39473866 Only sample from the top K options for each subsequent token.
39483867
39493868 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
39503869
39513870 Recommended for advanced use cases only.
39523871
3872 minimum: 0
3873
39533874- `top_p: optional number`
39543875
3876 **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.
3877
39553878 Use nucleus sampling.
39563879
39573880 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`.
39583881
39593882 Recommended for advanced use cases only.
39603883
3961### Returns
3962
3963- `BetaMessage object { id, container, content, 9 more }`
3884 maximum: 1, minimum: 0
3885
3886## Returns
3887
3888- `BetaMessage object`
39643889
39653890 - `id: string`
39663891
from line 3905
39803905
39813906 The time at which the container will expire.
39823907
3908 format: date-time
3909
39833910 - `skills: array of BetaSkill or null`
39843911
39853912 Skills loaded in the container
from line 3915
39883915
39893916 Skill ID
39903917
3918 maxLength: 64, minLength: 1
3919
39913920 - `type: "anthropic" or "custom"`
39923921
39933922 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 3928
39993928 - `version: string`
40003929
40013930 The resolved version: a skill version ID for custom skills.
3931
3932 maxLength: 64, minLength: 1
40023933
40033934 - `content: array of BetaContentBlock`
40043935
from line 3960
40293960 [{"type": "text", "text": "B)"}]
40303961 ```
40313962
4032 - `BetaTextBlock object { citations, text, type }`
3963 - `BetaTextBlock object`
40333964
40343965 - `citations: array of BetaTextCitation or null`
40353966
from line 3968
40373968
40383969 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
40393970
4040 - `BetaCitationCharLocation object { cited_text, document_index, document_title, 4 more }`
3971 - `BetaCitationCharLocation object`
40413972
40423973 - `cited_text: string`
40433974
40443975 - `document_index: number`
40453976
3977 minimum: 0
3978
40463979 - `document_title: string or null`
40473980
40483981 - `end_char_index: number`
from line 3984
40513984
40523985 - `start_char_index: number`
40533986
3987 minimum: 0
3988
40543989 - `type: "char_location"`
40553990
4056 - `"char_location"`
4057
4058 - `BetaCitationPageLocation object { cited_text, document_index, document_title, 4 more }`
3991 default: char_location
3992
3993 - `BetaCitationPageLocation object`
40593994
40603995 - `cited_text: string`
40613996
40623997 - `document_index: number`
40633998
3999 minimum: 0
4000
40644001 - `document_title: string or null`
40654002
40664003 - `end_page_number: number`
from line 4006
40694006
40704007 - `start_page_number: number`
40714008
4009 minimum: 1
4010
40724011 - `type: "page_location"`
40734012
4074 - `"page_location"`
4075
4076 - `BetaCitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
4013 default: page_location
4014
4015 - `BetaCitationContentBlockLocation object`
40774016
40784017 - `cited_text: string`
40794018
from line 4022
40834022
40844023 - `document_index: number`
40854024
4025 minimum: 0
4026
40864027 - `document_title: string or null`
40874028
40884029 - `end_block_index: number`
from line 4038
40974038
40984039 0-based index of the first cited block in the source's `content` array.
40994040
4041 minimum: 0
4042
41004043 - `type: "content_block_location"`
41014044
4102 - `"content_block_location"`
4103
4104 - `BetaCitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
4045 default: content_block_location
4046
4047 - `BetaCitationsWebSearchResultLocation object`
41054048
41064049 - `cited_text: string`
41074050
from line 4052
41094052
41104053 - `title: string or null`
41114054
4055 maxLength: 512
4056
41124057 - `type: "web_search_result_location"`
41134058
4114 - `"web_search_result_location"`
4059 default: web_search_result_location
41154060
41164061 - `url: string`
41174062
4118 - `BetaCitationSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
4063 - `BetaCitationSearchResultLocation object`
41194064
41204065 - `cited_text: string`
41214066
from line 4080
41354080
41364081 Counted separately from `document_index`; server-side web search results are not included in this count.
41374082
4083 minimum: 0
4084
41384085 - `source: string`
41394086
41404087 - `start_block_index: number`
41414088
41424089 0-based index of the first cited block in the source's `content` array.
41434090
4091 minimum: 0
4092
41444093 - `title: string or null`
41454094
41464095 - `type: "search_result_location"`
41474096
4148 - `"search_result_location"`
4097 default: search_result_location
41494098
41504099 - `text: string`
41514100
4101 maxLength: 5000000, minLength: 0
4102
41524103 - `type: "text"`
41534104
4154 - `"text"`
4155
4156 - `BetaThinkingBlock object { signature, thinking, type }`
4105 default: text
4106
4107 - `BetaThinkingBlock object`
41574108
41584109 - `signature: string`
41594110
from line 4120
41694120
41704121 - `type: "thinking"`
41714122
4172 - `"thinking"`
4173
4174 - `BetaRedactedThinkingBlock object { data, type }`
4123 default: thinking
4124
4125 - `BetaRedactedThinkingBlock object`
41754126
41764127 - `data: string`
41774128
from line 4134
41834134
41844135 - `type: "redacted_thinking"`
41854136
4186 - `"redacted_thinking"`
4187
4188 - `BetaToolUseBlock object { id, input, name, 3 more }`
4137 default: redacted_thinking
4138
4139 - `BetaToolUseBlock object`
41894140
41904141 - `id: string`
41914142
4143 pattern: ^[a-zA-Z0-9_-]+$
4144
41924145 - `input: map[unknown]`
41934146
41944147 - `name: string`
41954148
4149 minLength: 1
4150
41964151 - `type: "tool_use"`
41974152
4198 - `"tool_use"`
4153 default: tool_use
41994154
42004155 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
42014156
42024157 Tool invocation directly from the model.
42034158
4204 - `BetaDirectCaller object { type }`
4159 - `BetaDirectCaller object`
42054160
42064161 Tool invocation directly from the model.
42074162
42084163 - `type: "direct"`
42094164
4210 - `"direct"`
4211
4212 - `BetaServerToolCaller object { tool_id, type }`
4165 - `BetaServerToolCaller object`
42134166
42144167 Tool invocation generated by a server-side tool.
42154168
42164169 - `tool_id: string`
42174170
4171 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4172
42184173 - `type: "code_execution_20250825"`
42194174
4220 - `"code_execution_20250825"`
4221
4222 - `BetaServerToolCaller20260120 object { tool_id, type }`
4175 - `BetaServerToolCaller20260120 object`
42234176
42244177 - `tool_id: string`
42254178
4179 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4180
42264181 - `type: "code_execution_20260120"`
42274182
4228 - `"code_execution_20260120"`
4229
42304183 - `toolset_name: optional string or null`
42314184
42324185 For a toolset member tool_use, the toolset family.
42334186
4234 - `BetaServerToolUseBlock object { id, input, name, 2 more }`
4187 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
4188
4189 - `BetaServerToolUseBlock object`
42354190
42364191 - `id: string`
42374192
4193 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4194
42384195 - `input: map[unknown]`
42394196
42404197 - `name: "advisor" or "web_search" or "web_fetch" or 5 more`
from line 4214
42574214
42584215 - `type: "server_tool_use"`
42594216
4260 - `"server_tool_use"`
4217 default: server_tool_use
42614218
42624219 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
42634220
42644221 Tool invocation directly from the model.
42654222
4266 - `BetaDirectCaller object { type }`
4223 - `BetaDirectCaller object`
42674224
42684225 Tool invocation directly from the model.
42694226
4270 - `BetaServerToolCaller object { tool_id, type }`
4227 - `BetaServerToolCaller object`
42714228
42724229 Tool invocation generated by a server-side tool.
42734230
4274 - `BetaServerToolCaller20260120 object { tool_id, type }`
4275
4276 - `BetaWebSearchToolResultBlock object { content, tool_use_id, type, caller }`
4231 - `BetaServerToolCaller20260120 object`
4232
4233 - `BetaWebSearchToolResultBlock object`
42774234
42784235 - `content: BetaWebSearchToolResultBlockContent`
42794236
4280 - `BetaWebSearchToolResultError object { error_code, type }`
4237 - `BetaWebSearchToolResultError object`
42814238
42824239 - `error_code: BetaWebSearchToolResultErrorCode`
42834240
from line 4252
42954252
42964253 - `type: "web_search_tool_result_error"`
42974254
4298 - `"web_search_tool_result_error"`
4255 default: web_search_tool_result_error
42994256
43004257 - `array of BetaWebSearchResultBlock`
43014258
from line 4264
43074264
43084265 - `type: "web_search_result"`
43094266
4310 - `"web_search_result"`
4267 default: web_search_result
43114268
43124269 - `url: string`
43134270
43144271 - `tool_use_id: string`
43154272
4273 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4274
43164275 - `type: "web_search_tool_result"`
43174276
4318 - `"web_search_tool_result"`
4277 default: web_search_tool_result
43194278
43204279 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
43214280
43224281 Tool invocation directly from the model.
43234282
4324 - `BetaDirectCaller object { type }`
4283 - `BetaDirectCaller object`
43254284
43264285 Tool invocation directly from the model.
43274286
4328 - `BetaServerToolCaller object { tool_id, type }`
4287 - `BetaServerToolCaller object`
43294288
43304289 Tool invocation generated by a server-side tool.
43314290
4332 - `BetaServerToolCaller20260120 object { tool_id, type }`
4333
4334 - `BetaWebFetchToolResultBlock object { content, tool_use_id, type, caller }`
4291 - `BetaServerToolCaller20260120 object`
4292
4293 - `BetaWebFetchToolResultBlock object`
43354294
43364295 - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
43374296
4338 - `BetaWebFetchToolResultErrorBlock object { error_code, type }`
4297 - `BetaWebFetchToolResultErrorBlock object`
43394298
43404299 - `error_code: BetaWebFetchToolResultErrorCode`
43414300
from line 4318
43594318
43604319 - `type: "web_fetch_tool_result_error"`
43614320
4362 - `"web_fetch_tool_result_error"`
4363
4364 - `BetaWebFetchBlock object { content, retrieved_at, type, url }`
4321 default: web_fetch_tool_result_error
4322
4323 - `BetaWebFetchBlock object`
43654324
43664325 - `content: BetaDocumentBlock`
43674326
from line 4330
43714330
43724331 - `enabled: boolean`
43734332
4333 default: false
4334
43744335 - `source: BetaBase64PDFSource or BetaPlainTextSource`
43754336
4376 - `BetaBase64PDFSource object { data, media_type, type }`
4337 - `BetaBase64PDFSource object`
43774338
43784339 - `data: string`
43794340
4341 format: byte
4342
43804343 - `media_type: "application/pdf"`
43814344
4382 - `"application/pdf"`
4383
43844345 - `type: "base64"`
43854346
4386 - `"base64"`
4387
4388 - `BetaPlainTextSource object { data, media_type, type }`
4347 - `BetaPlainTextSource object`
43894348
43904349 - `data: string`
43914350
43924351 - `media_type: "text/plain"`
43934352
4394 - `"text/plain"`
4395
43964353 - `type: "text"`
43974354
4398 - `"text"`
4399
44004355 - `title: string or null`
44014356
44024357 The title of the document
44034358
44044359 - `type: "document"`
44054360
4406 - `"document"`
4361 default: document
44074362
44084363 - `retrieved_at: string or null`
44094364
from line 4366
44114366
44124367 - `type: "web_fetch_result"`
44134368
4414 - `"web_fetch_result"`
4369 default: web_fetch_result
44154370
44164371 - `url: string`
44174372
from line 4374
44194374
44204375 - `tool_use_id: string`
44214376
4377 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4378
44224379 - `type: "web_fetch_tool_result"`
44234380
4424 - `"web_fetch_tool_result"`
4381 default: web_fetch_tool_result
44254382
44264383 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
44274384
44284385 Tool invocation directly from the model.
44294386
4430 - `BetaDirectCaller object { type }`
4387 - `BetaDirectCaller object`
44314388
44324389 Tool invocation directly from the model.
44334390
4434 - `BetaServerToolCaller object { tool_id, type }`
4391 - `BetaServerToolCaller object`
44354392
44364393 Tool invocation generated by a server-side tool.
44374394
4438 - `BetaServerToolCaller20260120 object { tool_id, type }`
4439
4440 - `BetaAdvisorToolResultBlock object { content, tool_use_id, type }`
4395 - `BetaServerToolCaller20260120 object`
4396
4397 - `BetaAdvisorToolResultBlock object`
44414398
44424399 - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`
44434400
4444 - `BetaAdvisorToolResultError object { error_code, type }`
4401 - `BetaAdvisorToolResultError object`
44454402
44464403 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
44474404
from line 4418
44614418
44624419 - `type: "advisor_tool_result_error"`
44634420
4464 - `"advisor_tool_result_error"`
4465
4466 - `BetaAdvisorResultBlock object { stop_reason, text, type }`
4421 default: advisor_tool_result_error
4422
4423 - `BetaAdvisorResultBlock object`
44674424
44684425 - `stop_reason: string or null`
44694426
from line 4430
44734430
44744431 - `type: "advisor_result"`
44754432
4476 - `"advisor_result"`
4477
4478 - `BetaAdvisorRedactedResultBlock object { encrypted_content, stop_reason, type }`
4433 default: advisor_result
4434
4435 - `BetaAdvisorRedactedResultBlock object`
44794436
44804437 - `encrypted_content: string`
44814438
from line 4444
44874444
44884445 - `type: "advisor_redacted_result"`
44894446
4490 - `"advisor_redacted_result"`
4447 default: advisor_redacted_result
44914448
44924449 - `tool_use_id: string`
44934450
4451 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4452
44944453 - `type: "advisor_tool_result"`
44954454
4496 - `"advisor_tool_result"`
4497
4498 - `BetaCodeExecutionToolResultBlock object { content, tool_use_id, type }`
4455 default: advisor_tool_result
4456
4457 - `BetaCodeExecutionToolResultBlock object`
44994458
45004459 - `content: BetaCodeExecutionToolResultBlockContent`
45014460
45024461 Code execution result with encrypted stdout for PFC + web_search results.
45034462
4504 - `BetaCodeExecutionToolResultError object { error_code, type }`
4463 - `BetaCodeExecutionToolResultError object`
45054464
45064465 - `error_code: BetaCodeExecutionToolResultErrorCode`
45074466
from line 4474
45154474
45164475 - `type: "code_execution_tool_result_error"`
45174476
4518 - `"code_execution_tool_result_error"`
4519
4520 - `BetaCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
4477 default: code_execution_tool_result_error
4478
4479 - `BetaCodeExecutionResultBlock object`
45214480
45224481 - `content: array of BetaCodeExecutionOutputBlock`
45234482
from line 4484
45254484
45264485 - `type: "code_execution_output"`
45274486
4528 - `"code_execution_output"`
4487 default: code_execution_output
45294488
45304489 - `return_code: number`
45314490
from line 4494
45354494
45364495 - `type: "code_execution_result"`
45374496
4538 - `"code_execution_result"`
4539
4540 - `BetaEncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
4497 default: code_execution_result
4498
4499 - `BetaEncryptedCodeExecutionResultBlock object`
45414500
45424501 Code execution result with encrypted stdout for PFC + web_search results.
45434502
from line 4506
45474506
45484507 - `type: "code_execution_output"`
45494508
4509 default: code_execution_output
4510
45504511 - `encrypted_stdout: string`
45514512
45524513 - `return_code: number`
from line 4516
45554516
45564517 - `type: "encrypted_code_execution_result"`
45574518
4558 - `"encrypted_code_execution_result"`
4519 default: encrypted_code_execution_result
45594520
45604521 - `tool_use_id: string`
45614522
4523 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4524
45624525 - `type: "code_execution_tool_result"`
45634526
4564 - `"code_execution_tool_result"`
4565
4566 - `BetaBashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
4527 default: code_execution_tool_result
4528
4529 - `BetaBashCodeExecutionToolResultBlock object`
45674530
45684531 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
45694532
4570 - `BetaBashCodeExecutionToolResultError object { error_code, type }`
4533 - `BetaBashCodeExecutionToolResultError object`
45714534
45724535 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
45734536
from line 4546
45834546
45844547 - `type: "bash_code_execution_tool_result_error"`
45854548
4586 - `"bash_code_execution_tool_result_error"`
4587
4588 - `BetaBashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
4549 default: bash_code_execution_tool_result_error
4550
4551 - `BetaBashCodeExecutionResultBlock object`
45894552
45904553 - `content: array of BetaBashCodeExecutionOutputBlock`
45914554
from line 4556
45934556
45944557 - `type: "bash_code_execution_output"`
45954558
4596 - `"bash_code_execution_output"`
4559 default: bash_code_execution_output
45974560
45984561 - `return_code: number`
45994562
from line 4566
46034566
46044567 - `type: "bash_code_execution_result"`
46054568
4606 - `"bash_code_execution_result"`
4569 default: bash_code_execution_result
46074570
46084571 - `tool_use_id: string`
46094572
4573 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4574
46104575 - `type: "bash_code_execution_tool_result"`
46114576
4612 - `"bash_code_execution_tool_result"`
4613
4614 - `BetaTextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
4577 default: bash_code_execution_tool_result
4578
4579 - `BetaTextEditorCodeExecutionToolResultBlock object`
46154580
46164581 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
46174582
4618 - `BetaTextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
4583 - `BetaTextEditorCodeExecutionToolResultError object`
46194584
46204585 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
46214586
from line 4598
46334598
46344599 - `type: "text_editor_code_execution_tool_result_error"`
46354600
4636 - `"text_editor_code_execution_tool_result_error"`
4637
4638 - `BetaTextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
4601 default: text_editor_code_execution_tool_result_error
4602
4603 - `BetaTextEditorCodeExecutionViewResultBlock object`
46394604
46404605 - `content: string`
46414606
from line 4620
46554620
46564621 - `type: "text_editor_code_execution_view_result"`
46574622
4658 - `"text_editor_code_execution_view_result"`
4659
4660 - `BetaTextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
4623 default: text_editor_code_execution_view_result
4624
4625 - `BetaTextEditorCodeExecutionCreateResultBlock object`
46614626
46624627 - `is_file_update: boolean`
46634628
46644629 - `type: "text_editor_code_execution_create_result"`
46654630
4666 - `"text_editor_code_execution_create_result"`
4667
4668 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
4631 default: text_editor_code_execution_create_result
4632
4633 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
46694634
46704635 - `lines: array of string or null`
46714636
from line 4644
46794644
46804645 - `type: "text_editor_code_execution_str_replace_result"`
46814646
4682 - `"text_editor_code_execution_str_replace_result"`
4647 default: text_editor_code_execution_str_replace_result
46834648
46844649 - `tool_use_id: string`
46854650
4651 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4652
46864653 - `type: "text_editor_code_execution_tool_result"`
46874654
4688 - `"text_editor_code_execution_tool_result"`
4689
4690 - `BetaToolSearchToolResultBlock object { content, tool_use_id, type }`
4655 default: text_editor_code_execution_tool_result
4656
4657 - `BetaToolSearchToolResultBlock object`
46914658
46924659 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
46934660
4694 - `BetaToolSearchToolResultError object { error_code, error_message, type }`
4661 - `BetaToolSearchToolResultError object`
46954662
46964663 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
46974664
from line 4674
47074674
47084675 - `type: "tool_search_tool_result_error"`
47094676
4710 - `"tool_search_tool_result_error"`
4711
4712 - `BetaToolSearchToolSearchResultBlock object { tool_references, type }`
4677 default: tool_search_tool_result_error
4678
4679 - `BetaToolSearchToolSearchResultBlock object`
47134680
47144681 - `tool_references: array of BetaToolReferenceBlock`
47154682
47164683 - `tool_name: string`
47174684
4685 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
4686
47184687 - `type: "tool_reference"`
47194688
4720 - `"tool_reference"`
4689 default: tool_reference
47214690
47224691 - `type: "tool_search_tool_search_result"`
47234692
4724 - `"tool_search_tool_search_result"`
4693 default: tool_search_tool_search_result
47254694
47264695 - `tool_use_id: string`
47274696
4697 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4698
47284699 - `type: "tool_search_tool_result"`
47294700
4730 - `"tool_search_tool_result"`
4731
4732 - `BetaMCPToolUseBlock object { id, input, name, 2 more }`
4701 default: tool_search_tool_result
4702
4703 - `BetaMCPToolUseBlock object`
47334704
47344705 - `id: string`
47354706
4707 pattern: ^[a-zA-Z0-9_-]+$
4708
47364709 - `input: map[unknown]`
47374710
47384711 - `name: string`
from line 4718
47454718
47464719 - `type: "mcp_tool_use"`
47474720
4748 - `"mcp_tool_use"`
4749
4750 - `BetaMCPToolResultBlock object { content, is_error, tool_use_id, type }`
4721 default: mcp_tool_use
4722
4723 - `BetaMCPToolResultBlock object`
47514724
47524725 - `content: string or array of BetaTextBlock`
47534726
from line 4736
47634736
47644737 - `text: string`
47654738
4739 maxLength: 5000000, minLength: 0
4740
47664741 - `type: "text"`
47674742
4743 default: text
4744
47684745 - `is_error: boolean`
47694746
4747 default: false
4748
47704749 - `tool_use_id: string`
47714750
4751 pattern: ^[a-zA-Z0-9_-]+$
4752
47724753 - `type: "mcp_tool_result"`
47734754
4774 - `"mcp_tool_result"`
4775
4776 - `BetaContainerUploadBlock object { file_id, type }`
4755 default: mcp_tool_result
4756
4757 - `BetaContainerUploadBlock object`
47774758
47784759 Response model for a file uploaded to the container.
47794760
from line 4762
47814762
47824763 - `type: "container_upload"`
47834764
4784 - `"container_upload"`
4785
4786 - `BetaCompactionBlock object { content, encrypted_content, type }`
4765 default: container_upload
4766
4767 - `BetaCompactionBlock object`
47874768
47884769 A compaction block returned when autocompact is triggered.
47894770
from line 4782
48014782
48024783 - `type: "compaction"`
48034784
4804 - `"compaction"`
4805
4806 - `BetaFallbackBlock object { from, to, trigger, type }`
4785 default: compaction
4786
4787 - `BetaFallbackBlock object`
48074788
48084789 Marks the point in `content` where one model's output gives way to the next.
48094790
from line 4910
49294910
49304911 - `type: "refusal"`
49314912
4932 - `"refusal"`
4913 default: refusal
49334914
49344915 - `type: "fallback"`
49354916
4936 - `"fallback"`
4917 default: fallback
49374918
49384919 - `context_management: BetaContextManagementResponse or null`
49394920
from line 4926
49454926
49464927 List of context management edits that were applied.
49474928
4948 - `BetaClearToolUses20250919EditResponse object { cleared_input_tokens, cleared_tool_uses, type }`
4929 - `BetaClearToolUses20250919EditResponse object`
49494930
49504931 - `cleared_input_tokens: number`
49514932
49524933 Number of input tokens cleared by this edit.
49534934
4935 minimum: 0
4936
49544937 - `cleared_tool_uses: number`
49554938
49564939 Number of tool uses that were cleared.
49574940
4941 minimum: 0
4942
49584943 - `type: "clear_tool_uses_20250919"`
49594944
49604945 The type of context management edit applied.
49614946
4962 - `"clear_tool_uses_20250919"`
4963
4964 - `BetaClearThinking20251015EditResponse object { cleared_input_tokens, cleared_thinking_turns, type }`
4947 default: clear_tool_uses_20250919
4948
4949 - `BetaClearThinking20251015EditResponse object`
49654950
49664951 - `cleared_input_tokens: number`
49674952
49684953 Number of input tokens cleared by this edit.
49694954
4955 minimum: 0
4956
49704957 - `cleared_thinking_turns: number`
49714958
49724959 Number of thinking turns that were cleared.
49734960
4961 minimum: 0
4962
49744963 - `type: "clear_thinking_20251015"`
49754964
49764965 The type of context management edit applied.
49774966
4978 - `"clear_thinking_20251015"`
4967 default: clear_thinking_20251015
49794968
49804969 - `diagnostics: BetaDiagnostics or null`
49814970
from line 4975
49864975
49874976 Explains why the prompt cache could not fully reuse the prefix from the request identified by `diagnostics.previous_message_id`. `null` means diagnosis is still pending — the response was serialized before the background comparison completed.
49884977
4989 - `BetaCacheMissModelChanged object { cache_missed_input_tokens, type }`
4978 - `BetaCacheMissModelChanged object`
49904979
49914980 - `cache_missed_input_tokens: number`
49924981
from line 4983
49944983
49954984 - `type: "model_changed"`
49964985
4997 - `"model_changed"`
4998
4999 - `BetaCacheMissSystemChanged object { cache_missed_input_tokens, type }`
4986 default: model_changed
4987
4988 - `BetaCacheMissSystemChanged object`
50004989
50014990 - `cache_missed_input_tokens: number`
50024991
from line 4993
50044993
50054994 - `type: "system_changed"`
50064995
5007 - `"system_changed"`
5008
5009 - `BetaCacheMissToolsChanged object { cache_missed_input_tokens, type }`
4996 default: system_changed
4997
4998 - `BetaCacheMissToolsChanged object`
50104999
50115000 - `cache_missed_input_tokens: number`
50125001
from line 5003
50145003
50155004 - `type: "tools_changed"`
50165005
5017 - `"tools_changed"`
5018
5019 - `BetaCacheMissMessagesChanged object { cache_missed_input_tokens, type }`
5006 default: tools_changed
5007
5008 - `BetaCacheMissMessagesChanged object`
50205009
50215010 - `cache_missed_input_tokens: number`
50225011
from line 5013
50245013
50255014 - `type: "messages_changed"`
50265015
5027 - `"messages_changed"`
5028
5029 - `BetaCacheMissPreviousMessageNotFound object { type }`
5016 default: messages_changed
5017
5018 - `BetaCacheMissPreviousMessageNotFound object`
50305019
50315020 - `type: "previous_message_not_found"`
50325021
5033 - `"previous_message_not_found"`
5034
5035 - `BetaCacheMissUnavailable object { type }`
5022 default: previous_message_not_found
5023
5024 - `BetaCacheMissUnavailable object`
50365025
50375026 - `type: "unavailable"`
50385027
5039 - `"unavailable"`
5028 default: unavailable
50405029
50415030 - `model: Model`
50425031
from line 5039
50505039
50515040 This will always be `"assistant"`.
50525041
5053 - `"assistant"`
5042 default: assistant
50545043
50555044 - `stop_details: BetaRefusalStopDetails or null`
50565045
from line 5126
51375126
51385127 - `type: "refusal"`
51395128
5140 - `"refusal"`
5129 default: refusal
51415130
51425131 - `stop_reason: BetaStopReason or null`
51435132
from line 5172
51835172
51845173 For Messages, this is always `"message"`.
51855174
5186 - `"message"`
5175 default: message
51875176
51885177 - `usage: BetaUsage`
51895178
from line 5194
52055194
52065195 The number of input tokens used to create the 1 hour cache entry.
52075196
5197 default: 0, minimum: 0
5198
52085199 - `ephemeral_5m_input_tokens: number`
52095200
52105201 The number of input tokens used to create the 5 minute cache entry.
52115202
5203 default: 0, minimum: 0
5204
52125205 - `cache_creation_input_tokens: number or null`
52135206
52145207 The number of input tokens used to create the cache entry.
52155208
5209 minimum: 0
5210
52165211 - `cache_read_input_tokens: number or null`
52175212
52185213 The number of input tokens read from the cache.
5214
5215 minimum: 0
52195216
52205217 - `fallback_credit: BetaFallbackCreditUsage or null`
52215218
from line 5227
52305227 resulting shift is zero because there was nothing to move. `not_applied`:
52315228 no reprice was applied; the arm's `reason` says why.
52325229
5233 - `BetaFallbackCreditRedeemed object { type }`
5230 - `BetaFallbackCreditRedeemed object`
52345231
52355232 The reprice was applied: the retry is billed as if the conversation
52365233 had been on the retry model all along.
52375234
52385235 - `type: "redeemed"`
52395236
5240 - `"redeemed"`
5241
5242 - `BetaFallbackCreditNotApplied object { reason, type, remove_to_redeem }`
5237 default: redeemed
5238
5239 - `BetaFallbackCreditNotApplied object`
52435240
52445241 No reprice was applied; `reason` says why.
52455242
from line 5273
52765273
52775274 - `type: "not_applied"`
52785275
5279 - `"not_applied"`
5276 default: not_applied
52805277
52815278 - `remove_to_redeem: optional array of string or null`
52825279
from line 5294
52975294
52985295 The number of input tokens which were used.
52995296
5297 minimum: 0
5298
53005299 - `iterations: BetaIterationsUsage or null`
53015300
53025301 Per-iteration token usage breakdown.
from line 5306
53075306 - Calculate the true context window size from the last iteration
53085307 - Understand token accumulation across server-side tool use loops
53095308
5310 - `BetaMessageIterationUsage object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 4 more }`
5309 - `BetaMessageIterationUsage object`
53115310
53125311 Token usage for a sampling iteration.
53135312
from line 5318
53195318
53205319 The number of input tokens used to create the cache entry.
53215320
5321 default: 0, minimum: 0
5322
53225323 - `cache_read_input_tokens: number`
53235324
53245325 The number of input tokens read from the cache.
53255326
5327 default: 0, minimum: 0
5328
53265329 - `input_tokens: number`
53275330
53285331 The number of input tokens which were used.
53295332
5333 minimum: 0
5334
53305335 - `model: Model`
53315336
53325337 The model that will complete your prompt.
from line 5342
53375342
53385343 The number of output tokens which were used.
53395344
5345 minimum: 0
5346
53405347 - `type: "message"`
53415348
53425349 Usage for a sampling iteration
53435350
5344 - `"message"`
5345
5346 - `BetaCompactionIterationUsage object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
5351 default: message
5352
5353 - `BetaCompactionIterationUsage object`
53475354
53485355 Token usage for a compaction iteration.
53495356
from line 5362
53555362
53565363 The number of input tokens used to create the cache entry.
53575364
5365 default: 0, minimum: 0
5366
53585367 - `cache_read_input_tokens: number`
53595368
53605369 The number of input tokens read from the cache.
53615370
5371 default: 0, minimum: 0
5372
53625373 - `input_tokens: number`
53635374
53645375 The number of input tokens which were used.
53655376
5377 minimum: 0
5378
53665379 - `output_tokens: number`
53675380
53685381 The number of output tokens which were used.
53695382
5383 minimum: 0
5384
53705385 - `type: "compaction"`
53715386
53725387 Usage for a compaction iteration
53735388
5374 - `"compaction"`
5375
5376 - `BetaAdvisorMessageIterationUsage object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 4 more }`
5389 default: compaction
5390
5391 - `BetaAdvisorMessageIterationUsage object`
53775392
53785393 Token usage for an advisor sub-inference iteration.
53795394
from line 5400
53855400
53865401 The number of input tokens used to create the cache entry.
53875402
5403 default: 0, minimum: 0
5404
53885405 - `cache_read_input_tokens: number`
53895406
53905407 The number of input tokens read from the cache.
53915408
5409 default: 0, minimum: 0
5410
53925411 - `input_tokens: number`
53935412
53945413 The number of input tokens which were used.
53955414
5415 minimum: 0
5416
53965417 - `model: Model`
53975418
53985419 The model that will complete your prompt.
from line 5424
54035424
54045425 The number of output tokens which were used.
54055426
5427 minimum: 0
5428
54065429 - `type: "advisor_message"`
54075430
54085431 Usage for an advisor sub-inference iteration
54095432
5410 - `"advisor_message"`
5411
5412 - `BetaFallbackMessageIterationUsage object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 4 more }`
5433 default: advisor_message
5434
5435 - `BetaFallbackMessageIterationUsage object`
54135436
54145437 Token usage for the fallback-model attempt of a server-side fallback request.
54155438
from line 5449
54265449
54275450 The number of input tokens used to create the cache entry.
54285451
5452 default: 0, minimum: 0
5453
54295454 - `cache_read_input_tokens: number`
54305455
54315456 The number of input tokens read from the cache.
54325457
5458 default: 0, minimum: 0
5459
54335460 - `input_tokens: number`
54345461
54355462 The number of input tokens which were used.
54365463
5464 minimum: 0
5465
54375466 - `model: Model`
54385467
54395468 The model that will complete your prompt.
from line 5473
54445473
54455474 The number of output tokens which were used.
54465475
5476 minimum: 0
5477
54475478 - `type: "fallback_message"`
54485479
54495480 Usage for the fallback-model attempt that served the response
54505481
5451 - `"fallback_message"`
5482 default: fallback_message
54525483
54535484 - `output_tokens: number`
54545485
54555486 The number of output tokens which were used.
5487
5488 minimum: 0
54565489
54575490 - `output_tokens_details: BetaOutputTokensDetails or null`
54585491
from line 5507
54745507 generation count by a small number of tokens. Always ≤ `output_tokens`;
54755508 `output_tokens - thinking_tokens` approximates the non-reasoning output.
54765509
5510 default: 0, minimum: 0
5511
54775512 - `server_tool_use: BetaServerToolUsage or null`
54785513
54795514 The number of server tool requests.
from line 5517
54825517
54835518 The number of web fetch tool requests.
54845519
5520 default: 0, minimum: 0
5521
54855522 - `web_search_requests: number`
54865523
54875524 The number of web search tool requests.
54885525
5526 default: 0, minimum: 0
5527
54895528 - `service_tier: "standard" or "priority" or "batch" or null`
54905529
54915530 If the request used the priority, standard, or batch tier.
from line 5543
55045543
55055544 - `"fast"`
55065545
5507### Example
5508
5509```http
5546- `BetaRawMessageStreamEvent = BetaRawMessageStartEvent or BetaRawMessageDeltaEvent or BetaRawMessageStopEvent or 3 more`
5547
5548 - `BetaRawMessageStartEvent object`
5549
5550 - `message: BetaMessage`
5551
5552 - `type: "message_start"`
5553
5554 default: message_start
5555
5556 - `BetaRawMessageDeltaEvent object`
5557
5558 - `context_management: BetaContextManagementResponse or null`
5559
5560 Information about context management strategies applied during the request
5561
5562 - `delta: object`
5563
5564 - `container: BetaContainer or null`
5565
5566 Information about the container used in the request (for the code execution tool)
5567
5568 - `stop_details: BetaRefusalStopDetails or null`
5569
5570 Structured information about a refusal.
5571
5572 - `stop_reason: BetaStopReason or null`
5573
5574 - `stop_sequence: string or null`
5575
5576 - `type: "message_delta"`
5577
5578 default: message_delta
5579
5580 - `usage: BetaMessageDeltaUsage`
5581
5582 Billing and rate-limit usage.
5583
5584 Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
5585
5586 Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
5587
5588 For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
5589
5590 Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
5591
5592 - `cache_creation_input_tokens: number or null`
5593
5594 The cumulative number of input tokens used to create the cache entry.
5595
5596 minimum: 0
5597
5598 - `cache_read_input_tokens: number or null`
5599
5600 The cumulative number of input tokens read from the cache.
5601
5602 minimum: 0
5603
5604 - `fallback_credit: BetaFallbackCreditUsage or null`
5605
5606 Outcome of the `fallback_credit_token` presented on this request.
5607
5608 - `input_tokens: number or null`
5609
5610 The cumulative number of input tokens which were used.
5611
5612 minimum: 0
5613
5614 - `iterations: BetaIterationsUsage or null`
5615
5616 Per-iteration token usage breakdown.
5617
5618 Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
5619
5620 - Determine which iterations exceeded long context thresholds (>=200k tokens)
5621 - Calculate the true context window size from the last iteration
5622 - Understand token accumulation across server-side tool use loops
5623
5624 - `output_tokens: number`
5625
5626 The cumulative number of output tokens which were used.
5627
5628 - `output_tokens_details: BetaOutputTokensDetails or null`
5629
5630 Breakdown of output tokens by category.
5631
5632 `output_tokens` remains the inclusive, authoritative total used for billing.
5633 This object provides a read-only decomposition for observability — for example,
5634 how many of the billed output tokens were spent on internal reasoning that may
5635 have been summarized before being returned to you.
5636
5637 - `server_tool_use: BetaServerToolUsage or null`
5638
5639 The number of server tool requests.
5640
5641 - `BetaRawMessageStopEvent object`
5642
5643 - `type: "message_stop"`
5644
5645 default: message_stop
5646
5647 - `BetaRawContentBlockStartEvent object`
5648
5649 - `content_block: BetaTextBlock or BetaThinkingBlock or BetaRedactedThinkingBlock or 14 more`
5650
5651 Response model for a file uploaded to the container.
5652
5653 - `BetaTextBlock object`
5654
5655 - `BetaThinkingBlock object`
5656
5657 - `BetaRedactedThinkingBlock object`
5658
5659 - `BetaToolUseBlock object`
5660
5661 - `BetaServerToolUseBlock object`
5662
5663 - `BetaWebSearchToolResultBlock object`
5664
5665 - `BetaWebFetchToolResultBlock object`
5666
5667 - `BetaAdvisorToolResultBlock object`
5668
5669 - `BetaCodeExecutionToolResultBlock object`
5670
5671 - `BetaBashCodeExecutionToolResultBlock object`
5672
5673 - `BetaTextEditorCodeExecutionToolResultBlock object`
5674
5675 - `BetaToolSearchToolResultBlock object`
5676
5677 - `BetaMCPToolUseBlock object`
5678
5679 - `BetaMCPToolResultBlock object`
5680
5681 - `BetaContainerUploadBlock object`
5682
5683 Response model for a file uploaded to the container.
5684
5685 - `BetaCompactionBlock object`
5686
5687 A compaction block returned when autocompact is triggered.
5688
5689 When content is None, it indicates the compaction failed to produce a valid
5690 summary (e.g., malformed output from the model). Clients may round-trip
5691 compaction blocks with null content; the server treats them as no-ops.
5692
5693 - `BetaFallbackBlock object`
5694
5695 Marks the point in `content` where one model's output gives way to the next.
5696
5697 One block appears per hop where a preceding model actually ran this turn and
5698 declined. A turn where no preceding model ran and declined has no such
5699 boundary and carries no block — the signal for whether a fallback model
5700 served the response is the presence of a `fallback_message` entry in
5701 `usage.iterations`, not this block.
5702
5703 The block is treated like a server-tool content block for streaming: it
5704 arrives via the standard `content_block_start` / `content_block_stop`
5705 pair and carries no deltas.
5706
5707 - `index: number`
5708
5709 - `type: "content_block_start"`
5710
5711 default: content_block_start
5712
5713 - `BetaRawContentBlockDeltaEvent object`
5714
5715 - `delta: BetaRawContentBlockDelta`
5716
5717 - `BetaTextDelta object`
5718
5719 - `text: string`
5720
5721 - `type: "text_delta"`
5722
5723 default: text_delta
5724
5725 - `BetaInputJSONDelta object`
5726
5727 - `partial_json: string`
5728
5729 - `type: "input_json_delta"`
5730
5731 default: input_json_delta
5732
5733 - `BetaCitationsDelta object`
5734
5735 - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
5736
5737 - `BetaCitationCharLocation object`
5738
5739 - `BetaCitationPageLocation object`
5740
5741 - `BetaCitationContentBlockLocation object`
5742
5743 - `BetaCitationsWebSearchResultLocation object`
5744
5745 - `BetaCitationSearchResultLocation object`
5746
5747 - `type: "citations_delta"`
5748
5749 default: citations_delta
5750
5751 - `BetaThinkingDelta object`
5752
5753 - `estimated_tokens: number or null`
5754
5755 Per-frame increment of a coarse, running estimate of the tokens this thinking block has produced so far. Present whenever the `thinking-token-count-2026-05-13` beta is set; `null` unless `thinking.display` resolves to `"omitted"` and a count is due this frame. Sum the increments across `thinking_delta` frames on this block for a progress indicator. Each increment is a non-negative multiple of a fixed quantum and the cadence is rate-limited, so this is a deliberately lossy display hint, not a billable count; `usage.output_tokens` remains authoritative.
5756
5757 - `thinking: string`
5758
5759 The incremental `thinking` text for this content block. Concatenate the `thinking` values of successive `thinking_delta` events to assemble the block's full `thinking` value.
5760
5761 - `type: "thinking_delta"`
5762
5763 default: thinking_delta
5764
5765 - `BetaSignatureDelta object`
5766
5767 - `signature: string`
5768
5769 The `signature` for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a `signature_delta` event just before the block's `content_block_stop` event.
5770
5771 - `type: "signature_delta"`
5772
5773 default: signature_delta
5774
5775 - `BetaCompactionContentBlockDelta object`
5776
5777 - `content: string or null`
5778
5779 - `encrypted_content: string or null`
5780
5781 Opaque metadata from prior compaction, to be round-tripped verbatim
5782
5783 - `type: "compaction_delta"`
5784
5785 default: compaction_delta
5786
5787 - `index: number`
5788
5789 - `type: "content_block_delta"`
5790
5791 default: content_block_delta
5792
5793 - `BetaRawContentBlockStopEvent object`
5794
5795 - `index: number`
5796
5797 - `type: "content_block_stop"`
5798
5799 default: content_block_stop
5800
5801## Example
5802
5803```bash
55105804curl https://api.anthropic.com/v1/messages \
55115805 -H 'Content-Type: application/json' \
55125806 -H 'anthropic-version: 2023-06-01' \
from line 5846
55525846 }'
55535847```
55545848
5555#### Response
5849### Response (200)
55565850
55575851```json
55585852{
55595853
No line in this hunk matches that.