The whole hunk
from line 1, old and new numbered
/
lines
The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.
from line 1
1---
2title: Create a Message
3url: https://platform.claude.com/docs/en/api/beta/messages/create
4---
5
16# Create a Message
27
38**POST** `/v1/messages`
from line 21
1621
1722 - `string`
1823
19 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
24 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2025
2126 - `"message-batches-2024-09-24"`
2227
from line 69
6469
6570 - `"user-profiles-2026-08-18"`
6671
72 - `"user-profiles-2026-09-04"`
73
6774 - `"advisor-tool-2026-03-01"`
6875
6976 - `"managed-agents-2026-04-01"`
from line 116
109116- `"anthropic-user-profile-id": optional string`
110117
111118 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.
119
120- `"anthropic-workspace-id": optional string`
112121
113122## Body parameters
114123
from line 192
183192
184193 - `BetaTextBlockParam object`
185194
195 - `type: "text"`
196
186197 - `text: string`
187198
188199 minLength: 1
189
190 - `type: "text"`
191200
192201 - `cache_control: optional BetaCacheControlEphemeral or null`
193202
from line 223
214223
215224 - `BetaCitationCharLocationParam object`
216225
226 - `type: "char_location"`
227
217228 - `cited_text: string`
218229
219230 - `document_index: number`
from line 241
230241
231242 minimum: 0
232243
233 - `type: "char_location"`
234
235244 - `BetaCitationPageLocationParam object`
236245
246 - `type: "page_location"`
247
237248 - `cited_text: string`
238249
239250 - `document_index: number`
from line 261
250261
251262 minimum: 1
252263
253 - `type: "page_location"`
254
255264 - `BetaCitationContentBlockLocationParam object`
256265
266 - `type: "content_block_location"`
267
257268 - `cited_text: string`
258269
259270 The full text of the cited block range, concatenated.
from line 291
280291
281292 minimum: 0
282293
283 - `type: "content_block_location"`
284
285294 - `BetaCitationWebSearchResultLocationParam object`
286295
296 - `type: "web_search_result_location"`
297
287298 - `cited_text: string`
288299
289300 - `encrypted_index: string`
from line 303
292303
293304 maxLength: 512, minLength: 1
294305
295 - `type: "web_search_result_location"`
296
297306 - `url: string`
298307
299308 minLength: 1
300309
301310 - `BetaCitationSearchResultLocationParam object`
302311
312 - `type: "search_result_location"`
313
303314 - `cited_text: string`
304315
305316 The full text of the cited block range, concatenated.
from line 341
330341
331342 - `title: string or null`
332343
333 - `type: "search_result_location"`
334
335344 - `BetaImageBlockParam object`
336345
346 - `type: "image"`
347
337348 - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
338349
339350 - `BetaBase64ImageSource object`
340351
352 - `type: "base64"`
353
341354 - `data: string`
342355
343356 format: byte
from line 365
352365
353366 - `"image/webp"`
354367
368 - `BetaURLImageSource object`
369
370 - `type: "url"`
371
372 - `url: string`
373
374 - `BetaFileImageSource object`
375
376 - `type: "file"`
377
378 - `file_id: string`
379
380 - `cache_control: optional BetaCacheControlEphemeral or null`
381
382 Create a cache control breakpoint at this content block.
383
384 - `transformations: optional BetaImageTransformationsParam or null`
385
386 Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
387
388 - `oversized_image: optional "downsize" or "error"`
389
390 What the server does when this image exceeds the model's maximum image size. `"downsize"` (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. `"error"` instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
391
392 - `"downsize"`
393
394 - `"error"`
395
396 - `BetaRequestDocumentBlock object`
397
398 - `type: "document"`
399
400 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
401
402 - `BetaBase64PDFSource object`
403
355404 - `type: "base64"`
356405
357 - `BetaURLImageSource object`
406 - `data: string`
407
408 format: byte
409
410 - `media_type: "application/pdf"`
411
412 - `BetaPlainTextSource object`
413
414 - `type: "text"`
415
416 - `data: string`
417
418 - `media_type: "text/plain"`
419
420 - `BetaContentBlockSource object`
421
422 - `type: "content"`
423
424 - `content: string or array of BetaContentBlockSourceContent`
425
426 - `string`
427
428 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
429
430 - `BetaTextBlockParam object`
431
432 - `BetaImageBlockParam object`
433
434 - `BetaURLPDFSource object`
358435
359436 - `type: "url"`
360437
361438 - `url: string`
362439
363 - `BetaFileImageSource object`
440 - `BetaFileDocumentSource object`
441
442 - `type: "file"`
364443
365444 - `file_id: string`
366445
367 - `type: "file"`
368
369 - `type: "image"`
370
371446 - `cache_control: optional BetaCacheControlEphemeral or null`
372447
373448 Create a cache control breakpoint at this content block.
374449
375 - `transformations: optional BetaImageTransformationsParam or null`
376
377 Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
378
379 - `oversized_image: optional "downsize" or "error"`
380
381 What the server does when this image exceeds the model's maximum image size. `"downsize"` (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. `"error"` instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
382
383 - `"downsize"`
384
385 - `"error"`
386
387 - `BetaRequestDocumentBlock object`
388
389 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
390
391 - `BetaBase64PDFSource object`
392
393 - `data: string`
394
395 format: byte
396
397 - `media_type: "application/pdf"`
398
399 - `type: "base64"`
400
401 - `BetaPlainTextSource object`
402
403 - `data: string`
404
405 - `media_type: "text/plain"`
406
407 - `type: "text"`
408
409 - `BetaContentBlockSource object`
410
411 - `content: string or array of BetaContentBlockSourceContent`
412
413 - `string`
414
415 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
416
417 - `BetaTextBlockParam object`
418
419 - `BetaImageBlockParam object`
420
421 - `type: "content"`
422
423 - `BetaURLPDFSource object`
424
425 - `type: "url"`
426
427 - `url: string`
428
429 - `BetaFileDocumentSource object`
430
431 - `file_id: string`
432
433 - `type: "file"`
434
435 - `type: "document"`
450 - `citations: optional BetaCitationsConfigParam or null`
451
452 - `enabled: optional boolean`
453
454 - `context: optional string or null`
455
456 minLength: 1
457
458 - `title: optional string or null`
459
460 maxLength: 500, minLength: 1
461
462 - `BetaSearchResultBlockParam object`
463
464 - `type: "search_result"`
465
466 - `content: array of BetaTextBlockParam`
467
468 - `type: "text"`
469
470 - `text: string`
471
472 minLength: 1
473
474 - `cache_control: optional BetaCacheControlEphemeral or null`
475
476 Create a cache control breakpoint at this content block.
477
478 - `citations: optional array of BetaTextCitationParam or null`
479
480 - `source: string`
481
482 - `title: string`
436483
437484 - `cache_control: optional BetaCacheControlEphemeral or null`
438485
439486 Create a cache control breakpoint at this content block.
440487
441 - `citations: optional BetaCitationsConfigParam or null`
442
443 - `enabled: optional boolean`
444
445 - `context: optional string or null`
446
447 minLength: 1
448
449 - `title: optional string or null`
450
451 maxLength: 500, minLength: 1
452
453 - `BetaSearchResultBlockParam object`
454
455 - `content: array of BetaTextBlockParam`
456
457 - `text: string`
458
459 minLength: 1
460
461 - `type: "text"`
462
463 - `cache_control: optional BetaCacheControlEphemeral or null`
464
465 Create a cache control breakpoint at this content block.
466
467 - `citations: optional array of BetaTextCitationParam or null`
468
469 - `source: string`
470
471 - `title: string`
472
473 - `type: "search_result"`
488 - `citations: optional BetaCitationsConfigParam`
489
490 - `BetaThinkingBlockParam object`
491
492 - `type: "thinking"`
493
494 - `signature: string`
495
496 The `signature` value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
497
498 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
499
500 - `thinking: string`
501
502 The `thinking` text of this block as returned by the API.
503
504 - `BetaRedactedThinkingBlockParam object`
505
506 - `type: "redacted_thinking"`
507
508 - `data: string`
509
510 The `data` value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.
511
512 - `BetaToolUseBlockParam object`
513
514 - `type: "tool_use"`
515
516 - `id: string`
517
518 pattern: ^[a-zA-Z0-9_-]+$
519
520 - `input: map[unknown]`
521
522 - `name: string`
523
524 maxLength: 200, minLength: 1
474525
475526 - `cache_control: optional BetaCacheControlEphemeral or null`
476527
477528 Create a cache control breakpoint at this content block.
478529
479 - `citations: optional BetaCitationsConfigParam`
480
481 - `BetaThinkingBlockParam object`
482
483 - `signature: string`
484
485 The `signature` value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
486
487 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
488
489 - `thinking: string`
490
491 The `thinking` text of this block as returned by the API.
492
493 - `type: "thinking"`
494
495 - `BetaRedactedThinkingBlockParam object`
496
497 - `data: string`
498
499 The `data` value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.
500
501 - `type: "redacted_thinking"`
502
503 - `BetaToolUseBlockParam object`
504
505 - `id: string`
530 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
531
532 Tool invocation directly from the model.
533
534 - `BetaDirectCaller object`
535
536 Tool invocation directly from the model.
537
538 - `type: "direct"`
539
540 - `BetaServerToolCaller object`
541
542 Tool invocation generated by a server-side tool.
543
544 - `type: "code_execution_20250825"`
545
546 - `tool_id: string`
547
548 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
549
550 - `BetaServerToolCaller20260120 object`
551
552 - `type: "code_execution_20260120"`
553
554 - `tool_id: string`
555
556 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
557
558 - `toolset_name: optional string or null`
559
560 For a toolset member tool_use, the toolset family this member belongs to.
561
562 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
563
564 - `BetaToolResultBlockParam object`
565
566 - `type: "tool_result"`
567
568 - `tool_use_id: string`
506569
507570 pattern: ^[a-zA-Z0-9_-]+$
508571
509 - `input: map[unknown]`
510
511 - `name: string`
512
513 maxLength: 200, minLength: 1
514
515 - `type: "tool_use"`
516
517572 - `cache_control: optional BetaCacheControlEphemeral or null`
518573
519574 Create a cache control breakpoint at this content block.
520575
521 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
522
523 Tool invocation directly from the model.
524
525 - `BetaDirectCaller object`
526
527 Tool invocation directly from the model.
528
529 - `type: "direct"`
530
531 - `BetaServerToolCaller object`
532
533 Tool invocation generated by a server-side tool.
534
535 - `tool_id: string`
536
537 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
538
539 - `type: "code_execution_20250825"`
540
541 - `BetaServerToolCaller20260120 object`
542
543 - `tool_id: string`
544
545 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
546
547 - `type: "code_execution_20260120"`
548
549 - `toolset_name: optional string or null`
550
551 For a toolset member tool_use, the toolset family this member belongs to.
552
553 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
554
555 - `BetaToolResultBlockParam object`
556
557 - `tool_use_id: string`
558
559 pattern: ^[a-zA-Z0-9_-]+$
560
561 - `type: "tool_result"`
562
563 - `cache_control: optional BetaCacheControlEphemeral or null`
564
565 Create a cache control breakpoint at this content block.
566
567576 - `content: optional string or array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 3 more`
568577
569578 - `string`
from line 591
582591
583592 Tool reference block that can be included in tool_result content.
584593
594 - `type: "tool_reference"`
595
585596 - `tool_name: string`
586597
587598 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
588
589 - `type: "tool_reference"`
590599
591600 - `cache_control: optional BetaCacheControlEphemeral or null`
592601
from line 611
602611 browser toolset member `tool_use`. The server renders the
603612 model-visible text from it; the model never sees the raw fields.
604613
614 - `type: "browser_state"`
615
605616 - `tabs: array of BetaBrowserStateTabEntry`
606617
607618 All tabs open in the browser after this call — the full inventory, not a delta. May be empty. Whenever non-empty, exactly one entry carries `active: true`.
from line 640
629640 - `active: optional boolean`
630641
631642 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
632
633 - `type: "browser_state"`
634643
635644 - `cache_control: optional BetaCacheControlEphemeral or null`
636645
from line 661
652661 during a failed call gets no deferred `tab_opened`; it simply appears
653662 in the next result's `tabs` inventory.
654663
664 - `type: "tab_opened"`
665
655666 - `tab_id: string`
656667
657668 The `tab_id` of the opened tab, present in `tabs`.
658669
659670 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
660671
661 - `type: "tab_opened"`
662
663672 - `BetaBrowserStateChangeDownloadStarted object`
664673
665674 A file download that started during this call.
666675
676 - `type: "download_started"`
677
667678 - `download_id: string`
668679
669680 The caller-assigned identifier for this download, stable across the state changes reporting it.
670681
671682 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
672
673 - `type: "download_started"`
674683
675684 - `url: string`
676685
from line 694
685694 `download_started`, when the download finished during the call that
686695 started it (at most one state change per `download_id` per result).
687696
697 - `type: "download_completed"`
698
688699 - `download_id: string`
689700
690701 The caller-assigned identifier for this download, stable across the state changes reporting it.
691702
692703 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
693704
694 - `type: "download_completed"`
695
696705 - `url: string`
697706
698707 The final post-redirect URL the download was served from.
from line 724
715724
716725 A file download that failed — or was cancelled — during this call.
717726
727 - `type: "download_failed"`
728
718729 - `download_id: string`
719730
720731 The caller-assigned identifier for this download, stable across the state changes reporting it.
721732
722733 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
723734
724 - `type: "download_failed"`
725
726735 - `url: string`
727736
728737 The final post-redirect URL the download was served from.
from line 754
745754
746755 - `BetaServerToolUseBlockParam object`
747756
757 - `type: "server_tool_use"`
758
748759 - `id: string`
749760
750761 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 780
769780
770781 - `"tool_search_tool_bm25"`
771782
772 - `type: "server_tool_use"`
773
774783 - `cache_control: optional BetaCacheControlEphemeral or null`
775784
776785 Create a cache control breakpoint at this content block.
from line 800
791800
792801 - `BetaWebSearchToolResultBlockParam object`
793802
803 - `type: "web_search_tool_result"`
804
794805 - `content: BetaWebSearchToolResultBlockParamContent`
795806
796807 - `ResultBlock = array of BetaWebSearchResultBlockParam`
797808
809 - `type: "web_search_result"`
810
798811 - `encrypted_content: string`
799812
800813 - `title: string`
801814
802 - `type: "web_search_result"`
803
804815 - `url: string`
805816
806817 - `page_age: optional string or null`
807818
808819 - `BetaWebSearchToolRequestError object`
809820
821 - `type: "web_search_tool_result_error"`
822
810823 - `error_code: BetaWebSearchToolResultErrorCode`
811824
812825 - `"invalid_tool_input"`
from line 834
821834
822835 - `"request_too_large"`
823836
824 - `type: "web_search_tool_result_error"`
825
826837 - `tool_use_id: string`
827838
828839 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
829840
830 - `type: "web_search_tool_result"`
831
832841 - `cache_control: optional BetaCacheControlEphemeral or null`
833842
834843 Create a cache control breakpoint at this content block.
from line 858
849858
850859 - `BetaWebFetchToolResultBlockParam object`
851860
861 - `type: "web_fetch_tool_result"`
862
852863 - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
853864
854865 - `BetaWebFetchToolResultErrorBlockParam object`
855866
867 - `type: "web_fetch_tool_result_error"`
868
856869 - `error_code: BetaWebFetchToolResultErrorCode`
857870
858871 - `"invalid_tool_input"`
from line 886
873886
874887 - `"unavailable"`
875888
876 - `type: "web_fetch_tool_result_error"`
889 - `"content_too_large"`
877890
878891 - `BetaWebFetchBlockParam object`
879892
893 - `type: "web_fetch_result"`
894
880895 - `content: BetaRequestDocumentBlock`
881896
882 - `type: "web_fetch_result"`
883
884897 - `url: string`
885898
886899 Fetched content URL
from line 906
893906
894907 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
895908
896 - `type: "web_fetch_tool_result"`
897
898909 - `cache_control: optional BetaCacheControlEphemeral or null`
899910
900911 Create a cache control breakpoint at this content block.
from line 926
915926
916927 - `BetaAdvisorToolResultBlockParam object`
917928
929 - `type: "advisor_tool_result"`
930
918931 - `content: BetaAdvisorToolResultErrorParam or BetaAdvisorResultBlockParam or BetaAdvisorRedactedResultBlockParam`
919932
920933 - `BetaAdvisorToolResultErrorParam object`
921934
935 - `type: "advisor_tool_result_error"`
936
922937 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
923938
924939 - `"max_uses_exceeded"`
from line 950
935950
936951 - `"model_not_found"`
937952
938 - `type: "advisor_tool_result_error"`
939
940953 - `BetaAdvisorResultBlockParam object`
941954
955 - `type: "advisor_result"`
956
942957 - `text: string`
943958
944 - `type: "advisor_result"`
945
946959 - `stop_reason: optional string or null`
947960
948961 - `BetaAdvisorRedactedResultBlockParam object`
949962
963 - `type: "advisor_redacted_result"`
964
950965 - `encrypted_content: string`
951966
952967 Opaque blob produced by a prior response; must be round-tripped verbatim.
953968
954 - `type: "advisor_redacted_result"`
955
956969 - `stop_reason: optional string or null`
957970
958971 - `tool_use_id: string`
959972
960973 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
961974
962 - `type: "advisor_tool_result"`
963
964975 - `cache_control: optional BetaCacheControlEphemeral or null`
965976
966977 Create a cache control breakpoint at this content block.
967978
968979 - `BetaCodeExecutionToolResultBlockParam object`
969980
981 - `type: "code_execution_tool_result"`
982
970983 - `content: BetaCodeExecutionToolResultBlockParamContent`
971984
972985 Code execution result with encrypted stdout for PFC + web_search results.
973986
974987 - `BetaCodeExecutionToolResultErrorParam object`
975988
989 - `type: "code_execution_tool_result_error"`
990
976991 - `error_code: BetaCodeExecutionToolResultErrorCode`
977992
978993 - `"invalid_tool_input"`
from line 998
983998
984999 - `"execution_time_exceeded"`
9851000
986 - `type: "code_execution_tool_result_error"`
987
9881001 - `BetaCodeExecutionResultBlockParam object`
9891002
1003 - `type: "code_execution_result"`
1004
9901005 - `content: array of BetaCodeExecutionOutputBlockParam`
9911006
1007 - `type: "code_execution_output"`
1008
9921009 - `file_id: string`
9931010
1011 - `return_code: number`
1012
1013 - `stderr: string`
1014
1015 - `stdout: string`
1016
1017 - `BetaEncryptedCodeExecutionResultBlockParam object`
1018
1019 Code execution result with encrypted stdout for PFC + web_search results.
1020
1021 - `type: "encrypted_code_execution_result"`
1022
1023 - `content: array of BetaCodeExecutionOutputBlockParam`
1024
9941025 - `type: "code_execution_output"`
9951026
1027 - `file_id: string`
1028
1029 - `encrypted_stdout: string`
1030
9961031 - `return_code: number`
9971032
9981033 - `stderr: string`
9991034
1035 - `tool_use_id: string`
1036
1037 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1038
1039 - `cache_control: optional BetaCacheControlEphemeral or null`
1040
1041 Create a cache control breakpoint at this content block.
1042
1043 - `BetaBashCodeExecutionToolResultBlockParam object`
1044
1045 - `type: "bash_code_execution_tool_result"`
1046
1047 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
1048
1049 - `BetaBashCodeExecutionToolResultErrorParam object`
1050
1051 - `type: "bash_code_execution_tool_result_error"`
1052
1053 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1054
1055 - `"invalid_tool_input"`
1056
1057 - `"unavailable"`
1058
1059 - `"too_many_requests"`
1060
1061 - `"execution_time_exceeded"`
1062
1063 - `"output_file_too_large"`
1064
1065 - `BetaBashCodeExecutionResultBlockParam object`
1066
1067 - `type: "bash_code_execution_result"`
1068
1069 - `content: array of BetaBashCodeExecutionOutputBlockParam`
1070
1071 - `type: "bash_code_execution_output"`
1072
1073 - `file_id: string`
1074
1075 - `return_code: number`
1076
1077 - `stderr: string`
1078
10001079 - `stdout: string`
10011080
1002 - `type: "code_execution_result"`
1003
1004 - `BetaEncryptedCodeExecutionResultBlockParam object`
1005
1006 Code execution result with encrypted stdout for PFC + web_search results.
1007
1008 - `content: array of BetaCodeExecutionOutputBlockParam`
1009
1010 - `file_id: string`
1011
1012 - `type: "code_execution_output"`
1013
1014 - `encrypted_stdout: string`
1015
1016 - `return_code: number`
1017
1018 - `stderr: string`
1019
1020 - `type: "encrypted_code_execution_result"`
1021
10221081 - `tool_use_id: string`
10231082
10241083 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10251084
1026 - `type: "code_execution_tool_result"`
1027
10281085 - `cache_control: optional BetaCacheControlEphemeral or null`
10291086
10301087 Create a cache control breakpoint at this content block.
10311088
1032 - `BetaBashCodeExecutionToolResultBlockParam object`
1033
1034 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
1035
1036 - `BetaBashCodeExecutionToolResultErrorParam object`
1089 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
1090
1091 - `type: "text_editor_code_execution_tool_result"`
1092
1093 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
1094
1095 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
1096
1097 - `type: "text_editor_code_execution_tool_result_error"`
10371098
10381099 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10391100
from line 1106
10451106
10461107 - `"execution_time_exceeded"`
10471108
1048 - `"output_file_too_large"`
1049
1050 - `type: "bash_code_execution_tool_result_error"`
1051
1052 - `BetaBashCodeExecutionResultBlockParam object`
1053
1054 - `content: array of BetaBashCodeExecutionOutputBlockParam`
1055
1056 - `file_id: string`
1057
1058 - `type: "bash_code_execution_output"`
1059
1060 - `return_code: number`
1061
1062 - `stderr: string`
1063
1064 - `stdout: string`
1065
1066 - `type: "bash_code_execution_result"`
1109 - `"file_not_found"`
1110
1111 - `error_message: optional string or null`
1112
1113 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
1114
1115 - `type: "text_editor_code_execution_view_result"`
1116
1117 - `content: string`
1118
1119 - `file_type: "text" or "image" or "pdf"`
1120
1121 - `"text"`
1122
1123 - `"image"`
1124
1125 - `"pdf"`
1126
1127 - `num_lines: optional number or null`
1128
1129 - `start_line: optional number or null`
1130
1131 - `total_lines: optional number or null`
1132
1133 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
1134
1135 - `type: "text_editor_code_execution_create_result"`
1136
1137 - `is_file_update: boolean`
1138
1139 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
1140
1141 - `type: "text_editor_code_execution_str_replace_result"`
1142
1143 - `lines: optional array of string or null`
1144
1145 - `new_lines: optional number or null`
1146
1147 - `new_start: optional number or null`
1148
1149 - `old_lines: optional number or null`
1150
1151 - `old_start: optional number or null`
10671152
10681153 - `tool_use_id: string`
10691154
10701155 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10711156
1072 - `type: "bash_code_execution_tool_result"`
1073
10741157 - `cache_control: optional BetaCacheControlEphemeral or null`
10751158
10761159 Create a cache control breakpoint at this content block.
10771160
1078 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
1079
1080 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
1081
1082 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
1083
1084 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1161 - `BetaToolSearchToolResultBlockParam object`
1162
1163 - `type: "tool_search_tool_result"`
1164
1165 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
1166
1167 - `BetaToolSearchToolResultErrorParam object`
1168
1169 - `type: "tool_search_tool_result_error"`
1170
1171 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
10851172
10861173 - `"invalid_tool_input"`
10871174
from line 1178
10911178
10921179 - `"execution_time_exceeded"`
10931180
1094 - `"file_not_found"`
1095
1096 - `type: "text_editor_code_execution_tool_result_error"`
1097
10981181 - `error_message: optional string or null`
10991182
1100 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
1101
1102 - `content: string`
1103
1104 - `file_type: "text" or "image" or "pdf"`
1105
1106 - `"text"`
1107
1108 - `"image"`
1109
1110 - `"pdf"`
1111
1112 - `type: "text_editor_code_execution_view_result"`
1113
1114 - `num_lines: optional number or null`
1115
1116 - `start_line: optional number or null`
1117
1118 - `total_lines: optional number or null`
1119
1120 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
1121
1122 - `is_file_update: boolean`
1123
1124 - `type: "text_editor_code_execution_create_result"`
1125
1126 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
1127
1128 - `type: "text_editor_code_execution_str_replace_result"`
1129
1130 - `lines: optional array of string or null`
1131
1132 - `new_lines: optional number or null`
1133
1134 - `new_start: optional number or null`
1135
1136 - `old_lines: optional number or null`
1137
1138 - `old_start: optional number or null`
1183 - `BetaToolSearchToolSearchResultBlockParam object`
1184
1185 - `type: "tool_search_tool_search_result"`
1186
1187 - `tool_references: array of BetaToolReferenceBlockParam`
1188
1189 - `type: "tool_reference"`
1190
1191 - `tool_name: string`
1192
1193 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1194
1195 - `cache_control: optional BetaCacheControlEphemeral or null`
1196
1197 Create a cache control breakpoint at this content block.
11391198
11401199 - `tool_use_id: string`
11411200
11421201 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
11431202
1144 - `type: "text_editor_code_execution_tool_result"`
1145
11461203 - `cache_control: optional BetaCacheControlEphemeral or null`
11471204
11481205 Create a cache control breakpoint at this content block.
11491206
1150 - `BetaToolSearchToolResultBlockParam object`
1151
1152 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
1153
1154 - `BetaToolSearchToolResultErrorParam object`
1155
1156 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
1157
1158 - `"invalid_tool_input"`
1159
1160 - `"unavailable"`
1161
1162 - `"too_many_requests"`
1163
1164 - `"execution_time_exceeded"`
1165
1166 - `type: "tool_search_tool_result_error"`
1167
1168 - `error_message: optional string or null`
1169
1170 - `BetaToolSearchToolSearchResultBlockParam object`
1171
1172 - `tool_references: array of BetaToolReferenceBlockParam`
1173
1174 - `tool_name: string`
1175
1176 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1177
1178 - `type: "tool_reference"`
1179
1180 - `cache_control: optional BetaCacheControlEphemeral or null`
1181
1182 Create a cache control breakpoint at this content block.
1183
1184 - `type: "tool_search_tool_search_result"`
1207 - `BetaMCPToolUseBlockParam object`
1208
1209 - `type: "mcp_tool_use"`
1210
1211 - `id: string`
1212
1213 pattern: ^[a-zA-Z0-9_-]+$
1214
1215 - `input: map[unknown]`
1216
1217 - `name: string`
1218
1219 - `server_name: string`
1220
1221 The name of the MCP server
1222
1223 - `cache_control: optional BetaCacheControlEphemeral or null`
1224
1225 Create a cache control breakpoint at this content block.
1226
1227 - `BetaRequestMCPToolResultBlockParam object`
1228
1229 - `type: "mcp_tool_result"`
11851230
11861231 - `tool_use_id: string`
11871232
1188 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1189
1190 - `type: "tool_search_tool_result"`
1233 pattern: ^[a-zA-Z0-9_-]+$
11911234
11921235 - `cache_control: optional BetaCacheControlEphemeral or null`
11931236
11941237 Create a cache control breakpoint at this content block.
11951238
1196 - `BetaMCPToolUseBlockParam object`
1197
1198 - `id: string`
1199
1200 pattern: ^[a-zA-Z0-9_-]+$
1201
1202 - `input: map[unknown]`
1203
1204 - `name: string`
1205
1206 - `server_name: string`
1207
1208 The name of the MCP server
1209
1210 - `type: "mcp_tool_use"`
1211
1212 - `cache_control: optional BetaCacheControlEphemeral or null`
1213
1214 Create a cache control breakpoint at this content block.
1215
1216 - `BetaRequestMCPToolResultBlockParam object`
1217
1218 - `tool_use_id: string`
1219
1220 pattern: ^[a-zA-Z0-9_-]+$
1221
1222 - `type: "mcp_tool_result"`
1223
1224 - `cache_control: optional BetaCacheControlEphemeral or null`
1225
1226 Create a cache control breakpoint at this content block.
1227
12281239 - `content: optional string or array of BetaTextBlockParam`
12291240
12301241 - `string`
12311242
12321243 - `BetaMCPToolResultBlockParamContent = array of BetaTextBlockParam`
12331244
1245 - `type: "text"`
1246
12341247 - `text: string`
12351248
12361249 minLength: 1
1237
1238 - `type: "text"`
12391250
12401251 - `cache_control: optional BetaCacheControlEphemeral or null`
12411252
from line 1261
12501261 A content block that represents a file to be uploaded to the container
12511262 Files uploaded via this block will be available in the container's input directory.
12521263
1264 - `type: "container_upload"`
1265
12531266 - `file_id: string`
1254
1255 - `type: "container_upload"`
12561267
12571268 - `cache_control: optional BetaCacheControlEphemeral or null`
12581269
from line 1300
12891300 `tool` references a tool (or MCP toolset) by name from the request's
12901301 `tools`; it is offered to the model from this point in the
12911302 conversation onward.
1303
1304 - `type: "tool_addition"`
12921305
12931306 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
12941307
from line 1317
13041317 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13051318 `mcp_toolset_reference` for those.
13061319
1320 - `type: "tool_reference"`
1321
13071322 - `name: string`
13081323
13091324 pattern: ^[a-zA-Z0-9_-]{1,128}$
1310
1311 - `type: "tool_reference"`
13121325
13131326 - `BetaToolChangeMCPToolReference object`
13141327
13151328 Reference to a single MCP tool by its server and remote name — the
13161329 same `server_name`/`name` pair `mcp_tool_use` carries.
13171330
1331 - `type: "mcp_tool_reference"`
1332
13181333 - `name: string`
13191334
13201335 - `server_name: string`
13211336
1322 - `type: "mcp_tool_reference"`
1323
13241337 - `BetaToolChangeMCPToolsetReference object`
13251338
13261339 Reference to every tool in the named MCP server's toolset.
13271340
1341 - `type: "mcp_toolset_reference"`
1342
13281343 - `server_name: string`
1329
1330 - `type: "mcp_toolset_reference"`
1331
1332 - `type: "tool_addition"`
13331344
13341345 - `cache_control: optional BetaCacheControlEphemeral or null`
13351346
from line 1353
13421353 `tool` references a tool (or MCP toolset) by name from the request's
13431354 `tools`; it is no longer offered to the model from this point in the
13441355 conversation onward.
1356
1357 - `type: "tool_removal"`
13451358
13461359 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
13471360
from line 1378
13651378 - `BetaToolChangeMCPToolsetReference object`
13661379
13671380 Reference to every tool in the named MCP server's toolset.
1368
1369 - `type: "tool_removal"`
13701381
13711382 - `cache_control: optional BetaCacheControlEphemeral or null`
13721383
from line 1399
13881399 likewise rejected; between non-thinking blocks the block's placement has
13891400 no validation effect.
13901401
1402 - `type: "fallback"`
1403
13911404 - `from: BetaFallbackInfoParam`
13921405
13931406 Identifies one hop of a fallback transition.
from line 1490
14771490 - `to: BetaFallbackInfoParam`
14781491
14791492 Identifies one hop of a fallback transition.
1480
1481 - `type: "fallback"`
14821493
14831494 - `trigger: optional unknown`
14841495
from line 1561
15501561
15511562 maxItems: 20
15521563
1564 - `type: "anthropic" or "custom"`
1565
1566 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1567
1568 - `"anthropic"`
1569
1570 - `"custom"`
1571
15531572 - `skill_id: string`
15541573
15551574 Skill ID
15561575
15571576 maxLength: 64, minLength: 1
1558
1559 - `type: "anthropic" or "custom"`
1560
1561 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1562
1563 - `"anthropic"`
1564
1565 - `"custom"`
15661577
15671578 - `version: optional string`
15681579
from line 1785
17741785
17751786 A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
17761787
1788 - `type: "json_schema"`
1789
17771790 - `schema: map[unknown]`
17781791
17791792 The JSON schema of the format
17801793
1781 - `type: "json_schema"`
1782
17831794 - `task_budget: optional BetaTokenTaskBudget or null`
17841795
17851796 User-configurable total token budget across contexts.
17861797
1798 - `type: "tokens"`
1799
1800 The budget type. Currently only 'tokens' is supported.
1801
17871802 - `total: number`
17881803
17891804 Total token budget across all contexts in the session.
17901805
17911806 minimum: 1024
17921807
1793 - `type: "tokens"`
1794
1795 The budget type. Currently only 'tokens' is supported.
1796
17971808 - `remaining: optional number or null`
17981809
17991810 Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.
from line 1823
18121823
18131824 - `BetaThinkingConfigEnabled object`
18141825
1826 - `type: "enabled"`
1827
18151828 - `budget_tokens: number`
18161829
18171830 Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
from line 1834
18211834 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
18221835
18231836 minimum: 1024
1824
1825 - `type: "enabled"`
18261837
18271838 - `block_binding: optional BetaThinkingBlockBinding or null`
18281839
from line 1899
18881899
18891900 maxItems: 20
18901901
1902 - `type: "url"`
1903
18911904 - `name: string`
18921905
1893 - `type: "url"`
1894
18951906 - `url: string`
18961907
18971908 - `authorization_token: optional string or null`
from line 1971
19601971
19611972 - `array of BetaTextBlockParam`
19621973
1974 - `type: "text"`
1975
19631976 - `text: string`
19641977
19651978 minLength: 1
19661979
1967 - `type: "text"`
1968
19691980 - `cache_control: optional BetaCacheControlEphemeral or null`
19701981
19711982 Create a cache control breakpoint at this content block.
from line 2029
20182029
20192030 The model will use the specified tool with `tool_choice.name`.
20202031
2032 - `type: "tool"`
2033
20212034 - `name: string`
20222035
20232036 The name of the tool to use.
2024
2025 - `type: "tool"`
20262037
20272038 - `disable_parallel_tool_use: optional boolean`
20282039
from line 2113
21022113
21032114 - `BetaTool object`
21042115
2116 - `type: optional "custom" or null`
2117
21052118 - `input_schema: object`
21062119
21072120 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
from line 2169
21562169
21572170 When true, guarantees schema validation on tool names and inputs
21582171
2159 - `type: optional "custom" or null`
2160
21612172 - `BetaToolBash20241022 object`
21622173
2174 - `type: "bash_20241022"`
2175
21632176 - `name: "bash"`
21642177
21652178 Name of the tool.
21662179
21672180 This is how the tool will be called by the model and in `tool_use` blocks.
21682181
2169 - `type: "bash_20241022"`
2170
21712182 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21722183
21732184 - `"direct"`
from line 2205
21942205
21952206 - `BetaToolBash20250124 object`
21962207
2208 - `type: "bash_20250124"`
2209
21972210 - `name: "bash"`
21982211
21992212 Name of the tool.
22002213
22012214 This is how the tool will be called by the model and in `tool_use` blocks.
22022215
2203 - `type: "bash_20250124"`
2204
22052216 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22062217
22072218 - `"direct"`
from line 2239
22282239
22292240 - `BetaCodeExecutionTool20250522 object`
22302241
2242 - `type: "code_execution_20250522"`
2243
22312244 - `name: "code_execution"`
22322245
22332246 Name of the tool.
22342247
22352248 This is how the tool will be called by the model and in `tool_use` blocks.
22362249
2237 - `type: "code_execution_20250522"`
2238
22392250 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22402251
22412252 - `"direct"`
from line 2271
22602271
22612272 - `BetaCodeExecutionTool20250825 object`
22622273
2274 - `type: "code_execution_20250825"`
2275
22632276 - `name: "code_execution"`
22642277
22652278 Name of the tool.
22662279
22672280 This is how the tool will be called by the model and in `tool_use` blocks.
22682281
2269 - `type: "code_execution_20250825"`
2270
22712282 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22722283
22732284 - `"direct"`
from line 2305
22942305
22952306 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
22962307
2308 - `type: "code_execution_20260120"`
2309
22972310 - `name: "code_execution"`
22982311
22992312 Name of the tool.
23002313
23012314 This is how the tool will be called by the model and in `tool_use` blocks.
23022315
2303 - `type: "code_execution_20260120"`
2304
23052316 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23062317
23072318 - `"direct"`
from line 2339
23282339
23292340 Code execution tool with REPL state persistence.
23302341
2342 - `type: "code_execution_20260521"`
2343
23312344 - `name: "code_execution"`
23322345
23332346 Name of the tool.
23342347
23352348 This is how the tool will be called by the model and in `tool_use` blocks.
2336
2337 - `type: "code_execution_20260521"`
23382349
23392350 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23402351
from line 2391
23802391 absent. Unknown keys are rejected: the field set is this toolset
23812392 version's complete member set.
23822393
2394 - `type: optional BetaBrowserTypeConfig or null`
2395
2396 `type`'s config overrides.
2397
2398 - `defer_loading: optional boolean or null`
2399
2400 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2401
2402 - `enabled: optional boolean or null`
2403
2404 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.
2405
23832406 - `close_tab: optional BetaBrowserCloseTabConfig or null`
23842407
23852408 `close_tab`'s config overrides.
from line 2739
27162739
27172740 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.
27182741
2719 - `type: optional BetaBrowserTypeConfig or null`
2720
2721 `type`'s config overrides.
2742 - `wait: optional BetaBrowserWaitConfig or null`
2743
2744 `wait`'s config overrides.
27222745
27232746 - `defer_loading: optional boolean or null`
27242747
from line 2751
27282751
27292752 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.
27302753
2731 - `wait: optional BetaBrowserWaitConfig or null`
2732
2733 `wait`'s config overrides.
2754 - `zoom: optional BetaBrowserZoomConfig or null`
2755
2756 `zoom`'s config overrides.
27342757
27352758 - `defer_loading: optional boolean or null`
27362759
from line 2763
27402763
27412764 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.
27422765
2743 - `zoom: optional BetaBrowserZoomConfig or null`
2744
2745 `zoom`'s config overrides.
2746
2747 - `defer_loading: optional boolean or null`
2748
2749 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2750
2751 - `enabled: optional boolean or null`
2752
2753 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.
2754
27552766 - `BetaToolComputerUse20241022 object`
27562767
2768 - `type: "computer_20241022"`
2769
27572770 - `display_height_px: number`
27582771
27592772 The height of the display in pixels.
from line 2785
27722785
27732786 This is how the tool will be called by the model and in `tool_use` blocks.
27742787
2775 - `type: "computer_20241022"`
2776
27772788 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27782789
27792790 - `"direct"`
from line 2817
28062817
28072818 - `BetaMemoryTool20250818 object`
28082819
2820 - `type: "memory_20250818"`
2821
28092822 - `name: "memory"`
28102823
28112824 Name of the tool.
28122825
28132826 This is how the tool will be called by the model and in `tool_use` blocks.
28142827
2815 - `type: "memory_20250818"`
2816
28172828 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28182829
28192830 - `"direct"`
from line 2851
28402851
28412852 - `BetaToolComputerUse20250124 object`
28422853
2854 - `type: "computer_20250124"`
2855
28432856 - `display_height_px: number`
28442857
28452858 The height of the display in pixels.
from line 2871
28582871
28592872 This is how the tool will be called by the model and in `tool_use` blocks.
28602873
2861 - `type: "computer_20250124"`
2862
28632874 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28642875
28652876 - `"direct"`
from line 2903
28922903
28932904 - `BetaToolTextEditor20241022 object`
28942905
2906 - `type: "text_editor_20241022"`
2907
28952908 - `name: "str_replace_editor"`
28962909
28972910 Name of the tool.
28982911
28992912 This is how the tool will be called by the model and in `tool_use` blocks.
29002913
2901 - `type: "text_editor_20241022"`
2902
29032914 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29042915
29052916 - `"direct"`
from line 2937
29262937
29272938 - `BetaToolComputerUse20251124 object`
29282939
2940 - `type: "computer_20251124"`
2941
29292942 - `display_height_px: number`
29302943
29312944 The height of the display in pixels.
from line 2956
29432956 Name of the tool.
29442957
29452958 This is how the tool will be called by the model and in `tool_use` blocks.
2946
2947 - `type: "computer_20251124"`
29482959
29492960 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29502961
from line 3017
30063017 absent. Unknown keys are rejected: the field set is this toolset
30073018 version's complete member set.
30083019
3020 - `type: optional BetaComputerTypeConfig or null`
3021
3022 `type`'s config overrides.
3023
3024 - `defer_loading: optional boolean or null`
3025
3026 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
3027
3028 - `enabled: optional boolean or null`
3029
3030 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.
3031
30093032 - `cursor_position: optional BetaComputerCursorPositionConfig or null`
30103033
30113034 `cursor_position`'s config overrides.
from line 3197
31743197
31753198 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.
31763199
3177 - `type: optional BetaComputerTypeConfig or null`
3178
3179 `type`'s config overrides.
3200 - `wait: optional BetaComputerWaitConfig or null`
3201
3202 `wait`'s config overrides.
31803203
31813204 - `defer_loading: optional boolean or null`
31823205
from line 3209
31863209
31873210 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.
31883211
3189 - `wait: optional BetaComputerWaitConfig or null`
3190
3191 `wait`'s config overrides.
3212 - `zoom: optional BetaComputerZoomConfig or null`
3213
3214 `zoom`'s config overrides.
31923215
31933216 - `defer_loading: optional boolean or null`
31943217
from line 3221
31983221
31993222 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.
32003223
3201 - `zoom: optional BetaComputerZoomConfig or null`
3202
3203 `zoom`'s config overrides.
3204
3205 - `defer_loading: optional boolean or null`
3206
3207 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
3208
3209 - `enabled: optional boolean or null`
3210
3211 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.
3212
32133224 - `BetaToolTextEditor20250124 object`
32143225
3226 - `type: "text_editor_20250124"`
3227
32153228 - `name: "str_replace_editor"`
32163229
32173230 Name of the tool.
32183231
32193232 This is how the tool will be called by the model and in `tool_use` blocks.
32203233
3221 - `type: "text_editor_20250124"`
3222
32233234 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32243235
32253236 - `"direct"`
from line 3257
32463257
32473258 - `BetaToolTextEditor20250429 object`
32483259
3260 - `type: "text_editor_20250429"`
3261
32493262 - `name: "str_replace_based_edit_tool"`
32503263
32513264 Name of the tool.
32523265
32533266 This is how the tool will be called by the model and in `tool_use` blocks.
32543267
3255 - `type: "text_editor_20250429"`
3256
32573268 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32583269
32593270 - `"direct"`
from line 3291
32803291
32813292 - `BetaToolTextEditor20250728 object`
32823293
3294 - `type: "text_editor_20250728"`
3295
32833296 - `name: "str_replace_based_edit_tool"`
32843297
32853298 Name of the tool.
32863299
32873300 This is how the tool will be called by the model and in `tool_use` blocks.
32883301
3289 - `type: "text_editor_20250728"`
3290
32913302 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32923303
32933304 - `"direct"`
from line 3331
33203331
33213332 - `BetaWebSearchTool20250305 object`
33223333
3334 - `type: "web_search_20250305"`
3335
33233336 - `name: "web_search"`
33243337
33253338 Name of the tool.
33263339
33273340 This is how the tool will be called by the model and in `tool_use` blocks.
33283341
3329 - `type: "web_search_20250305"`
3330
33313342 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33323343
33333344 - `"direct"`
from line 3407
33963407
33973408 - `BetaWebFetchTool20250910 object`
33983409
3410 - `type: "web_fetch_20250910"`
3411
33993412 - `name: "web_fetch"`
34003413
34013414 Name of the tool.
34023415
34033416 This is how the tool will be called by the model and in `tool_use` blocks.
34043417
3405 - `type: "web_fetch_20250910"`
3406
34073418 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34083419
34093420 - `"direct"`
from line 3463
34523463
34533464 - `BetaWebSearchTool20260209 object`
34543465
3466 - `type: "web_search_20260209"`
3467
34553468 - `name: "web_search"`
34563469
34573470 Name of the tool.
34583471
34593472 This is how the tool will be called by the model and in `tool_use` blocks.
34603473
3461 - `type: "web_search_20260209"`
3462
34633474 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34643475
34653476 - `"direct"`
from line 3513
35023513
35033514 - `BetaWebFetchTool20260209 object`
35043515
3516 - `type: "web_fetch_20260209"`
3517
35053518 - `name: "web_fetch"`
35063519
35073520 Name of the tool.
35083521
35093522 This is how the tool will be called by the model and in `tool_use` blocks.
35103523
3511 - `type: "web_fetch_20260209"`
3512
35133524 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35143525
35153526 - `"direct"`
from line 3571
35603571
35613572 Web fetch tool with use_cache parameter for bypassing cached content.
35623573
3574 - `type: "web_fetch_20260309"`
3575
35633576 - `name: "web_fetch"`
35643577
35653578 Name of the tool.
35663579
35673580 This is how the tool will be called by the model and in `tool_use` blocks.
35683581
3569 - `type: "web_fetch_20260309"`
3570
35713582 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35723583
35733584 - `"direct"`
from line 3631
36203631
36213632 - `BetaWebSearchTool20260318 object`
36223633
3634 - `type: "web_search_20260318"`
3635
36233636 - `name: "web_search"`
36243637
36253638 Name of the tool.
36263639
36273640 This is how the tool will be called by the model and in `tool_use` blocks.
36283641
3629 - `type: "web_search_20260318"`
3630
36313642 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36323643
36333644 - `"direct"`
from line 3689
36783689
36793690 - `BetaWebFetchTool20260318 object`
36803691
3692 - `type: "web_fetch_20260318"`
3693
36813694 - `name: "web_fetch"`
36823695
36833696 Name of the tool.
36843697
36853698 This is how the tool will be called by the model and in `tool_use` blocks.
36863699
3687 - `type: "web_fetch_20260318"`
3688
36893700 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36903701
36913702 - `"direct"`
from line 3757
37463757
37473758 - `BetaAdvisorTool20260301 object`
37483759
3760 - `type: "advisor_20260301"`
3761
37493762 - `model: Model`
37503763
37513764 The model that will complete your prompt.
from line 3771
37583771
37593772 This is how the tool will be called by the model and in `tool_use` blocks.
37603773
3761 - `type: "advisor_20260301"`
3762
37633774 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
37643775
37653776 - `"direct"`
from line 3811
38003811
38013812 - `BetaToolSearchToolBm25_20251119 object`
38023813
3814 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3815
3816 - `"tool_search_tool_bm25_20251119"`
3817
3818 - `"tool_search_tool_bm25"`
3819
38033820 - `name: "tool_search_tool_bm25"`
38043821
38053822 Name of the tool.
38063823
38073824 This is how the tool will be called by the model and in `tool_use` blocks.
38083825
3809 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3810
3811 - `"tool_search_tool_bm25_20251119"`
3812
3813 - `"tool_search_tool_bm25"`
3814
38153826 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38163827
38173828 - `"direct"`
from line 3847
38363847
38373848 - `BetaToolSearchToolRegex20251119 object`
38383849
3850 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3851
3852 - `"tool_search_tool_regex_20251119"`
3853
3854 - `"tool_search_tool_regex"`
3855
38393856 - `name: "tool_search_tool_regex"`
38403857
38413858 Name of the tool.
38423859
38433860 This is how the tool will be called by the model and in `tool_use` blocks.
3844
3845 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3846
3847 - `"tool_search_tool_regex_20251119"`
3848
3849 - `"tool_search_tool_regex"`
38503861
38513862 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38523863
from line 3888
38773888 Allows configuring enabled status and defer_loading for all tools
38783889 from an MCP server, with optional per-tool overrides.
38793890
3891 - `type: "mcp_toolset"`
3892
38803893 - `mcp_server_name: string`
38813894
38823895 Name of the MCP server to configure tools for
38833896
38843897 maxLength: 255, minLength: 1
38853898
3886 - `type: "mcp_toolset"`
3887
38883899 - `cache_control: optional BetaCacheControlEphemeral or null`
38893900
38903901 Create a cache control breakpoint at this content block.
from line 3964
39533964
39543965- `BetaMessage object`
39553966
3967 - `type: "message"`
3968
3969 Object type.
3970
3971 For Messages, this is always `"message"`.
3972
3973 default: message
3974
39563975 - `id: string`
39573976
39583977 Unique object identifier.
from line 3996
39773996
39783997 Skills loaded in the container
39793998
3999 - `type: "anthropic" or "custom"`
4000
4001 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
4002
4003 - `"anthropic"`
4004
4005 - `"custom"`
4006
39804007 - `skill_id: string`
39814008
39824009 Skill ID
39834010
39844011 maxLength: 64, minLength: 1
3985
3986 - `type: "anthropic" or "custom"`
3987
3988 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
3989
3990 - `"anthropic"`
3991
3992 - `"custom"`
39934012
39944013 - `version: string`
39954014
from line 4047
40284047
40294048 - `BetaTextBlock object`
40304049
4050 - `type: "text"`
4051
4052 default: text
4053
40314054 - `citations: array of BetaTextCitation or null`
40324055
40334056 Citations supporting the text block.
from line 4059
40364059
40374060 - `BetaCitationCharLocation object`
40384061
4062 - `type: "char_location"`
4063
4064 default: char_location
4065
40394066 - `cited_text: string`
40404067
40414068 - `document_index: number`
from line 4079
40524079
40534080 minimum: 0
40544081
4055 - `type: "char_location"`
4056
4057 default: char_location
4058
40594082 - `BetaCitationPageLocation object`
40604083
4084 - `type: "page_location"`
4085
4086 default: page_location
4087
40614088 - `cited_text: string`
40624089
40634090 - `document_index: number`
from line 4101
40744101
40754102 minimum: 1
40764103
4077 - `type: "page_location"`
4078
4079 default: page_location
4080
40814104 - `BetaCitationContentBlockLocation object`
40824105
4106 - `type: "content_block_location"`
4107
4108 default: content_block_location
4109
40834110 - `cited_text: string`
40844111
40854112 The full text of the cited block range, concatenated.
from line 4133
41064133
41074134 minimum: 0
41084135
4109 - `type: "content_block_location"`
4110
4111 default: content_block_location
4112
41134136 - `BetaCitationsWebSearchResultLocation object`
41144137
4138 - `type: "web_search_result_location"`
4139
4140 default: web_search_result_location
4141
41154142 - `cited_text: string`
41164143
41174144 - `encrypted_index: string`
from line 4147
41204147
41214148 maxLength: 512
41224149
4123 - `type: "web_search_result_location"`
4124
4125 default: web_search_result_location
4126
41274150 - `url: string`
41284151
41294152 - `BetaCitationSearchResultLocation object`
41304153
4154 - `type: "search_result_location"`
4155
4156 default: search_result_location
4157
41314158 - `cited_text: string`
41324159
41334160 The full text of the cited block range, concatenated.
from line 4185
41584185
41594186 - `title: string or null`
41604187
4161 - `type: "search_result_location"`
4162
4163 default: search_result_location
4164
41654188 - `text: string`
41664189
4167 maxLength: 5000000, minLength: 0
4168
4169 - `type: "text"`
4170
4171 default: text
4190 minLength: 0
41724191
41734192 - `BetaThinkingBlock object`
41744193
4194 - `type: "thinking"`
4195
4196 default: thinking
4197
41754198 - `signature: string`
41764199
41774200 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
from line 4207
41844207
41854208 The text of Claude's thinking process for this block.
41864209
4187 - `type: "thinking"`
4188
4189 default: thinking
4190
41914210 - `BetaRedactedThinkingBlock object`
41924211
4212 - `type: "redacted_thinking"`
4213
4214 default: redacted_thinking
4215
41934216 - `data: string`
41944217
41954218 The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.
from line 4221
41984221
41994222 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.
42004223
4201 - `type: "redacted_thinking"`
4202
4203 default: redacted_thinking
4204
42054224 - `BetaToolUseBlock object`
42064225
4226 - `type: "tool_use"`
4227
4228 default: tool_use
4229
42074230 - `id: string`
42084231
42094232 pattern: ^[a-zA-Z0-9_-]+$
from line 4237
42144237
42154238 minLength: 1
42164239
4217 - `type: "tool_use"`
4218
4219 default: tool_use
4220
42214240 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
42224241
42234242 Tool invocation directly from the model.
from line 4251
42324251
42334252 Tool invocation generated by a server-side tool.
42344253
4254 - `type: "code_execution_20250825"`
4255
42354256 - `tool_id: string`
42364257
42374258 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
42384259
4239 - `type: "code_execution_20250825"`
4240
42414260 - `BetaServerToolCaller20260120 object`
42424261
4262 - `type: "code_execution_20260120"`
4263
42434264 - `tool_id: string`
42444265
42454266 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
42464267
4247 - `type: "code_execution_20260120"`
4248
42494268 - `toolset_name: optional string or null`
42504269
42514270 For a toolset member tool_use, the toolset family.
from line 4273
42544273
42554274 - `BetaServerToolUseBlock object`
42564275
4276 - `type: "server_tool_use"`
4277
4278 default: server_tool_use
4279
42574280 - `id: string`
42584281
42594282 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 4301
42784301
42794302 - `"tool_search_tool_bm25"`
42804303
4281 - `type: "server_tool_use"`
4282
4283 default: server_tool_use
4284
42854304 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
42864305
42874306 Tool invocation directly from the model.
from line 4317
42984317
42994318 - `BetaWebSearchToolResultBlock object`
43004319
4320 - `type: "web_search_tool_result"`
4321
4322 default: web_search_tool_result
4323
43014324 - `content: BetaWebSearchToolResultBlockContent`
43024325
43034326 - `BetaWebSearchToolResultError object`
43044327
4328 - `type: "web_search_tool_result_error"`
4329
4330 default: web_search_tool_result_error
4331
43054332 - `error_code: BetaWebSearchToolResultErrorCode`
43064333
43074334 - `"invalid_tool_input"`
from line 4343
43164343
43174344 - `"request_too_large"`
43184345
4319 - `type: "web_search_tool_result_error"`
4320
4321 default: web_search_tool_result_error
4322
43234346 - `array of BetaWebSearchResultBlock`
43244347
4348 - `type: "web_search_result"`
4349
4350 default: web_search_result
4351
43254352 - `encrypted_content: string`
43264353
43274354 - `page_age: string or null`
43284355
43294356 - `title: string`
43304357
4331 - `type: "web_search_result"`
4332
4333 default: web_search_result
4334
43354358 - `url: string`
43364359
43374360 - `tool_use_id: string`
43384361
43394362 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
43404363
4341 - `type: "web_search_tool_result"`
4342
4343 default: web_search_tool_result
4344
43454364 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
43464365
43474366 Tool invocation directly from the model.
from line 4377
43584377
43594378 - `BetaWebFetchToolResultBlock object`
43604379
4380 - `type: "web_fetch_tool_result"`
4381
4382 default: web_fetch_tool_result
4383
43614384 - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
43624385
43634386 - `BetaWebFetchToolResultErrorBlock object`
43644387
4388 - `type: "web_fetch_tool_result_error"`
4389
4390 default: web_fetch_tool_result_error
4391
43654392 - `error_code: BetaWebFetchToolResultErrorCode`
43664393
43674394 - `"invalid_tool_input"`
from line 4409
43824409
43834410 - `"unavailable"`
43844411
4385 - `type: "web_fetch_tool_result_error"`
4386
4387 default: web_fetch_tool_result_error
4412 - `"content_too_large"`
43884413
43894414 - `BetaWebFetchBlock object`
43904415
4416 - `type: "web_fetch_result"`
4417
4418 default: web_fetch_result
4419
43914420 - `content: BetaDocumentBlock`
43924421
4422 - `type: "document"`
4423
4424 default: document
4425
43934426 - `citations: BetaCitationConfig or null`
43944427
43954428 Citation configuration for the document
from line 4435
44024435
44034436 - `BetaBase64PDFSource object`
44044437
4438 - `type: "base64"`
4439
44054440 - `data: string`
44064441
44074442 format: byte
44084443
44094444 - `media_type: "application/pdf"`
44104445
4411 - `type: "base64"`
4412
44134446 - `BetaPlainTextSource object`
44144447
4448 - `type: "text"`
4449
44154450 - `data: string`
44164451
44174452 - `media_type: "text/plain"`
44184453
4419 - `type: "text"`
4420
44214454 - `title: string or null`
44224455
44234456 The title of the document
44244457
4425 - `type: "document"`
4426
4427 default: document
4428
44294458 - `retrieved_at: string or null`
44304459
44314460 ISO 8601 timestamp when the content was retrieved
44324461
4433 - `type: "web_fetch_result"`
4434
4435 default: web_fetch_result
4436
44374462 - `url: string`
44384463
44394464 Fetched content URL
from line 4467
44424467
44434468 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
44444469
4445 - `type: "web_fetch_tool_result"`
4446
4447 default: web_fetch_tool_result
4448
44494470 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
44504471
44514472 Tool invocation directly from the model.
from line 4483
44624483
44634484 - `BetaAdvisorToolResultBlock object`
44644485
4486 - `type: "advisor_tool_result"`
4487
4488 default: advisor_tool_result
4489
44654490 - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`
44664491
44674492 - `BetaAdvisorToolResultError object`
44684493
4494 - `type: "advisor_tool_result_error"`
4495
4496 default: advisor_tool_result_error
4497
44694498 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
44704499
44714500 - `"max_uses_exceeded"`
from line 4511
44824511
44834512 - `"model_not_found"`
44844513
4485 - `type: "advisor_tool_result_error"`
4486
4487 default: advisor_tool_result_error
4488
44894514 - `BetaAdvisorResultBlock object`
44904515
4516 - `type: "advisor_result"`
4517
4518 default: advisor_result
4519
44914520 - `stop_reason: string or null`
44924521
44934522 The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`). `max_tokens` indicates the advisor's output was truncated at the tool's `max_tokens` value or the advisor model's policy cap.
44944523
44954524 - `text: string`
44964525
4497 - `type: "advisor_result"`
4498
4499 default: advisor_result
4500
45014526 - `BetaAdvisorRedactedResultBlock object`
45024527
4528 - `type: "advisor_redacted_result"`
4529
4530 default: advisor_redacted_result
4531
45034532 - `encrypted_content: string`
45044533
45054534 Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
from line 4537
45084537
45094538 The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).
45104539
4511 - `type: "advisor_redacted_result"`
4512
4513 default: advisor_redacted_result
4514
45154540 - `tool_use_id: string`
45164541
45174542 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
45184543
4519 - `type: "advisor_tool_result"`
4520
4521 default: advisor_tool_result
4522
45234544 - `BetaCodeExecutionToolResultBlock object`
45244545
4546 - `type: "code_execution_tool_result"`
4547
4548 default: code_execution_tool_result
4549
45254550 - `content: BetaCodeExecutionToolResultBlockContent`
45264551
45274552 Code execution result with encrypted stdout for PFC + web_search results.
45284553
45294554 - `BetaCodeExecutionToolResultError object`
45304555
4556 - `type: "code_execution_tool_result_error"`
4557
4558 default: code_execution_tool_result_error
4559
45314560 - `error_code: BetaCodeExecutionToolResultErrorCode`
45324561
45334562 - `"invalid_tool_input"`
from line 4567
45384567
45394568 - `"execution_time_exceeded"`
45404569
4541 - `type: "code_execution_tool_result_error"`
4542
4543 default: code_execution_tool_result_error
4544
45454570 - `BetaCodeExecutionResultBlock object`
45464571
4572 - `type: "code_execution_result"`
4573
4574 default: code_execution_result
4575
45474576 - `content: array of BetaCodeExecutionOutputBlock`
45484577
4578 - `type: "code_execution_output"`
4579
4580 default: code_execution_output
4581
45494582 - `file_id: string`
45504583
4584 - `return_code: number`
4585
4586 - `stderr: string`
4587
4588 - `stdout: string`
4589
4590 - `BetaEncryptedCodeExecutionResultBlock object`
4591
4592 Code execution result with encrypted stdout for PFC + web_search results.
4593
4594 - `type: "encrypted_code_execution_result"`
4595
4596 default: encrypted_code_execution_result
4597
4598 - `content: array of BetaCodeExecutionOutputBlock`
4599
45514600 - `type: "code_execution_output"`
45524601
45534602 default: code_execution_output
45544603
4604 - `file_id: string`
4605
4606 - `encrypted_stdout: string`
4607
45554608 - `return_code: number`
45564609
45574610 - `stderr: string`
45584611
4612 - `tool_use_id: string`
4613
4614 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4615
4616 - `BetaBashCodeExecutionToolResultBlock object`
4617
4618 - `type: "bash_code_execution_tool_result"`
4619
4620 default: bash_code_execution_tool_result
4621
4622 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
4623
4624 - `BetaBashCodeExecutionToolResultError object`
4625
4626 - `type: "bash_code_execution_tool_result_error"`
4627
4628 default: bash_code_execution_tool_result_error
4629
4630 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
4631
4632 - `"invalid_tool_input"`
4633
4634 - `"unavailable"`
4635
4636 - `"too_many_requests"`
4637
4638 - `"execution_time_exceeded"`
4639
4640 - `"output_file_too_large"`
4641
4642 - `BetaBashCodeExecutionResultBlock object`
4643
4644 - `type: "bash_code_execution_result"`
4645
4646 default: bash_code_execution_result
4647
4648 - `content: array of BetaBashCodeExecutionOutputBlock`
4649
4650 - `type: "bash_code_execution_output"`
4651
4652 default: bash_code_execution_output
4653
4654 - `file_id: string`
4655
4656 - `return_code: number`
4657
4658 - `stderr: string`
4659
45594660 - `stdout: string`
45604661
4561 - `type: "code_execution_result"`
4562
4563 default: code_execution_result
4564
4565 - `BetaEncryptedCodeExecutionResultBlock object`
4566
4567 Code execution result with encrypted stdout for PFC + web_search results.
4568
4569 - `content: array of BetaCodeExecutionOutputBlock`
4570
4571 - `file_id: string`
4572
4573 - `type: "code_execution_output"`
4574
4575 default: code_execution_output
4576
4577 - `encrypted_stdout: string`
4578
4579 - `return_code: number`
4580
4581 - `stderr: string`
4582
4583 - `type: "encrypted_code_execution_result"`
4584
4585 default: encrypted_code_execution_result
4586
45874662 - `tool_use_id: string`
45884663
45894664 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
45904665
4591 - `type: "code_execution_tool_result"`
4592
4593 default: code_execution_tool_result
4594
4595 - `BetaBashCodeExecutionToolResultBlock object`
4596
4597 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
4598
4599 - `BetaBashCodeExecutionToolResultError object`
4666 - `BetaTextEditorCodeExecutionToolResultBlock object`
4667
4668 - `type: "text_editor_code_execution_tool_result"`
4669
4670 default: text_editor_code_execution_tool_result
4671
4672 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
4673
4674 - `BetaTextEditorCodeExecutionToolResultError object`
4675
4676 - `type: "text_editor_code_execution_tool_result_error"`
4677
4678 default: text_editor_code_execution_tool_result_error
46004679
46014680 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
46024681
from line 4687
46084687
46094688 - `"execution_time_exceeded"`
46104689
4611 - `"output_file_too_large"`
4612
4613 - `type: "bash_code_execution_tool_result_error"`
4614
4615 default: bash_code_execution_tool_result_error
4616
4617 - `BetaBashCodeExecutionResultBlock object`
4618
4619 - `content: array of BetaBashCodeExecutionOutputBlock`
4620
4621 - `file_id: string`
4622
4623 - `type: "bash_code_execution_output"`
4624
4625 default: bash_code_execution_output
4626
4627 - `return_code: number`
4628
4629 - `stderr: string`
4630
4631 - `stdout: string`
4632
4633 - `type: "bash_code_execution_result"`
4634
4635 default: bash_code_execution_result
4690 - `"file_not_found"`
4691
4692 - `error_message: string or null`
4693
4694 - `BetaTextEditorCodeExecutionViewResultBlock object`
4695
4696 - `type: "text_editor_code_execution_view_result"`
4697
4698 default: text_editor_code_execution_view_result
4699
4700 - `content: string`
4701
4702 - `file_type: "text" or "image" or "pdf"`
4703
4704 - `"text"`
4705
4706 - `"image"`
4707
4708 - `"pdf"`
4709
4710 - `num_lines: number or null`
4711
4712 - `start_line: number or null`
4713
4714 - `total_lines: number or null`
4715
4716 - `BetaTextEditorCodeExecutionCreateResultBlock object`
4717
4718 - `type: "text_editor_code_execution_create_result"`
4719
4720 default: text_editor_code_execution_create_result
4721
4722 - `is_file_update: boolean`
4723
4724 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
4725
4726 - `type: "text_editor_code_execution_str_replace_result"`
4727
4728 default: text_editor_code_execution_str_replace_result
4729
4730 - `lines: array of string or null`
4731
4732 - `new_lines: number or null`
4733
4734 - `new_start: number or null`
4735
4736 - `old_lines: number or null`
4737
4738 - `old_start: number or null`
46364739
46374740 - `tool_use_id: string`
46384741
46394742 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
46404743
4641 - `type: "bash_code_execution_tool_result"`
4642
4643 default: bash_code_execution_tool_result
4644
4645 - `BetaTextEditorCodeExecutionToolResultBlock object`
4646
4647 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
4648
4649 - `BetaTextEditorCodeExecutionToolResultError object`
4650
4651 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
4744 - `BetaToolSearchToolResultBlock object`
4745
4746 - `type: "tool_search_tool_result"`
4747
4748 default: tool_search_tool_result
4749
4750 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
4751
4752 - `BetaToolSearchToolResultError object`
4753
4754 - `type: "tool_search_tool_result_error"`
4755
4756 default: tool_search_tool_result_error
4757
4758 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
46524759
46534760 - `"invalid_tool_input"`
46544761
from line 4765
46584765
46594766 - `"execution_time_exceeded"`
46604767
4661 - `"file_not_found"`
4662
46634768 - `error_message: string or null`
46644769
4665 - `type: "text_editor_code_execution_tool_result_error"`
4666
4667 default: text_editor_code_execution_tool_result_error
4668
4669 - `BetaTextEditorCodeExecutionViewResultBlock object`
4670
4671 - `content: string`
4672
4673 - `file_type: "text" or "image" or "pdf"`
4674
4675 - `"text"`
4676
4677 - `"image"`
4678
4679 - `"pdf"`
4680
4681 - `num_lines: number or null`
4682
4683 - `start_line: number or null`
4684
4685 - `total_lines: number or null`
4686
4687 - `type: "text_editor_code_execution_view_result"`
4688
4689 default: text_editor_code_execution_view_result
4690
4691 - `BetaTextEditorCodeExecutionCreateResultBlock object`
4692
4693 - `is_file_update: boolean`
4694
4695 - `type: "text_editor_code_execution_create_result"`
4696
4697 default: text_editor_code_execution_create_result
4698
4699 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
4700
4701 - `lines: array of string or null`
4702
4703 - `new_lines: number or null`
4704
4705 - `new_start: number or null`
4706
4707 - `old_lines: number or null`
4708
4709 - `old_start: number or null`
4710
4711 - `type: "text_editor_code_execution_str_replace_result"`
4712
4713 default: text_editor_code_execution_str_replace_result
4770 - `BetaToolSearchToolSearchResultBlock object`
4771
4772 - `type: "tool_search_tool_search_result"`
4773
4774 default: tool_search_tool_search_result
4775
4776 - `tool_references: array of BetaToolReferenceBlock`
4777
4778 - `type: "tool_reference"`
4779
4780 default: tool_reference
4781
4782 - `tool_name: string`
4783
4784 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
47144785
47154786 - `tool_use_id: string`
47164787
47174788 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
47184789
4719 - `type: "text_editor_code_execution_tool_result"`
4720
4721 default: text_editor_code_execution_tool_result
4722
4723 - `BetaToolSearchToolResultBlock object`
4724
4725 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
4726
4727 - `BetaToolSearchToolResultError object`
4728
4729 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
4730
4731 - `"invalid_tool_input"`
4732
4733 - `"unavailable"`
4734
4735 - `"too_many_requests"`
4736
4737 - `"execution_time_exceeded"`
4738
4739 - `error_message: string or null`
4740
4741 - `type: "tool_search_tool_result_error"`
4742
4743 default: tool_search_tool_result_error
4744
4745 - `BetaToolSearchToolSearchResultBlock object`
4746
4747 - `tool_references: array of BetaToolReferenceBlock`
4748
4749 - `tool_name: string`
4750
4751 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
4752
4753 - `type: "tool_reference"`
4754
4755 default: tool_reference
4756
4757 - `type: "tool_search_tool_search_result"`
4758
4759 default: tool_search_tool_search_result
4790 - `BetaMCPToolUseBlock object`
4791
4792 - `type: "mcp_tool_use"`
4793
4794 default: mcp_tool_use
4795
4796 - `id: string`
4797
4798 pattern: ^[a-zA-Z0-9_-]+$
4799
4800 - `input: map[unknown]`
4801
4802 - `name: string`
4803
4804 The name of the MCP tool
4805
4806 - `server_name: string`
4807
4808 The name of the MCP server
4809
4810 - `BetaMCPToolResultBlock object`
4811
4812 - `type: "mcp_tool_result"`
4813
4814 default: mcp_tool_result
4815
4816 - `content: string or array of BetaTextBlock`
4817
4818 - `string`
4819
4820 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
4821
4822 - `type: "text"`
4823
4824 default: text
4825
4826 - `citations: array of BetaTextCitation or null`
4827
4828 Citations supporting the text block.
4829
4830 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`.
4831
4832 - `text: string`
4833
4834 minLength: 0
4835
4836 - `is_error: boolean`
4837
4838 default: false
47604839
47614840 - `tool_use_id: string`
47624841
4763 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4764
4765 - `type: "tool_search_tool_result"`
4766
4767 default: tool_search_tool_result
4768
4769 - `BetaMCPToolUseBlock object`
4770
4771 - `id: string`
4772
47734842 pattern: ^[a-zA-Z0-9_-]+$
47744843
4775 - `input: map[unknown]`
4776
4777 - `name: string`
4778
4779 The name of the MCP tool
4780
4781 - `server_name: string`
4782
4783 The name of the MCP server
4784
4785 - `type: "mcp_tool_use"`
4786
4787 default: mcp_tool_use
4788
4789 - `BetaMCPToolResultBlock object`
4790
4791 - `content: string or array of BetaTextBlock`
4792
4793 - `string`
4794
4795 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
4796
4797 - `citations: array of BetaTextCitation or null`
4798
4799 Citations supporting the text block.
4800
4801 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`.
4802
4803 - `text: string`
4804
4805 maxLength: 5000000, minLength: 0
4806
4807 - `type: "text"`
4808
4809 default: text
4810
4811 - `is_error: boolean`
4812
4813 default: false
4814
4815 - `tool_use_id: string`
4816
4817 pattern: ^[a-zA-Z0-9_-]+$
4818
4819 - `type: "mcp_tool_result"`
4820
4821 default: mcp_tool_result
4822
48234844 - `BetaContainerUploadBlock object`
48244845
48254846 Response model for a file uploaded to the container.
48264847
4848 - `type: "container_upload"`
4849
4850 default: container_upload
4851
48274852 - `file_id: string`
4828
4829 - `type: "container_upload"`
4830
4831 default: container_upload
48324853
48334854 - `BetaCompactionBlock object`
48344855
from line 4859
48384859 summary (e.g., malformed output from the model). Clients may round-trip
48394860 compaction blocks with null content; the server treats them as no-ops.
48404861
4862 - `type: "compaction"`
4863
4864 default: compaction
4865
48414866 - `content: string or null`
48424867
48434868 Summary of compacted content, or null if compaction failed
from line 4870
48454870 - `encrypted_content: string or null`
48464871
48474872 Opaque metadata from prior compaction, to be round-tripped verbatim
4848
4849 - `type: "compaction"`
4850
4851 default: compaction
48524873
48534874 - `BetaFallbackBlock object`
48544875
from line 4885
48644885 arrives via the standard `content_block_start` / `content_block_stop`
48654886 pair and carries no deltas.
48664887
4888 - `type: "fallback"`
4889
4890 default: fallback
4891
48674892 - `from: BetaFallbackInfo`
48684893
48694894 The model whose output ends at this point — the model that declined at this hop. When the declining hop is the requested model, its `model` echoes the top-level `model` string the caller sent (alias or canonical); when the declining hop is a fallback model, its `model` is that model's canonical id.
from line 4983
49584983
49594984 What caused the `from` model to hand over at this hop.
49604985
4986 - `type: "refusal"`
4987
4988 default: refusal
4989
49614990 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
49624991
49634992 The policy category that triggered a refusal.
from line 5011
49825011
49835012 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
49845013
4985 - `type: "refusal"`
4986
4987 default: refusal
4988
4989 - `type: "fallback"`
4990
4991 default: fallback
4992
49935014 - `context_management: BetaContextManagementResponse or null`
49945015
49955016 Context management response.
from line 5023
50025023
50035024 - `BetaClearToolUses20250919EditResponse object`
50045025
5026 - `type: "clear_tool_uses_20250919"`
5027
5028 The type of context management edit applied.
5029
5030 default: clear_tool_uses_20250919
5031
50055032 - `cleared_input_tokens: number`
50065033
50075034 Number of input tokens cleared by this edit.
from line 5041
50145041
50155042 minimum: 0
50165043
5017 - `type: "clear_tool_uses_20250919"`
5044 - `BetaClearThinking20251015EditResponse object`
5045
5046 - `type: "clear_thinking_20251015"`
50185047
50195048 The type of context management edit applied.
50205049
5021 default: clear_tool_uses_20250919
5022
5023 - `BetaClearThinking20251015EditResponse object`
5050 default: clear_thinking_20251015
50245051
50255052 - `cleared_input_tokens: number`
50265053
from line 5060
50335060 Number of thinking turns that were cleared.
50345061
50355062 minimum: 0
5036
5037 - `type: "clear_thinking_20251015"`
5038
5039 The type of context management edit applied.
5040
5041 default: clear_thinking_20251015
50425063
50435064 - `diagnostics: BetaDiagnostics or null`
50445065
from line 5072
50515072
50525073 - `BetaCacheMissModelChanged object`
50535074
5075 - `type: "model_changed"`
5076
5077 default: model_changed
5078
50545079 - `cache_missed_input_tokens: number`
50555080
50565081 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
50575082
5058 - `type: "model_changed"`
5059
5060 default: model_changed
5061
50625083 - `BetaCacheMissSystemChanged object`
50635084
5085 - `type: "system_changed"`
5086
5087 default: system_changed
5088
50645089 - `cache_missed_input_tokens: number`
50655090
50665091 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
50675092
5068 - `type: "system_changed"`
5069
5070 default: system_changed
5071
50725093 - `BetaCacheMissToolsChanged object`
50735094
5095 - `type: "tools_changed"`
5096
5097 default: tools_changed
5098
50745099 - `cache_missed_input_tokens: number`
50755100
50765101 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
50775102
5078 - `type: "tools_changed"`
5079
5080 default: tools_changed
5081
50825103 - `BetaCacheMissMessagesChanged object`
50835104
5105 - `type: "messages_changed"`
5106
5107 default: messages_changed
5108
50845109 - `cache_missed_input_tokens: number`
50855110
50865111 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
50875112
5088 - `type: "messages_changed"`
5089
5090 default: messages_changed
5091
50925113 - `BetaCacheMissPreviousMessageNotFound object`
50935114
50945115 - `type: "previous_message_not_found"`
from line 5139
51185139 - `stop_details: BetaRefusalStopDetails or null`
51195140
51205141 Structured information about a refusal.
5142
5143 - `type: "refusal"`
5144
5145 default: refusal
51215146
51225147 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
51235148
from line 5223
51985223
51995224 The server's suggested retry target for this refusal. Populated when a fallback attempt could not be made (the fallback model's rate limit was exhausted, or it was overloaded); names the fallback model the caller can retry directly. Null otherwise.
52005225
5201 - `type: "refusal"`
5202
5203 default: refusal
5204
52055226 - `stop_reason: BetaStopReason or null`
52065227
52075228 The reason that we stopped.
from line 5261
52405261
52415262 This value will be a non-null string if one of your custom stop sequences was generated.
52425263
5243 - `type: "message"`
5244
5245 Object type.
5246
5247 For Messages, this is always `"message"`.
5248
5249 default: message
5250
52515264 - `usage: BetaUsage`
52525265
52535266 Billing and rate-limit usage.
from line 5327
53145327
53155328 No reprice was applied; `reason` says why.
53165329
5330 - `type: "not_applied"`
5331
5332 default: not_applied
5333
53175334 - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`
53185335
53195336 Why the reprice was not applied.
from line 5361
53445361 - `"wrong_platform"`
53455362
53465363 - `"wrong_workspace"`
5347
5348 - `type: "not_applied"`
5349
5350 default: not_applied
53515364
53525365 - `remove_to_redeem: optional array of string or null`
53535366
from line 5399
53865399
53875400 Token usage for a sampling iteration.
53885401
5402 - `type: "message"`
5403
5404 Usage for a sampling iteration
5405
5406 default: message
5407
53895408 - `cache_creation: BetaCacheCreation or null`
53905409
53915410 Breakdown of cached tokens by TTL
from line 5439
54205439
54215440 minimum: 0
54225441
5423 - `type: "message"`
5424
5425 Usage for a sampling iteration
5426
5427 default: message
5428
54295442 - `BetaCompactionIterationUsage object`
54305443
54315444 Token usage for a compaction iteration.
54325445
5446 - `type: "compaction"`
5447
5448 Usage for a compaction iteration
5449
5450 default: compaction
5451
54335452 - `cache_creation: BetaCacheCreation or null`
54345453
54355454 Breakdown of cached tokens by TTL
from line 5477
54585477
54595478 minimum: 0
54605479
5461 - `type: "compaction"`
5462
5463 Usage for a compaction iteration
5464
5465 default: compaction
5466
54675480 - `BetaAdvisorMessageIterationUsage object`
54685481
54695482 Token usage for an advisor sub-inference iteration.
54705483
5484 - `type: "advisor_message"`
5485
5486 Usage for an advisor sub-inference iteration
5487
5488 default: advisor_message
5489
54715490 - `cache_creation: BetaCacheCreation or null`
54725491
54735492 Breakdown of cached tokens by TTL
from line 5520
55015520 The number of output tokens which were used.
55025521
55035522 minimum: 0
5504
5505 - `type: "advisor_message"`
5506
5507 Usage for an advisor sub-inference iteration
5508
5509 default: advisor_message
55105523
55115524 - `BetaFallbackMessageIterationUsage object`
55125525
from line 5530
55175530 a fallback model served the response is signalled by the presence of this
55185531 entry in `usage.iterations`.
55195532
5533 - `type: "fallback_message"`
5534
5535 Usage for the fallback-model attempt that served the response
5536
5537 default: fallback_message
5538
55205539 - `cache_creation: BetaCacheCreation or null`
55215540
55225541 Breakdown of cached tokens by TTL
from line 5569
55505569 The number of output tokens which were used.
55515570
55525571 minimum: 0
5553
5554 - `type: "fallback_message"`
5555
5556 Usage for the fallback-model attempt that served the response
5557
5558 default: fallback_message
55595572
55605573 - `output_tokens: number`
55615574
from line 5649
56365649 the final `message_delta` event carries it only when a server-side model
56375650 fallback happened mid-stream, in which case it holds the serving model's
56385651 entries and replaces the one in `message_start`.
5652
5653 - `type: "thinking_dropped"`
5654
5655 Always `thinking_dropped` for this entry type.
5656
5657 default: thinking_dropped
56395658
56405659 - `path: string`
56415660
from line 5686
56675686
56685687 - `"end_user_binding_mismatch"`
56695688
5670 - `type: "thinking_dropped"`
5671
5672 Always `thinking_dropped` for this entry type.
5673
5674 default: thinking_dropped
5675
56765689- `BetaRawMessageStreamEvent = BetaRawMessageStartEvent or BetaRawMessageDeltaEvent or BetaRawMessageStopEvent or 3 more`
56775690
56785691 - `BetaRawMessageStartEvent object`
56795692
5693 - `type: "message_start"`
5694
5695 default: message_start
5696
56805697 - `message: BetaMessage`
56815698
5682 - `type: "message_start"`
5683
5684 default: message_start
5685
56865699 - `BetaRawMessageDeltaEvent object`
56875700
5701 - `type: "message_delta"`
5702
5703 default: message_delta
5704
56885705 - `context_management: BetaContextManagementResponse or null`
56895706
56905707 Information about context management strategies applied during the request
from line 5719
57025719 - `stop_reason: BetaStopReason or null`
57035720
57045721 - `stop_sequence: string or null`
5705
5706 - `type: "message_delta"`
5707
5708 default: message_delta
57095722
57105723 - `usage: BetaMessageDeltaUsage`
57115724
from line 5800
57875800 the final `message_delta` event carries it only when a server-side model
57885801 fallback happened mid-stream, in which case it holds the serving model's
57895802 entries and replaces the one in `message_start`.
5803
5804 - `type: "thinking_dropped"`
5805
5806 Always `thinking_dropped` for this entry type.
5807
5808 default: thinking_dropped
57905809
57915810 - `path: string`
57925811
from line 5829
58105829 `organization_binding_mismatch`, `end_user_binding_mismatch`,
58115830 `model_binding_mismatch`, `prefix_binding_mismatch`.
58125831
5813 - `type: "thinking_dropped"`
5814
5815 Always `thinking_dropped` for this entry type.
5816
5817 default: thinking_dropped
5818
58195832 - `BetaRawMessageStopEvent object`
58205833
58215834 - `type: "message_stop"`
from line 5836
58235836 default: message_stop
58245837
58255838 - `BetaRawContentBlockStartEvent object`
5839
5840 - `type: "content_block_start"`
5841
5842 default: content_block_start
58265843
58275844 - `content_block: BetaTextBlock or BetaThinkingBlock or BetaRedactedThinkingBlock or 14 more`
58285845
from line 5901
58845901
58855902 - `index: number`
58865903
5887 - `type: "content_block_start"`
5888
5889 default: content_block_start
5890
58915904 - `BetaRawContentBlockDeltaEvent object`
58925905
5906 - `type: "content_block_delta"`
5907
5908 default: content_block_delta
5909
58935910 - `delta: BetaRawContentBlockDelta`
58945911
58955912 - `BetaTextDelta object`
58965913
5914 - `type: "text_delta"`
5915
5916 default: text_delta
5917
58975918 - `text: string`
58985919
5899 - `type: "text_delta"`
5900
5901 default: text_delta
5902
59035920 - `BetaInputJSONDelta object`
59045921
5922 - `type: "input_json_delta"`
5923
5924 default: input_json_delta
5925
59055926 - `partial_json: string`
59065927
5907 - `type: "input_json_delta"`
5908
5909 default: input_json_delta
5910
59115928 - `BetaCitationsDelta object`
59125929
5930 - `type: "citations_delta"`
5931
5932 default: citations_delta
5933
59135934 - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
59145935
59155936 - `BetaCitationCharLocation object`
from line 5943
59225943
59235944 - `BetaCitationSearchResultLocation object`
59245945
5925 - `type: "citations_delta"`
5926
5927 default: citations_delta
5928
59295946 - `BetaThinkingDelta object`
59305947
5948 - `type: "thinking_delta"`
5949
5950 default: thinking_delta
5951
59315952 - `estimated_tokens: number or null`
59325953
59335954 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.
from line 5957
59365957
59375958 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.
59385959
5939 - `type: "thinking_delta"`
5940
5941 default: thinking_delta
5942
59435960 - `BetaSignatureDelta object`
59445961
5962 - `type: "signature_delta"`
5963
5964 default: signature_delta
5965
59455966 - `signature: string`
59465967
59475968 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.
59485969
5949 - `type: "signature_delta"`
5950
5951 default: signature_delta
5952
59535970 - `BetaCompactionContentBlockDelta object`
59545971
5972 - `type: "compaction_delta"`
5973
5974 default: compaction_delta
5975
59555976 - `content: string or null`
59565977
59575978 - `encrypted_content: string or null`
59585979
59595980 Opaque metadata from prior compaction, to be round-tripped verbatim
59605981
5961 - `type: "compaction_delta"`
5962
5963 default: compaction_delta
5964
59655982 - `index: number`
59665983
5967 - `type: "content_block_delta"`
5968
5969 default: content_block_delta
5970
59715984 - `BetaRawContentBlockStopEvent object`
59725985
5986 - `type: "content_block_stop"`
5987
5988 default: content_block_stop
5989
59735990 - `index: number`
5974
5975 - `type: "content_block_stop"`
5976
5977 default: content_block_stop
59785991
59795992## Example
59805993
59815994