The whole hunk
from line 1, old and new numbered
/
lines
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
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: Batches
3url: https://platform.claude.com/docs/en/api/beta/messages/batches
4---
5
16# Batches
27
38## Create a Message Batch
from line 23
1823
1924 - `string`
2025
21 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
26 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2227
2328 - `"message-batches-2024-09-24"`
2429
from line 71
6671
6772 - `"user-profiles-2026-08-18"`
6873
74 - `"user-profiles-2026-09-04"`
75
6976 - `"advisor-tool-2026-03-01"`
7077
7178 - `"managed-agents-2026-04-01"`
from line 118
111118- `"anthropic-user-profile-id": optional string`
112119
113120 The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.
121
122- `"anthropic-workspace-id": optional string`
114123
115124### Body parameters
116125
from line 214
205214
206215 - `BetaTextBlockParam object`
207216
217 - `type: "text"`
218
208219 - `text: string`
209220
210221 minLength: 1
211
212 - `type: "text"`
213222
214223 - `cache_control: optional BetaCacheControlEphemeral or null`
215224
from line 245
236245
237246 - `BetaCitationCharLocationParam object`
238247
248 - `type: "char_location"`
249
239250 - `cited_text: string`
240251
241252 - `document_index: number`
from line 263
252263
253264 minimum: 0
254265
255 - `type: "char_location"`
256
257266 - `BetaCitationPageLocationParam object`
258267
268 - `type: "page_location"`
269
259270 - `cited_text: string`
260271
261272 - `document_index: number`
from line 283
272283
273284 minimum: 1
274285
275 - `type: "page_location"`
276
277286 - `BetaCitationContentBlockLocationParam object`
278287
288 - `type: "content_block_location"`
289
279290 - `cited_text: string`
280291
281292 The full text of the cited block range, concatenated.
from line 313
302313
303314 minimum: 0
304315
305 - `type: "content_block_location"`
306
307316 - `BetaCitationWebSearchResultLocationParam object`
308317
318 - `type: "web_search_result_location"`
319
309320 - `cited_text: string`
310321
311322 - `encrypted_index: string`
from line 325
314325
315326 maxLength: 512, minLength: 1
316327
317 - `type: "web_search_result_location"`
318
319328 - `url: string`
320329
321330 minLength: 1
322331
323332 - `BetaCitationSearchResultLocationParam object`
324333
334 - `type: "search_result_location"`
335
325336 - `cited_text: string`
326337
327338 The full text of the cited block range, concatenated.
from line 363
352363
353364 - `title: string or null`
354365
355 - `type: "search_result_location"`
356
357366 - `BetaImageBlockParam object`
358367
368 - `type: "image"`
369
359370 - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
360371
361372 - `BetaBase64ImageSource object`
362373
374 - `type: "base64"`
375
363376 - `data: string`
364377
365378 format: byte
from line 387
374387
375388 - `"image/webp"`
376389
390 - `BetaURLImageSource object`
391
392 - `type: "url"`
393
394 - `url: string`
395
396 - `BetaFileImageSource object`
397
398 - `type: "file"`
399
400 - `file_id: string`
401
402 - `cache_control: optional BetaCacheControlEphemeral or null`
403
404 Create a cache control breakpoint at this content block.
405
406 - `transformations: optional BetaImageTransformationsParam or null`
407
408 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.
409
410 - `oversized_image: optional "downsize" or "error"`
411
412 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.
413
414 - `"downsize"`
415
416 - `"error"`
417
418 - `BetaRequestDocumentBlock object`
419
420 - `type: "document"`
421
422 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
423
424 - `BetaBase64PDFSource object`
425
377426 - `type: "base64"`
378427
379 - `BetaURLImageSource object`
428 - `data: string`
429
430 format: byte
431
432 - `media_type: "application/pdf"`
433
434 - `BetaPlainTextSource object`
435
436 - `type: "text"`
437
438 - `data: string`
439
440 - `media_type: "text/plain"`
441
442 - `BetaContentBlockSource object`
443
444 - `type: "content"`
445
446 - `content: string or array of BetaContentBlockSourceContent`
447
448 - `string`
449
450 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
451
452 - `BetaTextBlockParam object`
453
454 - `BetaImageBlockParam object`
455
456 - `BetaURLPDFSource object`
380457
381458 - `type: "url"`
382459
383460 - `url: string`
384461
385 - `BetaFileImageSource object`
462 - `BetaFileDocumentSource object`
463
464 - `type: "file"`
386465
387466 - `file_id: string`
388467
389 - `type: "file"`
390
391 - `type: "image"`
392
393468 - `cache_control: optional BetaCacheControlEphemeral or null`
394469
395470 Create a cache control breakpoint at this content block.
396471
397 - `transformations: optional BetaImageTransformationsParam or null`
398
399 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.
400
401 - `oversized_image: optional "downsize" or "error"`
402
403 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.
404
405 - `"downsize"`
406
407 - `"error"`
408
409 - `BetaRequestDocumentBlock object`
410
411 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
412
413 - `BetaBase64PDFSource object`
414
415 - `data: string`
416
417 format: byte
418
419 - `media_type: "application/pdf"`
420
421 - `type: "base64"`
422
423 - `BetaPlainTextSource object`
424
425 - `data: string`
426
427 - `media_type: "text/plain"`
428
429 - `type: "text"`
430
431 - `BetaContentBlockSource object`
432
433 - `content: string or array of BetaContentBlockSourceContent`
434
435 - `string`
436
437 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
438
439 - `BetaTextBlockParam object`
440
441 - `BetaImageBlockParam object`
442
443 - `type: "content"`
444
445 - `BetaURLPDFSource object`
446
447 - `type: "url"`
448
449 - `url: string`
450
451 - `BetaFileDocumentSource object`
452
453 - `file_id: string`
454
455 - `type: "file"`
456
457 - `type: "document"`
472 - `citations: optional BetaCitationsConfigParam or null`
473
474 - `enabled: optional boolean`
475
476 - `context: optional string or null`
477
478 minLength: 1
479
480 - `title: optional string or null`
481
482 maxLength: 500, minLength: 1
483
484 - `BetaSearchResultBlockParam object`
485
486 - `type: "search_result"`
487
488 - `content: array of BetaTextBlockParam`
489
490 - `type: "text"`
491
492 - `text: string`
493
494 minLength: 1
495
496 - `cache_control: optional BetaCacheControlEphemeral or null`
497
498 Create a cache control breakpoint at this content block.
499
500 - `citations: optional array of BetaTextCitationParam or null`
501
502 - `source: string`
503
504 - `title: string`
458505
459506 - `cache_control: optional BetaCacheControlEphemeral or null`
460507
461508 Create a cache control breakpoint at this content block.
462509
463 - `citations: optional BetaCitationsConfigParam or null`
464
465 - `enabled: optional boolean`
466
467 - `context: optional string or null`
468
469 minLength: 1
470
471 - `title: optional string or null`
472
473 maxLength: 500, minLength: 1
474
475 - `BetaSearchResultBlockParam object`
476
477 - `content: array of BetaTextBlockParam`
478
479 - `text: string`
480
481 minLength: 1
482
483 - `type: "text"`
484
485 - `cache_control: optional BetaCacheControlEphemeral or null`
486
487 Create a cache control breakpoint at this content block.
488
489 - `citations: optional array of BetaTextCitationParam or null`
490
491 - `source: string`
492
493 - `title: string`
494
495 - `type: "search_result"`
510 - `citations: optional BetaCitationsConfigParam`
511
512 - `BetaThinkingBlockParam object`
513
514 - `type: "thinking"`
515
516 - `signature: string`
517
518 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.
519
520 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
521
522 - `thinking: string`
523
524 The `thinking` text of this block as returned by the API.
525
526 - `BetaRedactedThinkingBlockParam object`
527
528 - `type: "redacted_thinking"`
529
530 - `data: string`
531
532 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.
533
534 - `BetaToolUseBlockParam object`
535
536 - `type: "tool_use"`
537
538 - `id: string`
539
540 pattern: ^[a-zA-Z0-9_-]+$
541
542 - `input: map[unknown]`
543
544 - `name: string`
545
546 maxLength: 200, minLength: 1
496547
497548 - `cache_control: optional BetaCacheControlEphemeral or null`
498549
499550 Create a cache control breakpoint at this content block.
500551
501 - `citations: optional BetaCitationsConfigParam`
502
503 - `BetaThinkingBlockParam object`
504
505 - `signature: string`
506
507 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.
508
509 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
510
511 - `thinking: string`
512
513 The `thinking` text of this block as returned by the API.
514
515 - `type: "thinking"`
516
517 - `BetaRedactedThinkingBlockParam object`
518
519 - `data: string`
520
521 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.
522
523 - `type: "redacted_thinking"`
524
525 - `BetaToolUseBlockParam object`
526
527 - `id: string`
552 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
553
554 Tool invocation directly from the model.
555
556 - `BetaDirectCaller object`
557
558 Tool invocation directly from the model.
559
560 - `type: "direct"`
561
562 - `BetaServerToolCaller object`
563
564 Tool invocation generated by a server-side tool.
565
566 - `type: "code_execution_20250825"`
567
568 - `tool_id: string`
569
570 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
571
572 - `BetaServerToolCaller20260120 object`
573
574 - `type: "code_execution_20260120"`
575
576 - `tool_id: string`
577
578 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
579
580 - `toolset_name: optional string or null`
581
582 For a toolset member tool_use, the toolset family this member belongs to.
583
584 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
585
586 - `BetaToolResultBlockParam object`
587
588 - `type: "tool_result"`
589
590 - `tool_use_id: string`
528591
529592 pattern: ^[a-zA-Z0-9_-]+$
530593
531 - `input: map[unknown]`
532
533 - `name: string`
534
535 maxLength: 200, minLength: 1
536
537 - `type: "tool_use"`
538
539594 - `cache_control: optional BetaCacheControlEphemeral or null`
540595
541596 Create a cache control breakpoint at this content block.
542597
543 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
544
545 Tool invocation directly from the model.
546
547 - `BetaDirectCaller object`
548
549 Tool invocation directly from the model.
550
551 - `type: "direct"`
552
553 - `BetaServerToolCaller object`
554
555 Tool invocation generated by a server-side tool.
556
557 - `tool_id: string`
558
559 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
560
561 - `type: "code_execution_20250825"`
562
563 - `BetaServerToolCaller20260120 object`
564
565 - `tool_id: string`
566
567 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
568
569 - `type: "code_execution_20260120"`
570
571 - `toolset_name: optional string or null`
572
573 For a toolset member tool_use, the toolset family this member belongs to.
574
575 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
576
577 - `BetaToolResultBlockParam object`
578
579 - `tool_use_id: string`
580
581 pattern: ^[a-zA-Z0-9_-]+$
582
583 - `type: "tool_result"`
584
585 - `cache_control: optional BetaCacheControlEphemeral or null`
586
587 Create a cache control breakpoint at this content block.
588
589598 - `content: optional string or array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 3 more`
590599
591600 - `string`
from line 613
604613
605614 Tool reference block that can be included in tool_result content.
606615
616 - `type: "tool_reference"`
617
607618 - `tool_name: string`
608619
609620 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
610
611 - `type: "tool_reference"`
612621
613622 - `cache_control: optional BetaCacheControlEphemeral or null`
614623
from line 633
624633 browser toolset member `tool_use`. The server renders the
625634 model-visible text from it; the model never sees the raw fields.
626635
636 - `type: "browser_state"`
637
627638 - `tabs: array of BetaBrowserStateTabEntry`
628639
629640 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 662
651662 - `active: optional boolean`
652663
653664 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
654
655 - `type: "browser_state"`
656665
657666 - `cache_control: optional BetaCacheControlEphemeral or null`
658667
from line 683
674683 during a failed call gets no deferred `tab_opened`; it simply appears
675684 in the next result's `tabs` inventory.
676685
686 - `type: "tab_opened"`
687
677688 - `tab_id: string`
678689
679690 The `tab_id` of the opened tab, present in `tabs`.
680691
681692 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
682693
683 - `type: "tab_opened"`
684
685694 - `BetaBrowserStateChangeDownloadStarted object`
686695
687696 A file download that started during this call.
688697
698 - `type: "download_started"`
699
689700 - `download_id: string`
690701
691702 The caller-assigned identifier for this download, stable across the state changes reporting it.
692703
693704 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
694
695 - `type: "download_started"`
696705
697706 - `url: string`
698707
from line 716
707716 `download_started`, when the download finished during the call that
708717 started it (at most one state change per `download_id` per result).
709718
719 - `type: "download_completed"`
720
710721 - `download_id: string`
711722
712723 The caller-assigned identifier for this download, stable across the state changes reporting it.
713724
714725 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
715726
716 - `type: "download_completed"`
717
718727 - `url: string`
719728
720729 The final post-redirect URL the download was served from.
from line 746
737746
738747 A file download that failed — or was cancelled — during this call.
739748
749 - `type: "download_failed"`
750
740751 - `download_id: string`
741752
742753 The caller-assigned identifier for this download, stable across the state changes reporting it.
743754
744755 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
745756
746 - `type: "download_failed"`
747
748757 - `url: string`
749758
750759 The final post-redirect URL the download was served from.
from line 776
767776
768777 - `BetaServerToolUseBlockParam object`
769778
779 - `type: "server_tool_use"`
780
770781 - `id: string`
771782
772783 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 802
791802
792803 - `"tool_search_tool_bm25"`
793804
794 - `type: "server_tool_use"`
795
796805 - `cache_control: optional BetaCacheControlEphemeral or null`
797806
798807 Create a cache control breakpoint at this content block.
from line 822
813822
814823 - `BetaWebSearchToolResultBlockParam object`
815824
825 - `type: "web_search_tool_result"`
826
816827 - `content: BetaWebSearchToolResultBlockParamContent`
817828
818829 - `ResultBlock = array of BetaWebSearchResultBlockParam`
819830
831 - `type: "web_search_result"`
832
820833 - `encrypted_content: string`
821834
822835 - `title: string`
823836
824 - `type: "web_search_result"`
825
826837 - `url: string`
827838
828839 - `page_age: optional string or null`
829840
830841 - `BetaWebSearchToolRequestError object`
831842
843 - `type: "web_search_tool_result_error"`
844
832845 - `error_code: BetaWebSearchToolResultErrorCode`
833846
834847 - `"invalid_tool_input"`
from line 856
843856
844857 - `"request_too_large"`
845858
846 - `type: "web_search_tool_result_error"`
847
848859 - `tool_use_id: string`
849860
850861 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
851862
852 - `type: "web_search_tool_result"`
853
854863 - `cache_control: optional BetaCacheControlEphemeral or null`
855864
856865 Create a cache control breakpoint at this content block.
from line 880
871880
872881 - `BetaWebFetchToolResultBlockParam object`
873882
883 - `type: "web_fetch_tool_result"`
884
874885 - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
875886
876887 - `BetaWebFetchToolResultErrorBlockParam object`
877888
889 - `type: "web_fetch_tool_result_error"`
890
878891 - `error_code: BetaWebFetchToolResultErrorCode`
879892
880893 - `"invalid_tool_input"`
from line 908
895908
896909 - `"unavailable"`
897910
898 - `type: "web_fetch_tool_result_error"`
911 - `"content_too_large"`
899912
900913 - `BetaWebFetchBlockParam object`
901914
915 - `type: "web_fetch_result"`
916
902917 - `content: BetaRequestDocumentBlock`
903918
904 - `type: "web_fetch_result"`
905
906919 - `url: string`
907920
908921 Fetched content URL
from line 928
915928
916929 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
917930
918 - `type: "web_fetch_tool_result"`
919
920931 - `cache_control: optional BetaCacheControlEphemeral or null`
921932
922933 Create a cache control breakpoint at this content block.
from line 948
937948
938949 - `BetaAdvisorToolResultBlockParam object`
939950
951 - `type: "advisor_tool_result"`
952
940953 - `content: BetaAdvisorToolResultErrorParam or BetaAdvisorResultBlockParam or BetaAdvisorRedactedResultBlockParam`
941954
942955 - `BetaAdvisorToolResultErrorParam object`
943956
957 - `type: "advisor_tool_result_error"`
958
944959 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
945960
946961 - `"max_uses_exceeded"`
from line 972
957972
958973 - `"model_not_found"`
959974
960 - `type: "advisor_tool_result_error"`
961
962975 - `BetaAdvisorResultBlockParam object`
963976
977 - `type: "advisor_result"`
978
964979 - `text: string`
965980
966 - `type: "advisor_result"`
967
968981 - `stop_reason: optional string or null`
969982
970983 - `BetaAdvisorRedactedResultBlockParam object`
971984
985 - `type: "advisor_redacted_result"`
986
972987 - `encrypted_content: string`
973988
974989 Opaque blob produced by a prior response; must be round-tripped verbatim.
975990
976 - `type: "advisor_redacted_result"`
977
978991 - `stop_reason: optional string or null`
979992
980993 - `tool_use_id: string`
981994
982995 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
983996
984 - `type: "advisor_tool_result"`
985
986997 - `cache_control: optional BetaCacheControlEphemeral or null`
987998
988999 Create a cache control breakpoint at this content block.
9891000
9901001 - `BetaCodeExecutionToolResultBlockParam object`
9911002
1003 - `type: "code_execution_tool_result"`
1004
9921005 - `content: BetaCodeExecutionToolResultBlockParamContent`
9931006
9941007 Code execution result with encrypted stdout for PFC + web_search results.
9951008
9961009 - `BetaCodeExecutionToolResultErrorParam object`
9971010
1011 - `type: "code_execution_tool_result_error"`
1012
9981013 - `error_code: BetaCodeExecutionToolResultErrorCode`
9991014
10001015 - `"invalid_tool_input"`
from line 1020
10051020
10061021 - `"execution_time_exceeded"`
10071022
1008 - `type: "code_execution_tool_result_error"`
1009
10101023 - `BetaCodeExecutionResultBlockParam object`
10111024
1025 - `type: "code_execution_result"`
1026
10121027 - `content: array of BetaCodeExecutionOutputBlockParam`
10131028
1029 - `type: "code_execution_output"`
1030
10141031 - `file_id: string`
10151032
1033 - `return_code: number`
1034
1035 - `stderr: string`
1036
1037 - `stdout: string`
1038
1039 - `BetaEncryptedCodeExecutionResultBlockParam object`
1040
1041 Code execution result with encrypted stdout for PFC + web_search results.
1042
1043 - `type: "encrypted_code_execution_result"`
1044
1045 - `content: array of BetaCodeExecutionOutputBlockParam`
1046
10161047 - `type: "code_execution_output"`
10171048
1049 - `file_id: string`
1050
1051 - `encrypted_stdout: string`
1052
10181053 - `return_code: number`
10191054
10201055 - `stderr: string`
10211056
1057 - `tool_use_id: string`
1058
1059 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1060
1061 - `cache_control: optional BetaCacheControlEphemeral or null`
1062
1063 Create a cache control breakpoint at this content block.
1064
1065 - `BetaBashCodeExecutionToolResultBlockParam object`
1066
1067 - `type: "bash_code_execution_tool_result"`
1068
1069 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
1070
1071 - `BetaBashCodeExecutionToolResultErrorParam object`
1072
1073 - `type: "bash_code_execution_tool_result_error"`
1074
1075 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1076
1077 - `"invalid_tool_input"`
1078
1079 - `"unavailable"`
1080
1081 - `"too_many_requests"`
1082
1083 - `"execution_time_exceeded"`
1084
1085 - `"output_file_too_large"`
1086
1087 - `BetaBashCodeExecutionResultBlockParam object`
1088
1089 - `type: "bash_code_execution_result"`
1090
1091 - `content: array of BetaBashCodeExecutionOutputBlockParam`
1092
1093 - `type: "bash_code_execution_output"`
1094
1095 - `file_id: string`
1096
1097 - `return_code: number`
1098
1099 - `stderr: string`
1100
10221101 - `stdout: string`
10231102
1024 - `type: "code_execution_result"`
1025
1026 - `BetaEncryptedCodeExecutionResultBlockParam object`
1027
1028 Code execution result with encrypted stdout for PFC + web_search results.
1029
1030 - `content: array of BetaCodeExecutionOutputBlockParam`
1031
1032 - `file_id: string`
1033
1034 - `type: "code_execution_output"`
1035
1036 - `encrypted_stdout: string`
1037
1038 - `return_code: number`
1039
1040 - `stderr: string`
1041
1042 - `type: "encrypted_code_execution_result"`
1043
10441103 - `tool_use_id: string`
10451104
10461105 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10471106
1048 - `type: "code_execution_tool_result"`
1049
10501107 - `cache_control: optional BetaCacheControlEphemeral or null`
10511108
10521109 Create a cache control breakpoint at this content block.
10531110
1054 - `BetaBashCodeExecutionToolResultBlockParam object`
1055
1056 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
1057
1058 - `BetaBashCodeExecutionToolResultErrorParam object`
1111 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
1112
1113 - `type: "text_editor_code_execution_tool_result"`
1114
1115 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
1116
1117 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
1118
1119 - `type: "text_editor_code_execution_tool_result_error"`
10591120
10601121 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10611122
from line 1128
10671128
10681129 - `"execution_time_exceeded"`
10691130
1070 - `"output_file_too_large"`
1071
1072 - `type: "bash_code_execution_tool_result_error"`
1073
1074 - `BetaBashCodeExecutionResultBlockParam object`
1075
1076 - `content: array of BetaBashCodeExecutionOutputBlockParam`
1077
1078 - `file_id: string`
1079
1080 - `type: "bash_code_execution_output"`
1081
1082 - `return_code: number`
1083
1084 - `stderr: string`
1085
1086 - `stdout: string`
1087
1088 - `type: "bash_code_execution_result"`
1131 - `"file_not_found"`
1132
1133 - `error_message: optional string or null`
1134
1135 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
1136
1137 - `type: "text_editor_code_execution_view_result"`
1138
1139 - `content: string`
1140
1141 - `file_type: "text" or "image" or "pdf"`
1142
1143 - `"text"`
1144
1145 - `"image"`
1146
1147 - `"pdf"`
1148
1149 - `num_lines: optional number or null`
1150
1151 - `start_line: optional number or null`
1152
1153 - `total_lines: optional number or null`
1154
1155 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
1156
1157 - `type: "text_editor_code_execution_create_result"`
1158
1159 - `is_file_update: boolean`
1160
1161 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
1162
1163 - `type: "text_editor_code_execution_str_replace_result"`
1164
1165 - `lines: optional array of string or null`
1166
1167 - `new_lines: optional number or null`
1168
1169 - `new_start: optional number or null`
1170
1171 - `old_lines: optional number or null`
1172
1173 - `old_start: optional number or null`
10891174
10901175 - `tool_use_id: string`
10911176
10921177 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10931178
1094 - `type: "bash_code_execution_tool_result"`
1095
10961179 - `cache_control: optional BetaCacheControlEphemeral or null`
10971180
10981181 Create a cache control breakpoint at this content block.
10991182
1100 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
1101
1102 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
1103
1104 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
1105
1106 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1183 - `BetaToolSearchToolResultBlockParam object`
1184
1185 - `type: "tool_search_tool_result"`
1186
1187 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
1188
1189 - `BetaToolSearchToolResultErrorParam object`
1190
1191 - `type: "tool_search_tool_result_error"`
1192
1193 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
11071194
11081195 - `"invalid_tool_input"`
11091196
from line 1200
11131200
11141201 - `"execution_time_exceeded"`
11151202
1116 - `"file_not_found"`
1117
1118 - `type: "text_editor_code_execution_tool_result_error"`
1119
11201203 - `error_message: optional string or null`
11211204
1122 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
1123
1124 - `content: string`
1125
1126 - `file_type: "text" or "image" or "pdf"`
1127
1128 - `"text"`
1129
1130 - `"image"`
1131
1132 - `"pdf"`
1133
1134 - `type: "text_editor_code_execution_view_result"`
1135
1136 - `num_lines: optional number or null`
1137
1138 - `start_line: optional number or null`
1139
1140 - `total_lines: optional number or null`
1141
1142 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
1143
1144 - `is_file_update: boolean`
1145
1146 - `type: "text_editor_code_execution_create_result"`
1147
1148 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
1149
1150 - `type: "text_editor_code_execution_str_replace_result"`
1151
1152 - `lines: optional array of string or null`
1153
1154 - `new_lines: optional number or null`
1155
1156 - `new_start: optional number or null`
1157
1158 - `old_lines: optional number or null`
1159
1160 - `old_start: optional number or null`
1205 - `BetaToolSearchToolSearchResultBlockParam object`
1206
1207 - `type: "tool_search_tool_search_result"`
1208
1209 - `tool_references: array of BetaToolReferenceBlockParam`
1210
1211 - `type: "tool_reference"`
1212
1213 - `tool_name: string`
1214
1215 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1216
1217 - `cache_control: optional BetaCacheControlEphemeral or null`
1218
1219 Create a cache control breakpoint at this content block.
11611220
11621221 - `tool_use_id: string`
11631222
11641223 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
11651224
1166 - `type: "text_editor_code_execution_tool_result"`
1167
11681225 - `cache_control: optional BetaCacheControlEphemeral or null`
11691226
11701227 Create a cache control breakpoint at this content block.
11711228
1172 - `BetaToolSearchToolResultBlockParam object`
1173
1174 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
1175
1176 - `BetaToolSearchToolResultErrorParam object`
1177
1178 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
1179
1180 - `"invalid_tool_input"`
1181
1182 - `"unavailable"`
1183
1184 - `"too_many_requests"`
1185
1186 - `"execution_time_exceeded"`
1187
1188 - `type: "tool_search_tool_result_error"`
1189
1190 - `error_message: optional string or null`
1191
1192 - `BetaToolSearchToolSearchResultBlockParam object`
1193
1194 - `tool_references: array of BetaToolReferenceBlockParam`
1195
1196 - `tool_name: string`
1197
1198 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1199
1200 - `type: "tool_reference"`
1201
1202 - `cache_control: optional BetaCacheControlEphemeral or null`
1203
1204 Create a cache control breakpoint at this content block.
1205
1206 - `type: "tool_search_tool_search_result"`
1229 - `BetaMCPToolUseBlockParam object`
1230
1231 - `type: "mcp_tool_use"`
1232
1233 - `id: string`
1234
1235 pattern: ^[a-zA-Z0-9_-]+$
1236
1237 - `input: map[unknown]`
1238
1239 - `name: string`
1240
1241 - `server_name: string`
1242
1243 The name of the MCP server
1244
1245 - `cache_control: optional BetaCacheControlEphemeral or null`
1246
1247 Create a cache control breakpoint at this content block.
1248
1249 - `BetaRequestMCPToolResultBlockParam object`
1250
1251 - `type: "mcp_tool_result"`
12071252
12081253 - `tool_use_id: string`
12091254
1210 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1211
1212 - `type: "tool_search_tool_result"`
1255 pattern: ^[a-zA-Z0-9_-]+$
12131256
12141257 - `cache_control: optional BetaCacheControlEphemeral or null`
12151258
12161259 Create a cache control breakpoint at this content block.
12171260
1218 - `BetaMCPToolUseBlockParam object`
1219
1220 - `id: string`
1221
1222 pattern: ^[a-zA-Z0-9_-]+$
1223
1224 - `input: map[unknown]`
1225
1226 - `name: string`
1227
1228 - `server_name: string`
1229
1230 The name of the MCP server
1231
1232 - `type: "mcp_tool_use"`
1233
1234 - `cache_control: optional BetaCacheControlEphemeral or null`
1235
1236 Create a cache control breakpoint at this content block.
1237
1238 - `BetaRequestMCPToolResultBlockParam object`
1239
1240 - `tool_use_id: string`
1241
1242 pattern: ^[a-zA-Z0-9_-]+$
1243
1244 - `type: "mcp_tool_result"`
1245
1246 - `cache_control: optional BetaCacheControlEphemeral or null`
1247
1248 Create a cache control breakpoint at this content block.
1249
12501261 - `content: optional string or array of BetaTextBlockParam`
12511262
12521263 - `string`
12531264
12541265 - `BetaMCPToolResultBlockParamContent = array of BetaTextBlockParam`
12551266
1267 - `type: "text"`
1268
12561269 - `text: string`
12571270
12581271 minLength: 1
1259
1260 - `type: "text"`
12611272
12621273 - `cache_control: optional BetaCacheControlEphemeral or null`
12631274
from line 1283
12721283 A content block that represents a file to be uploaded to the container
12731284 Files uploaded via this block will be available in the container's input directory.
12741285
1286 - `type: "container_upload"`
1287
12751288 - `file_id: string`
1276
1277 - `type: "container_upload"`
12781289
12791290 - `cache_control: optional BetaCacheControlEphemeral or null`
12801291
from line 1322
13111322 `tool` references a tool (or MCP toolset) by name from the request's
13121323 `tools`; it is offered to the model from this point in the
13131324 conversation onward.
1325
1326 - `type: "tool_addition"`
13141327
13151328 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
13161329
from line 1339
13261339 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13271340 `mcp_toolset_reference` for those.
13281341
1342 - `type: "tool_reference"`
1343
13291344 - `name: string`
13301345
13311346 pattern: ^[a-zA-Z0-9_-]{1,128}$
1332
1333 - `type: "tool_reference"`
13341347
13351348 - `BetaToolChangeMCPToolReference object`
13361349
13371350 Reference to a single MCP tool by its server and remote name — the
13381351 same `server_name`/`name` pair `mcp_tool_use` carries.
13391352
1353 - `type: "mcp_tool_reference"`
1354
13401355 - `name: string`
13411356
13421357 - `server_name: string`
13431358
1344 - `type: "mcp_tool_reference"`
1345
13461359 - `BetaToolChangeMCPToolsetReference object`
13471360
13481361 Reference to every tool in the named MCP server's toolset.
13491362
1363 - `type: "mcp_toolset_reference"`
1364
13501365 - `server_name: string`
1351
1352 - `type: "mcp_toolset_reference"`
1353
1354 - `type: "tool_addition"`
13551366
13561367 - `cache_control: optional BetaCacheControlEphemeral or null`
13571368
from line 1375
13641375 `tool` references a tool (or MCP toolset) by name from the request's
13651376 `tools`; it is no longer offered to the model from this point in the
13661377 conversation onward.
1378
1379 - `type: "tool_removal"`
13671380
13681381 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
13691382
from line 1400
13871400 - `BetaToolChangeMCPToolsetReference object`
13881401
13891402 Reference to every tool in the named MCP server's toolset.
1390
1391 - `type: "tool_removal"`
13921403
13931404 - `cache_control: optional BetaCacheControlEphemeral or null`
13941405
from line 1421
14101421 likewise rejected; between non-thinking blocks the block's placement has
14111422 no validation effect.
14121423
1424 - `type: "fallback"`
1425
14131426 - `from: BetaFallbackInfoParam`
14141427
14151428 Identifies one hop of a fallback transition.
from line 1512
14991512 - `to: BetaFallbackInfoParam`
15001513
15011514 Identifies one hop of a fallback transition.
1502
1503 - `type: "fallback"`
15041515
15051516 - `trigger: optional unknown`
15061517
from line 1583
15721583
15731584 maxItems: 20
15741585
1586 - `type: "anthropic" or "custom"`
1587
1588 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1589
1590 - `"anthropic"`
1591
1592 - `"custom"`
1593
15751594 - `skill_id: string`
15761595
15771596 Skill ID
15781597
15791598 maxLength: 64, minLength: 1
1580
1581 - `type: "anthropic" or "custom"`
1582
1583 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1584
1585 - `"anthropic"`
1586
1587 - `"custom"`
15881599
15891600 - `version: optional string`
15901601
from line 1807
17961807
17971808 A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
17981809
1810 - `type: "json_schema"`
1811
17991812 - `schema: map[unknown]`
18001813
18011814 The JSON schema of the format
18021815
1803 - `type: "json_schema"`
1804
18051816 - `task_budget: optional BetaTokenTaskBudget or null`
18061817
18071818 User-configurable total token budget across contexts.
18081819
1820 - `type: "tokens"`
1821
1822 The budget type. Currently only 'tokens' is supported.
1823
18091824 - `total: number`
18101825
18111826 Total token budget across all contexts in the session.
18121827
18131828 minimum: 1024
18141829
1815 - `type: "tokens"`
1816
1817 The budget type. Currently only 'tokens' is supported.
1818
18191830 - `remaining: optional number or null`
18201831
18211832 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 1845
18341845
18351846 - `BetaThinkingConfigEnabled object`
18361847
1848 - `type: "enabled"`
1849
18371850 - `budget_tokens: number`
18381851
18391852 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 1856
18431856 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
18441857
18451858 minimum: 1024
1846
1847 - `type: "enabled"`
18481859
18491860 - `block_binding: optional BetaThinkingBlockBinding or null`
18501861
from line 1921
19101921
19111922 maxItems: 20
19121923
1924 - `type: "url"`
1925
19131926 - `name: string`
19141927
1915 - `type: "url"`
1916
19171928 - `url: string`
19181929
19191930 - `authorization_token: optional string or null`
from line 1993
19821993
19831994 - `array of BetaTextBlockParam`
19841995
1996 - `type: "text"`
1997
19851998 - `text: string`
19861999
19872000 minLength: 1
19882001
1989 - `type: "text"`
1990
19912002 - `cache_control: optional BetaCacheControlEphemeral or null`
19922003
19932004 Create a cache control breakpoint at this content block.
from line 2051
20402051
20412052 The model will use the specified tool with `tool_choice.name`.
20422053
2054 - `type: "tool"`
2055
20432056 - `name: string`
20442057
20452058 The name of the tool to use.
2046
2047 - `type: "tool"`
20482059
20492060 - `disable_parallel_tool_use: optional boolean`
20502061
from line 2135
21242135
21252136 - `BetaTool object`
21262137
2138 - `type: optional "custom" or null`
2139
21272140 - `input_schema: object`
21282141
21292142 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
from line 2191
21782191
21792192 When true, guarantees schema validation on tool names and inputs
21802193
2181 - `type: optional "custom" or null`
2182
21832194 - `BetaToolBash20241022 object`
21842195
2196 - `type: "bash_20241022"`
2197
21852198 - `name: "bash"`
21862199
21872200 Name of the tool.
21882201
21892202 This is how the tool will be called by the model and in `tool_use` blocks.
21902203
2191 - `type: "bash_20241022"`
2192
21932204 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21942205
21952206 - `"direct"`
from line 2227
22162227
22172228 - `BetaToolBash20250124 object`
22182229
2230 - `type: "bash_20250124"`
2231
22192232 - `name: "bash"`
22202233
22212234 Name of the tool.
22222235
22232236 This is how the tool will be called by the model and in `tool_use` blocks.
22242237
2225 - `type: "bash_20250124"`
2226
22272238 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22282239
22292240 - `"direct"`
from line 2261
22502261
22512262 - `BetaCodeExecutionTool20250522 object`
22522263
2264 - `type: "code_execution_20250522"`
2265
22532266 - `name: "code_execution"`
22542267
22552268 Name of the tool.
22562269
22572270 This is how the tool will be called by the model and in `tool_use` blocks.
22582271
2259 - `type: "code_execution_20250522"`
2260
22612272 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22622273
22632274 - `"direct"`
from line 2293
22822293
22832294 - `BetaCodeExecutionTool20250825 object`
22842295
2296 - `type: "code_execution_20250825"`
2297
22852298 - `name: "code_execution"`
22862299
22872300 Name of the tool.
22882301
22892302 This is how the tool will be called by the model and in `tool_use` blocks.
22902303
2291 - `type: "code_execution_20250825"`
2292
22932304 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22942305
22952306 - `"direct"`
from line 2327
23162327
23172328 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
23182329
2330 - `type: "code_execution_20260120"`
2331
23192332 - `name: "code_execution"`
23202333
23212334 Name of the tool.
23222335
23232336 This is how the tool will be called by the model and in `tool_use` blocks.
23242337
2325 - `type: "code_execution_20260120"`
2326
23272338 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23282339
23292340 - `"direct"`
from line 2361
23502361
23512362 Code execution tool with REPL state persistence.
23522363
2364 - `type: "code_execution_20260521"`
2365
23532366 - `name: "code_execution"`
23542367
23552368 Name of the tool.
23562369
23572370 This is how the tool will be called by the model and in `tool_use` blocks.
2358
2359 - `type: "code_execution_20260521"`
23602371
23612372 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23622373
from line 2413
24022413 absent. Unknown keys are rejected: the field set is this toolset
24032414 version's complete member set.
24042415
2416 - `type: optional BetaBrowserTypeConfig or null`
2417
2418 `type`'s config overrides.
2419
2420 - `defer_loading: optional boolean or null`
2421
2422 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2423
2424 - `enabled: optional boolean or null`
2425
2426 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.
2427
24052428 - `close_tab: optional BetaBrowserCloseTabConfig or null`
24062429
24072430 `close_tab`'s config overrides.
from line 2761
27382761
27392762 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.
27402763
2741 - `type: optional BetaBrowserTypeConfig or null`
2742
2743 `type`'s config overrides.
2764 - `wait: optional BetaBrowserWaitConfig or null`
2765
2766 `wait`'s config overrides.
27442767
27452768 - `defer_loading: optional boolean or null`
27462769
from line 2773
27502773
27512774 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.
27522775
2753 - `wait: optional BetaBrowserWaitConfig or null`
2754
2755 `wait`'s config overrides.
2776 - `zoom: optional BetaBrowserZoomConfig or null`
2777
2778 `zoom`'s config overrides.
27562779
27572780 - `defer_loading: optional boolean or null`
27582781
from line 2785
27622785
27632786 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.
27642787
2765 - `zoom: optional BetaBrowserZoomConfig or null`
2766
2767 `zoom`'s config overrides.
2768
2769 - `defer_loading: optional boolean or null`
2770
2771 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2772
2773 - `enabled: optional boolean or null`
2774
2775 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.
2776
27772788 - `BetaToolComputerUse20241022 object`
27782789
2790 - `type: "computer_20241022"`
2791
27792792 - `display_height_px: number`
27802793
27812794 The height of the display in pixels.
from line 2807
27942807
27952808 This is how the tool will be called by the model and in `tool_use` blocks.
27962809
2797 - `type: "computer_20241022"`
2798
27992810 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28002811
28012812 - `"direct"`
from line 2839
28282839
28292840 - `BetaMemoryTool20250818 object`
28302841
2842 - `type: "memory_20250818"`
2843
28312844 - `name: "memory"`
28322845
28332846 Name of the tool.
28342847
28352848 This is how the tool will be called by the model and in `tool_use` blocks.
28362849
2837 - `type: "memory_20250818"`
2838
28392850 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28402851
28412852 - `"direct"`
from line 2873
28622873
28632874 - `BetaToolComputerUse20250124 object`
28642875
2876 - `type: "computer_20250124"`
2877
28652878 - `display_height_px: number`
28662879
28672880 The height of the display in pixels.
from line 2893
28802893
28812894 This is how the tool will be called by the model and in `tool_use` blocks.
28822895
2883 - `type: "computer_20250124"`
2884
28852896 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28862897
28872898 - `"direct"`
from line 2925
29142925
29152926 - `BetaToolTextEditor20241022 object`
29162927
2928 - `type: "text_editor_20241022"`
2929
29172930 - `name: "str_replace_editor"`
29182931
29192932 Name of the tool.
29202933
29212934 This is how the tool will be called by the model and in `tool_use` blocks.
29222935
2923 - `type: "text_editor_20241022"`
2924
29252936 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29262937
29272938 - `"direct"`
from line 2959
29482959
29492960 - `BetaToolComputerUse20251124 object`
29502961
2962 - `type: "computer_20251124"`
2963
29512964 - `display_height_px: number`
29522965
29532966 The height of the display in pixels.
from line 2978
29652978 Name of the tool.
29662979
29672980 This is how the tool will be called by the model and in `tool_use` blocks.
2968
2969 - `type: "computer_20251124"`
29702981
29712982 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29722983
from line 3039
30283039 absent. Unknown keys are rejected: the field set is this toolset
30293040 version's complete member set.
30303041
3042 - `type: optional BetaComputerTypeConfig or null`
3043
3044 `type`'s config overrides.
3045
3046 - `defer_loading: optional boolean or null`
3047
3048 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
3049
3050 - `enabled: optional boolean or null`
3051
3052 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.
3053
30313054 - `cursor_position: optional BetaComputerCursorPositionConfig or null`
30323055
30333056 `cursor_position`'s config overrides.
from line 3219
31963219
31973220 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.
31983221
3199 - `type: optional BetaComputerTypeConfig or null`
3200
3201 `type`'s config overrides.
3222 - `wait: optional BetaComputerWaitConfig or null`
3223
3224 `wait`'s config overrides.
32023225
32033226 - `defer_loading: optional boolean or null`
32043227
from line 3231
32083231
32093232 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.
32103233
3211 - `wait: optional BetaComputerWaitConfig or null`
3212
3213 `wait`'s config overrides.
3234 - `zoom: optional BetaComputerZoomConfig or null`
3235
3236 `zoom`'s config overrides.
32143237
32153238 - `defer_loading: optional boolean or null`
32163239
from line 3243
32203243
32213244 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.
32223245
3223 - `zoom: optional BetaComputerZoomConfig or null`
3224
3225 `zoom`'s config overrides.
3226
3227 - `defer_loading: optional boolean or null`
3228
3229 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
3230
3231 - `enabled: optional boolean or null`
3232
3233 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.
3234
32353246 - `BetaToolTextEditor20250124 object`
32363247
3248 - `type: "text_editor_20250124"`
3249
32373250 - `name: "str_replace_editor"`
32383251
32393252 Name of the tool.
32403253
32413254 This is how the tool will be called by the model and in `tool_use` blocks.
32423255
3243 - `type: "text_editor_20250124"`
3244
32453256 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32463257
32473258 - `"direct"`
from line 3279
32683279
32693280 - `BetaToolTextEditor20250429 object`
32703281
3282 - `type: "text_editor_20250429"`
3283
32713284 - `name: "str_replace_based_edit_tool"`
32723285
32733286 Name of the tool.
32743287
32753288 This is how the tool will be called by the model and in `tool_use` blocks.
32763289
3277 - `type: "text_editor_20250429"`
3278
32793290 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32803291
32813292 - `"direct"`
from line 3313
33023313
33033314 - `BetaToolTextEditor20250728 object`
33043315
3316 - `type: "text_editor_20250728"`
3317
33053318 - `name: "str_replace_based_edit_tool"`
33063319
33073320 Name of the tool.
33083321
33093322 This is how the tool will be called by the model and in `tool_use` blocks.
33103323
3311 - `type: "text_editor_20250728"`
3312
33133324 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33143325
33153326 - `"direct"`
from line 3353
33423353
33433354 - `BetaWebSearchTool20250305 object`
33443355
3356 - `type: "web_search_20250305"`
3357
33453358 - `name: "web_search"`
33463359
33473360 Name of the tool.
33483361
33493362 This is how the tool will be called by the model and in `tool_use` blocks.
33503363
3351 - `type: "web_search_20250305"`
3352
33533364 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33543365
33553366 - `"direct"`
from line 3429
34183429
34193430 - `BetaWebFetchTool20250910 object`
34203431
3432 - `type: "web_fetch_20250910"`
3433
34213434 - `name: "web_fetch"`
34223435
34233436 Name of the tool.
34243437
34253438 This is how the tool will be called by the model and in `tool_use` blocks.
34263439
3427 - `type: "web_fetch_20250910"`
3428
34293440 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34303441
34313442 - `"direct"`
from line 3485
34743485
34753486 - `BetaWebSearchTool20260209 object`
34763487
3488 - `type: "web_search_20260209"`
3489
34773490 - `name: "web_search"`
34783491
34793492 Name of the tool.
34803493
34813494 This is how the tool will be called by the model and in `tool_use` blocks.
34823495
3483 - `type: "web_search_20260209"`
3484
34853496 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34863497
34873498 - `"direct"`
from line 3535
35243535
35253536 - `BetaWebFetchTool20260209 object`
35263537
3538 - `type: "web_fetch_20260209"`
3539
35273540 - `name: "web_fetch"`
35283541
35293542 Name of the tool.
35303543
35313544 This is how the tool will be called by the model and in `tool_use` blocks.
35323545
3533 - `type: "web_fetch_20260209"`
3534
35353546 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35363547
35373548 - `"direct"`
from line 3593
35823593
35833594 Web fetch tool with use_cache parameter for bypassing cached content.
35843595
3596 - `type: "web_fetch_20260309"`
3597
35853598 - `name: "web_fetch"`
35863599
35873600 Name of the tool.
35883601
35893602 This is how the tool will be called by the model and in `tool_use` blocks.
35903603
3591 - `type: "web_fetch_20260309"`
3592
35933604 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35943605
35953606 - `"direct"`
from line 3653
36423653
36433654 - `BetaWebSearchTool20260318 object`
36443655
3656 - `type: "web_search_20260318"`
3657
36453658 - `name: "web_search"`
36463659
36473660 Name of the tool.
36483661
36493662 This is how the tool will be called by the model and in `tool_use` blocks.
36503663
3651 - `type: "web_search_20260318"`
3652
36533664 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36543665
36553666 - `"direct"`
from line 3711
37003711
37013712 - `BetaWebFetchTool20260318 object`
37023713
3714 - `type: "web_fetch_20260318"`
3715
37033716 - `name: "web_fetch"`
37043717
37053718 Name of the tool.
37063719
37073720 This is how the tool will be called by the model and in `tool_use` blocks.
37083721
3709 - `type: "web_fetch_20260318"`
3710
37113722 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
37123723
37133724 - `"direct"`
from line 3779
37683779
37693780 - `BetaAdvisorTool20260301 object`
37703781
3782 - `type: "advisor_20260301"`
3783
37713784 - `model: Model`
37723785
37733786 The model that will complete your prompt.
from line 3793
37803793
37813794 This is how the tool will be called by the model and in `tool_use` blocks.
37823795
3783 - `type: "advisor_20260301"`
3784
37853796 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
37863797
37873798 - `"direct"`
from line 3833
38223833
38233834 - `BetaToolSearchToolBm25_20251119 object`
38243835
3836 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3837
3838 - `"tool_search_tool_bm25_20251119"`
3839
3840 - `"tool_search_tool_bm25"`
3841
38253842 - `name: "tool_search_tool_bm25"`
38263843
38273844 Name of the tool.
38283845
38293846 This is how the tool will be called by the model and in `tool_use` blocks.
38303847
3831 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3832
3833 - `"tool_search_tool_bm25_20251119"`
3834
3835 - `"tool_search_tool_bm25"`
3836
38373848 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38383849
38393850 - `"direct"`
from line 3869
38583869
38593870 - `BetaToolSearchToolRegex20251119 object`
38603871
3872 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3873
3874 - `"tool_search_tool_regex_20251119"`
3875
3876 - `"tool_search_tool_regex"`
3877
38613878 - `name: "tool_search_tool_regex"`
38623879
38633880 Name of the tool.
38643881
38653882 This is how the tool will be called by the model and in `tool_use` blocks.
3866
3867 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3868
3869 - `"tool_search_tool_regex_20251119"`
3870
3871 - `"tool_search_tool_regex"`
38723883
38733884 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38743885
from line 3910
38993910 Allows configuring enabled status and defer_loading for all tools
39003911 from an MCP server, with optional per-tool overrides.
39013912
3913 - `type: "mcp_toolset"`
3914
39023915 - `mcp_server_name: string`
39033916
39043917 Name of the MCP server to configure tools for
39053918
39063919 maxLength: 255, minLength: 1
39073920
3908 - `type: "mcp_toolset"`
3909
39103921 - `cache_control: optional BetaCacheControlEphemeral or null`
39113922
39123923 Create a cache control breakpoint at this content block.
from line 3986
39753986
39763987- `BetaMessageBatch object`
39773988
3989 - `type: "message_batch"`
3990
3991 Object type.
3992
3993 For Message Batches, this is always `"message_batch"`.
3994
3995 default: message_batch
3996
39783997 - `id: string`
39793998
39803999 Unique object identifier.
from line 4091
40724091 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
40734092
40744093 Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
4075
4076 - `type: "message_batch"`
4077
4078 Object type.
4079
4080 For Message Batches, this is always `"message_batch"`.
4081
4082 default: message_batch
40834094
40844095### Example
40854096
from line 4164
41534164
41544165 - `string`
41554166
4156 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
4167 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
41574168
41584169 - `"message-batches-2024-09-24"`
41594170
from line 4212
42014212
42024213 - `"user-profiles-2026-08-18"`
42034214
4215 - `"user-profiles-2026-09-04"`
4216
42044217 - `"advisor-tool-2026-03-01"`
42054218
42064219 - `"managed-agents-2026-04-01"`
from line 4256
42434256
42444257 - `"mid-conversation-system-clear-at-2026-08-21"`
42454258
4259- `"anthropic-workspace-id": optional string`
4260
42464261### Returns
42474262
42484263- `BetaMessageBatch object`
42494264
4265 - `type: "message_batch"`
4266
4267 Object type.
4268
4269 For Message Batches, this is always `"message_batch"`.
4270
4271 default: message_batch
4272
42504273 - `id: string`
42514274
42524275 Unique object identifier.
from line 4367
43444367 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
43454368
43464369 Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
4347
4348 - `type: "message_batch"`
4349
4350 Object type.
4351
4352 For Message Batches, this is always `"message_batch"`.
4353
4354 default: message_batch
43554370
43564371### Example
43574372
from line 4434
44194434
44204435 - `string`
44214436
4422 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
4437 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
44234438
44244439 - `"message-batches-2024-09-24"`
44254440
from line 4482
44674482
44684483 - `"user-profiles-2026-08-18"`
44694484
4485 - `"user-profiles-2026-09-04"`
4486
44704487 - `"advisor-tool-2026-03-01"`
44714488
44724489 - `"managed-agents-2026-04-01"`
from line 4526
45094526
45104527 - `"mid-conversation-system-clear-at-2026-08-21"`
45114528
4529- `"anthropic-workspace-id": optional string`
4530
45124531### Returns
45134532
45144533- `data: array of BetaMessageBatch`
45154534
4535 - `type: "message_batch"`
4536
4537 Object type.
4538
4539 For Message Batches, this is always `"message_batch"`.
4540
4541 default: message_batch
4542
45164543 - `id: string`
45174544
45184545 Unique object identifier.
from line 4637
46104637 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
46114638
46124639 Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
4613
4614 - `type: "message_batch"`
4615
4616 Object type.
4617
4618 For Message Batches, this is always `"message_batch"`.
4619
4620 default: message_batch
46214640
46224641- `first_id: string or null`
46234642
from line 4713
46944713
46954714 - `string`
46964715
4697 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
4716 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
46984717
46994718 - `"message-batches-2024-09-24"`
47004719
from line 4761
47424761
47434762 - `"user-profiles-2026-08-18"`
47444763
4764 - `"user-profiles-2026-09-04"`
4765
47454766 - `"advisor-tool-2026-03-01"`
47464767
47474768 - `"managed-agents-2026-04-01"`
from line 4805
47844805
47854806 - `"mid-conversation-system-clear-at-2026-08-21"`
47864807
4808- `"anthropic-workspace-id": optional string`
4809
47874810### Returns
47884811
47894812- `BetaMessageBatch object`
47904813
4814 - `type: "message_batch"`
4815
4816 Object type.
4817
4818 For Message Batches, this is always `"message_batch"`.
4819
4820 default: message_batch
4821
47914822 - `id: string`
47924823
47934824 Unique object identifier.
from line 4916
48854916 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
48864917
48874918 Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
4888
4889 - `type: "message_batch"`
4890
4891 Object type.
4892
4893 For Message Batches, this is always `"message_batch"`.
4894
4895 default: message_batch
48964919
48974920### Example
48984921
from line 4974
49514974
49524975 - `string`
49534976
4954 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
4977 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
49554978
49564979 - `"message-batches-2024-09-24"`
49574980
from line 5022
49995022
50005023 - `"user-profiles-2026-08-18"`
50015024
5025 - `"user-profiles-2026-09-04"`
5026
50025027 - `"advisor-tool-2026-03-01"`
50035028
50045029 - `"managed-agents-2026-04-01"`
from line 5066
50415066
50425067 - `"mid-conversation-system-clear-at-2026-08-21"`
50435068
5069- `"anthropic-workspace-id": optional string`
5070
50445071### Returns
50455072
50465073- `BetaDeletedMessageBatch object`
50475074
5075 - `type: "message_batch_deleted"`
5076
5077 Deleted object type.
5078
5079 For Message Batches, this is always `"message_batch_deleted"`.
5080
5081 default: message_batch_deleted
5082
50485083 - `id: string`
50495084
50505085 ID of the Message Batch.
5051
5052 - `type: "message_batch_deleted"`
5053
5054 Deleted object type.
5055
5056 For Message Batches, this is always `"message_batch_deleted"`.
5057
5058 default: message_batch_deleted
50595086
50605087### Example
50615088
from line 5127
51005127
51015128 - `string`
51025129
5103 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
5130 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
51045131
51055132 - `"message-batches-2024-09-24"`
51065133
from line 5175
51485175
51495176 - `"user-profiles-2026-08-18"`
51505177
5178 - `"user-profiles-2026-09-04"`
5179
51515180 - `"advisor-tool-2026-03-01"`
51525181
51535182 - `"managed-agents-2026-04-01"`
from line 5219
51905219
51915220 - `"mid-conversation-system-clear-at-2026-08-21"`
51925221
5222- `"anthropic-workspace-id": optional string`
5223
51935224### Returns
51945225
51955226- `BetaMessageBatchIndividualResponse object`
from line 5241
52105241
52115242 - `BetaMessageBatchSucceededResult object`
52125243
5244 - `type: "succeeded"`
5245
5246 default: succeeded
5247
52135248 - `message: BetaMessage`
52145249
5250 - `type: "message"`
5251
5252 Object type.
5253
5254 For Messages, this is always `"message"`.
5255
5256 default: message
5257
52155258 - `id: string`
52165259
52175260 Unique object identifier.
from line 5279
52365279
52375280 Skills loaded in the container
52385281
5282 - `type: "anthropic" or "custom"`
5283
5284 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
5285
5286 - `"anthropic"`
5287
5288 - `"custom"`
5289
52395290 - `skill_id: string`
52405291
52415292 Skill ID
52425293
52435294 maxLength: 64, minLength: 1
5244
5245 - `type: "anthropic" or "custom"`
5246
5247 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
5248
5249 - `"anthropic"`
5250
5251 - `"custom"`
52525295
52535296 - `version: string`
52545297
from line 5330
52875330
52885331 - `BetaTextBlock object`
52895332
5333 - `type: "text"`
5334
5335 default: text
5336
52905337 - `citations: array of BetaTextCitation or null`
52915338
52925339 Citations supporting the text block.
from line 5342
52955342
52965343 - `BetaCitationCharLocation object`
52975344
5345 - `type: "char_location"`
5346
5347 default: char_location
5348
52985349 - `cited_text: string`
52995350
53005351 - `document_index: number`
from line 5362
53115362
53125363 minimum: 0
53135364
5314 - `type: "char_location"`
5315
5316 default: char_location
5317
53185365 - `BetaCitationPageLocation object`
53195366
5367 - `type: "page_location"`
5368
5369 default: page_location
5370
53205371 - `cited_text: string`
53215372
53225373 - `document_index: number`
from line 5384
53335384
53345385 minimum: 1
53355386
5336 - `type: "page_location"`
5337
5338 default: page_location
5339
53405387 - `BetaCitationContentBlockLocation object`
53415388
5389 - `type: "content_block_location"`
5390
5391 default: content_block_location
5392
53425393 - `cited_text: string`
53435394
53445395 The full text of the cited block range, concatenated.
from line 5416
53655416
53665417 minimum: 0
53675418
5368 - `type: "content_block_location"`
5369
5370 default: content_block_location
5371
53725419 - `BetaCitationsWebSearchResultLocation object`
53735420
5421 - `type: "web_search_result_location"`
5422
5423 default: web_search_result_location
5424
53745425 - `cited_text: string`
53755426
53765427 - `encrypted_index: string`
from line 5430
53795430
53805431 maxLength: 512
53815432
5382 - `type: "web_search_result_location"`
5383
5384 default: web_search_result_location
5385
53865433 - `url: string`
53875434
53885435 - `BetaCitationSearchResultLocation object`
53895436
5437 - `type: "search_result_location"`
5438
5439 default: search_result_location
5440
53905441 - `cited_text: string`
53915442
53925443 The full text of the cited block range, concatenated.
from line 5468
54175468
54185469 - `title: string or null`
54195470
5420 - `type: "search_result_location"`
5421
5422 default: search_result_location
5423
54245471 - `text: string`
54255472
5426 maxLength: 5000000, minLength: 0
5427
5428 - `type: "text"`
5429
5430 default: text
5473 minLength: 0
54315474
54325475 - `BetaThinkingBlock object`
54335476
5477 - `type: "thinking"`
5478
5479 default: thinking
5480
54345481 - `signature: string`
54355482
54365483 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
from line 5490
54435490
54445491 The text of Claude's thinking process for this block.
54455492
5446 - `type: "thinking"`
5447
5448 default: thinking
5449
54505493 - `BetaRedactedThinkingBlock object`
54515494
5495 - `type: "redacted_thinking"`
5496
5497 default: redacted_thinking
5498
54525499 - `data: string`
54535500
54545501 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 5504
54575504
54585505 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.
54595506
5460 - `type: "redacted_thinking"`
5461
5462 default: redacted_thinking
5463
54645507 - `BetaToolUseBlock object`
54655508
5509 - `type: "tool_use"`
5510
5511 default: tool_use
5512
54665513 - `id: string`
54675514
54685515 pattern: ^[a-zA-Z0-9_-]+$
from line 5520
54735520
54745521 minLength: 1
54755522
5476 - `type: "tool_use"`
5477
5478 default: tool_use
5479
54805523 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
54815524
54825525 Tool invocation directly from the model.
from line 5534
54915534
54925535 Tool invocation generated by a server-side tool.
54935536
5537 - `type: "code_execution_20250825"`
5538
54945539 - `tool_id: string`
54955540
54965541 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
54975542
5498 - `type: "code_execution_20250825"`
5499
55005543 - `BetaServerToolCaller20260120 object`
55015544
5545 - `type: "code_execution_20260120"`
5546
55025547 - `tool_id: string`
55035548
55045549 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
55055550
5506 - `type: "code_execution_20260120"`
5507
55085551 - `toolset_name: optional string or null`
55095552
55105553 For a toolset member tool_use, the toolset family.
from line 5556
55135556
55145557 - `BetaServerToolUseBlock object`
55155558
5559 - `type: "server_tool_use"`
5560
5561 default: server_tool_use
5562
55165563 - `id: string`
55175564
55185565 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 5584
55375584
55385585 - `"tool_search_tool_bm25"`
55395586
5540 - `type: "server_tool_use"`
5541
5542 default: server_tool_use
5543
55445587 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
55455588
55465589 Tool invocation directly from the model.
from line 5600
55575600
55585601 - `BetaWebSearchToolResultBlock object`
55595602
5603 - `type: "web_search_tool_result"`
5604
5605 default: web_search_tool_result
5606
55605607 - `content: BetaWebSearchToolResultBlockContent`
55615608
55625609 - `BetaWebSearchToolResultError object`
55635610
5611 - `type: "web_search_tool_result_error"`
5612
5613 default: web_search_tool_result_error
5614
55645615 - `error_code: BetaWebSearchToolResultErrorCode`
55655616
55665617 - `"invalid_tool_input"`
from line 5626
55755626
55765627 - `"request_too_large"`
55775628
5578 - `type: "web_search_tool_result_error"`
5579
5580 default: web_search_tool_result_error
5581
55825629 - `array of BetaWebSearchResultBlock`
55835630
5631 - `type: "web_search_result"`
5632
5633 default: web_search_result
5634
55845635 - `encrypted_content: string`
55855636
55865637 - `page_age: string or null`
55875638
55885639 - `title: string`
55895640
5590 - `type: "web_search_result"`
5591
5592 default: web_search_result
5593
55945641 - `url: string`
55955642
55965643 - `tool_use_id: string`
55975644
55985645 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
55995646
5600 - `type: "web_search_tool_result"`
5601
5602 default: web_search_tool_result
5603
56045647 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
56055648
56065649 Tool invocation directly from the model.
from line 5660
56175660
56185661 - `BetaWebFetchToolResultBlock object`
56195662
5663 - `type: "web_fetch_tool_result"`
5664
5665 default: web_fetch_tool_result
5666
56205667 - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
56215668
56225669 - `BetaWebFetchToolResultErrorBlock object`
56235670
5671 - `type: "web_fetch_tool_result_error"`
5672
5673 default: web_fetch_tool_result_error
5674
56245675 - `error_code: BetaWebFetchToolResultErrorCode`
56255676
56265677 - `"invalid_tool_input"`
from line 5692
56415692
56425693 - `"unavailable"`
56435694
5644 - `type: "web_fetch_tool_result_error"`
5645
5646 default: web_fetch_tool_result_error
5695 - `"content_too_large"`
56475696
56485697 - `BetaWebFetchBlock object`
56495698
5699 - `type: "web_fetch_result"`
5700
5701 default: web_fetch_result
5702
56505703 - `content: BetaDocumentBlock`
56515704
5705 - `type: "document"`
5706
5707 default: document
5708
56525709 - `citations: BetaCitationConfig or null`
56535710
56545711 Citation configuration for the document
from line 5718
56615718
56625719 - `BetaBase64PDFSource object`
56635720
5721 - `type: "base64"`
5722
56645723 - `data: string`
56655724
56665725 format: byte
56675726
56685727 - `media_type: "application/pdf"`
56695728
5670 - `type: "base64"`
5671
56725729 - `BetaPlainTextSource object`
56735730
5731 - `type: "text"`
5732
56745733 - `data: string`
56755734
56765735 - `media_type: "text/plain"`
56775736
5678 - `type: "text"`
5679
56805737 - `title: string or null`
56815738
56825739 The title of the document
56835740
5684 - `type: "document"`
5685
5686 default: document
5687
56885741 - `retrieved_at: string or null`
56895742
56905743 ISO 8601 timestamp when the content was retrieved
56915744
5692 - `type: "web_fetch_result"`
5693
5694 default: web_fetch_result
5695
56965745 - `url: string`
56975746
56985747 Fetched content URL
from line 5750
57015750
57025751 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
57035752
5704 - `type: "web_fetch_tool_result"`
5705
5706 default: web_fetch_tool_result
5707
57085753 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
57095754
57105755 Tool invocation directly from the model.
from line 5766
57215766
57225767 - `BetaAdvisorToolResultBlock object`
57235768
5769 - `type: "advisor_tool_result"`
5770
5771 default: advisor_tool_result
5772
57245773 - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`
57255774
57265775 - `BetaAdvisorToolResultError object`
57275776
5777 - `type: "advisor_tool_result_error"`
5778
5779 default: advisor_tool_result_error
5780
57285781 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
57295782
57305783 - `"max_uses_exceeded"`
from line 5794
57415794
57425795 - `"model_not_found"`
57435796
5744 - `type: "advisor_tool_result_error"`
5745
5746 default: advisor_tool_result_error
5747
57485797 - `BetaAdvisorResultBlock object`
57495798
5799 - `type: "advisor_result"`
5800
5801 default: advisor_result
5802
57505803 - `stop_reason: string or null`
57515804
57525805 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.
57535806
57545807 - `text: string`
57555808
5756 - `type: "advisor_result"`
5757
5758 default: advisor_result
5759
57605809 - `BetaAdvisorRedactedResultBlock object`
57615810
5811 - `type: "advisor_redacted_result"`
5812
5813 default: advisor_redacted_result
5814
57625815 - `encrypted_content: string`
57635816
57645817 Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
from line 5820
57675820
57685821 The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).
57695822
5770 - `type: "advisor_redacted_result"`
5771
5772 default: advisor_redacted_result
5773
57745823 - `tool_use_id: string`
57755824
57765825 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
57775826
5778 - `type: "advisor_tool_result"`
5779
5780 default: advisor_tool_result
5781
57825827 - `BetaCodeExecutionToolResultBlock object`
57835828
5829 - `type: "code_execution_tool_result"`
5830
5831 default: code_execution_tool_result
5832
57845833 - `content: BetaCodeExecutionToolResultBlockContent`
57855834
57865835 Code execution result with encrypted stdout for PFC + web_search results.
57875836
57885837 - `BetaCodeExecutionToolResultError object`
57895838
5839 - `type: "code_execution_tool_result_error"`
5840
5841 default: code_execution_tool_result_error
5842
57905843 - `error_code: BetaCodeExecutionToolResultErrorCode`
57915844
57925845 - `"invalid_tool_input"`
from line 5850
57975850
57985851 - `"execution_time_exceeded"`
57995852
5800 - `type: "code_execution_tool_result_error"`
5801
5802 default: code_execution_tool_result_error
5803
58045853 - `BetaCodeExecutionResultBlock object`
58055854
5855 - `type: "code_execution_result"`
5856
5857 default: code_execution_result
5858
58065859 - `content: array of BetaCodeExecutionOutputBlock`
58075860
5861 - `type: "code_execution_output"`
5862
5863 default: code_execution_output
5864
58085865 - `file_id: string`
58095866
5867 - `return_code: number`
5868
5869 - `stderr: string`
5870
5871 - `stdout: string`
5872
5873 - `BetaEncryptedCodeExecutionResultBlock object`
5874
5875 Code execution result with encrypted stdout for PFC + web_search results.
5876
5877 - `type: "encrypted_code_execution_result"`
5878
5879 default: encrypted_code_execution_result
5880
5881 - `content: array of BetaCodeExecutionOutputBlock`
5882
58105883 - `type: "code_execution_output"`
58115884
58125885 default: code_execution_output
58135886
5887 - `file_id: string`
5888
5889 - `encrypted_stdout: string`
5890
58145891 - `return_code: number`
58155892
58165893 - `stderr: string`
58175894
5895 - `tool_use_id: string`
5896
5897 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5898
5899 - `BetaBashCodeExecutionToolResultBlock object`
5900
5901 - `type: "bash_code_execution_tool_result"`
5902
5903 default: bash_code_execution_tool_result
5904
5905 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
5906
5907 - `BetaBashCodeExecutionToolResultError object`
5908
5909 - `type: "bash_code_execution_tool_result_error"`
5910
5911 default: bash_code_execution_tool_result_error
5912
5913 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
5914
5915 - `"invalid_tool_input"`
5916
5917 - `"unavailable"`
5918
5919 - `"too_many_requests"`
5920
5921 - `"execution_time_exceeded"`
5922
5923 - `"output_file_too_large"`
5924
5925 - `BetaBashCodeExecutionResultBlock object`
5926
5927 - `type: "bash_code_execution_result"`
5928
5929 default: bash_code_execution_result
5930
5931 - `content: array of BetaBashCodeExecutionOutputBlock`
5932
5933 - `type: "bash_code_execution_output"`
5934
5935 default: bash_code_execution_output
5936
5937 - `file_id: string`
5938
5939 - `return_code: number`
5940
5941 - `stderr: string`
5942
58185943 - `stdout: string`
58195944
5820 - `type: "code_execution_result"`
5821
5822 default: code_execution_result
5823
5824 - `BetaEncryptedCodeExecutionResultBlock object`
5825
5826 Code execution result with encrypted stdout for PFC + web_search results.
5827
5828 - `content: array of BetaCodeExecutionOutputBlock`
5829
5830 - `file_id: string`
5831
5832 - `type: "code_execution_output"`
5833
5834 default: code_execution_output
5835
5836 - `encrypted_stdout: string`
5837
5838 - `return_code: number`
5839
5840 - `stderr: string`
5841
5842 - `type: "encrypted_code_execution_result"`
5843
5844 default: encrypted_code_execution_result
5845
58465945 - `tool_use_id: string`
58475946
58485947 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
58495948
5850 - `type: "code_execution_tool_result"`
5851
5852 default: code_execution_tool_result
5853
5854 - `BetaBashCodeExecutionToolResultBlock object`
5855
5856 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
5857
5858 - `BetaBashCodeExecutionToolResultError object`
5949 - `BetaTextEditorCodeExecutionToolResultBlock object`
5950
5951 - `type: "text_editor_code_execution_tool_result"`
5952
5953 default: text_editor_code_execution_tool_result
5954
5955 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
5956
5957 - `BetaTextEditorCodeExecutionToolResultError object`
5958
5959 - `type: "text_editor_code_execution_tool_result_error"`
5960
5961 default: text_editor_code_execution_tool_result_error
58595962
58605963 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
58615964
from line 5970
58675970
58685971 - `"execution_time_exceeded"`
58695972
5870 - `"output_file_too_large"`
5871
5872 - `type: "bash_code_execution_tool_result_error"`
5873
5874 default: bash_code_execution_tool_result_error
5875
5876 - `BetaBashCodeExecutionResultBlock object`
5877
5878 - `content: array of BetaBashCodeExecutionOutputBlock`
5879
5880 - `file_id: string`
5881
5882 - `type: "bash_code_execution_output"`
5883
5884 default: bash_code_execution_output
5885
5886 - `return_code: number`
5887
5888 - `stderr: string`
5889
5890 - `stdout: string`
5891
5892 - `type: "bash_code_execution_result"`
5893
5894 default: bash_code_execution_result
5973 - `"file_not_found"`
5974
5975 - `error_message: string or null`
5976
5977 - `BetaTextEditorCodeExecutionViewResultBlock object`
5978
5979 - `type: "text_editor_code_execution_view_result"`
5980
5981 default: text_editor_code_execution_view_result
5982
5983 - `content: string`
5984
5985 - `file_type: "text" or "image" or "pdf"`
5986
5987 - `"text"`
5988
5989 - `"image"`
5990
5991 - `"pdf"`
5992
5993 - `num_lines: number or null`
5994
5995 - `start_line: number or null`
5996
5997 - `total_lines: number or null`
5998
5999 - `BetaTextEditorCodeExecutionCreateResultBlock object`
6000
6001 - `type: "text_editor_code_execution_create_result"`
6002
6003 default: text_editor_code_execution_create_result
6004
6005 - `is_file_update: boolean`
6006
6007 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
6008
6009 - `type: "text_editor_code_execution_str_replace_result"`
6010
6011 default: text_editor_code_execution_str_replace_result
6012
6013 - `lines: array of string or null`
6014
6015 - `new_lines: number or null`
6016
6017 - `new_start: number or null`
6018
6019 - `old_lines: number or null`
6020
6021 - `old_start: number or null`
58956022
58966023 - `tool_use_id: string`
58976024
58986025 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
58996026
5900 - `type: "bash_code_execution_tool_result"`
5901
5902 default: bash_code_execution_tool_result
5903
5904 - `BetaTextEditorCodeExecutionToolResultBlock object`
5905
5906 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
5907
5908 - `BetaTextEditorCodeExecutionToolResultError object`
5909
5910 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
6027 - `BetaToolSearchToolResultBlock object`
6028
6029 - `type: "tool_search_tool_result"`
6030
6031 default: tool_search_tool_result
6032
6033 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
6034
6035 - `BetaToolSearchToolResultError object`
6036
6037 - `type: "tool_search_tool_result_error"`
6038
6039 default: tool_search_tool_result_error
6040
6041 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
59116042
59126043 - `"invalid_tool_input"`
59136044
from line 6048
59176048
59186049 - `"execution_time_exceeded"`
59196050
5920 - `"file_not_found"`
5921
59226051 - `error_message: string or null`
59236052
5924 - `type: "text_editor_code_execution_tool_result_error"`
5925
5926 default: text_editor_code_execution_tool_result_error
5927
5928 - `BetaTextEditorCodeExecutionViewResultBlock object`
5929
5930 - `content: string`
5931
5932 - `file_type: "text" or "image" or "pdf"`
5933
5934 - `"text"`
5935
5936 - `"image"`
5937
5938 - `"pdf"`
5939
5940 - `num_lines: number or null`
5941
5942 - `start_line: number or null`
5943
5944 - `total_lines: number or null`
5945
5946 - `type: "text_editor_code_execution_view_result"`
5947
5948 default: text_editor_code_execution_view_result
5949
5950 - `BetaTextEditorCodeExecutionCreateResultBlock object`
5951
5952 - `is_file_update: boolean`
5953
5954 - `type: "text_editor_code_execution_create_result"`
5955
5956 default: text_editor_code_execution_create_result
5957
5958 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
5959
5960 - `lines: array of string or null`
5961
5962 - `new_lines: number or null`
5963
5964 - `new_start: number or null`
5965
5966 - `old_lines: number or null`
5967
5968 - `old_start: number or null`
5969
5970 - `type: "text_editor_code_execution_str_replace_result"`
5971
5972 default: text_editor_code_execution_str_replace_result
6053 - `BetaToolSearchToolSearchResultBlock object`
6054
6055 - `type: "tool_search_tool_search_result"`
6056
6057 default: tool_search_tool_search_result
6058
6059 - `tool_references: array of BetaToolReferenceBlock`
6060
6061 - `type: "tool_reference"`
6062
6063 default: tool_reference
6064
6065 - `tool_name: string`
6066
6067 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
59736068
59746069 - `tool_use_id: string`
59756070
59766071 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
59776072
5978 - `type: "text_editor_code_execution_tool_result"`
5979
5980 default: text_editor_code_execution_tool_result
5981
5982 - `BetaToolSearchToolResultBlock object`
5983
5984 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
5985
5986 - `BetaToolSearchToolResultError object`
5987
5988 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
5989
5990 - `"invalid_tool_input"`
5991
5992 - `"unavailable"`
5993
5994 - `"too_many_requests"`
5995
5996 - `"execution_time_exceeded"`
5997
5998 - `error_message: string or null`
5999
6000 - `type: "tool_search_tool_result_error"`
6001
6002 default: tool_search_tool_result_error
6003
6004 - `BetaToolSearchToolSearchResultBlock object`
6005
6006 - `tool_references: array of BetaToolReferenceBlock`
6007
6008 - `tool_name: string`
6009
6010 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
6011
6012 - `type: "tool_reference"`
6013
6014 default: tool_reference
6015
6016 - `type: "tool_search_tool_search_result"`
6017
6018 default: tool_search_tool_search_result
6073 - `BetaMCPToolUseBlock object`
6074
6075 - `type: "mcp_tool_use"`
6076
6077 default: mcp_tool_use
6078
6079 - `id: string`
6080
6081 pattern: ^[a-zA-Z0-9_-]+$
6082
6083 - `input: map[unknown]`
6084
6085 - `name: string`
6086
6087 The name of the MCP tool
6088
6089 - `server_name: string`
6090
6091 The name of the MCP server
6092
6093 - `BetaMCPToolResultBlock object`
6094
6095 - `type: "mcp_tool_result"`
6096
6097 default: mcp_tool_result
6098
6099 - `content: string or array of BetaTextBlock`
6100
6101 - `string`
6102
6103 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
6104
6105 - `type: "text"`
6106
6107 default: text
6108
6109 - `citations: array of BetaTextCitation or null`
6110
6111 Citations supporting the text block.
6112
6113 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`.
6114
6115 - `text: string`
6116
6117 minLength: 0
6118
6119 - `is_error: boolean`
6120
6121 default: false
60196122
60206123 - `tool_use_id: string`
60216124
6022 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6023
6024 - `type: "tool_search_tool_result"`
6025
6026 default: tool_search_tool_result
6027
6028 - `BetaMCPToolUseBlock object`
6029
6030 - `id: string`
6031
60326125 pattern: ^[a-zA-Z0-9_-]+$
60336126
6034 - `input: map[unknown]`
6035
6036 - `name: string`
6037
6038 The name of the MCP tool
6039
6040 - `server_name: string`
6041
6042 The name of the MCP server
6043
6044 - `type: "mcp_tool_use"`
6045
6046 default: mcp_tool_use
6047
6048 - `BetaMCPToolResultBlock object`
6049
6050 - `content: string or array of BetaTextBlock`
6051
6052 - `string`
6053
6054 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
6055
6056 - `citations: array of BetaTextCitation or null`
6057
6058 Citations supporting the text block.
6059
6060 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`.
6061
6062 - `text: string`
6063
6064 maxLength: 5000000, minLength: 0
6065
6066 - `type: "text"`
6067
6068 default: text
6069
6070 - `is_error: boolean`
6071
6072 default: false
6073
6074 - `tool_use_id: string`
6075
6076 pattern: ^[a-zA-Z0-9_-]+$
6077
6078 - `type: "mcp_tool_result"`
6079
6080 default: mcp_tool_result
6081
60826127 - `BetaContainerUploadBlock object`
60836128
60846129 Response model for a file uploaded to the container.
60856130
6131 - `type: "container_upload"`
6132
6133 default: container_upload
6134
60866135 - `file_id: string`
6087
6088 - `type: "container_upload"`
6089
6090 default: container_upload
60916136
60926137 - `BetaCompactionBlock object`
60936138
from line 6142
60976142 summary (e.g., malformed output from the model). Clients may round-trip
60986143 compaction blocks with null content; the server treats them as no-ops.
60996144
6145 - `type: "compaction"`
6146
6147 default: compaction
6148
61006149 - `content: string or null`
61016150
61026151 Summary of compacted content, or null if compaction failed
from line 6153
61046153 - `encrypted_content: string or null`
61056154
61066155 Opaque metadata from prior compaction, to be round-tripped verbatim
6107
6108 - `type: "compaction"`
6109
6110 default: compaction
61116156
61126157 - `BetaFallbackBlock object`
61136158
from line 6168
61236168 arrives via the standard `content_block_start` / `content_block_stop`
61246169 pair and carries no deltas.
61256170
6171 - `type: "fallback"`
6172
6173 default: fallback
6174
61266175 - `from: BetaFallbackInfo`
61276176
61286177 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 6266
62176266
62186267 What caused the `from` model to hand over at this hop.
62196268
6269 - `type: "refusal"`
6270
6271 default: refusal
6272
62206273 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
62216274
62226275 The policy category that triggered a refusal.
from line 6294
62416294
62426295 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
62436296
6244 - `type: "refusal"`
6245
6246 default: refusal
6247
6248 - `type: "fallback"`
6249
6250 default: fallback
6251
62526297 - `context_management: BetaContextManagementResponse or null`
62536298
62546299 Context management response.
from line 6306
62616306
62626307 - `BetaClearToolUses20250919EditResponse object`
62636308
6309 - `type: "clear_tool_uses_20250919"`
6310
6311 The type of context management edit applied.
6312
6313 default: clear_tool_uses_20250919
6314
62646315 - `cleared_input_tokens: number`
62656316
62666317 Number of input tokens cleared by this edit.
from line 6324
62736324
62746325 minimum: 0
62756326
6276 - `type: "clear_tool_uses_20250919"`
6327 - `BetaClearThinking20251015EditResponse object`
6328
6329 - `type: "clear_thinking_20251015"`
62776330
62786331 The type of context management edit applied.
62796332
6280 default: clear_tool_uses_20250919
6281
6282 - `BetaClearThinking20251015EditResponse object`
6333 default: clear_thinking_20251015
62836334
62846335 - `cleared_input_tokens: number`
62856336
from line 6343
62926343 Number of thinking turns that were cleared.
62936344
62946345 minimum: 0
6295
6296 - `type: "clear_thinking_20251015"`
6297
6298 The type of context management edit applied.
6299
6300 default: clear_thinking_20251015
63016346
63026347 - `diagnostics: BetaDiagnostics or null`
63036348
from line 6355
63106355
63116356 - `BetaCacheMissModelChanged object`
63126357
6358 - `type: "model_changed"`
6359
6360 default: model_changed
6361
63136362 - `cache_missed_input_tokens: number`
63146363
63156364 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
63166365
6317 - `type: "model_changed"`
6318
6319 default: model_changed
6320
63216366 - `BetaCacheMissSystemChanged object`
63226367
6368 - `type: "system_changed"`
6369
6370 default: system_changed
6371
63236372 - `cache_missed_input_tokens: number`
63246373
63256374 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
63266375
6327 - `type: "system_changed"`
6328
6329 default: system_changed
6330
63316376 - `BetaCacheMissToolsChanged object`
63326377
6378 - `type: "tools_changed"`
6379
6380 default: tools_changed
6381
63336382 - `cache_missed_input_tokens: number`
63346383
63356384 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
63366385
6337 - `type: "tools_changed"`
6338
6339 default: tools_changed
6340
63416386 - `BetaCacheMissMessagesChanged object`
63426387
6388 - `type: "messages_changed"`
6389
6390 default: messages_changed
6391
63436392 - `cache_missed_input_tokens: number`
63446393
63456394 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
63466395
6347 - `type: "messages_changed"`
6348
6349 default: messages_changed
6350
63516396 - `BetaCacheMissPreviousMessageNotFound object`
63526397
63536398 - `type: "previous_message_not_found"`
from line 6422
63776422 - `stop_details: BetaRefusalStopDetails or null`
63786423
63796424 Structured information about a refusal.
6425
6426 - `type: "refusal"`
6427
6428 default: refusal
63806429
63816430 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
63826431
from line 6506
64576506
64586507 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.
64596508
6460 - `type: "refusal"`
6461
6462 default: refusal
6463
64646509 - `stop_reason: BetaStopReason or null`
64656510
64666511 The reason that we stopped.
from line 6544
64996544
65006545 This value will be a non-null string if one of your custom stop sequences was generated.
65016546
6502 - `type: "message"`
6503
6504 Object type.
6505
6506 For Messages, this is always `"message"`.
6507
6508 default: message
6509
65106547 - `usage: BetaUsage`
65116548
65126549 Billing and rate-limit usage.
from line 6610
65736610
65746611 No reprice was applied; `reason` says why.
65756612
6613 - `type: "not_applied"`
6614
6615 default: not_applied
6616
65766617 - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`
65776618
65786619 Why the reprice was not applied.
from line 6644
66036644 - `"wrong_platform"`
66046645
66056646 - `"wrong_workspace"`
6606
6607 - `type: "not_applied"`
6608
6609 default: not_applied
66106647
66116648 - `remove_to_redeem: optional array of string or null`
66126649
from line 6682
66456682
66466683 Token usage for a sampling iteration.
66476684
6685 - `type: "message"`
6686
6687 Usage for a sampling iteration
6688
6689 default: message
6690
66486691 - `cache_creation: BetaCacheCreation or null`
66496692
66506693 Breakdown of cached tokens by TTL
from line 6722
66796722
66806723 minimum: 0
66816724
6682 - `type: "message"`
6683
6684 Usage for a sampling iteration
6685
6686 default: message
6687
66886725 - `BetaCompactionIterationUsage object`
66896726
66906727 Token usage for a compaction iteration.
66916728
6729 - `type: "compaction"`
6730
6731 Usage for a compaction iteration
6732
6733 default: compaction
6734
66926735 - `cache_creation: BetaCacheCreation or null`
66936736
66946737 Breakdown of cached tokens by TTL
from line 6760
67176760
67186761 minimum: 0
67196762
6720 - `type: "compaction"`
6721
6722 Usage for a compaction iteration
6723
6724 default: compaction
6725
67266763 - `BetaAdvisorMessageIterationUsage object`
67276764
67286765 Token usage for an advisor sub-inference iteration.
67296766
6767 - `type: "advisor_message"`
6768
6769 Usage for an advisor sub-inference iteration
6770
6771 default: advisor_message
6772
67306773 - `cache_creation: BetaCacheCreation or null`
67316774
67326775 Breakdown of cached tokens by TTL
from line 6803
67606803 The number of output tokens which were used.
67616804
67626805 minimum: 0
6763
6764 - `type: "advisor_message"`
6765
6766 Usage for an advisor sub-inference iteration
6767
6768 default: advisor_message
67696806
67706807 - `BetaFallbackMessageIterationUsage object`
67716808
from line 6813
67766813 a fallback model served the response is signalled by the presence of this
67776814 entry in `usage.iterations`.
67786815
6816 - `type: "fallback_message"`
6817
6818 Usage for the fallback-model attempt that served the response
6819
6820 default: fallback_message
6821
67796822 - `cache_creation: BetaCacheCreation or null`
67806823
67816824 Breakdown of cached tokens by TTL
from line 6852
68096852 The number of output tokens which were used.
68106853
68116854 minimum: 0
6812
6813 - `type: "fallback_message"`
6814
6815 Usage for the fallback-model attempt that served the response
6816
6817 default: fallback_message
68186855
68196856 - `output_tokens: number`
68206857
from line 6932
68956932 the final `message_delta` event carries it only when a server-side model
68966933 fallback happened mid-stream, in which case it holds the serving model's
68976934 entries and replaces the one in `message_start`.
6935
6936 - `type: "thinking_dropped"`
6937
6938 Always `thinking_dropped` for this entry type.
6939
6940 default: thinking_dropped
68986941
68996942 - `path: string`
69006943
from line 6969
69266969
69276970 - `"end_user_binding_mismatch"`
69286971
6929 - `type: "thinking_dropped"`
6930
6931 Always `thinking_dropped` for this entry type.
6932
6933 default: thinking_dropped
6934
6935 - `type: "succeeded"`
6936
6937 default: succeeded
6938
69396972 - `BetaMessageBatchErroredResult object`
69406973
6974 - `type: "errored"`
6975
6976 default: errored
6977
69416978 - `error: BetaErrorResponse`
69426979
6980 - `type: "error"`
6981
6982 default: error
6983
69436984 - `error: BetaError`
69446985
69456986 - `BetaInvalidRequestError object`
69466987
6988 - `type: "invalid_request_error"`
6989
6990 default: invalid_request_error
6991
69476992 - `message: string`
69486993
69496994 default: Invalid request
69506995
6951 - `type: "invalid_request_error"`
6952
6953 default: invalid_request_error
6954
69556996 - `BetaAuthenticationError object`
69566997
6998 - `type: "authentication_error"`
6999
7000 default: authentication_error
7001
69577002 - `message: string`
69587003
69597004 default: Authentication error
69607005
6961 - `type: "authentication_error"`
6962
6963 default: authentication_error
6964
69657006 - `BetaBillingError object`
69667007
7008 - `type: "billing_error"`
7009
7010 default: billing_error
7011
69677012 - `message: string`
69687013
69697014 default: Billing error
69707015
6971 - `type: "billing_error"`
6972
6973 default: billing_error
6974
69757016 - `BetaPermissionError object`
69767017
7018 - `type: "permission_error"`
7019
7020 default: permission_error
7021
69777022 - `message: string`
69787023
69797024 default: Permission denied
69807025
6981 - `type: "permission_error"`
6982
6983 default: permission_error
6984
69857026 - `BetaNotFoundError object`
69867027
7028 - `type: "not_found_error"`
7029
7030 default: not_found_error
7031
69877032 - `message: string`
69887033
69897034 default: Not found
69907035
6991 - `type: "not_found_error"`
6992
6993 default: not_found_error
6994
69957036 - `BetaRateLimitError object`
69967037
7038 - `type: "rate_limit_error"`
7039
7040 default: rate_limit_error
7041
69977042 - `message: string`
69987043
69997044 default: Rate limited
70007045
7001 - `type: "rate_limit_error"`
7002
7003 default: rate_limit_error
7004
70057046 - `BetaGatewayTimeoutError object`
70067047
7048 - `type: "timeout_error"`
7049
7050 default: timeout_error
7051
70077052 - `message: string`
70087053
70097054 default: Request timeout
70107055
7011 - `type: "timeout_error"`
7012
7013 default: timeout_error
7014
70157056 - `BetaAPIError object`
70167057
7058 - `type: "api_error"`
7059
7060 default: api_error
7061
70177062 - `message: string`
70187063
70197064 default: Internal server error
70207065
7021 - `type: "api_error"`
7022
7023 default: api_error
7024
70257066 - `BetaOverloadedError object`
70267067
7068 - `type: "overloaded_error"`
7069
7070 default: overloaded_error
7071
70277072 - `message: string`
70287073
70297074 default: Overloaded
70307075
7031 - `type: "overloaded_error"`
7032
7033 default: overloaded_error
7034
70357076 - `request_id: string or null`
7036
7037 - `type: "error"`
7038
7039 default: error
7040
7041 - `type: "errored"`
7042
7043 default: errored
70447077
70457078 - `BetaMessageBatchCanceledResult object`
70467079
from line 7102
70697102
70707103- `BetaDeletedMessageBatch object`
70717104
7105 - `type: "message_batch_deleted"`
7106
7107 Deleted object type.
7108
7109 For Message Batches, this is always `"message_batch_deleted"`.
7110
7111 default: message_batch_deleted
7112
70727113 - `id: string`
70737114
70747115 ID of the Message Batch.
70757116
7076 - `type: "message_batch_deleted"`
7077
7078 Deleted object type.
7079
7080 For Message Batches, this is always `"message_batch_deleted"`.
7081
7082 default: message_batch_deleted
7083
70847117### Beta Message Batch
70857118
70867119- `BetaMessageBatch object`
70877120
7121 - `type: "message_batch"`
7122
7123 Object type.
7124
7125 For Message Batches, this is always `"message_batch"`.
7126
7127 default: message_batch
7128
70887129 - `id: string`
70897130
70907131 Unique object identifier.
from line 7224
71837224
71847225 Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
71857226
7186 - `type: "message_batch"`
7187
7188 Object type.
7189
7190 For Message Batches, this is always `"message_batch"`.
7191
7192 default: message_batch
7193
71947227### Beta Message Batch Canceled Result
71957228
71967229- `BetaMessageBatchCanceledResult object`
from line 7236
72037236
72047237- `BetaMessageBatchErroredResult object`
72057238
7239 - `type: "errored"`
7240
7241 default: errored
7242
72067243 - `error: BetaErrorResponse`
72077244
7245 - `type: "error"`
7246
7247 default: error
7248
72087249 - `error: BetaError`
72097250
72107251 - `BetaInvalidRequestError object`
72117252
7253 - `type: "invalid_request_error"`
7254
7255 default: invalid_request_error
7256
72127257 - `message: string`
72137258
72147259 default: Invalid request
72157260
7216 - `type: "invalid_request_error"`
7217
7218 default: invalid_request_error
7219
72207261 - `BetaAuthenticationError object`
72217262
7263 - `type: "authentication_error"`
7264
7265 default: authentication_error
7266
72227267 - `message: string`
72237268
72247269 default: Authentication error
72257270
7226 - `type: "authentication_error"`
7227
7228 default: authentication_error
7229
72307271 - `BetaBillingError object`
72317272
7273 - `type: "billing_error"`
7274
7275 default: billing_error
7276
72327277 - `message: string`
72337278
72347279 default: Billing error
72357280
7236 - `type: "billing_error"`
7237
7238 default: billing_error
7239
72407281 - `BetaPermissionError object`
72417282
7283 - `type: "permission_error"`
7284
7285 default: permission_error
7286
72427287 - `message: string`
72437288
72447289 default: Permission denied
72457290
7246 - `type: "permission_error"`
7247
7248 default: permission_error
7249
72507291 - `BetaNotFoundError object`
72517292
7293 - `type: "not_found_error"`
7294
7295 default: not_found_error
7296
72527297 - `message: string`
72537298
72547299 default: Not found
72557300
7256 - `type: "not_found_error"`
7257
7258 default: not_found_error
7259
72607301 - `BetaRateLimitError object`
72617302
7303 - `type: "rate_limit_error"`
7304
7305 default: rate_limit_error
7306
72627307 - `message: string`
72637308
72647309 default: Rate limited
72657310
7266 - `type: "rate_limit_error"`
7267
7268 default: rate_limit_error
7269
72707311 - `BetaGatewayTimeoutError object`
72717312
7313 - `type: "timeout_error"`
7314
7315 default: timeout_error
7316
72727317 - `message: string`
72737318
72747319 default: Request timeout
72757320
7276 - `type: "timeout_error"`
7277
7278 default: timeout_error
7279
72807321 - `BetaAPIError object`
72817322
7323 - `type: "api_error"`
7324
7325 default: api_error
7326
72827327 - `message: string`
72837328
72847329 default: Internal server error
72857330
7286 - `type: "api_error"`
7287
7288 default: api_error
7289
72907331 - `BetaOverloadedError object`
72917332
7333 - `type: "overloaded_error"`
7334
7335 default: overloaded_error
7336
72927337 - `message: string`
72937338
72947339 default: Overloaded
72957340
7296 - `type: "overloaded_error"`
7297
7298 default: overloaded_error
7299
73007341 - `request_id: string or null`
73017342
7302 - `type: "error"`
7303
7304 default: error
7305
7306 - `type: "errored"`
7307
7308 default: errored
7309
73107343### Beta Message Batch Expired Result
73117344
73127345- `BetaMessageBatchExpiredResult object`
from line 7368
73357368
73367369 - `BetaMessageBatchSucceededResult object`
73377370
7371 - `type: "succeeded"`
7372
7373 default: succeeded
7374
73387375 - `message: BetaMessage`
73397376
7377 - `type: "message"`
7378
7379 Object type.
7380
7381 For Messages, this is always `"message"`.
7382
7383 default: message
7384
73407385 - `id: string`
73417386
73427387 Unique object identifier.
from line 7406
73617406
73627407 Skills loaded in the container
73637408
7409 - `type: "anthropic" or "custom"`
7410
7411 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
7412
7413 - `"anthropic"`
7414
7415 - `"custom"`
7416
73647417 - `skill_id: string`
73657418
73667419 Skill ID
73677420
73687421 maxLength: 64, minLength: 1
7369
7370 - `type: "anthropic" or "custom"`
7371
7372 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
7373
7374 - `"anthropic"`
7375
7376 - `"custom"`
73777422
73787423 - `version: string`
73797424
from line 7457
74127457
74137458 - `BetaTextBlock object`
74147459
7460 - `type: "text"`
7461
7462 default: text
7463
74157464 - `citations: array of BetaTextCitation or null`
74167465
74177466 Citations supporting the text block.
from line 7469
74207469
74217470 - `BetaCitationCharLocation object`
74227471
7472 - `type: "char_location"`
7473
7474 default: char_location
7475
74237476 - `cited_text: string`
74247477
74257478 - `document_index: number`
from line 7489
74367489
74377490 minimum: 0
74387491
7439 - `type: "char_location"`
7440
7441 default: char_location
7442
74437492 - `BetaCitationPageLocation object`
74447493
7494 - `type: "page_location"`
7495
7496 default: page_location
7497
74457498 - `cited_text: string`
74467499
74477500 - `document_index: number`
from line 7511
74587511
74597512 minimum: 1
74607513
7461 - `type: "page_location"`
7462
7463 default: page_location
7464
74657514 - `BetaCitationContentBlockLocation object`
74667515
7516 - `type: "content_block_location"`
7517
7518 default: content_block_location
7519
74677520 - `cited_text: string`
74687521
74697522 The full text of the cited block range, concatenated.
from line 7543
74907543
74917544 minimum: 0
74927545
7493 - `type: "content_block_location"`
7494
7495 default: content_block_location
7496
74977546 - `BetaCitationsWebSearchResultLocation object`
74987547
7548 - `type: "web_search_result_location"`
7549
7550 default: web_search_result_location
7551
74997552 - `cited_text: string`
75007553
75017554 - `encrypted_index: string`
from line 7557
75047557
75057558 maxLength: 512
75067559
7507 - `type: "web_search_result_location"`
7508
7509 default: web_search_result_location
7510
75117560 - `url: string`
75127561
75137562 - `BetaCitationSearchResultLocation object`
75147563
7564 - `type: "search_result_location"`
7565
7566 default: search_result_location
7567
75157568 - `cited_text: string`
75167569
75177570 The full text of the cited block range, concatenated.
from line 7595
75427595
75437596 - `title: string or null`
75447597
7545 - `type: "search_result_location"`
7546
7547 default: search_result_location
7548
75497598 - `text: string`
75507599
7551 maxLength: 5000000, minLength: 0
7552
7553 - `type: "text"`
7554
7555 default: text
7600 minLength: 0
75567601
75577602 - `BetaThinkingBlock object`
75587603
7604 - `type: "thinking"`
7605
7606 default: thinking
7607
75597608 - `signature: string`
75607609
75617610 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
from line 7617
75687617
75697618 The text of Claude's thinking process for this block.
75707619
7571 - `type: "thinking"`
7572
7573 default: thinking
7574
75757620 - `BetaRedactedThinkingBlock object`
75767621
7622 - `type: "redacted_thinking"`
7623
7624 default: redacted_thinking
7625
75777626 - `data: string`
75787627
75797628 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 7631
75827631
75837632 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.
75847633
7585 - `type: "redacted_thinking"`
7586
7587 default: redacted_thinking
7588
75897634 - `BetaToolUseBlock object`
75907635
7636 - `type: "tool_use"`
7637
7638 default: tool_use
7639
75917640 - `id: string`
75927641
75937642 pattern: ^[a-zA-Z0-9_-]+$
from line 7647
75987647
75997648 minLength: 1
76007649
7601 - `type: "tool_use"`
7602
7603 default: tool_use
7604
76057650 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
76067651
76077652 Tool invocation directly from the model.
from line 7661
76167661
76177662 Tool invocation generated by a server-side tool.
76187663
7664 - `type: "code_execution_20250825"`
7665
76197666 - `tool_id: string`
76207667
76217668 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
76227669
7623 - `type: "code_execution_20250825"`
7624
76257670 - `BetaServerToolCaller20260120 object`
76267671
7672 - `type: "code_execution_20260120"`
7673
76277674 - `tool_id: string`
76287675
76297676 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
76307677
7631 - `type: "code_execution_20260120"`
7632
76337678 - `toolset_name: optional string or null`
76347679
76357680 For a toolset member tool_use, the toolset family.
from line 7683
76387683
76397684 - `BetaServerToolUseBlock object`
76407685
7686 - `type: "server_tool_use"`
7687
7688 default: server_tool_use
7689
76417690 - `id: string`
76427691
76437692 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 7711
76627711
76637712 - `"tool_search_tool_bm25"`
76647713
7665 - `type: "server_tool_use"`
7666
7667 default: server_tool_use
7668
76697714 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
76707715
76717716 Tool invocation directly from the model.
from line 7727
76827727
76837728 - `BetaWebSearchToolResultBlock object`
76847729
7730 - `type: "web_search_tool_result"`
7731
7732 default: web_search_tool_result
7733
76857734 - `content: BetaWebSearchToolResultBlockContent`
76867735
76877736 - `BetaWebSearchToolResultError object`
76887737
7738 - `type: "web_search_tool_result_error"`
7739
7740 default: web_search_tool_result_error
7741
76897742 - `error_code: BetaWebSearchToolResultErrorCode`
76907743
76917744 - `"invalid_tool_input"`
from line 7753
77007753
77017754 - `"request_too_large"`
77027755
7703 - `type: "web_search_tool_result_error"`
7704
7705 default: web_search_tool_result_error
7706
77077756 - `array of BetaWebSearchResultBlock`
77087757
7758 - `type: "web_search_result"`
7759
7760 default: web_search_result
7761
77097762 - `encrypted_content: string`
77107763
77117764 - `page_age: string or null`
77127765
77137766 - `title: string`
77147767
7715 - `type: "web_search_result"`
7716
7717 default: web_search_result
7718
77197768 - `url: string`
77207769
77217770 - `tool_use_id: string`
77227771
77237772 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
77247773
7725 - `type: "web_search_tool_result"`
7726
7727 default: web_search_tool_result
7728
77297774 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
77307775
77317776 Tool invocation directly from the model.
from line 7787
77427787
77437788 - `BetaWebFetchToolResultBlock object`
77447789
7790 - `type: "web_fetch_tool_result"`
7791
7792 default: web_fetch_tool_result
7793
77457794 - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
77467795
77477796 - `BetaWebFetchToolResultErrorBlock object`
77487797
7798 - `type: "web_fetch_tool_result_error"`
7799
7800 default: web_fetch_tool_result_error
7801
77497802 - `error_code: BetaWebFetchToolResultErrorCode`
77507803
77517804 - `"invalid_tool_input"`
from line 7819
77667819
77677820 - `"unavailable"`
77687821
7769 - `type: "web_fetch_tool_result_error"`
7770
7771 default: web_fetch_tool_result_error
7822 - `"content_too_large"`
77727823
77737824 - `BetaWebFetchBlock object`
77747825
7826 - `type: "web_fetch_result"`
7827
7828 default: web_fetch_result
7829
77757830 - `content: BetaDocumentBlock`
77767831
7832 - `type: "document"`
7833
7834 default: document
7835
77777836 - `citations: BetaCitationConfig or null`
77787837
77797838 Citation configuration for the document
from line 7845
77867845
77877846 - `BetaBase64PDFSource object`
77887847
7848 - `type: "base64"`
7849
77897850 - `data: string`
77907851
77917852 format: byte
77927853
77937854 - `media_type: "application/pdf"`
77947855
7795 - `type: "base64"`
7796
77977856 - `BetaPlainTextSource object`
77987857
7858 - `type: "text"`
7859
77997860 - `data: string`
78007861
78017862 - `media_type: "text/plain"`
78027863
7803 - `type: "text"`
7804
78057864 - `title: string or null`
78067865
78077866 The title of the document
78087867
7809 - `type: "document"`
7810
7811 default: document
7812
78137868 - `retrieved_at: string or null`
78147869
78157870 ISO 8601 timestamp when the content was retrieved
78167871
7817 - `type: "web_fetch_result"`
7818
7819 default: web_fetch_result
7820
78217872 - `url: string`
78227873
78237874 Fetched content URL
from line 7877
78267877
78277878 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
78287879
7829 - `type: "web_fetch_tool_result"`
7830
7831 default: web_fetch_tool_result
7832
78337880 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
78347881
78357882 Tool invocation directly from the model.
from line 7893
78467893
78477894 - `BetaAdvisorToolResultBlock object`
78487895
7896 - `type: "advisor_tool_result"`
7897
7898 default: advisor_tool_result
7899
78497900 - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`
78507901
78517902 - `BetaAdvisorToolResultError object`
78527903
7904 - `type: "advisor_tool_result_error"`
7905
7906 default: advisor_tool_result_error
7907
78537908 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
78547909
78557910 - `"max_uses_exceeded"`
from line 7921
78667921
78677922 - `"model_not_found"`
78687923
7869 - `type: "advisor_tool_result_error"`
7870
7871 default: advisor_tool_result_error
7872
78737924 - `BetaAdvisorResultBlock object`
78747925
7926 - `type: "advisor_result"`
7927
7928 default: advisor_result
7929
78757930 - `stop_reason: string or null`
78767931
78777932 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.
78787933
78797934 - `text: string`
78807935
7881 - `type: "advisor_result"`
7882
7883 default: advisor_result
7884
78857936 - `BetaAdvisorRedactedResultBlock object`
78867937
7938 - `type: "advisor_redacted_result"`
7939
7940 default: advisor_redacted_result
7941
78877942 - `encrypted_content: string`
78887943
78897944 Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
from line 7947
78927947
78937948 The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).
78947949
7895 - `type: "advisor_redacted_result"`
7896
7897 default: advisor_redacted_result
7898
78997950 - `tool_use_id: string`
79007951
79017952 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
79027953
7903 - `type: "advisor_tool_result"`
7904
7905 default: advisor_tool_result
7906
79077954 - `BetaCodeExecutionToolResultBlock object`
79087955
7956 - `type: "code_execution_tool_result"`
7957
7958 default: code_execution_tool_result
7959
79097960 - `content: BetaCodeExecutionToolResultBlockContent`
79107961
79117962 Code execution result with encrypted stdout for PFC + web_search results.
79127963
79137964 - `BetaCodeExecutionToolResultError object`
79147965
7966 - `type: "code_execution_tool_result_error"`
7967
7968 default: code_execution_tool_result_error
7969
79157970 - `error_code: BetaCodeExecutionToolResultErrorCode`
79167971
79177972 - `"invalid_tool_input"`
from line 7977
79227977
79237978 - `"execution_time_exceeded"`
79247979
7925 - `type: "code_execution_tool_result_error"`
7926
7927 default: code_execution_tool_result_error
7928
79297980 - `BetaCodeExecutionResultBlock object`
79307981
7982 - `type: "code_execution_result"`
7983
7984 default: code_execution_result
7985
79317986 - `content: array of BetaCodeExecutionOutputBlock`
79327987
7988 - `type: "code_execution_output"`
7989
7990 default: code_execution_output
7991
79337992 - `file_id: string`
79347993
7994 - `return_code: number`
7995
7996 - `stderr: string`
7997
7998 - `stdout: string`
7999
8000 - `BetaEncryptedCodeExecutionResultBlock object`
8001
8002 Code execution result with encrypted stdout for PFC + web_search results.
8003
8004 - `type: "encrypted_code_execution_result"`
8005
8006 default: encrypted_code_execution_result
8007
8008 - `content: array of BetaCodeExecutionOutputBlock`
8009
79358010 - `type: "code_execution_output"`
79368011
79378012 default: code_execution_output
79388013
8014 - `file_id: string`
8015
8016 - `encrypted_stdout: string`
8017
79398018 - `return_code: number`
79408019
79418020 - `stderr: string`
79428021
8022 - `tool_use_id: string`
8023
8024 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8025
8026 - `BetaBashCodeExecutionToolResultBlock object`
8027
8028 - `type: "bash_code_execution_tool_result"`
8029
8030 default: bash_code_execution_tool_result
8031
8032 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
8033
8034 - `BetaBashCodeExecutionToolResultError object`
8035
8036 - `type: "bash_code_execution_tool_result_error"`
8037
8038 default: bash_code_execution_tool_result_error
8039
8040 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
8041
8042 - `"invalid_tool_input"`
8043
8044 - `"unavailable"`
8045
8046 - `"too_many_requests"`
8047
8048 - `"execution_time_exceeded"`
8049
8050 - `"output_file_too_large"`
8051
8052 - `BetaBashCodeExecutionResultBlock object`
8053
8054 - `type: "bash_code_execution_result"`
8055
8056 default: bash_code_execution_result
8057
8058 - `content: array of BetaBashCodeExecutionOutputBlock`
8059
8060 - `type: "bash_code_execution_output"`
8061
8062 default: bash_code_execution_output
8063
8064 - `file_id: string`
8065
8066 - `return_code: number`
8067
8068 - `stderr: string`
8069
79438070 - `stdout: string`
79448071
7945 - `type: "code_execution_result"`
7946
7947 default: code_execution_result
7948
7949 - `BetaEncryptedCodeExecutionResultBlock object`
7950
7951 Code execution result with encrypted stdout for PFC + web_search results.
7952
7953 - `content: array of BetaCodeExecutionOutputBlock`
7954
7955 - `file_id: string`
7956
7957 - `type: "code_execution_output"`
7958
7959 default: code_execution_output
7960
7961 - `encrypted_stdout: string`
7962
7963 - `return_code: number`
7964
7965 - `stderr: string`
7966
7967 - `type: "encrypted_code_execution_result"`
7968
7969 default: encrypted_code_execution_result
7970
79718072 - `tool_use_id: string`
79728073
79738074 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
79748075
7975 - `type: "code_execution_tool_result"`
7976
7977 default: code_execution_tool_result
7978
7979 - `BetaBashCodeExecutionToolResultBlock object`
7980
7981 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
7982
7983 - `BetaBashCodeExecutionToolResultError object`
8076 - `BetaTextEditorCodeExecutionToolResultBlock object`
8077
8078 - `type: "text_editor_code_execution_tool_result"`
8079
8080 default: text_editor_code_execution_tool_result
8081
8082 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
8083
8084 - `BetaTextEditorCodeExecutionToolResultError object`
8085
8086 - `type: "text_editor_code_execution_tool_result_error"`
8087
8088 default: text_editor_code_execution_tool_result_error
79848089
79858090 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
79868091
from line 8097
79928097
79938098 - `"execution_time_exceeded"`
79948099
7995 - `"output_file_too_large"`
7996
7997 - `type: "bash_code_execution_tool_result_error"`
7998
7999 default: bash_code_execution_tool_result_error
8000
8001 - `BetaBashCodeExecutionResultBlock object`
8002
8003 - `content: array of BetaBashCodeExecutionOutputBlock`
8004
8005 - `file_id: string`
8006
8007 - `type: "bash_code_execution_output"`
8008
8009 default: bash_code_execution_output
8010
8011 - `return_code: number`
8012
8013 - `stderr: string`
8014
8015 - `stdout: string`
8016
8017 - `type: "bash_code_execution_result"`
8018
8019 default: bash_code_execution_result
8100 - `"file_not_found"`
8101
8102 - `error_message: string or null`
8103
8104 - `BetaTextEditorCodeExecutionViewResultBlock object`
8105
8106 - `type: "text_editor_code_execution_view_result"`
8107
8108 default: text_editor_code_execution_view_result
8109
8110 - `content: string`
8111
8112 - `file_type: "text" or "image" or "pdf"`
8113
8114 - `"text"`
8115
8116 - `"image"`
8117
8118 - `"pdf"`
8119
8120 - `num_lines: number or null`
8121
8122 - `start_line: number or null`
8123
8124 - `total_lines: number or null`
8125
8126 - `BetaTextEditorCodeExecutionCreateResultBlock object`
8127
8128 - `type: "text_editor_code_execution_create_result"`
8129
8130 default: text_editor_code_execution_create_result
8131
8132 - `is_file_update: boolean`
8133
8134 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
8135
8136 - `type: "text_editor_code_execution_str_replace_result"`
8137
8138 default: text_editor_code_execution_str_replace_result
8139
8140 - `lines: array of string or null`
8141
8142 - `new_lines: number or null`
8143
8144 - `new_start: number or null`
8145
8146 - `old_lines: number or null`
8147
8148 - `old_start: number or null`
80208149
80218150 - `tool_use_id: string`
80228151
80238152 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
80248153
8025 - `type: "bash_code_execution_tool_result"`
8026
8027 default: bash_code_execution_tool_result
8028
8029 - `BetaTextEditorCodeExecutionToolResultBlock object`
8030
8031 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
8032
8033 - `BetaTextEditorCodeExecutionToolResultError object`
8034
8035 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
8154 - `BetaToolSearchToolResultBlock object`
8155
8156 - `type: "tool_search_tool_result"`
8157
8158 default: tool_search_tool_result
8159
8160 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
8161
8162 - `BetaToolSearchToolResultError object`
8163
8164 - `type: "tool_search_tool_result_error"`
8165
8166 default: tool_search_tool_result_error
8167
8168 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
80368169
80378170 - `"invalid_tool_input"`
80388171
from line 8175
80428175
80438176 - `"execution_time_exceeded"`
80448177
8045 - `"file_not_found"`
8046
80478178 - `error_message: string or null`
80488179
8049 - `type: "text_editor_code_execution_tool_result_error"`
8050
8051 default: text_editor_code_execution_tool_result_error
8052
8053 - `BetaTextEditorCodeExecutionViewResultBlock object`
8054
8055 - `content: string`
8056
8057 - `file_type: "text" or "image" or "pdf"`
8058
8059 - `"text"`
8060
8061 - `"image"`
8062
8063 - `"pdf"`
8064
8065 - `num_lines: number or null`
8066
8067 - `start_line: number or null`
8068
8069 - `total_lines: number or null`
8070
8071 - `type: "text_editor_code_execution_view_result"`
8072
8073 default: text_editor_code_execution_view_result
8074
8075 - `BetaTextEditorCodeExecutionCreateResultBlock object`
8076
8077 - `is_file_update: boolean`
8078
8079 - `type: "text_editor_code_execution_create_result"`
8080
8081 default: text_editor_code_execution_create_result
8082
8083 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
8084
8085 - `lines: array of string or null`
8086
8087 - `new_lines: number or null`
8088
8089 - `new_start: number or null`
8090
8091 - `old_lines: number or null`
8092
8093 - `old_start: number or null`
8094
8095 - `type: "text_editor_code_execution_str_replace_result"`
8096
8097 default: text_editor_code_execution_str_replace_result
8180 - `BetaToolSearchToolSearchResultBlock object`
8181
8182 - `type: "tool_search_tool_search_result"`
8183
8184 default: tool_search_tool_search_result
8185
8186 - `tool_references: array of BetaToolReferenceBlock`
8187
8188 - `type: "tool_reference"`
8189
8190 default: tool_reference
8191
8192 - `tool_name: string`
8193
8194 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
80988195
80998196 - `tool_use_id: string`
81008197
81018198 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
81028199
8103 - `type: "text_editor_code_execution_tool_result"`
8104
8105 default: text_editor_code_execution_tool_result
8106
8107 - `BetaToolSearchToolResultBlock object`
8108
8109 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
8110
8111 - `BetaToolSearchToolResultError object`
8112
8113 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
8114
8115 - `"invalid_tool_input"`
8116
8117 - `"unavailable"`
8118
8119 - `"too_many_requests"`
8120
8121 - `"execution_time_exceeded"`
8122
8123 - `error_message: string or null`
8124
8125 - `type: "tool_search_tool_result_error"`
8126
8127 default: tool_search_tool_result_error
8128
8129 - `BetaToolSearchToolSearchResultBlock object`
8130
8131 - `tool_references: array of BetaToolReferenceBlock`
8132
8133 - `tool_name: string`
8134
8135 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
8136
8137 - `type: "tool_reference"`
8138
8139 default: tool_reference
8140
8141 - `type: "tool_search_tool_search_result"`
8142
8143 default: tool_search_tool_search_result
8200 - `BetaMCPToolUseBlock object`
8201
8202 - `type: "mcp_tool_use"`
8203
8204 default: mcp_tool_use
8205
8206 - `id: string`
8207
8208 pattern: ^[a-zA-Z0-9_-]+$
8209
8210 - `input: map[unknown]`
8211
8212 - `name: string`
8213
8214 The name of the MCP tool
8215
8216 - `server_name: string`
8217
8218 The name of the MCP server
8219
8220 - `BetaMCPToolResultBlock object`
8221
8222 - `type: "mcp_tool_result"`
8223
8224 default: mcp_tool_result
8225
8226 - `content: string or array of BetaTextBlock`
8227
8228 - `string`
8229
8230 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
8231
8232 - `type: "text"`
8233
8234 default: text
8235
8236 - `citations: array of BetaTextCitation or null`
8237
8238 Citations supporting the text block.
8239
8240 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`.
8241
8242 - `text: string`
8243
8244 minLength: 0
8245
8246 - `is_error: boolean`
8247
8248 default: false
81448249
81458250 - `tool_use_id: string`
81468251
8147 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8148
8149 - `type: "tool_search_tool_result"`
8150
8151 default: tool_search_tool_result
8152
8153 - `BetaMCPToolUseBlock object`
8154
8155 - `id: string`
8156
81578252 pattern: ^[a-zA-Z0-9_-]+$
81588253
8159 - `input: map[unknown]`
8160
8161 - `name: string`
8162
8163 The name of the MCP tool
8164
8165 - `server_name: string`
8166
8167 The name of the MCP server
8168
8169 - `type: "mcp_tool_use"`
8170
8171 default: mcp_tool_use
8172
8173 - `BetaMCPToolResultBlock object`
8174
8175 - `content: string or array of BetaTextBlock`
8176
8177 - `string`
8178
8179 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
8180
8181 - `citations: array of BetaTextCitation or null`
8182
8183 Citations supporting the text block.
8184
8185 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`.
8186
8187 - `text: string`
8188
8189 maxLength: 5000000, minLength: 0
8190
8191 - `type: "text"`
8192
8193 default: text
8194
8195 - `is_error: boolean`
8196
8197 default: false
8198
8199 - `tool_use_id: string`
8200
8201 pattern: ^[a-zA-Z0-9_-]+$
8202
8203 - `type: "mcp_tool_result"`
8204
8205 default: mcp_tool_result
8206
82078254 - `BetaContainerUploadBlock object`
82088255
82098256 Response model for a file uploaded to the container.
82108257
8258 - `type: "container_upload"`
8259
8260 default: container_upload
8261
82118262 - `file_id: string`
8212
8213 - `type: "container_upload"`
8214
8215 default: container_upload
82168263
82178264 - `BetaCompactionBlock object`
82188265
from line 8269
82228269 summary (e.g., malformed output from the model). Clients may round-trip
82238270 compaction blocks with null content; the server treats them as no-ops.
82248271
8272 - `type: "compaction"`
8273
8274 default: compaction
8275
82258276 - `content: string or null`
82268277
82278278 Summary of compacted content, or null if compaction failed
from line 8280
82298280 - `encrypted_content: string or null`
82308281
82318282 Opaque metadata from prior compaction, to be round-tripped verbatim
8232
8233 - `type: "compaction"`
8234
8235 default: compaction
82368283
82378284 - `BetaFallbackBlock object`
82388285
from line 8295
82488295 arrives via the standard `content_block_start` / `content_block_stop`
82498296 pair and carries no deltas.
82508297
8298 - `type: "fallback"`
8299
8300 default: fallback
8301
82518302 - `from: BetaFallbackInfo`
82528303
82538304 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 8393
83428393
83438394 What caused the `from` model to hand over at this hop.
83448395
8396 - `type: "refusal"`
8397
8398 default: refusal
8399
83458400 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
83468401
83478402 The policy category that triggered a refusal.
from line 8421
83668421
83678422 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
83688423
8369 - `type: "refusal"`
8370
8371 default: refusal
8372
8373 - `type: "fallback"`
8374
8375 default: fallback
8376
83778424 - `context_management: BetaContextManagementResponse or null`
83788425
83798426 Context management response.
from line 8433
83868433
83878434 - `BetaClearToolUses20250919EditResponse object`
83888435
8436 - `type: "clear_tool_uses_20250919"`
8437
8438 The type of context management edit applied.
8439
8440 default: clear_tool_uses_20250919
8441
83898442 - `cleared_input_tokens: number`
83908443
83918444 Number of input tokens cleared by this edit.
from line 8451
83988451
83998452 minimum: 0
84008453
8401 - `type: "clear_tool_uses_20250919"`
8454 - `BetaClearThinking20251015EditResponse object`
8455
8456 - `type: "clear_thinking_20251015"`
84028457
84038458 The type of context management edit applied.
84048459
8405 default: clear_tool_uses_20250919
8406
8407 - `BetaClearThinking20251015EditResponse object`
8460 default: clear_thinking_20251015
84088461
84098462 - `cleared_input_tokens: number`
84108463
from line 8470
84178470 Number of thinking turns that were cleared.
84188471
84198472 minimum: 0
8420
8421 - `type: "clear_thinking_20251015"`
8422
8423 The type of context management edit applied.
8424
8425 default: clear_thinking_20251015
84268473
84278474 - `diagnostics: BetaDiagnostics or null`
84288475
from line 8482
84358482
84368483 - `BetaCacheMissModelChanged object`
84378484
8485 - `type: "model_changed"`
8486
8487 default: model_changed
8488
84388489 - `cache_missed_input_tokens: number`
84398490
84408491 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
84418492
8442 - `type: "model_changed"`
8443
8444 default: model_changed
8445
84468493 - `BetaCacheMissSystemChanged object`
84478494
8495 - `type: "system_changed"`
8496
8497 default: system_changed
8498
84488499 - `cache_missed_input_tokens: number`
84498500
84508501 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
84518502
8452 - `type: "system_changed"`
8453
8454 default: system_changed
8455
84568503 - `BetaCacheMissToolsChanged object`
84578504
8505 - `type: "tools_changed"`
8506
8507 default: tools_changed
8508
84588509 - `cache_missed_input_tokens: number`
84598510
84608511 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
84618512
8462 - `type: "tools_changed"`
8463
8464 default: tools_changed
8465
84668513 - `BetaCacheMissMessagesChanged object`
84678514
8515 - `type: "messages_changed"`
8516
8517 default: messages_changed
8518
84688519 - `cache_missed_input_tokens: number`
84698520
84708521 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
84718522
8472 - `type: "messages_changed"`
8473
8474 default: messages_changed
8475
84768523 - `BetaCacheMissPreviousMessageNotFound object`
84778524
84788525 - `type: "previous_message_not_found"`
from line 8549
85028549 - `stop_details: BetaRefusalStopDetails or null`
85038550
85048551 Structured information about a refusal.
8552
8553 - `type: "refusal"`
8554
8555 default: refusal
85058556
85068557 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
85078558
from line 8633
85828633
85838634 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.
85848635
8585 - `type: "refusal"`
8586
8587 default: refusal
8588
85898636 - `stop_reason: BetaStopReason or null`
85908637
85918638 The reason that we stopped.
from line 8671
86248671
86258672 This value will be a non-null string if one of your custom stop sequences was generated.
86268673
8627 - `type: "message"`
8628
8629 Object type.
8630
8631 For Messages, this is always `"message"`.
8632
8633 default: message
8634
86358674 - `usage: BetaUsage`
86368675
86378676 Billing and rate-limit usage.
from line 8737
86988737
86998738 No reprice was applied; `reason` says why.
87008739
8740 - `type: "not_applied"`
8741
8742 default: not_applied
8743
87018744 - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`
87028745
87038746 Why the reprice was not applied.
from line 8771
87288771 - `"wrong_platform"`
87298772
87308773 - `"wrong_workspace"`
8731
8732 - `type: "not_applied"`
8733
8734 default: not_applied
87358774
87368775 - `remove_to_redeem: optional array of string or null`
87378776
from line 8809
87708809
87718810 Token usage for a sampling iteration.
87728811
8812 - `type: "message"`
8813
8814 Usage for a sampling iteration
8815
8816 default: message
8817
87738818 - `cache_creation: BetaCacheCreation or null`
87748819
87758820 Breakdown of cached tokens by TTL
from line 8849
88048849
88058850 minimum: 0
88068851
8807 - `type: "message"`
8808
8809 Usage for a sampling iteration
8810
8811 default: message
8812
88138852 - `BetaCompactionIterationUsage object`
88148853
88158854 Token usage for a compaction iteration.
88168855
8856 - `type: "compaction"`
8857
8858 Usage for a compaction iteration
8859
8860 default: compaction
8861
88178862 - `cache_creation: BetaCacheCreation or null`
88188863
88198864 Breakdown of cached tokens by TTL
from line 8887
88428887
88438888 minimum: 0
88448889
8845 - `type: "compaction"`
8846
8847 Usage for a compaction iteration
8848
8849 default: compaction
8850
88518890 - `BetaAdvisorMessageIterationUsage object`
88528891
88538892 Token usage for an advisor sub-inference iteration.
88548893
8894 - `type: "advisor_message"`
8895
8896 Usage for an advisor sub-inference iteration
8897
8898 default: advisor_message
8899
88558900 - `cache_creation: BetaCacheCreation or null`
88568901
88578902 Breakdown of cached tokens by TTL
from line 8930
88858930 The number of output tokens which were used.
88868931
88878932 minimum: 0
8888
8889 - `type: "advisor_message"`
8890
8891 Usage for an advisor sub-inference iteration
8892
8893 default: advisor_message
88948933
88958934 - `BetaFallbackMessageIterationUsage object`
88968935
from line 8940
89018940 a fallback model served the response is signalled by the presence of this
89028941 entry in `usage.iterations`.
89038942
8943 - `type: "fallback_message"`
8944
8945 Usage for the fallback-model attempt that served the response
8946
8947 default: fallback_message
8948
89048949 - `cache_creation: BetaCacheCreation or null`
89058950
89068951 Breakdown of cached tokens by TTL
from line 8979
89348979 The number of output tokens which were used.
89358980
89368981 minimum: 0
8937
8938 - `type: "fallback_message"`
8939
8940 Usage for the fallback-model attempt that served the response
8941
8942 default: fallback_message
89438982
89448983 - `output_tokens: number`
89458984
from line 9059
90209059 the final `message_delta` event carries it only when a server-side model
90219060 fallback happened mid-stream, in which case it holds the serving model's
90229061 entries and replaces the one in `message_start`.
9062
9063 - `type: "thinking_dropped"`
9064
9065 Always `thinking_dropped` for this entry type.
9066
9067 default: thinking_dropped
90239068
90249069 - `path: string`
90259070
from line 9096
90519096
90529097 - `"end_user_binding_mismatch"`
90539098
9054 - `type: "thinking_dropped"`
9055
9056 Always `thinking_dropped` for this entry type.
9057
9058 default: thinking_dropped
9059
9060 - `type: "succeeded"`
9061
9062 default: succeeded
9063
90649099 - `BetaMessageBatchErroredResult object`
90659100
9101 - `type: "errored"`
9102
9103 default: errored
9104
90669105 - `error: BetaErrorResponse`
90679106
9107 - `type: "error"`
9108
9109 default: error
9110
90689111 - `error: BetaError`
90699112
90709113 - `BetaInvalidRequestError object`
90719114
9115 - `type: "invalid_request_error"`
9116
9117 default: invalid_request_error
9118
90729119 - `message: string`
90739120
90749121 default: Invalid request
90759122
9076 - `type: "invalid_request_error"`
9077
9078 default: invalid_request_error
9079
90809123 - `BetaAuthenticationError object`
90819124
9125 - `type: "authentication_error"`
9126
9127 default: authentication_error
9128
90829129 - `message: string`
90839130
90849131 default: Authentication error
90859132
9086 - `type: "authentication_error"`
9087
9088 default: authentication_error
9089
90909133 - `BetaBillingError object`
90919134
9135 - `type: "billing_error"`
9136
9137 default: billing_error
9138
90929139 - `message: string`
90939140
90949141 default: Billing error
90959142
9096 - `type: "billing_error"`
9097
9098 default: billing_error
9099
91009143 - `BetaPermissionError object`
91019144
9145 - `type: "permission_error"`
9146
9147 default: permission_error
9148
91029149 - `message: string`
91039150
91049151 default: Permission denied
91059152
9106 - `type: "permission_error"`
9107
9108 default: permission_error
9109
91109153 - `BetaNotFoundError object`
91119154
9155 - `type: "not_found_error"`
9156
9157 default: not_found_error
9158
91129159 - `message: string`
91139160
91149161 default: Not found
91159162
9116 - `type: "not_found_error"`
9117
9118 default: not_found_error
9119
91209163 - `BetaRateLimitError object`
91219164
9165 - `type: "rate_limit_error"`
9166
9167 default: rate_limit_error
9168
91229169 - `message: string`
91239170
91249171 default: Rate limited
91259172
9126 - `type: "rate_limit_error"`
9127
9128 default: rate_limit_error
9129
91309173 - `BetaGatewayTimeoutError object`
91319174
9175 - `type: "timeout_error"`
9176
9177 default: timeout_error
9178
91329179 - `message: string`
91339180
91349181 default: Request timeout
91359182
9136 - `type: "timeout_error"`
9137
9138 default: timeout_error
9139
91409183 - `BetaAPIError object`
91419184
9185 - `type: "api_error"`
9186
9187 default: api_error
9188
91429189 - `message: string`
91439190
91449191 default: Internal server error
91459192
9146 - `type: "api_error"`
9147
9148 default: api_error
9149
91509193 - `BetaOverloadedError object`
91519194
9195 - `type: "overloaded_error"`
9196
9197 default: overloaded_error
9198
91529199 - `message: string`
91539200
91549201 default: Overloaded
91559202
9156 - `type: "overloaded_error"`
9157
9158 default: overloaded_error
9159
91609203 - `request_id: string or null`
91619204
9162 - `type: "error"`
9163
9164 default: error
9165
9166 - `type: "errored"`
9167
9168 default: errored
9169
91709205 - `BetaMessageBatchCanceledResult object`
91719206
91729207 - `type: "canceled"`
from line 9266
92319266
92329267 - `BetaMessageBatchSucceededResult object`
92339268
9269 - `type: "succeeded"`
9270
9271 default: succeeded
9272
92349273 - `message: BetaMessage`
92359274
9275 - `type: "message"`
9276
9277 Object type.
9278
9279 For Messages, this is always `"message"`.
9280
9281 default: message
9282
92369283 - `id: string`
92379284
92389285 Unique object identifier.
from line 9304
92579304
92589305 Skills loaded in the container
92599306
9307 - `type: "anthropic" or "custom"`
9308
9309 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
9310
9311 - `"anthropic"`
9312
9313 - `"custom"`
9314
92609315 - `skill_id: string`
92619316
92629317 Skill ID
92639318
92649319 maxLength: 64, minLength: 1
9265
9266 - `type: "anthropic" or "custom"`
9267
9268 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
9269
9270 - `"anthropic"`
9271
9272 - `"custom"`
92739320
92749321 - `version: string`
92759322
from line 9355
93089355
93099356 - `BetaTextBlock object`
93109357
9358 - `type: "text"`
9359
9360 default: text
9361
93119362 - `citations: array of BetaTextCitation or null`
93129363
93139364 Citations supporting the text block.
from line 9367
93169367
93179368 - `BetaCitationCharLocation object`
93189369
9370 - `type: "char_location"`
9371
9372 default: char_location
9373
93199374 - `cited_text: string`
93209375
93219376 - `document_index: number`
from line 9387
93329387
93339388 minimum: 0
93349389
9335 - `type: "char_location"`
9336
9337 default: char_location
9338
93399390 - `BetaCitationPageLocation object`
93409391
9392 - `type: "page_location"`
9393
9394 default: page_location
9395
93419396 - `cited_text: string`
93429397
93439398 - `document_index: number`
from line 9409
93549409
93559410 minimum: 1
93569411
9357 - `type: "page_location"`
9358
9359 default: page_location
9360
93619412 - `BetaCitationContentBlockLocation object`
93629413
9414 - `type: "content_block_location"`
9415
9416 default: content_block_location
9417
93639418 - `cited_text: string`
93649419
93659420 The full text of the cited block range, concatenated.
from line 9441
93869441
93879442 minimum: 0
93889443
9389 - `type: "content_block_location"`
9390
9391 default: content_block_location
9392
93939444 - `BetaCitationsWebSearchResultLocation object`
93949445
9446 - `type: "web_search_result_location"`
9447
9448 default: web_search_result_location
9449
93959450 - `cited_text: string`
93969451
93979452 - `encrypted_index: string`
from line 9455
94009455
94019456 maxLength: 512
94029457
9403 - `type: "web_search_result_location"`
9404
9405 default: web_search_result_location
9406
94079458 - `url: string`
94089459
94099460 - `BetaCitationSearchResultLocation object`
94109461
9462 - `type: "search_result_location"`
9463
9464 default: search_result_location
9465
94119466 - `cited_text: string`
94129467
94139468 The full text of the cited block range, concatenated.
from line 9493
94389493
94399494 - `title: string or null`
94409495
9441 - `type: "search_result_location"`
9442
9443 default: search_result_location
9444
94459496 - `text: string`
94469497
9447 maxLength: 5000000, minLength: 0
9448
9449 - `type: "text"`
9450
9451 default: text
9498 minLength: 0
94529499
94539500 - `BetaThinkingBlock object`
94549501
9502 - `type: "thinking"`
9503
9504 default: thinking
9505
94559506 - `signature: string`
94569507
94579508 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
from line 9515
94649515
94659516 The text of Claude's thinking process for this block.
94669517
9467 - `type: "thinking"`
9468
9469 default: thinking
9470
94719518 - `BetaRedactedThinkingBlock object`
94729519
9520 - `type: "redacted_thinking"`
9521
9522 default: redacted_thinking
9523
94739524 - `data: string`
94749525
94759526 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 9529
94789529
94799530 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.
94809531
9481 - `type: "redacted_thinking"`
9482
9483 default: redacted_thinking
9484
94859532 - `BetaToolUseBlock object`
94869533
9534 - `type: "tool_use"`
9535
9536 default: tool_use
9537
94879538 - `id: string`
94889539
94899540 pattern: ^[a-zA-Z0-9_-]+$
from line 9545
94949545
94959546 minLength: 1
94969547
9497 - `type: "tool_use"`
9498
9499 default: tool_use
9500
95019548 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
95029549
95039550 Tool invocation directly from the model.
from line 9559
95129559
95139560 Tool invocation generated by a server-side tool.
95149561
9562 - `type: "code_execution_20250825"`
9563
95159564 - `tool_id: string`
95169565
95179566 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
95189567
9519 - `type: "code_execution_20250825"`
9520
95219568 - `BetaServerToolCaller20260120 object`
95229569
9570 - `type: "code_execution_20260120"`
9571
95239572 - `tool_id: string`
95249573
95259574 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
95269575
9527 - `type: "code_execution_20260120"`
9528
95299576 - `toolset_name: optional string or null`
95309577
95319578 For a toolset member tool_use, the toolset family.
from line 9581
95349581
95359582 - `BetaServerToolUseBlock object`
95369583
9584 - `type: "server_tool_use"`
9585
9586 default: server_tool_use
9587
95379588 - `id: string`
95389589
95399590 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 9609
95589609
95599610 - `"tool_search_tool_bm25"`
95609611
9561 - `type: "server_tool_use"`
9562
9563 default: server_tool_use
9564
95659612 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
95669613
95679614 Tool invocation directly from the model.
from line 9625
95789625
95799626 - `BetaWebSearchToolResultBlock object`
95809627
9628 - `type: "web_search_tool_result"`
9629
9630 default: web_search_tool_result
9631
95819632 - `content: BetaWebSearchToolResultBlockContent`
95829633
95839634 - `BetaWebSearchToolResultError object`
95849635
9636 - `type: "web_search_tool_result_error"`
9637
9638 default: web_search_tool_result_error
9639
95859640 - `error_code: BetaWebSearchToolResultErrorCode`
95869641
95879642 - `"invalid_tool_input"`
from line 9651
95969651
95979652 - `"request_too_large"`
95989653
9599 - `type: "web_search_tool_result_error"`
9600
9601 default: web_search_tool_result_error
9602
96039654 - `array of BetaWebSearchResultBlock`
96049655
9656 - `type: "web_search_result"`
9657
9658 default: web_search_result
9659
96059660 - `encrypted_content: string`
96069661
96079662 - `page_age: string or null`
96089663
96099664 - `title: string`
96109665
9611 - `type: "web_search_result"`
9612
9613 default: web_search_result
9614
96159666 - `url: string`
96169667
96179668 - `tool_use_id: string`
96189669
96199670 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
96209671
9621 - `type: "web_search_tool_result"`
9622
9623 default: web_search_tool_result
9624
96259672 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
96269673
96279674 Tool invocation directly from the model.
from line 9685
96389685
96399686 - `BetaWebFetchToolResultBlock object`
96409687
9688 - `type: "web_fetch_tool_result"`
9689
9690 default: web_fetch_tool_result
9691
96419692 - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
96429693
96439694 - `BetaWebFetchToolResultErrorBlock object`
96449695
9696 - `type: "web_fetch_tool_result_error"`
9697
9698 default: web_fetch_tool_result_error
9699
96459700 - `error_code: BetaWebFetchToolResultErrorCode`
96469701
96479702 - `"invalid_tool_input"`
from line 9717
96629717
96639718 - `"unavailable"`
96649719
9665 - `type: "web_fetch_tool_result_error"`
9666
9667 default: web_fetch_tool_result_error
9720 - `"content_too_large"`
96689721
96699722 - `BetaWebFetchBlock object`
96709723
9724 - `type: "web_fetch_result"`
9725
9726 default: web_fetch_result
9727
96719728 - `content: BetaDocumentBlock`
96729729
9730 - `type: "document"`
9731
9732 default: document
9733
96739734 - `citations: BetaCitationConfig or null`
96749735
96759736 Citation configuration for the document
from line 9743
96829743
96839744 - `BetaBase64PDFSource object`
96849745
9746 - `type: "base64"`
9747
96859748 - `data: string`
96869749
96879750 format: byte
96889751
96899752 - `media_type: "application/pdf"`
96909753
9691 - `type: "base64"`
9692
96939754 - `BetaPlainTextSource object`
96949755
9756 - `type: "text"`
9757
96959758 - `data: string`
96969759
96979760 - `media_type: "text/plain"`
96989761
9699 - `type: "text"`
9700
97019762 - `title: string or null`
97029763
97039764 The title of the document
97049765
9705 - `type: "document"`
9706
9707 default: document
9708
97099766 - `retrieved_at: string or null`
97109767
97119768 ISO 8601 timestamp when the content was retrieved
97129769
9713 - `type: "web_fetch_result"`
9714
9715 default: web_fetch_result
9716
97179770 - `url: string`
97189771
97199772 Fetched content URL
from line 9775
97229775
97239776 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
97249777
9725 - `type: "web_fetch_tool_result"`
9726
9727 default: web_fetch_tool_result
9728
97299778 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
97309779
97319780 Tool invocation directly from the model.
from line 9791
97429791
97439792 - `BetaAdvisorToolResultBlock object`
97449793
9794 - `type: "advisor_tool_result"`
9795
9796 default: advisor_tool_result
9797
97459798 - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`
97469799
97479800 - `BetaAdvisorToolResultError object`
97489801
9802 - `type: "advisor_tool_result_error"`
9803
9804 default: advisor_tool_result_error
9805
97499806 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
97509807
97519808 - `"max_uses_exceeded"`
from line 9819
97629819
97639820 - `"model_not_found"`
97649821
9765 - `type: "advisor_tool_result_error"`
9766
9767 default: advisor_tool_result_error
9768
97699822 - `BetaAdvisorResultBlock object`
97709823
9824 - `type: "advisor_result"`
9825
9826 default: advisor_result
9827
97719828 - `stop_reason: string or null`
97729829
97739830 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.
97749831
97759832 - `text: string`
97769833
9777 - `type: "advisor_result"`
9778
9779 default: advisor_result
9780
97819834 - `BetaAdvisorRedactedResultBlock object`
97829835
9836 - `type: "advisor_redacted_result"`
9837
9838 default: advisor_redacted_result
9839
97839840 - `encrypted_content: string`
97849841
97859842 Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
from line 9845
97889845
97899846 The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).
97909847
9791 - `type: "advisor_redacted_result"`
9792
9793 default: advisor_redacted_result
9794
97959848 - `tool_use_id: string`
97969849
97979850 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
97989851
9799 - `type: "advisor_tool_result"`
9800
9801 default: advisor_tool_result
9802
98039852 - `BetaCodeExecutionToolResultBlock object`
98049853
9854 - `type: "code_execution_tool_result"`
9855
9856 default: code_execution_tool_result
9857
98059858 - `content: BetaCodeExecutionToolResultBlockContent`
98069859
98079860 Code execution result with encrypted stdout for PFC + web_search results.
98089861
98099862 - `BetaCodeExecutionToolResultError object`
98109863
9864 - `type: "code_execution_tool_result_error"`
9865
9866 default: code_execution_tool_result_error
9867
98119868 - `error_code: BetaCodeExecutionToolResultErrorCode`
98129869
98139870 - `"invalid_tool_input"`
from line 9875
98189875
98199876 - `"execution_time_exceeded"`
98209877
9821 - `type: "code_execution_tool_result_error"`
9822
9823 default: code_execution_tool_result_error
9824
98259878 - `BetaCodeExecutionResultBlock object`
98269879
9880 - `type: "code_execution_result"`
9881
9882 default: code_execution_result
9883
98279884 - `content: array of BetaCodeExecutionOutputBlock`
98289885
9886 - `type: "code_execution_output"`
9887
9888 default: code_execution_output
9889
98299890 - `file_id: string`
98309891
9892 - `return_code: number`
9893
9894 - `stderr: string`
9895
9896 - `stdout: string`
9897
9898 - `BetaEncryptedCodeExecutionResultBlock object`
9899
9900 Code execution result with encrypted stdout for PFC + web_search results.
9901
9902 - `type: "encrypted_code_execution_result"`
9903
9904 default: encrypted_code_execution_result
9905
9906 - `content: array of BetaCodeExecutionOutputBlock`
9907
98319908 - `type: "code_execution_output"`
98329909
98339910 default: code_execution_output
98349911
9912 - `file_id: string`
9913
9914 - `encrypted_stdout: string`
9915
98359916 - `return_code: number`
98369917
98379918 - `stderr: string`
98389919
9920 - `tool_use_id: string`
9921
9922 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
9923
9924 - `BetaBashCodeExecutionToolResultBlock object`
9925
9926 - `type: "bash_code_execution_tool_result"`
9927
9928 default: bash_code_execution_tool_result
9929
9930 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
9931
9932 - `BetaBashCodeExecutionToolResultError object`
9933
9934 - `type: "bash_code_execution_tool_result_error"`
9935
9936 default: bash_code_execution_tool_result_error
9937
9938 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
9939
9940 - `"invalid_tool_input"`
9941
9942 - `"unavailable"`
9943
9944 - `"too_many_requests"`
9945
9946 - `"execution_time_exceeded"`
9947
9948 - `"output_file_too_large"`
9949
9950 - `BetaBashCodeExecutionResultBlock object`
9951
9952 - `type: "bash_code_execution_result"`
9953
9954 default: bash_code_execution_result
9955
9956 - `content: array of BetaBashCodeExecutionOutputBlock`
9957
9958 - `type: "bash_code_execution_output"`
9959
9960 default: bash_code_execution_output
9961
9962 - `file_id: string`
9963
9964 - `return_code: number`
9965
9966 - `stderr: string`
9967
98399968 - `stdout: string`
98409969
9841 - `type: "code_execution_result"`
9842
9843 default: code_execution_result
9844
9845 - `BetaEncryptedCodeExecutionResultBlock object`
9846
9847 Code execution result with encrypted stdout for PFC + web_search results.
9848
9849 - `content: array of BetaCodeExecutionOutputBlock`
9850
9851 - `file_id: string`
9852
9853 - `type: "code_execution_output"`
9854
9855 default: code_execution_output
9856
9857 - `encrypted_stdout: string`
9858
9859 - `return_code: number`
9860
9861 - `stderr: string`
9862
9863 - `type: "encrypted_code_execution_result"`
9864
9865 default: encrypted_code_execution_result
9866
98679970 - `tool_use_id: string`
98689971
98699972 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
98709973
9871 - `type: "code_execution_tool_result"`
9872
9873 default: code_execution_tool_result
9874
9875 - `BetaBashCodeExecutionToolResultBlock object`
9876
9877 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
9878
9879 - `BetaBashCodeExecutionToolResultError object`
9974 - `BetaTextEditorCodeExecutionToolResultBlock object`
9975
9976 - `type: "text_editor_code_execution_tool_result"`
9977
9978 default: text_editor_code_execution_tool_result
9979
9980 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
9981
9982 - `BetaTextEditorCodeExecutionToolResultError object`
9983
9984 - `type: "text_editor_code_execution_tool_result_error"`
9985
9986 default: text_editor_code_execution_tool_result_error
98809987
98819988 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
98829989
from line 9995
98889995
98899996 - `"execution_time_exceeded"`
98909997
9891 - `"output_file_too_large"`
9892
9893 - `type: "bash_code_execution_tool_result_error"`
9894
9895 default: bash_code_execution_tool_result_error
9896
9897 - `BetaBashCodeExecutionResultBlock object`
9898
9899 - `content: array of BetaBashCodeExecutionOutputBlock`
9900
9901 - `file_id: string`
9902
9903 - `type: "bash_code_execution_output"`
9904
9905 default: bash_code_execution_output
9906
9907 - `return_code: number`
9908
9909 - `stderr: string`
9910
9911 - `stdout: string`
9912
9913 - `type: "bash_code_execution_result"`
9914
9915 default: bash_code_execution_result
9998 - `"file_not_found"`
9999
10000 - `error_message: string or null`
10001
10002 - `BetaTextEditorCodeExecutionViewResultBlock object`
10003
10004 - `type: "text_editor_code_execution_view_result"`
10005
10006 default: text_editor_code_execution_view_result
10007
10008 - `content: string`
10009
10010 - `file_type: "text" or "image" or "pdf"`
10011
10012 - `"text"`
10013
10014 - `"image"`
10015
10016 - `"pdf"`
10017
10018 - `num_lines: number or null`
10019
10020 - `start_line: number or null`
10021
10022 - `total_lines: number or null`
10023
10024 - `BetaTextEditorCodeExecutionCreateResultBlock object`
10025
10026 - `type: "text_editor_code_execution_create_result"`
10027
10028 default: text_editor_code_execution_create_result
10029
10030 - `is_file_update: boolean`
10031
10032 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
10033
10034 - `type: "text_editor_code_execution_str_replace_result"`
10035
10036 default: text_editor_code_execution_str_replace_result
10037
10038 - `lines: array of string or null`
10039
10040 - `new_lines: number or null`
10041
10042 - `new_start: number or null`
10043
10044 - `old_lines: number or null`
10045
10046 - `old_start: number or null`
991610047
991710048 - `tool_use_id: string`
991810049
991910050 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
992010051
9921 - `type: "bash_code_execution_tool_result"`
9922
9923 default: bash_code_execution_tool_result
9924
9925 - `BetaTextEditorCodeExecutionToolResultBlock object`
9926
9927 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
9928
9929 - `BetaTextEditorCodeExecutionToolResultError object`
9930
9931 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10052 - `BetaToolSearchToolResultBlock object`
10053
10054 - `type: "tool_search_tool_result"`
10055
10056 default: tool_search_tool_result
10057
10058 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
10059
10060 - `BetaToolSearchToolResultError object`
10061
10062 - `type: "tool_search_tool_result_error"`
10063
10064 default: tool_search_tool_result_error
10065
10066 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
993210067
993310068 - `"invalid_tool_input"`
993410069
from line 10073
993810073
993910074 - `"execution_time_exceeded"`
994010075
9941 - `"file_not_found"`
9942
994310076 - `error_message: string or null`
994410077
9945 - `type: "text_editor_code_execution_tool_result_error"`
9946
9947 default: text_editor_code_execution_tool_result_error
9948
9949 - `BetaTextEditorCodeExecutionViewResultBlock object`
9950
9951 - `content: string`
9952
9953 - `file_type: "text" or "image" or "pdf"`
9954
9955 - `"text"`
9956
9957 - `"image"`
9958
9959 - `"pdf"`
9960
9961 - `num_lines: number or null`
9962
9963 - `start_line: number or null`
9964
9965 - `total_lines: number or null`
9966
9967 - `type: "text_editor_code_execution_view_result"`
9968
9969 default: text_editor_code_execution_view_result
9970
9971 - `BetaTextEditorCodeExecutionCreateResultBlock object`
9972
9973 - `is_file_update: boolean`
9974
9975 - `type: "text_editor_code_execution_create_result"`
9976
9977 default: text_editor_code_execution_create_result
9978
9979 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
9980
9981 - `lines: array of string or null`
9982
9983 - `new_lines: number or null`
9984
9985 - `new_start: number or null`
9986
9987 - `old_lines: number or null`
9988
9989 - `old_start: number or null`
9990
9991 - `type: "text_editor_code_execution_str_replace_result"`
9992
9993 default: text_editor_code_execution_str_replace_result
10078 - `BetaToolSearchToolSearchResultBlock object`
10079
10080 - `type: "tool_search_tool_search_result"`
10081
10082 default: tool_search_tool_search_result
10083
10084 - `tool_references: array of BetaToolReferenceBlock`
10085
10086 - `type: "tool_reference"`
10087
10088 default: tool_reference
10089
10090 - `tool_name: string`
10091
10092 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
999410093
999510094 - `tool_use_id: string`
999610095
999710096 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
999810097
9999 - `type: "text_editor_code_execution_tool_result"`
10000
10001 default: text_editor_code_execution_tool_result
10002
10003 - `BetaToolSearchToolResultBlock object`
10004
10005 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
10006
10007 - `BetaToolSearchToolResultError object`
10008
10009 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
10010
10011 - `"invalid_tool_input"`
10012
10013 - `"unavailable"`
10014
10015 - `"too_many_requests"`
10016
10017 - `"execution_time_exceeded"`
10018
10019 - `error_message: string or null`
10020
10021 - `type: "tool_search_tool_result_error"`
10022
10023 default: tool_search_tool_result_error
10024
10025 - `BetaToolSearchToolSearchResultBlock object`
10026
10027 - `tool_references: array of BetaToolReferenceBlock`
10028
10029 - `tool_name: string`
10030
10031 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
10032
10033 - `type: "tool_reference"`
10034
10035 default: tool_reference
10036
10037 - `type: "tool_search_tool_search_result"`
10038
10039 default: tool_search_tool_search_result
10098 - `BetaMCPToolUseBlock object`
10099
10100 - `type: "mcp_tool_use"`
10101
10102 default: mcp_tool_use
10103
10104 - `id: string`
10105
10106 pattern: ^[a-zA-Z0-9_-]+$
10107
10108 - `input: map[unknown]`
10109
10110 - `name: string`
10111
10112 The name of the MCP tool
10113
10114 - `server_name: string`
10115
10116 The name of the MCP server
10117
10118 - `BetaMCPToolResultBlock object`
10119
10120 - `type: "mcp_tool_result"`
10121
10122 default: mcp_tool_result
10123
10124 - `content: string or array of BetaTextBlock`
10125
10126 - `string`
10127
10128 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
10129
10130 - `type: "text"`
10131
10132 default: text
10133
10134 - `citations: array of BetaTextCitation or null`
10135
10136 Citations supporting the text block.
10137
10138 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`.
10139
10140 - `text: string`
10141
10142 minLength: 0
10143
10144 - `is_error: boolean`
10145
10146 default: false
1004010147
1004110148 - `tool_use_id: string`
1004210149
10043 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10044
10045 - `type: "tool_search_tool_result"`
10046
10047 default: tool_search_tool_result
10048
10049 - `BetaMCPToolUseBlock object`
10050
10051 - `id: string`
10052
1005310150 pattern: ^[a-zA-Z0-9_-]+$
1005410151
10055 - `input: map[unknown]`
10056
10057 - `name: string`
10058
10059 The name of the MCP tool
10060
10061 - `server_name: string`
10062
10063 The name of the MCP server
10064
10065 - `type: "mcp_tool_use"`
10066
10067 default: mcp_tool_use
10068
10069 - `BetaMCPToolResultBlock object`
10070
10071 - `content: string or array of BetaTextBlock`
10072
10073 - `string`
10074
10075 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
10076
10077 - `citations: array of BetaTextCitation or null`
10078
10079 Citations supporting the text block.
10080
10081 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`.
10082
10083 - `text: string`
10084
10085 maxLength: 5000000, minLength: 0
10086
10087 - `type: "text"`
10088
10089 default: text
10090
10091 - `is_error: boolean`
10092
10093 default: false
10094
10095 - `tool_use_id: string`
10096
10097 pattern: ^[a-zA-Z0-9_-]+$
10098
10099 - `type: "mcp_tool_result"`
10100
10101 default: mcp_tool_result
10102
1010310152 - `BetaContainerUploadBlock object`
1010410153
1010510154 Response model for a file uploaded to the container.
1010610155
10156 - `type: "container_upload"`
10157
10158 default: container_upload
10159
1010710160 - `file_id: string`
10108
10109 - `type: "container_upload"`
10110
10111 default: container_upload
1011210161
1011310162 - `BetaCompactionBlock object`
1011410163
from line 10167
1011810167 summary (e.g., malformed output from the model). Clients may round-trip
1011910168 compaction blocks with null content; the server treats them as no-ops.
1012010169
10170 - `type: "compaction"`
10171
10172 default: compaction
10173
1012110174 - `content: string or null`
1012210175
1012310176 Summary of compacted content, or null if compaction failed
from line 10178
1012510178 - `encrypted_content: string or null`
1012610179
1012710180 Opaque metadata from prior compaction, to be round-tripped verbatim
10128
10129 - `type: "compaction"`
10130
10131 default: compaction
1013210181
1013310182 - `BetaFallbackBlock object`
1013410183
from line 10193
1014410193 arrives via the standard `content_block_start` / `content_block_stop`
1014510194 pair and carries no deltas.
1014610195
10196 - `type: "fallback"`
10197
10198 default: fallback
10199
1014710200 - `from: BetaFallbackInfo`
1014810201
1014910202 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 10291
1023810291
1023910292 What caused the `from` model to hand over at this hop.
1024010293
10294 - `type: "refusal"`
10295
10296 default: refusal
10297
1024110298 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
1024210299
1024310300 The policy category that triggered a refusal.
from line 10319
1026210319
1026310320 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
1026410321
10265 - `type: "refusal"`
10266
10267 default: refusal
10268
10269 - `type: "fallback"`
10270
10271 default: fallback
10272
1027310322 - `context_management: BetaContextManagementResponse or null`
1027410323
1027510324 Context management response.
from line 10331
1028210331
1028310332 - `BetaClearToolUses20250919EditResponse object`
1028410333
10334 - `type: "clear_tool_uses_20250919"`
10335
10336 The type of context management edit applied.
10337
10338 default: clear_tool_uses_20250919
10339
1028510340 - `cleared_input_tokens: number`
1028610341
1028710342 Number of input tokens cleared by this edit.
from line 10349
1029410349
1029510350 minimum: 0
1029610351
10297 - `type: "clear_tool_uses_20250919"`
10352 - `BetaClearThinking20251015EditResponse object`
10353
10354 - `type: "clear_thinking_20251015"`
1029810355
1029910356 The type of context management edit applied.
1030010357
10301 default: clear_tool_uses_20250919
10302
10303 - `BetaClearThinking20251015EditResponse object`
10358 default: clear_thinking_20251015
1030410359
1030510360 - `cleared_input_tokens: number`
1030610361
from line 10368
1031310368 Number of thinking turns that were cleared.
1031410369
1031510370 minimum: 0
10316
10317 - `type: "clear_thinking_20251015"`
10318
10319 The type of context management edit applied.
10320
10321 default: clear_thinking_20251015
1032210371
1032310372 - `diagnostics: BetaDiagnostics or null`
1032410373
from line 10380
1033110380
1033210381 - `BetaCacheMissModelChanged object`
1033310382
10383 - `type: "model_changed"`
10384
10385 default: model_changed
10386
1033410387 - `cache_missed_input_tokens: number`
1033510388
1033610389 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
1033710390
10338 - `type: "model_changed"`
10339
10340 default: model_changed
10341
1034210391 - `BetaCacheMissSystemChanged object`
1034310392
10393 - `type: "system_changed"`
10394
10395 default: system_changed
10396
1034410397 - `cache_missed_input_tokens: number`
1034510398
1034610399 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
1034710400
10348 - `type: "system_changed"`
10349
10350 default: system_changed
10351
1035210401 - `BetaCacheMissToolsChanged object`
1035310402
10403 - `type: "tools_changed"`
10404
10405 default: tools_changed
10406
1035410407 - `cache_missed_input_tokens: number`
1035510408
1035610409 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
1035710410
10358 - `type: "tools_changed"`
10359
10360 default: tools_changed
10361
1036210411 - `BetaCacheMissMessagesChanged object`
1036310412
10413 - `type: "messages_changed"`
10414
10415 default: messages_changed
10416
1036410417 - `cache_missed_input_tokens: number`
1036510418
1036610419 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
1036710420
10368 - `type: "messages_changed"`
10369
10370 default: messages_changed
10371
1037210421 - `BetaCacheMissPreviousMessageNotFound object`
1037310422
1037410423 - `type: "previous_message_not_found"`
from line 10447
1039810447 - `stop_details: BetaRefusalStopDetails or null`
1039910448
1040010449 Structured information about a refusal.
10450
10451 - `type: "refusal"`
10452
10453 default: refusal
1040110454
1040210455 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
1040310456
from line 10531
1047810531
1047910532 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.
1048010533
10481 - `type: "refusal"`
10482
10483 default: refusal
10484
1048510534 - `stop_reason: BetaStopReason or null`
1048610535
1048710536 The reason that we stopped.
from line 10569
1052010569
1052110570 This value will be a non-null string if one of your custom stop sequences was generated.
1052210571
10523 - `type: "message"`
10524
10525 Object type.
10526
10527 For Messages, this is always `"message"`.
10528
10529 default: message
10530
1053110572 - `usage: BetaUsage`
1053210573
1053310574 Billing and rate-limit usage.
from line 10635
1059410635
1059510636 No reprice was applied; `reason` says why.
1059610637
10638 - `type: "not_applied"`
10639
10640 default: not_applied
10641
1059710642 - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`
1059810643
1059910644 Why the reprice was not applied.
from line 10669
1062410669 - `"wrong_platform"`
1062510670
1062610671 - `"wrong_workspace"`
10627
10628 - `type: "not_applied"`
10629
10630 default: not_applied
1063110672
1063210673 - `remove_to_redeem: optional array of string or null`
1063310674
from line 10707
1066610707
1066710708 Token usage for a sampling iteration.
1066810709
10710 - `type: "message"`
10711
10712 Usage for a sampling iteration
10713
10714 default: message
10715
1066910716 - `cache_creation: BetaCacheCreation or null`
1067010717
1067110718 Breakdown of cached tokens by TTL
from line 10747
1070010747
1070110748 minimum: 0
1070210749
10703 - `type: "message"`
10704
10705 Usage for a sampling iteration
10706
10707 default: message
10708
1070910750 - `BetaCompactionIterationUsage object`
1071010751
1071110752 Token usage for a compaction iteration.
1071210753
10754 - `type: "compaction"`
10755
10756 Usage for a compaction iteration
10757
10758 default: compaction
10759
1071310760 - `cache_creation: BetaCacheCreation or null`
1071410761
1071510762 Breakdown of cached tokens by TTL
from line 10785
1073810785
1073910786 minimum: 0
1074010787
10741 - `type: "compaction"`
10742
10743 Usage for a compaction iteration
10744
10745 default: compaction
10746
1074710788 - `BetaAdvisorMessageIterationUsage object`
1074810789
1074910790 Token usage for an advisor sub-inference iteration.
1075010791
10792 - `type: "advisor_message"`
10793
10794 Usage for an advisor sub-inference iteration
10795
10796 default: advisor_message
10797
1075110798 - `cache_creation: BetaCacheCreation or null`
1075210799
1075310800 Breakdown of cached tokens by TTL
from line 10828
1078110828 The number of output tokens which were used.
1078210829
1078310830 minimum: 0
10784
10785 - `type: "advisor_message"`
10786
10787 Usage for an advisor sub-inference iteration
10788
10789 default: advisor_message
1079010831
1079110832 - `BetaFallbackMessageIterationUsage object`
1079210833
from line 10838
1079710838 a fallback model served the response is signalled by the presence of this
1079810839 entry in `usage.iterations`.
1079910840
10841 - `type: "fallback_message"`
10842
10843 Usage for the fallback-model attempt that served the response
10844
10845 default: fallback_message
10846
1080010847 - `cache_creation: BetaCacheCreation or null`
1080110848
1080210849 Breakdown of cached tokens by TTL
from line 10877
1083010877 The number of output tokens which were used.
1083110878
1083210879 minimum: 0
10833
10834 - `type: "fallback_message"`
10835
10836 Usage for the fallback-model attempt that served the response
10837
10838 default: fallback_message
1083910880
1084010881 - `output_tokens: number`
1084110882
from line 10957
1091610957 the final `message_delta` event carries it only when a server-side model
1091710958 fallback happened mid-stream, in which case it holds the serving model's
1091810959 entries and replaces the one in `message_start`.
10960
10961 - `type: "thinking_dropped"`
10962
10963 Always `thinking_dropped` for this entry type.
10964
10965 default: thinking_dropped
1091910966
1092010967 - `path: string`
1092110968
from line 10994
1094710994
1094810995 - `"end_user_binding_mismatch"`
1094910996
10950 - `type: "thinking_dropped"`
10951
10952 Always `thinking_dropped` for this entry type.
10953
10954 default: thinking_dropped
10955
10956 - `type: "succeeded"`
10957
10958 default: succeeded
10959
1096010997 - `BetaMessageBatchErroredResult object`
1096110998
10999 - `type: "errored"`
11000
11001 default: errored
11002
1096211003 - `error: BetaErrorResponse`
1096311004
11005 - `type: "error"`
11006
11007 default: error
11008
1096411009 - `error: BetaError`
1096511010
1096611011 - `BetaInvalidRequestError object`
1096711012
11013 - `type: "invalid_request_error"`
11014
11015 default: invalid_request_error
11016
1096811017 - `message: string`
1096911018
1097011019 default: Invalid request
1097111020
10972 - `type: "invalid_request_error"`
10973
10974 default: invalid_request_error
10975
1097611021 - `BetaAuthenticationError object`
1097711022
11023 - `type: "authentication_error"`
11024
11025 default: authentication_error
11026
1097811027 - `message: string`
1097911028
1098011029 default: Authentication error
1098111030
10982 - `type: "authentication_error"`
10983
10984 default: authentication_error
10985
1098611031 - `BetaBillingError object`
1098711032
11033 - `type: "billing_error"`
11034
11035 default: billing_error
11036
1098811037 - `message: string`
1098911038
1099011039 default: Billing error
1099111040
10992 - `type: "billing_error"`
10993
10994 default: billing_error
10995
1099611041 - `BetaPermissionError object`
1099711042
11043 - `type: "permission_error"`
11044
11045 default: permission_error
11046
1099811047 - `message: string`
1099911048
1100011049 default: Permission denied
1100111050
11002 - `type: "permission_error"`
11003
11004 default: permission_error
11005
1100611051 - `BetaNotFoundError object`
1100711052
11053 - `type: "not_found_error"`
11054
11055 default: not_found_error
11056
1100811057 - `message: string`
1100911058
1101011059 default: Not found
1101111060
11012 - `type: "not_found_error"`
11013
11014 default: not_found_error
11015
1101611061 - `BetaRateLimitError object`
1101711062
11063 - `type: "rate_limit_error"`
11064
11065 default: rate_limit_error
11066
1101811067 - `message: string`
1101911068
1102011069 default: Rate limited
1102111070
11022 - `type: "rate_limit_error"`
11023
11024 default: rate_limit_error
11025
1102611071 - `BetaGatewayTimeoutError object`
1102711072
11073 - `type: "timeout_error"`
11074
11075 default: timeout_error
11076
1102811077 - `message: string`
1102911078
1103011079 default: Request timeout
1103111080
11032 - `type: "timeout_error"`
11033
11034 default: timeout_error
11035
1103611081 - `BetaAPIError object`
1103711082
11083 - `type: "api_error"`
11084
11085 default: api_error
11086
1103811087 - `message: string`
1103911088
1104011089 default: Internal server error
1104111090
11042 - `type: "api_error"`
11043
11044 default: api_error
11045
1104611091 - `BetaOverloadedError object`
1104711092
11093 - `type: "overloaded_error"`
11094
11095 default: overloaded_error
11096
1104811097 - `message: string`
1104911098
1105011099 default: Overloaded
1105111100
11052 - `type: "overloaded_error"`
11053
11054 default: overloaded_error
11055
1105611101 - `request_id: string or null`
1105711102
11058 - `type: "error"`
11059
11060 default: error
11061
11062 - `type: "errored"`
11063
11064 default: errored
11065
1106611103 - `BetaMessageBatchCanceledResult object`
1106711104
1106811105 - `type: "canceled"`
from line 11116
1107911116
1108011117- `BetaMessageBatchSucceededResult object`
1108111118
11119 - `type: "succeeded"`
11120
11121 default: succeeded
11122
1108211123 - `message: BetaMessage`
1108311124
11125 - `type: "message"`
11126
11127 Object type.
11128
11129 For Messages, this is always `"message"`.
11130
11131 default: message
11132
1108411133 - `id: string`
1108511134
1108611135 Unique object identifier.
from line 11154
1110511154
1110611155 Skills loaded in the container
1110711156
11157 - `type: "anthropic" or "custom"`
11158
11159 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
11160
11161 - `"anthropic"`
11162
11163 - `"custom"`
11164
1110811165 - `skill_id: string`
1110911166
1111011167 Skill ID
1111111168
1111211169 maxLength: 64, minLength: 1
11113
11114 - `type: "anthropic" or "custom"`
11115
11116 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
11117
11118 - `"anthropic"`
11119
11120 - `"custom"`
1112111170
1112211171 - `version: string`
1112311172
from line 11205
1115611205
1115711206 - `BetaTextBlock object`
1115811207
11208 - `type: "text"`
11209
11210 default: text
11211
1115911212 - `citations: array of BetaTextCitation or null`
1116011213
1116111214 Citations supporting the text block.
from line 11217
1116411217
1116511218 - `BetaCitationCharLocation object`
1116611219
11220 - `type: "char_location"`
11221
11222 default: char_location
11223
1116711224 - `cited_text: string`
1116811225
1116911226 - `document_index: number`
from line 11237
1118011237
1118111238 minimum: 0
1118211239
11183 - `type: "char_location"`
11184
11185 default: char_location
11186
1118711240 - `BetaCitationPageLocation object`
1118811241
11242 - `type: "page_location"`
11243
11244 default: page_location
11245
1118911246 - `cited_text: string`
1119011247
1119111248 - `document_index: number`
from line 11259
1120211259
1120311260 minimum: 1
1120411261
11205 - `type: "page_location"`
11206
11207 default: page_location
11208
1120911262 - `BetaCitationContentBlockLocation object`
1121011263
11264 - `type: "content_block_location"`
11265
11266 default: content_block_location
11267
1121111268 - `cited_text: string`
1121211269
1121311270 The full text of the cited block range, concatenated.
from line 11291
1123411291
1123511292 minimum: 0
1123611293
11237 - `type: "content_block_location"`
11238
11239 default: content_block_location
11240
1124111294 - `BetaCitationsWebSearchResultLocation object`
1124211295
11296 - `type: "web_search_result_location"`
11297
11298 default: web_search_result_location
11299
1124311300 - `cited_text: string`
1124411301
1124511302 - `encrypted_index: string`
from line 11305
1124811305
1124911306 maxLength: 512
1125011307
11251 - `type: "web_search_result_location"`
11252
11253 default: web_search_result_location
11254
1125511308 - `url: string`
1125611309
1125711310 - `BetaCitationSearchResultLocation object`
1125811311
11312 - `type: "search_result_location"`
11313
11314 default: search_result_location
11315
1125911316 - `cited_text: string`
1126011317
1126111318 The full text of the cited block range, concatenated.
from line 11343
1128611343
1128711344 - `title: string or null`
1128811345
11289 - `type: "search_result_location"`
11290
11291 default: search_result_location
11292
1129311346 - `text: string`
1129411347
11295 maxLength: 5000000, minLength: 0
11296
11297 - `type: "text"`
11298
11299 default: text
11348 minLength: 0
1130011349
1130111350 - `BetaThinkingBlock object`
1130211351
11352 - `type: "thinking"`
11353
11354 default: thinking
11355
1130311356 - `signature: string`
1130411357
1130511358 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
from line 11365
1131211365
1131311366 The text of Claude's thinking process for this block.
1131411367
11315 - `type: "thinking"`
11316
11317 default: thinking
11318
1131911368 - `BetaRedactedThinkingBlock object`
1132011369
11370 - `type: "redacted_thinking"`
11371
11372 default: redacted_thinking
11373
1132111374 - `data: string`
1132211375
1132311376 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 11379
1132611379
1132711380 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.
1132811381
11329 - `type: "redacted_thinking"`
11330
11331 default: redacted_thinking
11332
1133311382 - `BetaToolUseBlock object`
1133411383
11384 - `type: "tool_use"`
11385
11386 default: tool_use
11387
1133511388 - `id: string`
1133611389
1133711390 pattern: ^[a-zA-Z0-9_-]+$
from line 11395
1134211395
1134311396 minLength: 1
1134411397
11345 - `type: "tool_use"`
11346
11347 default: tool_use
11348
1134911398 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
1135011399
1135111400 Tool invocation directly from the model.
from line 11409
1136011409
1136111410 Tool invocation generated by a server-side tool.
1136211411
11412 - `type: "code_execution_20250825"`
11413
1136311414 - `tool_id: string`
1136411415
1136511416 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1136611417
11367 - `type: "code_execution_20250825"`
11368
1136911418 - `BetaServerToolCaller20260120 object`
1137011419
11420 - `type: "code_execution_20260120"`
11421
1137111422 - `tool_id: string`
1137211423
1137311424 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1137411425
11375 - `type: "code_execution_20260120"`
11376
1137711426 - `toolset_name: optional string or null`
1137811427
1137911428 For a toolset member tool_use, the toolset family.
from line 11431
1138211431
1138311432 - `BetaServerToolUseBlock object`
1138411433
11434 - `type: "server_tool_use"`
11435
11436 default: server_tool_use
11437
1138511438 - `id: string`
1138611439
1138711440 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 11459
1140611459
1140711460 - `"tool_search_tool_bm25"`
1140811461
11409 - `type: "server_tool_use"`
11410
11411 default: server_tool_use
11412
1141311462 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
1141411463
1141511464 Tool invocation directly from the model.
from line 11475
1142611475
1142711476 - `BetaWebSearchToolResultBlock object`
1142811477
11478 - `type: "web_search_tool_result"`
11479
11480 default: web_search_tool_result
11481
1142911482 - `content: BetaWebSearchToolResultBlockContent`
1143011483
1143111484 - `BetaWebSearchToolResultError object`
1143211485
11486 - `type: "web_search_tool_result_error"`
11487
11488 default: web_search_tool_result_error
11489
1143311490 - `error_code: BetaWebSearchToolResultErrorCode`
1143411491
1143511492 - `"invalid_tool_input"`
from line 11501
1144411501
1144511502 - `"request_too_large"`
1144611503
11447 - `type: "web_search_tool_result_error"`
11448
11449 default: web_search_tool_result_error
11450
1145111504 - `array of BetaWebSearchResultBlock`
1145211505
11506 - `type: "web_search_result"`
11507
11508 default: web_search_result
11509
1145311510 - `encrypted_content: string`
1145411511
1145511512 - `page_age: string or null`
1145611513
1145711514 - `title: string`
1145811515
11459 - `type: "web_search_result"`
11460
11461 default: web_search_result
11462
1146311516 - `url: string`
1146411517
1146511518 - `tool_use_id: string`
1146611519
1146711520 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1146811521
11469 - `type: "web_search_tool_result"`
11470
11471 default: web_search_tool_result
11472
1147311522 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
1147411523
1147511524 Tool invocation directly from the model.
from line 11535
1148611535
1148711536 - `BetaWebFetchToolResultBlock object`
1148811537
11538 - `type: "web_fetch_tool_result"`
11539
11540 default: web_fetch_tool_result
11541
1148911542 - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
1149011543
1149111544 - `BetaWebFetchToolResultErrorBlock object`
1149211545
11546 - `type: "web_fetch_tool_result_error"`
11547
11548 default: web_fetch_tool_result_error
11549
1149311550 - `error_code: BetaWebFetchToolResultErrorCode`
1149411551
1149511552 - `"invalid_tool_input"`
from line 11567
1151011567
1151111568 - `"unavailable"`
1151211569
11513 - `type: "web_fetch_tool_result_error"`
11514
11515 default: web_fetch_tool_result_error
11570 - `"content_too_large"`
1151611571
1151711572 - `BetaWebFetchBlock object`
1151811573
11574 - `type: "web_fetch_result"`
11575
11576 default: web_fetch_result
11577
1151911578 - `content: BetaDocumentBlock`
1152011579
11580 - `type: "document"`
11581
11582 default: document
11583
1152111584 - `citations: BetaCitationConfig or null`
1152211585
1152311586 Citation configuration for the document
from line 11593
1153011593
1153111594 - `BetaBase64PDFSource object`
1153211595
11596 - `type: "base64"`
11597
1153311598 - `data: string`
1153411599
1153511600 format: byte
1153611601
1153711602 - `media_type: "application/pdf"`
1153811603
11539 - `type: "base64"`
11540
1154111604 - `BetaPlainTextSource object`
1154211605
11606 - `type: "text"`
11607
1154311608 - `data: string`
1154411609
1154511610 - `media_type: "text/plain"`
1154611611
11547 - `type: "text"`
11548
1154911612 - `title: string or null`
1155011613
1155111614 The title of the document
1155211615
11553 - `type: "document"`
11554
11555 default: document
11556
1155711616 - `retrieved_at: string or null`
1155811617
1155911618 ISO 8601 timestamp when the content was retrieved
1156011619
11561 - `type: "web_fetch_result"`
11562
11563 default: web_fetch_result
11564
1156511620 - `url: string`
1156611621
1156711622 Fetched content URL
from line 11625
1157011625
1157111626 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1157211627
11573 - `type: "web_fetch_tool_result"`
11574
11575 default: web_fetch_tool_result
11576
1157711628 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
1157811629
1157911630 Tool invocation directly from the model.
from line 11641
1159011641
1159111642 - `BetaAdvisorToolResultBlock object`
1159211643
11644 - `type: "advisor_tool_result"`
11645
11646 default: advisor_tool_result
11647
1159311648 - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`
1159411649
1159511650 - `BetaAdvisorToolResultError object`
1159611651
11652 - `type: "advisor_tool_result_error"`
11653
11654 default: advisor_tool_result_error
11655
1159711656 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
1159811657
1159911658 - `"max_uses_exceeded"`
from line 11669
1161011669
1161111670 - `"model_not_found"`
1161211671
11613 - `type: "advisor_tool_result_error"`
11614
11615 default: advisor_tool_result_error
11616
1161711672 - `BetaAdvisorResultBlock object`
1161811673
11674 - `type: "advisor_result"`
11675
11676 default: advisor_result
11677
1161911678 - `stop_reason: string or null`
1162011679
1162111680 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.
1162211681
1162311682 - `text: string`
1162411683
11625 - `type: "advisor_result"`
11626
11627 default: advisor_result
11628
1162911684 - `BetaAdvisorRedactedResultBlock object`
1163011685
11686 - `type: "advisor_redacted_result"`
11687
11688 default: advisor_redacted_result
11689
1163111690 - `encrypted_content: string`
1163211691
1163311692 Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
from line 11695
1163611695
1163711696 The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).
1163811697
11639 - `type: "advisor_redacted_result"`
11640
11641 default: advisor_redacted_result
11642
1164311698 - `tool_use_id: string`
1164411699
1164511700 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1164611701
11647 - `type: "advisor_tool_result"`
11648
11649 default: advisor_tool_result
11650
1165111702 - `BetaCodeExecutionToolResultBlock object`
1165211703
11704 - `type: "code_execution_tool_result"`
11705
11706 default: code_execution_tool_result
11707
1165311708 - `content: BetaCodeExecutionToolResultBlockContent`
1165411709
1165511710 Code execution result with encrypted stdout for PFC + web_search results.
1165611711
1165711712 - `BetaCodeExecutionToolResultError object`
1165811713
11714 - `type: "code_execution_tool_result_error"`
11715
11716 default: code_execution_tool_result_error
11717
1165911718 - `error_code: BetaCodeExecutionToolResultErrorCode`
1166011719
1166111720 - `"invalid_tool_input"`
from line 11725
1166611725
1166711726 - `"execution_time_exceeded"`
1166811727
11669 - `type: "code_execution_tool_result_error"`
11670
11671 default: code_execution_tool_result_error
11672
1167311728 - `BetaCodeExecutionResultBlock object`
1167411729
11730 - `type: "code_execution_result"`
11731
11732 default: code_execution_result
11733
1167511734 - `content: array of BetaCodeExecutionOutputBlock`
1167611735
11736 - `type: "code_execution_output"`
11737
11738 default: code_execution_output
11739
1167711740 - `file_id: string`
1167811741
11742 - `return_code: number`
11743
11744 - `stderr: string`
11745
11746 - `stdout: string`
11747
11748 - `BetaEncryptedCodeExecutionResultBlock object`
11749
11750 Code execution result with encrypted stdout for PFC + web_search results.
11751
11752 - `type: "encrypted_code_execution_result"`
11753
11754 default: encrypted_code_execution_result
11755
11756 - `content: array of BetaCodeExecutionOutputBlock`
11757
1167911758 - `type: "code_execution_output"`
1168011759
1168111760 default: code_execution_output
1168211761
11762 - `file_id: string`
11763
11764 - `encrypted_stdout: string`
11765
1168311766 - `return_code: number`
1168411767
1168511768 - `stderr: string`
1168611769
11770 - `tool_use_id: string`
11771
11772 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
11773
11774 - `BetaBashCodeExecutionToolResultBlock object`
11775
11776 - `type: "bash_code_execution_tool_result"`
11777
11778 default: bash_code_execution_tool_result
11779
11780 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
11781
11782 - `BetaBashCodeExecutionToolResultError object`
11783
11784 - `type: "bash_code_execution_tool_result_error"`
11785
11786 default: bash_code_execution_tool_result_error
11787
11788 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
11789
11790 - `"invalid_tool_input"`
11791
11792 - `"unavailable"`
11793
11794 - `"too_many_requests"`
11795
11796 - `"execution_time_exceeded"`
11797
11798 - `"output_file_too_large"`
11799
11800 - `BetaBashCodeExecutionResultBlock object`
11801
11802 - `type: "bash_code_execution_result"`
11803
11804 default: bash_code_execution_result
11805
11806 - `content: array of BetaBashCodeExecutionOutputBlock`
11807
11808 - `type: "bash_code_execution_output"`
11809
11810 default: bash_code_execution_output
11811
11812 - `file_id: string`
11813
11814 - `return_code: number`
11815
11816 - `stderr: string`
11817
1168711818 - `stdout: string`
1168811819
11689 - `type: "code_execution_result"`
11690
11691 default: code_execution_result
11692
11693 - `BetaEncryptedCodeExecutionResultBlock object`
11694
11695 Code execution result with encrypted stdout for PFC + web_search results.
11696
11697 - `content: array of BetaCodeExecutionOutputBlock`
11698
11699 - `file_id: string`
11700
11701 - `type: "code_execution_output"`
11702
11703 default: code_execution_output
11704
11705 - `encrypted_stdout: string`
11706
11707 - `return_code: number`
11708
11709 - `stderr: string`
11710
11711 - `type: "encrypted_code_execution_result"`
11712
11713 default: encrypted_code_execution_result
11714
1171511820 - `tool_use_id: string`
1171611821
1171711822 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1171811823
11719 - `type: "code_execution_tool_result"`
11720
11721 default: code_execution_tool_result
11722
11723 - `BetaBashCodeExecutionToolResultBlock object`
11724
11725 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
11726
11727 - `BetaBashCodeExecutionToolResultError object`
11824 - `BetaTextEditorCodeExecutionToolResultBlock object`
11825
11826 - `type: "text_editor_code_execution_tool_result"`
11827
11828 default: text_editor_code_execution_tool_result
11829
11830 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
11831
11832 - `BetaTextEditorCodeExecutionToolResultError object`
11833
11834 - `type: "text_editor_code_execution_tool_result_error"`
11835
11836 default: text_editor_code_execution_tool_result_error
1172811837
1172911838 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1173011839
from line 11845
1173611845
1173711846 - `"execution_time_exceeded"`
1173811847
11739 - `"output_file_too_large"`
11740
11741 - `type: "bash_code_execution_tool_result_error"`
11742
11743 default: bash_code_execution_tool_result_error
11744
11745 - `BetaBashCodeExecutionResultBlock object`
11746
11747 - `content: array of BetaBashCodeExecutionOutputBlock`
11748
11749 - `file_id: string`
11750
11751 - `type: "bash_code_execution_output"`
11752
11753 default: bash_code_execution_output
11754
11755 - `return_code: number`
11756
11757 - `stderr: string`
11758
11759 - `stdout: string`
11760
11761 - `type: "bash_code_execution_result"`
11762
11763 default: bash_code_execution_result
11848 - `"file_not_found"`
11849
11850 - `error_message: string or null`
11851
11852 - `BetaTextEditorCodeExecutionViewResultBlock object`
11853
11854 - `type: "text_editor_code_execution_view_result"`
11855
11856 default: text_editor_code_execution_view_result
11857
11858 - `content: string`
11859
11860 - `file_type: "text" or "image" or "pdf"`
11861
11862 - `"text"`
11863
11864 - `"image"`
11865
11866 - `"pdf"`
11867
11868 - `num_lines: number or null`
11869
11870 - `start_line: number or null`
11871
11872 - `total_lines: number or null`
11873
11874 - `BetaTextEditorCodeExecutionCreateResultBlock object`
11875
11876 - `type: "text_editor_code_execution_create_result"`
11877
11878 default: text_editor_code_execution_create_result
11879
11880 - `is_file_update: boolean`
11881
11882 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
11883
11884 - `type: "text_editor_code_execution_str_replace_result"`
11885
11886 default: text_editor_code_execution_str_replace_result
11887
11888 - `lines: array of string or null`
11889
11890 - `new_lines: number or null`
11891
11892 - `new_start: number or null`
11893
11894 - `old_lines: number or null`
11895
11896 - `old_start: number or null`
1176411897
1176511898 - `tool_use_id: string`
1176611899
1176711900 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1176811901
11769 - `type: "bash_code_execution_tool_result"`
11770
11771 default: bash_code_execution_tool_result
11772
11773 - `BetaTextEditorCodeExecutionToolResultBlock object`
11774
11775 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
11776
11777 - `BetaTextEditorCodeExecutionToolResultError object`
11778
11779 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
11902 - `BetaToolSearchToolResultBlock object`
11903
11904 - `type: "tool_search_tool_result"`
11905
11906 default: tool_search_tool_result
11907
11908 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
11909
11910 - `BetaToolSearchToolResultError object`
11911
11912 - `type: "tool_search_tool_result_error"`
11913
11914 default: tool_search_tool_result_error
11915
11916 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
1178011917
1178111918 - `"invalid_tool_input"`
1178211919
from line 11923
1178611923
1178711924 - `"execution_time_exceeded"`
1178811925
11789 - `"file_not_found"`
11790
1179111926 - `error_message: string or null`
1179211927
11793 - `type: "text_editor_code_execution_tool_result_error"`
11794
11795 default: text_editor_code_execution_tool_result_error
11796
11797 - `BetaTextEditorCodeExecutionViewResultBlock object`
11798
11799 - `content: string`
11800
11801 - `file_type: "text" or "image" or "pdf"`
11802
11803 - `"text"`
11804
11805 - `"image"`
11806
11807 - `"pdf"`
11808
11809 - `num_lines: number or null`
11810
11811 - `start_line: number or null`
11812
11813 - `total_lines: number or null`
11814
11815 - `type: "text_editor_code_execution_view_result"`
11816
11817 default: text_editor_code_execution_view_result
11818
11819 - `BetaTextEditorCodeExecutionCreateResultBlock object`
11820
11821 - `is_file_update: boolean`
11822
11823 - `type: "text_editor_code_execution_create_result"`
11824
11825 default: text_editor_code_execution_create_result
11826
11827 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
11828
11829 - `lines: array of string or null`
11830
11831 - `new_lines: number or null`
11832
11833 - `new_start: number or null`
11834
11835 - `old_lines: number or null`
11836
11837 - `old_start: number or null`
11838
11839 - `type: "text_editor_code_execution_str_replace_result"`
11840
11841 default: text_editor_code_execution_str_replace_result
11928 - `BetaToolSearchToolSearchResultBlock object`
11929
11930 - `type: "tool_search_tool_search_result"`
11931
11932 default: tool_search_tool_search_result
11933
11934 - `tool_references: array of BetaToolReferenceBlock`
11935
11936 - `type: "tool_reference"`
11937
11938 default: tool_reference
11939
11940 - `tool_name: string`
11941
11942 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1184211943
1184311944 - `tool_use_id: string`
1184411945
1184511946 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1184611947
11847 - `type: "text_editor_code_execution_tool_result"`
11848
11849 default: text_editor_code_execution_tool_result
11850
11851 - `BetaToolSearchToolResultBlock object`
11852
11853 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
11854
11855 - `BetaToolSearchToolResultError object`
11856
11857 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
11858
11859 - `"invalid_tool_input"`
11860
11861 - `"unavailable"`
11862
11863 - `"too_many_requests"`
11864
11865 - `"execution_time_exceeded"`
11866
11867 - `error_message: string or null`
11868
11869 - `type: "tool_search_tool_result_error"`
11870
11871 default: tool_search_tool_result_error
11872
11873 - `BetaToolSearchToolSearchResultBlock object`
11874
11875 - `tool_references: array of BetaToolReferenceBlock`
11876
11877 - `tool_name: string`
11878
11879 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
11880
11881 - `type: "tool_reference"`
11882
11883 default: tool_reference
11884
11885 - `type: "tool_search_tool_search_result"`
11886
11887 default: tool_search_tool_search_result
11948 - `BetaMCPToolUseBlock object`
11949
11950 - `type: "mcp_tool_use"`
11951
11952 default: mcp_tool_use
11953
11954 - `id: string`
11955
11956 pattern: ^[a-zA-Z0-9_-]+$
11957
11958 - `input: map[unknown]`
11959
11960 - `name: string`
11961
11962 The name of the MCP tool
11963
11964 - `server_name: string`
11965
11966 The name of the MCP server
11967
11968 - `BetaMCPToolResultBlock object`
11969
11970 - `type: "mcp_tool_result"`
11971
11972 default: mcp_tool_result
11973
11974 - `content: string or array of BetaTextBlock`
11975
11976 - `string`
11977
11978 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
11979
11980 - `type: "text"`
11981
11982 default: text
11983
11984 - `citations: array of BetaTextCitation or null`
11985
11986 Citations supporting the text block.
11987
11988 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`.
11989
11990 - `text: string`
11991
11992 minLength: 0
11993
11994 - `is_error: boolean`
11995
11996 default: false
1188811997
1188911998 - `tool_use_id: string`
1189011999
11891 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
11892
11893 - `type: "tool_search_tool_result"`
11894
11895 default: tool_search_tool_result
11896
11897 - `BetaMCPToolUseBlock object`
11898
11899 - `id: string`
11900
1190112000 pattern: ^[a-zA-Z0-9_-]+$
1190212001
11903 - `input: map[unknown]`
11904
11905 - `name: string`
11906
11907 The name of the MCP tool
11908
11909 - `server_name: string`
11910
11911 The name of the MCP server
11912
11913 - `type: "mcp_tool_use"`
11914
11915 default: mcp_tool_use
11916
11917 - `BetaMCPToolResultBlock object`
11918
11919 - `content: string or array of BetaTextBlock`
11920
11921 - `string`
11922
11923 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
11924
11925 - `citations: array of BetaTextCitation or null`
11926
11927 Citations supporting the text block.
11928
11929 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`.
11930
11931 - `text: string`
11932
11933 maxLength: 5000000, minLength: 0
11934
11935 - `type: "text"`
11936
11937 default: text
11938
11939 - `is_error: boolean`
11940
11941 default: false
11942
11943 - `tool_use_id: string`
11944
11945 pattern: ^[a-zA-Z0-9_-]+$
11946
11947 - `type: "mcp_tool_result"`
11948
11949 default: mcp_tool_result
11950
1195112002 - `BetaContainerUploadBlock object`
1195212003
1195312004 Response model for a file uploaded to the container.
1195412005
12006 - `type: "container_upload"`
12007
12008 default: container_upload
12009
1195512010 - `file_id: string`
11956
11957 - `type: "container_upload"`
11958
11959 default: container_upload
1196012011
1196112012 - `BetaCompactionBlock object`
1196212013
from line 12017
1196612017 summary (e.g., malformed output from the model). Clients may round-trip
1196712018 compaction blocks with null content; the server treats them as no-ops.
1196812019
12020 - `type: "compaction"`
12021
12022 default: compaction
12023
1196912024 - `content: string or null`
1197012025
1197112026 Summary of compacted content, or null if compaction failed
from line 12028
1197312028 - `encrypted_content: string or null`
1197412029
1197512030 Opaque metadata from prior compaction, to be round-tripped verbatim
11976
11977 - `type: "compaction"`
11978
11979 default: compaction
1198012031
1198112032 - `BetaFallbackBlock object`
1198212033
from line 12043
1199212043 arrives via the standard `content_block_start` / `content_block_stop`
1199312044 pair and carries no deltas.
1199412045
12046 - `type: "fallback"`
12047
12048 default: fallback
12049
1199512050 - `from: BetaFallbackInfo`
1199612051
1199712052 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 12141
1208612141
1208712142 What caused the `from` model to hand over at this hop.
1208812143
12144 - `type: "refusal"`
12145
12146 default: refusal
12147
1208912148 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
1209012149
1209112150 The policy category that triggered a refusal.
from line 12169
1211012169
1211112170 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
1211212171
12113 - `type: "refusal"`
12114
12115 default: refusal
12116
12117 - `type: "fallback"`
12118
12119 default: fallback
12120
1212112172 - `context_management: BetaContextManagementResponse or null`
1212212173
1212312174 Context management response.
from line 12181
1213012181
1213112182 - `BetaClearToolUses20250919EditResponse object`
1213212183
12184 - `type: "clear_tool_uses_20250919"`
12185
12186 The type of context management edit applied.
12187
12188 default: clear_tool_uses_20250919
12189
1213312190 - `cleared_input_tokens: number`
1213412191
1213512192 Number of input tokens cleared by this edit.
from line 12199
1214212199
1214312200 minimum: 0
1214412201
12145 - `type: "clear_tool_uses_20250919"`
12202 - `BetaClearThinking20251015EditResponse object`
12203
12204 - `type: "clear_thinking_20251015"`
1214612205
1214712206 The type of context management edit applied.
1214812207
12149 default: clear_tool_uses_20250919
12150
12151 - `BetaClearThinking20251015EditResponse object`
12208 default: clear_thinking_20251015
1215212209
1215312210 - `cleared_input_tokens: number`
1215412211
from line 12218
1216112218 Number of thinking turns that were cleared.
1216212219
1216312220 minimum: 0
12164
12165 - `type: "clear_thinking_20251015"`
12166
12167 The type of context management edit applied.
12168
12169 default: clear_thinking_20251015
1217012221
1217112222 - `diagnostics: BetaDiagnostics or null`
1217212223
from line 12230
1217912230
1218012231 - `BetaCacheMissModelChanged object`
1218112232
12233 - `type: "model_changed"`
12234
12235 default: model_changed
12236
1218212237 - `cache_missed_input_tokens: number`
1218312238
1218412239 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
1218512240
12186 - `type: "model_changed"`
12187
12188 default: model_changed
12189
1219012241 - `BetaCacheMissSystemChanged object`
1219112242
12243 - `type: "system_changed"`
12244
12245 default: system_changed
12246
1219212247 - `cache_missed_input_tokens: number`
1219312248
1219412249 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
1219512250
12196 - `type: "system_changed"`
12197
12198 default: system_changed
12199
1220012251 - `BetaCacheMissToolsChanged object`
1220112252
12253 - `type: "tools_changed"`
12254
12255 default: tools_changed
12256
1220212257 - `cache_missed_input_tokens: number`
1220312258
1220412259 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
1220512260
12206 - `type: "tools_changed"`
12207
12208 default: tools_changed
12209
1221012261 - `BetaCacheMissMessagesChanged object`
1221112262
12263 - `type: "messages_changed"`
12264
12265 default: messages_changed
12266
1221212267 - `cache_missed_input_tokens: number`
1221312268
1221412269 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
1221512270
12216 - `type: "messages_changed"`
12217
12218 default: messages_changed
12219
1222012271 - `BetaCacheMissPreviousMessageNotFound object`
1222112272
1222212273 - `type: "previous_message_not_found"`
from line 12297
1224612297 - `stop_details: BetaRefusalStopDetails or null`
1224712298
1224812299 Structured information about a refusal.
12300
12301 - `type: "refusal"`
12302
12303 default: refusal
1224912304
1225012305 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
1225112306
from line 12381
1232612381
1232712382 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.
1232812383
12329 - `type: "refusal"`
12330
12331 default: refusal
12332
1233312384 - `stop_reason: BetaStopReason or null`
1233412385
1233512386 The reason that we stopped.
from line 12419
1236812419
1236912420 This value will be a non-null string if one of your custom stop sequences was generated.
1237012421
12371 - `type: "message"`
12372
12373 Object type.
12374
12375 For Messages, this is always `"message"`.
12376
12377 default: message
12378
1237912422 - `usage: BetaUsage`
1238012423
1238112424 Billing and rate-limit usage.
from line 12485
1244212485
1244312486 No reprice was applied; `reason` says why.
1244412487
12488 - `type: "not_applied"`
12489
12490 default: not_applied
12491
1244512492 - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`
1244612493
1244712494 Why the reprice was not applied.
from line 12519
1247212519 - `"wrong_platform"`
1247312520
1247412521 - `"wrong_workspace"`
12475
12476 - `type: "not_applied"`
12477
12478 default: not_applied
1247912522
1248012523 - `remove_to_redeem: optional array of string or null`
1248112524
from line 12557
1251412557
1251512558 Token usage for a sampling iteration.
1251612559
12560 - `type: "message"`
12561
12562 Usage for a sampling iteration
12563
12564 default: message
12565
1251712566 - `cache_creation: BetaCacheCreation or null`
1251812567
1251912568 Breakdown of cached tokens by TTL
from line 12597
1254812597
1254912598 minimum: 0
1255012599
12551 - `type: "message"`
12552
12553 Usage for a sampling iteration
12554
12555 default: message
12556
1255712600 - `BetaCompactionIterationUsage object`
1255812601
1255912602 Token usage for a compaction iteration.
1256012603
12604 - `type: "compaction"`
12605
12606 Usage for a compaction iteration
12607
12608 default: compaction
12609
1256112610 - `cache_creation: BetaCacheCreation or null`
1256212611
1256312612 Breakdown of cached tokens by TTL
from line 12635
1258612635
1258712636 minimum: 0
1258812637
12589 - `type: "compaction"`
12590
12591 Usage for a compaction iteration
12592
12593 default: compaction
12594
1259512638 - `BetaAdvisorMessageIterationUsage object`
1259612639
1259712640 Token usage for an advisor sub-inference iteration.
1259812641
12642 - `type: "advisor_message"`
12643
12644 Usage for an advisor sub-inference iteration
12645
12646 default: advisor_message
12647
1259912648 - `cache_creation: BetaCacheCreation or null`
1260012649
1260112650 Breakdown of cached tokens by TTL
from line 12678
1262912678 The number of output tokens which were used.
1263012679
1263112680 minimum: 0
12632
12633 - `type: "advisor_message"`
12634
12635 Usage for an advisor sub-inference iteration
12636
12637 default: advisor_message
1263812681
1263912682 - `BetaFallbackMessageIterationUsage object`
1264012683
from line 12688
1264512688 a fallback model served the response is signalled by the presence of this
1264612689 entry in `usage.iterations`.
1264712690
12691 - `type: "fallback_message"`
12692
12693 Usage for the fallback-model attempt that served the response
12694
12695 default: fallback_message
12696
1264812697 - `cache_creation: BetaCacheCreation or null`
1264912698
1265012699 Breakdown of cached tokens by TTL
from line 12727
1267812727 The number of output tokens which were used.
1267912728
1268012729 minimum: 0
12681
12682 - `type: "fallback_message"`
12683
12684 Usage for the fallback-model attempt that served the response
12685
12686 default: fallback_message
1268712730
1268812731 - `output_tokens: number`
1268912732
from line 12807
1276412807 the final `message_delta` event carries it only when a server-side model
1276512808 fallback happened mid-stream, in which case it holds the serving model's
1276612809 entries and replaces the one in `message_start`.
12810
12811 - `type: "thinking_dropped"`
12812
12813 Always `thinking_dropped` for this entry type.
12814
12815 default: thinking_dropped
1276712816
1276812817 - `path: string`
1276912818
from line 12843
1279412843 - `"organization_binding_mismatch"`
1279512844
1279612845 - `"end_user_binding_mismatch"`
12797
12798 - `type: "thinking_dropped"`
12799
12800 Always `thinking_dropped` for this entry type.
12801
12802 default: thinking_dropped
12803
12804 - `type: "succeeded"`
12805
12806 default: succeeded
1280712846