Sweep 22 Sep 2026 · 17:19Z Build v2.1.280 501 read Stable v2.1.267 Latest v2.1.280 Next v2.1.280 Feeds RSS JSON llms.txt Unofficial
One capture · api

One read of Claude Developer Platform

519 pages moved out of 628 read.

api-20260910T183729Z

Pages moved 519 significant first
Pages read 628 in this capture
Captured 18:37 UTC
Corpus hash 29858da7c2f1 corpus-hash

What this read moved

201–225 of 519

This capture is too large to show at once. Changes 201-225 of 519 are below, significant first; the rest are on the following screens.

api/beta/messages/batches Changed · +2477 / -2438 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 

api/beta/messages/batches/cancel Changed · +18 / -9 lines

from line 1
1---
2title: Cancel a Message Batch
3url: https://platform.claude.com/docs/en/api/beta/messages/batches/cancel
4---
5 
16# Cancel a Message Batch
27 
38**POST** `/v1/messages/batches/{message_batch_id}/cancel`
from line 27
2227 
2328 - `string`
2429 
25 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
30 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2631 
2732 - `"message-batches-2024-09-24"`
2833 
from line 75
7075 
7176 - `"user-profiles-2026-08-18"`
7277 
78 - `"user-profiles-2026-09-04"`
79 
7380 - `"advisor-tool-2026-03-01"`
7481 
7582 - `"managed-agents-2026-04-01"`
from line 119
112119 
113120 - `"mid-conversation-system-clear-at-2026-08-21"`
114121 
122- `"anthropic-workspace-id": optional string`
123 
115124## Returns
116125 
117126- `BetaMessageBatch object`
118127 
128 - `type: "message_batch"`
129 
130 Object type.
131 
132 For Message Batches, this is always `"message_batch"`.
133 
134 default: message_batch
135 
119136 - `id: string`
120137 
121138 Unique object identifier.
from line 230
213230 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
214231 
215232 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.
216 
217 - `type: "message_batch"`
218 
219 Object type.
220 
221 For Message Batches, this is always `"message_batch"`.
222 
223 default: message_batch
224233 
225234## Example
226235 

api/beta/messages/batches/create Changed · +540 / -529 lines

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

from line 1
1---
2title: Create a Message Batch
3url: https://platform.claude.com/docs/en/api/beta/messages/batches/create
4---
5 
16# Create a Message Batch
27 
38**POST** `/v1/messages/batches`
from line 21
1621 
1722 - `string`
1823 
19 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
24 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2025 
2126 - `"message-batches-2024-09-24"`
2227 
from line 69
6469 
6570 - `"user-profiles-2026-08-18"`
6671 
72 - `"user-profiles-2026-09-04"`
73 
6774 - `"advisor-tool-2026-03-01"`
6875 
6976 - `"managed-agents-2026-04-01"`
from line 116
109116- `"anthropic-user-profile-id": optional string`
110117 
111118 The user profile ID to attribute 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.
119 
120- `"anthropic-workspace-id": optional string`
112121 
113122## Body parameters
114123 
from line 212
203212 
204213 - `BetaTextBlockParam object`
205214 
215 - `type: "text"`
216 
206217 - `text: string`
207218 
208219 minLength: 1
209 
210 - `type: "text"`
211220 
212221 - `cache_control: optional BetaCacheControlEphemeral or null`
213222 
from line 243
234243 
235244 - `BetaCitationCharLocationParam object`
236245 
246 - `type: "char_location"`
247 
237248 - `cited_text: string`
238249 
239250 - `document_index: number`
from line 261
250261 
251262 minimum: 0
252263 
253 - `type: "char_location"`
254 
255264 - `BetaCitationPageLocationParam object`
256265 
266 - `type: "page_location"`
267 
257268 - `cited_text: string`
258269 
259270 - `document_index: number`
from line 281
270281 
271282 minimum: 1
272283 
273 - `type: "page_location"`
274 
275284 - `BetaCitationContentBlockLocationParam object`
276285 
286 - `type: "content_block_location"`
287 
277288 - `cited_text: string`
278289 
279290 The full text of the cited block range, concatenated.
from line 311
300311 
301312 minimum: 0
302313 
303 - `type: "content_block_location"`
304 
305314 - `BetaCitationWebSearchResultLocationParam object`
306315 
316 - `type: "web_search_result_location"`
317 
307318 - `cited_text: string`
308319 
309320 - `encrypted_index: string`
from line 323
312323 
313324 maxLength: 512, minLength: 1
314325 
315 - `type: "web_search_result_location"`
316 
317326 - `url: string`
318327 
319328 minLength: 1
320329 
321330 - `BetaCitationSearchResultLocationParam object`
322331 
332 - `type: "search_result_location"`
333 
323334 - `cited_text: string`
324335 
325336 The full text of the cited block range, concatenated.
from line 361
350361 
351362 - `title: string or null`
352363 
353 - `type: "search_result_location"`
354 
355364 - `BetaImageBlockParam object`
356365 
366 - `type: "image"`
367 
357368 - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
358369 
359370 - `BetaBase64ImageSource object`
360371 
372 - `type: "base64"`
373 
361374 - `data: string`
362375 
363376 format: byte
from line 385
372385 
373386 - `"image/webp"`
374387 
388 - `BetaURLImageSource object`
389 
390 - `type: "url"`
391 
392 - `url: string`
393 
394 - `BetaFileImageSource object`
395 
396 - `type: "file"`
397 
398 - `file_id: string`
399 
400 - `cache_control: optional BetaCacheControlEphemeral or null`
401 
402 Create a cache control breakpoint at this content block.
403 
404 - `transformations: optional BetaImageTransformationsParam or null`
405 
406 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.
407 
408 - `oversized_image: optional "downsize" or "error"`
409 
410 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.
411 
412 - `"downsize"`
413 
414 - `"error"`
415 
416 - `BetaRequestDocumentBlock object`
417 
418 - `type: "document"`
419 
420 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
421 
422 - `BetaBase64PDFSource object`
423 
375424 - `type: "base64"`
376425 
377 - `BetaURLImageSource object`
426 - `data: string`
427 
428 format: byte
429 
430 - `media_type: "application/pdf"`
431 
432 - `BetaPlainTextSource object`
433 
434 - `type: "text"`
435 
436 - `data: string`
437 
438 - `media_type: "text/plain"`
439 
440 - `BetaContentBlockSource object`
441 
442 - `type: "content"`
443 
444 - `content: string or array of BetaContentBlockSourceContent`
445 
446 - `string`
447 
448 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
449 
450 - `BetaTextBlockParam object`
451 
452 - `BetaImageBlockParam object`
453 
454 - `BetaURLPDFSource object`
378455 
379456 - `type: "url"`
380457 
381458 - `url: string`
382459 
383 - `BetaFileImageSource object`
460 - `BetaFileDocumentSource object`
461 
462 - `type: "file"`
384463 
385464 - `file_id: string`
386465 
387 - `type: "file"`
388 
389 - `type: "image"`
390 
391466 - `cache_control: optional BetaCacheControlEphemeral or null`
392467 
393468 Create a cache control breakpoint at this content block.
394469 
395 - `transformations: optional BetaImageTransformationsParam or null`
396 
397 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.
398 
399 - `oversized_image: optional "downsize" or "error"`
400 
401 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.
402 
403 - `"downsize"`
404 
405 - `"error"`
406 
407 - `BetaRequestDocumentBlock object`
408 
409 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
410 
411 - `BetaBase64PDFSource object`
412 
413 - `data: string`
414 
415 format: byte
416 
417 - `media_type: "application/pdf"`
418 
419 - `type: "base64"`
420 
421 - `BetaPlainTextSource object`
422 
423 - `data: string`
424 
425 - `media_type: "text/plain"`
426 
427 - `type: "text"`
428 
429 - `BetaContentBlockSource object`
430 
431 - `content: string or array of BetaContentBlockSourceContent`
432 
433 - `string`
434 
435 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
436 
437 - `BetaTextBlockParam object`
438 
439 - `BetaImageBlockParam object`
440 
441 - `type: "content"`
442 
443 - `BetaURLPDFSource object`
444 
445 - `type: "url"`
446 
447 - `url: string`
448 
449 - `BetaFileDocumentSource object`
450 
451 - `file_id: string`
452 
453 - `type: "file"`
454 
455 - `type: "document"`
470 - `citations: optional BetaCitationsConfigParam or null`
471 
472 - `enabled: optional boolean`
473 
474 - `context: optional string or null`
475 
476 minLength: 1
477 
478 - `title: optional string or null`
479 
480 maxLength: 500, minLength: 1
481 
482 - `BetaSearchResultBlockParam object`
483 
484 - `type: "search_result"`
485 
486 - `content: array of BetaTextBlockParam`
487 
488 - `type: "text"`
489 
490 - `text: string`
491 
492 minLength: 1
493 
494 - `cache_control: optional BetaCacheControlEphemeral or null`
495 
496 Create a cache control breakpoint at this content block.
497 
498 - `citations: optional array of BetaTextCitationParam or null`
499 
500 - `source: string`
501 
502 - `title: string`
456503 
457504 - `cache_control: optional BetaCacheControlEphemeral or null`
458505 
459506 Create a cache control breakpoint at this content block.
460507 
461 - `citations: optional BetaCitationsConfigParam or null`
462 
463 - `enabled: optional boolean`
464 
465 - `context: optional string or null`
466 
467 minLength: 1
468 
469 - `title: optional string or null`
470 
471 maxLength: 500, minLength: 1
472 
473 - `BetaSearchResultBlockParam object`
474 
475 - `content: array of BetaTextBlockParam`
476 
477 - `text: string`
478 
479 minLength: 1
480 
481 - `type: "text"`
482 
483 - `cache_control: optional BetaCacheControlEphemeral or null`
484 
485 Create a cache control breakpoint at this content block.
486 
487 - `citations: optional array of BetaTextCitationParam or null`
488 
489 - `source: string`
490 
491 - `title: string`
492 
493 - `type: "search_result"`
508 - `citations: optional BetaCitationsConfigParam`
509 
510 - `BetaThinkingBlockParam object`
511 
512 - `type: "thinking"`
513 
514 - `signature: string`
515 
516 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.
517 
518 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
519 
520 - `thinking: string`
521 
522 The `thinking` text of this block as returned by the API.
523 
524 - `BetaRedactedThinkingBlockParam object`
525 
526 - `type: "redacted_thinking"`
527 
528 - `data: string`
529 
530 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.
531 
532 - `BetaToolUseBlockParam object`
533 
534 - `type: "tool_use"`
535 
536 - `id: string`
537 
538 pattern: ^[a-zA-Z0-9_-]+$
539 
540 - `input: map[unknown]`
541 
542 - `name: string`
543 
544 maxLength: 200, minLength: 1
494545 
495546 - `cache_control: optional BetaCacheControlEphemeral or null`
496547 
497548 Create a cache control breakpoint at this content block.
498549 
499 - `citations: optional BetaCitationsConfigParam`
500 
501 - `BetaThinkingBlockParam object`
502 
503 - `signature: string`
504 
505 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.
506 
507 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
508 
509 - `thinking: string`
510 
511 The `thinking` text of this block as returned by the API.
512 
513 - `type: "thinking"`
514 
515 - `BetaRedactedThinkingBlockParam object`
516 
517 - `data: string`
518 
519 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.
520 
521 - `type: "redacted_thinking"`
522 
523 - `BetaToolUseBlockParam object`
524 
525 - `id: string`
550 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
551 
552 Tool invocation directly from the model.
553 
554 - `BetaDirectCaller object`
555 
556 Tool invocation directly from the model.
557 
558 - `type: "direct"`
559 
560 - `BetaServerToolCaller object`
561 
562 Tool invocation generated by a server-side tool.
563 
564 - `type: "code_execution_20250825"`
565 
566 - `tool_id: string`
567 
568 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
569 
570 - `BetaServerToolCaller20260120 object`
571 
572 - `type: "code_execution_20260120"`
573 
574 - `tool_id: string`
575 
576 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
577 
578 - `toolset_name: optional string or null`
579 
580 For a toolset member tool_use, the toolset family this member belongs to.
581 
582 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
583 
584 - `BetaToolResultBlockParam object`
585 
586 - `type: "tool_result"`
587 
588 - `tool_use_id: string`
526589 
527590 pattern: ^[a-zA-Z0-9_-]+$
528591 
529 - `input: map[unknown]`
530 
531 - `name: string`
532 
533 maxLength: 200, minLength: 1
534 
535 - `type: "tool_use"`
536 
537592 - `cache_control: optional BetaCacheControlEphemeral or null`
538593 
539594 Create a cache control breakpoint at this content block.
540595 
541 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
542 
543 Tool invocation directly from the model.
544 
545 - `BetaDirectCaller object`
546 
547 Tool invocation directly from the model.
548 
549 - `type: "direct"`
550 
551 - `BetaServerToolCaller object`
552 
553 Tool invocation generated by a server-side tool.
554 
555 - `tool_id: string`
556 
557 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
558 
559 - `type: "code_execution_20250825"`
560 
561 - `BetaServerToolCaller20260120 object`
562 
563 - `tool_id: string`
564 
565 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
566 
567 - `type: "code_execution_20260120"`
568 
569 - `toolset_name: optional string or null`
570 
571 For a toolset member tool_use, the toolset family this member belongs to.
572 
573 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
574 
575 - `BetaToolResultBlockParam object`
576 
577 - `tool_use_id: string`
578 
579 pattern: ^[a-zA-Z0-9_-]+$
580 
581 - `type: "tool_result"`
582 
583 - `cache_control: optional BetaCacheControlEphemeral or null`
584 
585 Create a cache control breakpoint at this content block.
586 
587596 - `content: optional string or array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 3 more`
588597 
589598 - `string`
from line 611
602611 
603612 Tool reference block that can be included in tool_result content.
604613 
614 - `type: "tool_reference"`
615 
605616 - `tool_name: string`
606617 
607618 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
608 
609 - `type: "tool_reference"`
610619 
611620 - `cache_control: optional BetaCacheControlEphemeral or null`
612621 
from line 631
622631 browser toolset member `tool_use`. The server renders the
623632 model-visible text from it; the model never sees the raw fields.
624633 
634 - `type: "browser_state"`
635 
625636 - `tabs: array of BetaBrowserStateTabEntry`
626637 
627638 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 660
649660 - `active: optional boolean`
650661 
651662 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
652 
653 - `type: "browser_state"`
654663 
655664 - `cache_control: optional BetaCacheControlEphemeral or null`
656665 
from line 681
672681 during a failed call gets no deferred `tab_opened`; it simply appears
673682 in the next result's `tabs` inventory.
674683 
684 - `type: "tab_opened"`
685 
675686 - `tab_id: string`
676687 
677688 The `tab_id` of the opened tab, present in `tabs`.
678689 
679690 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
680691 
681 - `type: "tab_opened"`
682 
683692 - `BetaBrowserStateChangeDownloadStarted object`
684693 
685694 A file download that started during this call.
686695 
696 - `type: "download_started"`
697 
687698 - `download_id: string`
688699 
689700 The caller-assigned identifier for this download, stable across the state changes reporting it.
690701 
691702 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
692 
693 - `type: "download_started"`
694703 
695704 - `url: string`
696705 
from line 714
705714 `download_started`, when the download finished during the call that
706715 started it (at most one state change per `download_id` per result).
707716 
717 - `type: "download_completed"`
718 
708719 - `download_id: string`
709720 
710721 The caller-assigned identifier for this download, stable across the state changes reporting it.
711722 
712723 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
713724 
714 - `type: "download_completed"`
715 
716725 - `url: string`
717726 
718727 The final post-redirect URL the download was served from.
from line 744
735744 
736745 A file download that failed — or was cancelled — during this call.
737746 
747 - `type: "download_failed"`
748 
738749 - `download_id: string`
739750 
740751 The caller-assigned identifier for this download, stable across the state changes reporting it.
741752 
742753 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
743754 
744 - `type: "download_failed"`
745 
746755 - `url: string`
747756 
748757 The final post-redirect URL the download was served from.
from line 774
765774 
766775 - `BetaServerToolUseBlockParam object`
767776 
777 - `type: "server_tool_use"`
778 
768779 - `id: string`
769780 
770781 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 800
789800 
790801 - `"tool_search_tool_bm25"`
791802 
792 - `type: "server_tool_use"`
793 
794803 - `cache_control: optional BetaCacheControlEphemeral or null`
795804 
796805 Create a cache control breakpoint at this content block.
from line 820
811820 
812821 - `BetaWebSearchToolResultBlockParam object`
813822 
823 - `type: "web_search_tool_result"`
824 
814825 - `content: BetaWebSearchToolResultBlockParamContent`
815826 
816827 - `ResultBlock = array of BetaWebSearchResultBlockParam`
817828 
829 - `type: "web_search_result"`
830 
818831 - `encrypted_content: string`
819832 
820833 - `title: string`
821834 
822 - `type: "web_search_result"`
823 
824835 - `url: string`
825836 
826837 - `page_age: optional string or null`
827838 
828839 - `BetaWebSearchToolRequestError object`
829840 
841 - `type: "web_search_tool_result_error"`
842 
830843 - `error_code: BetaWebSearchToolResultErrorCode`
831844 
832845 - `"invalid_tool_input"`
from line 854
841854 
842855 - `"request_too_large"`
843856 
844 - `type: "web_search_tool_result_error"`
845 
846857 - `tool_use_id: string`
847858 
848859 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
849860 
850 - `type: "web_search_tool_result"`
851 
852861 - `cache_control: optional BetaCacheControlEphemeral or null`
853862 
854863 Create a cache control breakpoint at this content block.
from line 878
869878 
870879 - `BetaWebFetchToolResultBlockParam object`
871880 
881 - `type: "web_fetch_tool_result"`
882 
872883 - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
873884 
874885 - `BetaWebFetchToolResultErrorBlockParam object`
875886 
887 - `type: "web_fetch_tool_result_error"`
888 
876889 - `error_code: BetaWebFetchToolResultErrorCode`
877890 
878891 - `"invalid_tool_input"`
from line 906
893906 
894907 - `"unavailable"`
895908 
896 - `type: "web_fetch_tool_result_error"`
909 - `"content_too_large"`
897910 
898911 - `BetaWebFetchBlockParam object`
899912 
913 - `type: "web_fetch_result"`
914 
900915 - `content: BetaRequestDocumentBlock`
901916 
902 - `type: "web_fetch_result"`
903 
904917 - `url: string`
905918 
906919 Fetched content URL
from line 926
913926 
914927 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
915928 
916 - `type: "web_fetch_tool_result"`
917 
918929 - `cache_control: optional BetaCacheControlEphemeral or null`
919930 
920931 Create a cache control breakpoint at this content block.
from line 946
935946 
936947 - `BetaAdvisorToolResultBlockParam object`
937948 
949 - `type: "advisor_tool_result"`
950 
938951 - `content: BetaAdvisorToolResultErrorParam or BetaAdvisorResultBlockParam or BetaAdvisorRedactedResultBlockParam`
939952 
940953 - `BetaAdvisorToolResultErrorParam object`
941954 
955 - `type: "advisor_tool_result_error"`
956 
942957 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
943958 
944959 - `"max_uses_exceeded"`
from line 970
955970 
956971 - `"model_not_found"`
957972 
958 - `type: "advisor_tool_result_error"`
959 
960973 - `BetaAdvisorResultBlockParam object`
961974 
975 - `type: "advisor_result"`
976 
962977 - `text: string`
963978 
964 - `type: "advisor_result"`
965 
966979 - `stop_reason: optional string or null`
967980 
968981 - `BetaAdvisorRedactedResultBlockParam object`
969982 
983 - `type: "advisor_redacted_result"`
984 
970985 - `encrypted_content: string`
971986 
972987 Opaque blob produced by a prior response; must be round-tripped verbatim.
973988 
974 - `type: "advisor_redacted_result"`
975 
976989 - `stop_reason: optional string or null`
977990 
978991 - `tool_use_id: string`
979992 
980993 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
981994 
982 - `type: "advisor_tool_result"`
983 
984995 - `cache_control: optional BetaCacheControlEphemeral or null`
985996 
986997 Create a cache control breakpoint at this content block.
987998 
988999 - `BetaCodeExecutionToolResultBlockParam object`
9891000 
1001 - `type: "code_execution_tool_result"`
1002 
9901003 - `content: BetaCodeExecutionToolResultBlockParamContent`
9911004 
9921005 Code execution result with encrypted stdout for PFC + web_search results.
9931006 
9941007 - `BetaCodeExecutionToolResultErrorParam object`
9951008 
1009 - `type: "code_execution_tool_result_error"`
1010 
9961011 - `error_code: BetaCodeExecutionToolResultErrorCode`
9971012 
9981013 - `"invalid_tool_input"`
from line 1018
10031018 
10041019 - `"execution_time_exceeded"`
10051020 
1006 - `type: "code_execution_tool_result_error"`
1007 
10081021 - `BetaCodeExecutionResultBlockParam object`
10091022 
1023 - `type: "code_execution_result"`
1024 
10101025 - `content: array of BetaCodeExecutionOutputBlockParam`
10111026 
1027 - `type: "code_execution_output"`
1028 
10121029 - `file_id: string`
10131030 
1031 - `return_code: number`
1032 
1033 - `stderr: string`
1034 
1035 - `stdout: string`
1036 
1037 - `BetaEncryptedCodeExecutionResultBlockParam object`
1038 
1039 Code execution result with encrypted stdout for PFC + web_search results.
1040 
1041 - `type: "encrypted_code_execution_result"`
1042 
1043 - `content: array of BetaCodeExecutionOutputBlockParam`
1044 
10141045 - `type: "code_execution_output"`
10151046 
1047 - `file_id: string`
1048 
1049 - `encrypted_stdout: string`
1050 
10161051 - `return_code: number`
10171052 
10181053 - `stderr: string`
10191054 
1055 - `tool_use_id: string`
1056 
1057 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1058 
1059 - `cache_control: optional BetaCacheControlEphemeral or null`
1060 
1061 Create a cache control breakpoint at this content block.
1062 
1063 - `BetaBashCodeExecutionToolResultBlockParam object`
1064 
1065 - `type: "bash_code_execution_tool_result"`
1066 
1067 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
1068 
1069 - `BetaBashCodeExecutionToolResultErrorParam object`
1070 
1071 - `type: "bash_code_execution_tool_result_error"`
1072 
1073 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1074 
1075 - `"invalid_tool_input"`
1076 
1077 - `"unavailable"`
1078 
1079 - `"too_many_requests"`
1080 
1081 - `"execution_time_exceeded"`
1082 
1083 - `"output_file_too_large"`
1084 
1085 - `BetaBashCodeExecutionResultBlockParam object`
1086 
1087 - `type: "bash_code_execution_result"`
1088 
1089 - `content: array of BetaBashCodeExecutionOutputBlockParam`
1090 
1091 - `type: "bash_code_execution_output"`
1092 
1093 - `file_id: string`
1094 
1095 - `return_code: number`
1096 
1097 - `stderr: string`
1098 
10201099 - `stdout: string`
10211100 
1022 - `type: "code_execution_result"`
1023 
1024 - `BetaEncryptedCodeExecutionResultBlockParam object`
1025 
1026 Code execution result with encrypted stdout for PFC + web_search results.
1027 
1028 - `content: array of BetaCodeExecutionOutputBlockParam`
1029 
1030 - `file_id: string`
1031 
1032 - `type: "code_execution_output"`
1033 
1034 - `encrypted_stdout: string`
1035 
1036 - `return_code: number`
1037 
1038 - `stderr: string`
1039 
1040 - `type: "encrypted_code_execution_result"`
1041 
10421101 - `tool_use_id: string`
10431102 
10441103 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10451104 
1046 - `type: "code_execution_tool_result"`
1047 
10481105 - `cache_control: optional BetaCacheControlEphemeral or null`
10491106 
10501107 Create a cache control breakpoint at this content block.
10511108 
1052 - `BetaBashCodeExecutionToolResultBlockParam object`
1053 
1054 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
1055 
1056 - `BetaBashCodeExecutionToolResultErrorParam object`
1109 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
1110 
1111 - `type: "text_editor_code_execution_tool_result"`
1112 
1113 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
1114 
1115 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
1116 
1117 - `type: "text_editor_code_execution_tool_result_error"`
10571118 
10581119 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10591120 
from line 1126
10651126 
10661127 - `"execution_time_exceeded"`
10671128 
1068 - `"output_file_too_large"`
1069 
1070 - `type: "bash_code_execution_tool_result_error"`
1071 
1072 - `BetaBashCodeExecutionResultBlockParam object`
1073 
1074 - `content: array of BetaBashCodeExecutionOutputBlockParam`
1075 
1076 - `file_id: string`
1077 
1078 - `type: "bash_code_execution_output"`
1079 
1080 - `return_code: number`
1081 
1082 - `stderr: string`
1083 
1084 - `stdout: string`
1085 
1086 - `type: "bash_code_execution_result"`
1129 - `"file_not_found"`
1130 
1131 - `error_message: optional string or null`
1132 
1133 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
1134 
1135 - `type: "text_editor_code_execution_view_result"`
1136 
1137 - `content: string`
1138 
1139 - `file_type: "text" or "image" or "pdf"`
1140 
1141 - `"text"`
1142 
1143 - `"image"`
1144 
1145 - `"pdf"`
1146 
1147 - `num_lines: optional number or null`
1148 
1149 - `start_line: optional number or null`
1150 
1151 - `total_lines: optional number or null`
1152 
1153 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
1154 
1155 - `type: "text_editor_code_execution_create_result"`
1156 
1157 - `is_file_update: boolean`
1158 
1159 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
1160 
1161 - `type: "text_editor_code_execution_str_replace_result"`
1162 
1163 - `lines: optional array of string or null`
1164 
1165 - `new_lines: optional number or null`
1166 
1167 - `new_start: optional number or null`
1168 
1169 - `old_lines: optional number or null`
1170 
1171 - `old_start: optional number or null`
10871172 
10881173 - `tool_use_id: string`
10891174 
10901175 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10911176 
1092 - `type: "bash_code_execution_tool_result"`
1093 
10941177 - `cache_control: optional BetaCacheControlEphemeral or null`
10951178 
10961179 Create a cache control breakpoint at this content block.
10971180 
1098 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
1099 
1100 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
1101 
1102 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
1103 
1104 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1181 - `BetaToolSearchToolResultBlockParam object`
1182 
1183 - `type: "tool_search_tool_result"`
1184 
1185 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
1186 
1187 - `BetaToolSearchToolResultErrorParam object`
1188 
1189 - `type: "tool_search_tool_result_error"`
1190 
1191 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
11051192 
11061193 - `"invalid_tool_input"`
11071194 
from line 1198
11111198 
11121199 - `"execution_time_exceeded"`
11131200 
1114 - `"file_not_found"`
1115 
1116 - `type: "text_editor_code_execution_tool_result_error"`
1117 
11181201 - `error_message: optional string or null`
11191202 
1120 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
1121 
1122 - `content: string`
1123 
1124 - `file_type: "text" or "image" or "pdf"`
1125 
1126 - `"text"`
1127 
1128 - `"image"`
1129 
1130 - `"pdf"`
1131 
1132 - `type: "text_editor_code_execution_view_result"`
1133 
1134 - `num_lines: optional number or null`
1135 
1136 - `start_line: optional number or null`
1137 
1138 - `total_lines: optional number or null`
1139 
1140 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
1141 
1142 - `is_file_update: boolean`
1143 
1144 - `type: "text_editor_code_execution_create_result"`
1145 
1146 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
1147 
1148 - `type: "text_editor_code_execution_str_replace_result"`
1149 
1150 - `lines: optional array of string or null`
1151 
1152 - `new_lines: optional number or null`
1153 
1154 - `new_start: optional number or null`
1155 
1156 - `old_lines: optional number or null`
1157 
1158 - `old_start: optional number or null`
1203 - `BetaToolSearchToolSearchResultBlockParam object`
1204 
1205 - `type: "tool_search_tool_search_result"`
1206 
1207 - `tool_references: array of BetaToolReferenceBlockParam`
1208 
1209 - `type: "tool_reference"`
1210 
1211 - `tool_name: string`
1212 
1213 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1214 
1215 - `cache_control: optional BetaCacheControlEphemeral or null`
1216 
1217 Create a cache control breakpoint at this content block.
11591218 
11601219 - `tool_use_id: string`
11611220 
11621221 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
11631222 
1164 - `type: "text_editor_code_execution_tool_result"`
1165 
11661223 - `cache_control: optional BetaCacheControlEphemeral or null`
11671224 
11681225 Create a cache control breakpoint at this content block.
11691226 
1170 - `BetaToolSearchToolResultBlockParam object`
1171 
1172 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
1173 
1174 - `BetaToolSearchToolResultErrorParam object`
1175 
1176 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
1177 
1178 - `"invalid_tool_input"`
1179 
1180 - `"unavailable"`
1181 
1182 - `"too_many_requests"`
1183 
1184 - `"execution_time_exceeded"`
1185 
1186 - `type: "tool_search_tool_result_error"`
1187 
1188 - `error_message: optional string or null`
1189 
1190 - `BetaToolSearchToolSearchResultBlockParam object`
1191 
1192 - `tool_references: array of BetaToolReferenceBlockParam`
1193 
1194 - `tool_name: string`
1195 
1196 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1197 
1198 - `type: "tool_reference"`
1199 
1200 - `cache_control: optional BetaCacheControlEphemeral or null`
1201 
1202 Create a cache control breakpoint at this content block.
1203 
1204 - `type: "tool_search_tool_search_result"`
1227 - `BetaMCPToolUseBlockParam object`
1228 
1229 - `type: "mcp_tool_use"`
1230 
1231 - `id: string`
1232 
1233 pattern: ^[a-zA-Z0-9_-]+$
1234 
1235 - `input: map[unknown]`
1236 
1237 - `name: string`
1238 
1239 - `server_name: string`
1240 
1241 The name of the MCP server
1242 
1243 - `cache_control: optional BetaCacheControlEphemeral or null`
1244 
1245 Create a cache control breakpoint at this content block.
1246 
1247 - `BetaRequestMCPToolResultBlockParam object`
1248 
1249 - `type: "mcp_tool_result"`
12051250 
12061251 - `tool_use_id: string`
12071252 
1208 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1209 
1210 - `type: "tool_search_tool_result"`
1253 pattern: ^[a-zA-Z0-9_-]+$
12111254 
12121255 - `cache_control: optional BetaCacheControlEphemeral or null`
12131256 
12141257 Create a cache control breakpoint at this content block.
12151258 
1216 - `BetaMCPToolUseBlockParam object`
1217 
1218 - `id: string`
1219 
1220 pattern: ^[a-zA-Z0-9_-]+$
1221 
1222 - `input: map[unknown]`
1223 
1224 - `name: string`
1225 
1226 - `server_name: string`
1227 
1228 The name of the MCP server
1229 
1230 - `type: "mcp_tool_use"`
1231 
1232 - `cache_control: optional BetaCacheControlEphemeral or null`
1233 
1234 Create a cache control breakpoint at this content block.
1235 
1236 - `BetaRequestMCPToolResultBlockParam object`
1237 
1238 - `tool_use_id: string`
1239 
1240 pattern: ^[a-zA-Z0-9_-]+$
1241 
1242 - `type: "mcp_tool_result"`
1243 
1244 - `cache_control: optional BetaCacheControlEphemeral or null`
1245 
1246 Create a cache control breakpoint at this content block.
1247 
12481259 - `content: optional string or array of BetaTextBlockParam`
12491260 
12501261 - `string`
12511262 
12521263 - `BetaMCPToolResultBlockParamContent = array of BetaTextBlockParam`
12531264 
1265 - `type: "text"`
1266 
12541267 - `text: string`
12551268 
12561269 minLength: 1
1257 
1258 - `type: "text"`
12591270 
12601271 - `cache_control: optional BetaCacheControlEphemeral or null`
12611272 
from line 1281
12701281 A content block that represents a file to be uploaded to the container
12711282 Files uploaded via this block will be available in the container's input directory.
12721283 
1284 - `type: "container_upload"`
1285 
12731286 - `file_id: string`
1274 
1275 - `type: "container_upload"`
12761287 
12771288 - `cache_control: optional BetaCacheControlEphemeral or null`
12781289 
from line 1320
13091320 `tool` references a tool (or MCP toolset) by name from the request's
13101321 `tools`; it is offered to the model from this point in the
13111322 conversation onward.
1323 
1324 - `type: "tool_addition"`
13121325 
13131326 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
13141327 
from line 1337
13241337 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
13251338 `mcp_toolset_reference` for those.
13261339 
1340 - `type: "tool_reference"`
1341 
13271342 - `name: string`
13281343 
13291344 pattern: ^[a-zA-Z0-9_-]{1,128}$
1330 
1331 - `type: "tool_reference"`
13321345 
13331346 - `BetaToolChangeMCPToolReference object`
13341347 
13351348 Reference to a single MCP tool by its server and remote name — the
13361349 same `server_name`/`name` pair `mcp_tool_use` carries.
13371350 
1351 - `type: "mcp_tool_reference"`
1352 
13381353 - `name: string`
13391354 
13401355 - `server_name: string`
13411356 
1342 - `type: "mcp_tool_reference"`
1343 
13441357 - `BetaToolChangeMCPToolsetReference object`
13451358 
13461359 Reference to every tool in the named MCP server's toolset.
13471360 
1361 - `type: "mcp_toolset_reference"`
1362 
13481363 - `server_name: string`
1349 
1350 - `type: "mcp_toolset_reference"`
1351 
1352 - `type: "tool_addition"`
13531364 
13541365 - `cache_control: optional BetaCacheControlEphemeral or null`
13551366 
from line 1373
13621373 `tool` references a tool (or MCP toolset) by name from the request's
13631374 `tools`; it is no longer offered to the model from this point in the
13641375 conversation onward.
1376 
1377 - `type: "tool_removal"`
13651378 
13661379 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
13671380 
from line 1398
13851398 - `BetaToolChangeMCPToolsetReference object`
13861399 
13871400 Reference to every tool in the named MCP server's toolset.
1388 
1389 - `type: "tool_removal"`
13901401 
13911402 - `cache_control: optional BetaCacheControlEphemeral or null`
13921403 
from line 1419
14081419 likewise rejected; between non-thinking blocks the block's placement has
14091420 no validation effect.
14101421 
1422 - `type: "fallback"`
1423 
14111424 - `from: BetaFallbackInfoParam`
14121425 
14131426 Identifies one hop of a fallback transition.
from line 1510
14971510 - `to: BetaFallbackInfoParam`
14981511 
14991512 Identifies one hop of a fallback transition.
1500 
1501 - `type: "fallback"`
15021513 
15031514 - `trigger: optional unknown`
15041515 
from line 1581
15701581 
15711582 maxItems: 20
15721583 
1584 - `type: "anthropic" or "custom"`
1585 
1586 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1587 
1588 - `"anthropic"`
1589 
1590 - `"custom"`
1591 
15731592 - `skill_id: string`
15741593 
15751594 Skill ID
15761595 
15771596 maxLength: 64, minLength: 1
1578 
1579 - `type: "anthropic" or "custom"`
1580 
1581 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1582 
1583 - `"anthropic"`
1584 
1585 - `"custom"`
15861597 
15871598 - `version: optional string`
15881599 
from line 1805
17941805 
17951806 A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
17961807 
1808 - `type: "json_schema"`
1809 
17971810 - `schema: map[unknown]`
17981811 
17991812 The JSON schema of the format
18001813 
1801 - `type: "json_schema"`
1802 
18031814 - `task_budget: optional BetaTokenTaskBudget or null`
18041815 
18051816 User-configurable total token budget across contexts.
18061817 
1818 - `type: "tokens"`
1819 
1820 The budget type. Currently only 'tokens' is supported.
1821 
18071822 - `total: number`
18081823 
18091824 Total token budget across all contexts in the session.
18101825 
18111826 minimum: 1024
18121827 
1813 - `type: "tokens"`
1814 
1815 The budget type. Currently only 'tokens' is supported.
1816 
18171828 - `remaining: optional number or null`
18181829 
18191830 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 1843
18321843 
18331844 - `BetaThinkingConfigEnabled object`
18341845 
1846 - `type: "enabled"`
1847 
18351848 - `budget_tokens: number`
18361849 
18371850 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 1854
18411854 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
18421855 
18431856 minimum: 1024
1844 
1845 - `type: "enabled"`
18461857 
18471858 - `block_binding: optional BetaThinkingBlockBinding or null`
18481859 
from line 1919
19081919 
19091920 maxItems: 20
19101921 
1922 - `type: "url"`
1923 
19111924 - `name: string`
19121925 
1913 - `type: "url"`
1914 
19151926 - `url: string`
19161927 
19171928 - `authorization_token: optional string or null`
from line 1991
19801991 
19811992 - `array of BetaTextBlockParam`
19821993 
1994 - `type: "text"`
1995 
19831996 - `text: string`
19841997 
19851998 minLength: 1
19861999 
1987 - `type: "text"`
1988 
19892000 - `cache_control: optional BetaCacheControlEphemeral or null`
19902001 
19912002 Create a cache control breakpoint at this content block.
from line 2049
20382049 
20392050 The model will use the specified tool with `tool_choice.name`.
20402051 
2052 - `type: "tool"`
2053 
20412054 - `name: string`
20422055 
20432056 The name of the tool to use.
2044 
2045 - `type: "tool"`
20462057 
20472058 - `disable_parallel_tool_use: optional boolean`
20482059 
from line 2133
21222133 
21232134 - `BetaTool object`
21242135 
2136 - `type: optional "custom" or null`
2137 
21252138 - `input_schema: object`
21262139 
21272140 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
from line 2189
21762189 
21772190 When true, guarantees schema validation on tool names and inputs
21782191 
2179 - `type: optional "custom" or null`
2180 
21812192 - `BetaToolBash20241022 object`
21822193 
2194 - `type: "bash_20241022"`
2195 
21832196 - `name: "bash"`
21842197 
21852198 Name of the tool.
21862199 
21872200 This is how the tool will be called by the model and in `tool_use` blocks.
21882201 
2189 - `type: "bash_20241022"`
2190 
21912202 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21922203 
21932204 - `"direct"`
from line 2225
22142225 
22152226 - `BetaToolBash20250124 object`
22162227 
2228 - `type: "bash_20250124"`
2229 
22172230 - `name: "bash"`
22182231 
22192232 Name of the tool.
22202233 
22212234 This is how the tool will be called by the model and in `tool_use` blocks.
22222235 
2223 - `type: "bash_20250124"`
2224 
22252236 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22262237 
22272238 - `"direct"`
from line 2259
22482259 
22492260 - `BetaCodeExecutionTool20250522 object`
22502261 
2262 - `type: "code_execution_20250522"`
2263 
22512264 - `name: "code_execution"`
22522265 
22532266 Name of the tool.
22542267 
22552268 This is how the tool will be called by the model and in `tool_use` blocks.
22562269 
2257 - `type: "code_execution_20250522"`
2258 
22592270 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22602271 
22612272 - `"direct"`
from line 2291
22802291 
22812292 - `BetaCodeExecutionTool20250825 object`
22822293 
2294 - `type: "code_execution_20250825"`
2295 
22832296 - `name: "code_execution"`
22842297 
22852298 Name of the tool.
22862299 
22872300 This is how the tool will be called by the model and in `tool_use` blocks.
22882301 
2289 - `type: "code_execution_20250825"`
2290 
22912302 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
22922303 
22932304 - `"direct"`
from line 2325
23142325 
23152326 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
23162327 
2328 - `type: "code_execution_20260120"`
2329 
23172330 - `name: "code_execution"`
23182331 
23192332 Name of the tool.
23202333 
23212334 This is how the tool will be called by the model and in `tool_use` blocks.
23222335 
2323 - `type: "code_execution_20260120"`
2324 
23252336 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23262337 
23272338 - `"direct"`
from line 2359
23482359 
23492360 Code execution tool with REPL state persistence.
23502361 
2362 - `type: "code_execution_20260521"`
2363 
23512364 - `name: "code_execution"`
23522365 
23532366 Name of the tool.
23542367 
23552368 This is how the tool will be called by the model and in `tool_use` blocks.
2356 
2357 - `type: "code_execution_20260521"`
23582369 
23592370 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23602371 
from line 2411
24002411 absent. Unknown keys are rejected: the field set is this toolset
24012412 version's complete member set.
24022413 
2414 - `type: optional BetaBrowserTypeConfig or null`
2415 
2416 `type`'s config overrides.
2417 
2418 - `defer_loading: optional boolean or null`
2419 
2420 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2421 
2422 - `enabled: optional boolean or null`
2423 
2424 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.
2425 
24032426 - `close_tab: optional BetaBrowserCloseTabConfig or null`
24042427 
24052428 `close_tab`'s config overrides.
from line 2759
27362759 
27372760 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.
27382761 
2739 - `type: optional BetaBrowserTypeConfig or null`
2740 
2741 `type`'s config overrides.
2742 
2743 - `defer_loading: optional boolean or null`
2744 
2745 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2746 
2747 - `enabled: optional boolean or null`
2748 
2749 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.
2750 
27512762 - `wait: optional BetaBrowserWaitConfig or null`
27522763 
27532764 `wait`'s config overrides.
from line 2785
27742785 
27752786 - `BetaToolComputerUse20241022 object`
27762787 
2788 - `type: "computer_20241022"`
2789 
27772790 - `display_height_px: number`
27782791 
27792792 The height of the display in pixels.
from line 2805
27922805 
27932806 This is how the tool will be called by the model and in `tool_use` blocks.
27942807 
2795 - `type: "computer_20241022"`
2796 
27972808 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27982809 
27992810 - `"direct"`
from line 2837
28262837 
28272838 - `BetaMemoryTool20250818 object`
28282839 
2840 - `type: "memory_20250818"`
2841 
28292842 - `name: "memory"`
28302843 
28312844 Name of the tool.
28322845 
28332846 This is how the tool will be called by the model and in `tool_use` blocks.
28342847 
2835 - `type: "memory_20250818"`
2836 
28372848 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28382849 
28392850 - `"direct"`
from line 2871
28602871 
28612872 - `BetaToolComputerUse20250124 object`
28622873 
2874 - `type: "computer_20250124"`
2875 
28632876 - `display_height_px: number`
28642877 
28652878 The height of the display in pixels.
from line 2891
28782891 
28792892 This is how the tool will be called by the model and in `tool_use` blocks.
28802893 
2881 - `type: "computer_20250124"`
2882 
28832894 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28842895 
28852896 - `"direct"`
from line 2923
29122923 
29132924 - `BetaToolTextEditor20241022 object`
29142925 
2926 - `type: "text_editor_20241022"`
2927 
29152928 - `name: "str_replace_editor"`
29162929 
29172930 Name of the tool.
29182931 
29192932 This is how the tool will be called by the model and in `tool_use` blocks.
29202933 
2921 - `type: "text_editor_20241022"`
2922 
29232934 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29242935 
29252936 - `"direct"`
from line 2957
29462957 
29472958 - `BetaToolComputerUse20251124 object`
29482959 
2960 - `type: "computer_20251124"`
2961 
29492962 - `display_height_px: number`
29502963 
29512964 The height of the display in pixels.
from line 2976
29632976 Name of the tool.
29642977 
29652978 This is how the tool will be called by the model and in `tool_use` blocks.
2966 
2967 - `type: "computer_20251124"`
29682979 
29692980 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29702981 
from line 3037
30263037 absent. Unknown keys are rejected: the field set is this toolset
30273038 version's complete member set.
30283039 
3040 - `type: optional BetaComputerTypeConfig or null`
3041 
3042 `type`'s config overrides.
3043 
3044 - `defer_loading: optional boolean or null`
3045 
3046 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
3047 
3048 - `enabled: optional boolean or null`
3049 
3050 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.
3051 
30293052 - `cursor_position: optional BetaComputerCursorPositionConfig or null`
30303053 
30313054 `cursor_position`'s config overrides.
from line 3217
31943217 
31953218 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.
31963219 
3197 - `type: optional BetaComputerTypeConfig or null`
3198 
3199 `type`'s config overrides.
3200 
3201 - `defer_loading: optional boolean or null`
3202 
3203 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
3204 
3205 - `enabled: optional boolean or null`
3206 
3207 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.
3208 
32093220 - `wait: optional BetaComputerWaitConfig or null`
32103221 
32113222 `wait`'s config overrides.
from line 3243
32323243 
32333244 - `BetaToolTextEditor20250124 object`
32343245 
3246 - `type: "text_editor_20250124"`
3247 
32353248 - `name: "str_replace_editor"`
32363249 
32373250 Name of the tool.
32383251 
32393252 This is how the tool will be called by the model and in `tool_use` blocks.
32403253 
3241 - `type: "text_editor_20250124"`
3242 
32433254 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32443255 
32453256 - `"direct"`
from line 3277
32663277 
32673278 - `BetaToolTextEditor20250429 object`
32683279 
3280 - `type: "text_editor_20250429"`
3281 
32693282 - `name: "str_replace_based_edit_tool"`
32703283 
32713284 Name of the tool.
32723285 
32733286 This is how the tool will be called by the model and in `tool_use` blocks.
32743287 
3275 - `type: "text_editor_20250429"`
3276 
32773288 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32783289 
32793290 - `"direct"`
from line 3311
33003311 
33013312 - `BetaToolTextEditor20250728 object`
33023313 
3314 - `type: "text_editor_20250728"`
3315 
33033316 - `name: "str_replace_based_edit_tool"`
33043317 
33053318 Name of the tool.
33063319 
33073320 This is how the tool will be called by the model and in `tool_use` blocks.
33083321 
3309 - `type: "text_editor_20250728"`
3310 
33113322 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33123323 
33133324 - `"direct"`
from line 3351
33403351 
33413352 - `BetaWebSearchTool20250305 object`
33423353 
3354 - `type: "web_search_20250305"`
3355 
33433356 - `name: "web_search"`
33443357 
33453358 Name of the tool.
33463359 
33473360 This is how the tool will be called by the model and in `tool_use` blocks.
33483361 
3349 - `type: "web_search_20250305"`
3350 
33513362 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33523363 
33533364 - `"direct"`
from line 3427
34163427 
34173428 - `BetaWebFetchTool20250910 object`
34183429 
3430 - `type: "web_fetch_20250910"`
3431 
34193432 - `name: "web_fetch"`
34203433 
34213434 Name of the tool.
34223435 
34233436 This is how the tool will be called by the model and in `tool_use` blocks.
34243437 
3425 - `type: "web_fetch_20250910"`
3426 
34273438 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34283439 
34293440 - `"direct"`
from line 3483
34723483 
34733484 - `BetaWebSearchTool20260209 object`
34743485 
3486 - `type: "web_search_20260209"`
3487 
34753488 - `name: "web_search"`
34763489 
34773490 Name of the tool.
34783491 
34793492 This is how the tool will be called by the model and in `tool_use` blocks.
34803493 
3481 - `type: "web_search_20260209"`
3482 
34833494 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34843495 
34853496 - `"direct"`
from line 3533
35223533 
35233534 - `BetaWebFetchTool20260209 object`
35243535 
3536 - `type: "web_fetch_20260209"`
3537 
35253538 - `name: "web_fetch"`
35263539 
35273540 Name of the tool.
35283541 
35293542 This is how the tool will be called by the model and in `tool_use` blocks.
35303543 
3531 - `type: "web_fetch_20260209"`
3532 
35333544 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35343545 
35353546 - `"direct"`
from line 3591
35803591 
35813592 Web fetch tool with use_cache parameter for bypassing cached content.
35823593 
3594 - `type: "web_fetch_20260309"`
3595 
35833596 - `name: "web_fetch"`
35843597 
35853598 Name of the tool.
35863599 
35873600 This is how the tool will be called by the model and in `tool_use` blocks.
35883601 
3589 - `type: "web_fetch_20260309"`
3590 
35913602 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35923603 
35933604 - `"direct"`
from line 3651
36403651 
36413652 - `BetaWebSearchTool20260318 object`
36423653 
3654 - `type: "web_search_20260318"`
3655 
36433656 - `name: "web_search"`
36443657 
36453658 Name of the tool.
36463659 
36473660 This is how the tool will be called by the model and in `tool_use` blocks.
36483661 
3649 - `type: "web_search_20260318"`
3650 
36513662 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36523663 
36533664 - `"direct"`
from line 3709
36983709 
36993710 - `BetaWebFetchTool20260318 object`
37003711 
3712 - `type: "web_fetch_20260318"`
3713 
37013714 - `name: "web_fetch"`
37023715 
37033716 Name of the tool.
37043717 
37053718 This is how the tool will be called by the model and in `tool_use` blocks.
37063719 
3707 - `type: "web_fetch_20260318"`
3708 
37093720 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
37103721 
37113722 - `"direct"`
from line 3777
37663777 
37673778 - `BetaAdvisorTool20260301 object`
37683779 
3780 - `type: "advisor_20260301"`
3781 
37693782 - `model: Model`
37703783 
37713784 The model that will complete your prompt.
from line 3791
37783791 
37793792 This is how the tool will be called by the model and in `tool_use` blocks.
37803793 
3781 - `type: "advisor_20260301"`
3782 
37833794 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
37843795 
37853796 - `"direct"`
from line 3831
38203831 
38213832 - `BetaToolSearchToolBm25_20251119 object`
38223833 
3834 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3835 
3836 - `"tool_search_tool_bm25_20251119"`
3837 
3838 - `"tool_search_tool_bm25"`
3839 
38233840 - `name: "tool_search_tool_bm25"`
38243841 
38253842 Name of the tool.
38263843 
38273844 This is how the tool will be called by the model and in `tool_use` blocks.
38283845 
3829 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3830 
3831 - `"tool_search_tool_bm25_20251119"`
3832 
3833 - `"tool_search_tool_bm25"`
3834 
38353846 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38363847 
38373848 - `"direct"`
from line 3867
38563867 
38573868 - `BetaToolSearchToolRegex20251119 object`
38583869 
3870 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3871 
3872 - `"tool_search_tool_regex_20251119"`
3873 
3874 - `"tool_search_tool_regex"`
3875 
38593876 - `name: "tool_search_tool_regex"`
38603877 
38613878 Name of the tool.
38623879 
38633880 This is how the tool will be called by the model and in `tool_use` blocks.
3864 
3865 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3866 
3867 - `"tool_search_tool_regex_20251119"`
3868 
3869 - `"tool_search_tool_regex"`
38703881 
38713882 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
38723883 
from line 3908
38973908 Allows configuring enabled status and defer_loading for all tools
38983909 from an MCP server, with optional per-tool overrides.
38993910 
3911 - `type: "mcp_toolset"`
3912 
39003913 - `mcp_server_name: string`
39013914 
39023915 Name of the MCP server to configure tools for
39033916 
39043917 maxLength: 255, minLength: 1
39053918 
3906 - `type: "mcp_toolset"`
3907 
39083919 - `cache_control: optional BetaCacheControlEphemeral or null`
39093920 
39103921 Create a cache control breakpoint at this content block.
from line 3984
39733984 
39743985- `BetaMessageBatch object`
39753986 
3987 - `type: "message_batch"`
3988 
3989 Object type.
3990 
3991 For Message Batches, this is always `"message_batch"`.
3992 
3993 default: message_batch
3994 
39763995 - `id: string`
39773996 
39783997 Unique object identifier.
from line 4089
40704089 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
40714090 
40724091 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.
4073 
4074 - `type: "message_batch"`
4075 
4076 Object type.
4077 
4078 For Message Batches, this is always `"message_batch"`.
4079 
4080 default: message_batch
40814092 
40824093## Example
40834094 
40844095 

api/beta/messages/batches/delete Changed · +14 / -5 lines

from line 1
1---
2title: Delete a Message Batch
3url: https://platform.claude.com/docs/en/api/beta/messages/batches/delete
4---
5 
16# Delete a Message Batch
27 
38**DELETE** `/v1/messages/batches/{message_batch_id}`
from line 27
2227 
2328 - `string`
2429 
25 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
30 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2631 
2732 - `"message-batches-2024-09-24"`
2833 
from line 75
7075 
7176 - `"user-profiles-2026-08-18"`
7277 
78 - `"user-profiles-2026-09-04"`
79 
7380 - `"advisor-tool-2026-03-01"`
7481 
7582 - `"managed-agents-2026-04-01"`
from line 119
112119 
113120 - `"mid-conversation-system-clear-at-2026-08-21"`
114121 
122- `"anthropic-workspace-id": optional string`
123 
115124## Returns
116125 
117126- `BetaDeletedMessageBatch object`
118127 
119 - `id: string`
120 
121 ID of the Message Batch.
122 
123128 - `type: "message_batch_deleted"`
124129 
125130 Deleted object type.
from line 132
127132 For Message Batches, this is always `"message_batch_deleted"`.
128133 
129134 default: message_batch_deleted
135 
136 - `id: string`
137 
138 ID of the Message Batch.
130139 
131140## Example
132141 

api/beta/messages/batches/list Changed · +18 / -9 lines

from line 1
1---
2title: List Message Batches
3url: https://platform.claude.com/docs/en/api/beta/messages/batches/list
4---
5 
16# List Message Batches
27 
38**GET** `/v1/messages/batches`
from line 37
3237 
3338 - `string`
3439 
35 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
40 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
3641 
3742 - `"message-batches-2024-09-24"`
3843 
from line 85
8085 
8186 - `"user-profiles-2026-08-18"`
8287 
88 - `"user-profiles-2026-09-04"`
89 
8390 - `"advisor-tool-2026-03-01"`
8491 
8592 - `"managed-agents-2026-04-01"`
from line 129
122129 
123130 - `"mid-conversation-system-clear-at-2026-08-21"`
124131 
132- `"anthropic-workspace-id": optional string`
133 
125134## Returns
126135 
127136- `data: array of BetaMessageBatch`
128137 
138 - `type: "message_batch"`
139 
140 Object type.
141 
142 For Message Batches, this is always `"message_batch"`.
143 
144 default: message_batch
145 
129146 - `id: string`
130147 
131148 Unique object identifier.
from line 240
223240 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
224241 
225242 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.
226 
227 - `type: "message_batch"`
228 
229 Object type.
230 
231 For Message Batches, this is always `"message_batch"`.
232 
233 default: message_batch
234243 
235244- `first_id: string or null`
236245 

api/beta/messages/batches/results Changed · +473 / -462 lines

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

from line 1
1---
2title: Retrieve Message Batch results
3url: https://platform.claude.com/docs/en/api/beta/messages/batches/results
4---
5 
16# Retrieve Message Batch results
27 
38**GET** `/v1/messages/batches/{message_batch_id}/results`
from line 27
2227 
2328 - `string`
2429 
25 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
30 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2631 
2732 - `"message-batches-2024-09-24"`
2833 
from line 75
7075 
7176 - `"user-profiles-2026-08-18"`
7277 
78 - `"user-profiles-2026-09-04"`
79 
7380 - `"advisor-tool-2026-03-01"`
7481 
7582 - `"managed-agents-2026-04-01"`
from line 119
112119 
113120 - `"mid-conversation-system-clear-at-2026-08-21"`
114121 
122- `"anthropic-workspace-id": optional string`
123 
115124## Returns
116125 
117126- `BetaMessageBatchIndividualResponse object`
from line 141
132141 
133142 - `BetaMessageBatchSucceededResult object`
134143 
144 - `type: "succeeded"`
145 
146 default: succeeded
147 
135148 - `message: BetaMessage`
136149 
150 - `type: "message"`
151 
152 Object type.
153 
154 For Messages, this is always `"message"`.
155 
156 default: message
157 
137158 - `id: string`
138159 
139160 Unique object identifier.
from line 179
158179 
159180 Skills loaded in the container
160181 
182 - `type: "anthropic" or "custom"`
183 
184 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
185 
186 - `"anthropic"`
187 
188 - `"custom"`
189 
161190 - `skill_id: string`
162191 
163192 Skill ID
164193 
165194 maxLength: 64, minLength: 1
166 
167 - `type: "anthropic" or "custom"`
168 
169 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
170 
171 - `"anthropic"`
172 
173 - `"custom"`
174195 
175196 - `version: string`
176197 
from line 230
209230 
210231 - `BetaTextBlock object`
211232 
233 - `type: "text"`
234 
235 default: text
236 
212237 - `citations: array of BetaTextCitation or null`
213238 
214239 Citations supporting the text block.
from line 242
217242 
218243 - `BetaCitationCharLocation object`
219244 
245 - `type: "char_location"`
246 
247 default: char_location
248 
220249 - `cited_text: string`
221250 
222251 - `document_index: number`
from line 262
233262 
234263 minimum: 0
235264 
236 - `type: "char_location"`
237 
238 default: char_location
239 
240265 - `BetaCitationPageLocation object`
241266 
267 - `type: "page_location"`
268 
269 default: page_location
270 
242271 - `cited_text: string`
243272 
244273 - `document_index: number`
from line 284
255284 
256285 minimum: 1
257286 
258 - `type: "page_location"`
259 
260 default: page_location
261 
262287 - `BetaCitationContentBlockLocation object`
263288 
289 - `type: "content_block_location"`
290 
291 default: content_block_location
292 
264293 - `cited_text: string`
265294 
266295 The full text of the cited block range, concatenated.
from line 316
287316 
288317 minimum: 0
289318 
290 - `type: "content_block_location"`
291 
292 default: content_block_location
293 
294319 - `BetaCitationsWebSearchResultLocation object`
295320 
321 - `type: "web_search_result_location"`
322 
323 default: web_search_result_location
324 
296325 - `cited_text: string`
297326 
298327 - `encrypted_index: string`
from line 330
301330 
302331 maxLength: 512
303332 
304 - `type: "web_search_result_location"`
305 
306 default: web_search_result_location
307 
308333 - `url: string`
309334 
310335 - `BetaCitationSearchResultLocation object`
311336 
337 - `type: "search_result_location"`
338 
339 default: search_result_location
340 
312341 - `cited_text: string`
313342 
314343 The full text of the cited block range, concatenated.
from line 368
339368 
340369 - `title: string or null`
341370 
342 - `type: "search_result_location"`
343 
344 default: search_result_location
345 
346371 - `text: string`
347372 
348 maxLength: 5000000, minLength: 0
349 
350 - `type: "text"`
351 
352 default: text
373 minLength: 0
353374 
354375 - `BetaThinkingBlock object`
355376 
377 - `type: "thinking"`
378 
379 default: thinking
380 
356381 - `signature: string`
357382 
358383 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
from line 390
365390 
366391 The text of Claude's thinking process for this block.
367392 
368 - `type: "thinking"`
369 
370 default: thinking
371 
372393 - `BetaRedactedThinkingBlock object`
373394 
395 - `type: "redacted_thinking"`
396 
397 default: redacted_thinking
398 
374399 - `data: string`
375400 
376401 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 404
379404 
380405 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.
381406 
382 - `type: "redacted_thinking"`
383 
384 default: redacted_thinking
385 
386407 - `BetaToolUseBlock object`
387408 
409 - `type: "tool_use"`
410 
411 default: tool_use
412 
388413 - `id: string`
389414 
390415 pattern: ^[a-zA-Z0-9_-]+$
from line 420
395420 
396421 minLength: 1
397422 
398 - `type: "tool_use"`
399 
400 default: tool_use
401 
402423 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
403424 
404425 Tool invocation directly from the model.
from line 434
413434 
414435 Tool invocation generated by a server-side tool.
415436 
437 - `type: "code_execution_20250825"`
438 
416439 - `tool_id: string`
417440 
418441 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
419442 
420 - `type: "code_execution_20250825"`
421 
422443 - `BetaServerToolCaller20260120 object`
423444 
445 - `type: "code_execution_20260120"`
446 
424447 - `tool_id: string`
425448 
426449 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
427450 
428 - `type: "code_execution_20260120"`
429 
430451 - `toolset_name: optional string or null`
431452 
432453 For a toolset member tool_use, the toolset family.
from line 456
435456 
436457 - `BetaServerToolUseBlock object`
437458 
459 - `type: "server_tool_use"`
460 
461 default: server_tool_use
462 
438463 - `id: string`
439464 
440465 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 484
459484 
460485 - `"tool_search_tool_bm25"`
461486 
462 - `type: "server_tool_use"`
463 
464 default: server_tool_use
465 
466487 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
467488 
468489 Tool invocation directly from the model.
from line 500
479500 
480501 - `BetaWebSearchToolResultBlock object`
481502 
503 - `type: "web_search_tool_result"`
504 
505 default: web_search_tool_result
506 
482507 - `content: BetaWebSearchToolResultBlockContent`
483508 
484509 - `BetaWebSearchToolResultError object`
485510 
511 - `type: "web_search_tool_result_error"`
512 
513 default: web_search_tool_result_error
514 
486515 - `error_code: BetaWebSearchToolResultErrorCode`
487516 
488517 - `"invalid_tool_input"`
from line 526
497526 
498527 - `"request_too_large"`
499528 
500 - `type: "web_search_tool_result_error"`
501 
502 default: web_search_tool_result_error
503 
504529 - `array of BetaWebSearchResultBlock`
505530 
531 - `type: "web_search_result"`
532 
533 default: web_search_result
534 
506535 - `encrypted_content: string`
507536 
508537 - `page_age: string or null`
509538 
510539 - `title: string`
511540 
512 - `type: "web_search_result"`
513 
514 default: web_search_result
515 
516541 - `url: string`
517542 
518543 - `tool_use_id: string`
519544 
520545 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
521546 
522 - `type: "web_search_tool_result"`
523 
524 default: web_search_tool_result
525 
526547 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
527548 
528549 Tool invocation directly from the model.
from line 560
539560 
540561 - `BetaWebFetchToolResultBlock object`
541562 
563 - `type: "web_fetch_tool_result"`
564 
565 default: web_fetch_tool_result
566 
542567 - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
543568 
544569 - `BetaWebFetchToolResultErrorBlock object`
545570 
571 - `type: "web_fetch_tool_result_error"`
572 
573 default: web_fetch_tool_result_error
574 
546575 - `error_code: BetaWebFetchToolResultErrorCode`
547576 
548577 - `"invalid_tool_input"`
from line 592
563592 
564593 - `"unavailable"`
565594 
566 - `type: "web_fetch_tool_result_error"`
567 
568 default: web_fetch_tool_result_error
595 - `"content_too_large"`
569596 
570597 - `BetaWebFetchBlock object`
571598 
599 - `type: "web_fetch_result"`
600 
601 default: web_fetch_result
602 
572603 - `content: BetaDocumentBlock`
573604 
605 - `type: "document"`
606 
607 default: document
608 
574609 - `citations: BetaCitationConfig or null`
575610 
576611 Citation configuration for the document
from line 618
583618 
584619 - `BetaBase64PDFSource object`
585620 
621 - `type: "base64"`
622 
586623 - `data: string`
587624 
588625 format: byte
589626 
590627 - `media_type: "application/pdf"`
591628 
592 - `type: "base64"`
593 
594629 - `BetaPlainTextSource object`
595630 
631 - `type: "text"`
632 
596633 - `data: string`
597634 
598635 - `media_type: "text/plain"`
599636 
600 - `type: "text"`
601 
602637 - `title: string or null`
603638 
604639 The title of the document
605640 
606 - `type: "document"`
607 
608 default: document
609 
610641 - `retrieved_at: string or null`
611642 
612643 ISO 8601 timestamp when the content was retrieved
613644 
614 - `type: "web_fetch_result"`
615 
616 default: web_fetch_result
617 
618645 - `url: string`
619646 
620647 Fetched content URL
from line 650
623650 
624651 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
625652 
626 - `type: "web_fetch_tool_result"`
627 
628 default: web_fetch_tool_result
629 
630653 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
631654 
632655 Tool invocation directly from the model.
from line 666
643666 
644667 - `BetaAdvisorToolResultBlock object`
645668 
669 - `type: "advisor_tool_result"`
670 
671 default: advisor_tool_result
672 
646673 - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`
647674 
648675 - `BetaAdvisorToolResultError object`
649676 
677 - `type: "advisor_tool_result_error"`
678 
679 default: advisor_tool_result_error
680 
650681 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
651682 
652683 - `"max_uses_exceeded"`
from line 694
663694 
664695 - `"model_not_found"`
665696 
666 - `type: "advisor_tool_result_error"`
667 
668 default: advisor_tool_result_error
669 
670697 - `BetaAdvisorResultBlock object`
671698 
699 - `type: "advisor_result"`
700 
701 default: advisor_result
702 
672703 - `stop_reason: string or null`
673704 
674705 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.
675706 
676707 - `text: string`
677708 
678 - `type: "advisor_result"`
679 
680 default: advisor_result
681 
682709 - `BetaAdvisorRedactedResultBlock object`
683710 
711 - `type: "advisor_redacted_result"`
712 
713 default: advisor_redacted_result
714 
684715 - `encrypted_content: string`
685716 
686717 Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
from line 720
689720 
690721 The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).
691722 
692 - `type: "advisor_redacted_result"`
693 
694 default: advisor_redacted_result
695 
696723 - `tool_use_id: string`
697724 
698725 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
699726 
700 - `type: "advisor_tool_result"`
701 
702 default: advisor_tool_result
703 
704727 - `BetaCodeExecutionToolResultBlock object`
705728 
729 - `type: "code_execution_tool_result"`
730 
731 default: code_execution_tool_result
732 
706733 - `content: BetaCodeExecutionToolResultBlockContent`
707734 
708735 Code execution result with encrypted stdout for PFC + web_search results.
709736 
710737 - `BetaCodeExecutionToolResultError object`
711738 
739 - `type: "code_execution_tool_result_error"`
740 
741 default: code_execution_tool_result_error
742 
712743 - `error_code: BetaCodeExecutionToolResultErrorCode`
713744 
714745 - `"invalid_tool_input"`
from line 750
719750 
720751 - `"execution_time_exceeded"`
721752 
722 - `type: "code_execution_tool_result_error"`
723 
724 default: code_execution_tool_result_error
725 
726753 - `BetaCodeExecutionResultBlock object`
727754 
755 - `type: "code_execution_result"`
756 
757 default: code_execution_result
758 
728759 - `content: array of BetaCodeExecutionOutputBlock`
729760 
761 - `type: "code_execution_output"`
762 
763 default: code_execution_output
764 
730765 - `file_id: string`
731766 
767 - `return_code: number`
768 
769 - `stderr: string`
770 
771 - `stdout: string`
772 
773 - `BetaEncryptedCodeExecutionResultBlock object`
774 
775 Code execution result with encrypted stdout for PFC + web_search results.
776 
777 - `type: "encrypted_code_execution_result"`
778 
779 default: encrypted_code_execution_result
780 
781 - `content: array of BetaCodeExecutionOutputBlock`
782 
732783 - `type: "code_execution_output"`
733784 
734785 default: code_execution_output
735786 
787 - `file_id: string`
788 
789 - `encrypted_stdout: string`
790 
736791 - `return_code: number`
737792 
738793 - `stderr: string`
739794 
795 - `tool_use_id: string`
796 
797 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
798 
799 - `BetaBashCodeExecutionToolResultBlock object`
800 
801 - `type: "bash_code_execution_tool_result"`
802 
803 default: bash_code_execution_tool_result
804 
805 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
806 
807 - `BetaBashCodeExecutionToolResultError object`
808 
809 - `type: "bash_code_execution_tool_result_error"`
810 
811 default: bash_code_execution_tool_result_error
812 
813 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
814 
815 - `"invalid_tool_input"`
816 
817 - `"unavailable"`
818 
819 - `"too_many_requests"`
820 
821 - `"execution_time_exceeded"`
822 
823 - `"output_file_too_large"`
824 
825 - `BetaBashCodeExecutionResultBlock object`
826 
827 - `type: "bash_code_execution_result"`
828 
829 default: bash_code_execution_result
830 
831 - `content: array of BetaBashCodeExecutionOutputBlock`
832 
833 - `type: "bash_code_execution_output"`
834 
835 default: bash_code_execution_output
836 
837 - `file_id: string`
838 
839 - `return_code: number`
840 
841 - `stderr: string`
842 
740843 - `stdout: string`
741844 
742 - `type: "code_execution_result"`
743 
744 default: code_execution_result
745 
746 - `BetaEncryptedCodeExecutionResultBlock object`
747 
748 Code execution result with encrypted stdout for PFC + web_search results.
749 
750 - `content: array of BetaCodeExecutionOutputBlock`
751 
752 - `file_id: string`
753 
754 - `type: "code_execution_output"`
755 
756 default: code_execution_output
757 
758 - `encrypted_stdout: string`
759 
760 - `return_code: number`
761 
762 - `stderr: string`
763 
764 - `type: "encrypted_code_execution_result"`
765 
766 default: encrypted_code_execution_result
767 
768845 - `tool_use_id: string`
769846 
770847 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
771848 
772 - `type: "code_execution_tool_result"`
773 
774 default: code_execution_tool_result
775 
776 - `BetaBashCodeExecutionToolResultBlock object`
777 
778 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
779 
780 - `BetaBashCodeExecutionToolResultError object`
849 - `BetaTextEditorCodeExecutionToolResultBlock object`
850 
851 - `type: "text_editor_code_execution_tool_result"`
852 
853 default: text_editor_code_execution_tool_result
854 
855 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
856 
857 - `BetaTextEditorCodeExecutionToolResultError object`
858 
859 - `type: "text_editor_code_execution_tool_result_error"`
860 
861 default: text_editor_code_execution_tool_result_error
781862 
782863 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
783864 
from line 870
789870 
790871 - `"execution_time_exceeded"`
791872 
792 - `"output_file_too_large"`
793 
794 - `type: "bash_code_execution_tool_result_error"`
795 
796 default: bash_code_execution_tool_result_error
797 
798 - `BetaBashCodeExecutionResultBlock object`
799 
800 - `content: array of BetaBashCodeExecutionOutputBlock`
801 
802 - `file_id: string`
803 
804 - `type: "bash_code_execution_output"`
805 
806 default: bash_code_execution_output
807 
808 - `return_code: number`
809 
810 - `stderr: string`
811 
812 - `stdout: string`
813 
814 - `type: "bash_code_execution_result"`
815 
816 default: bash_code_execution_result
873 - `"file_not_found"`
874 
875 - `error_message: string or null`
876 
877 - `BetaTextEditorCodeExecutionViewResultBlock object`
878 
879 - `type: "text_editor_code_execution_view_result"`
880 
881 default: text_editor_code_execution_view_result
882 
883 - `content: string`
884 
885 - `file_type: "text" or "image" or "pdf"`
886 
887 - `"text"`
888 
889 - `"image"`
890 
891 - `"pdf"`
892 
893 - `num_lines: number or null`
894 
895 - `start_line: number or null`
896 
897 - `total_lines: number or null`
898 
899 - `BetaTextEditorCodeExecutionCreateResultBlock object`
900 
901 - `type: "text_editor_code_execution_create_result"`
902 
903 default: text_editor_code_execution_create_result
904 
905 - `is_file_update: boolean`
906 
907 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
908 
909 - `type: "text_editor_code_execution_str_replace_result"`
910 
911 default: text_editor_code_execution_str_replace_result
912 
913 - `lines: array of string or null`
914 
915 - `new_lines: number or null`
916 
917 - `new_start: number or null`
918 
919 - `old_lines: number or null`
920 
921 - `old_start: number or null`
817922 
818923 - `tool_use_id: string`
819924 
820925 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
821926 
822 - `type: "bash_code_execution_tool_result"`
823 
824 default: bash_code_execution_tool_result
825 
826 - `BetaTextEditorCodeExecutionToolResultBlock object`
827 
828 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
829 
830 - `BetaTextEditorCodeExecutionToolResultError object`
831 
832 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
927 - `BetaToolSearchToolResultBlock object`
928 
929 - `type: "tool_search_tool_result"`
930 
931 default: tool_search_tool_result
932 
933 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
934 
935 - `BetaToolSearchToolResultError object`
936 
937 - `type: "tool_search_tool_result_error"`
938 
939 default: tool_search_tool_result_error
940 
941 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
833942 
834943 - `"invalid_tool_input"`
835944 
from line 948
839948 
840949 - `"execution_time_exceeded"`
841950 
842 - `"file_not_found"`
843 
844951 - `error_message: string or null`
845952 
846 - `type: "text_editor_code_execution_tool_result_error"`
847 
848 default: text_editor_code_execution_tool_result_error
849 
850 - `BetaTextEditorCodeExecutionViewResultBlock object`
851 
852 - `content: string`
853 
854 - `file_type: "text" or "image" or "pdf"`
855 
856 - `"text"`
857 
858 - `"image"`
859 
860 - `"pdf"`
861 
862 - `num_lines: number or null`
863 
864 - `start_line: number or null`
865 
866 - `total_lines: number or null`
867 
868 - `type: "text_editor_code_execution_view_result"`
869 
870 default: text_editor_code_execution_view_result
871 
872 - `BetaTextEditorCodeExecutionCreateResultBlock object`
873 
874 - `is_file_update: boolean`
875 
876 - `type: "text_editor_code_execution_create_result"`
877 
878 default: text_editor_code_execution_create_result
879 
880 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
881 
882 - `lines: array of string or null`
883 
884 - `new_lines: number or null`
885 
886 - `new_start: number or null`
887 
888 - `old_lines: number or null`
889 
890 - `old_start: number or null`
891 
892 - `type: "text_editor_code_execution_str_replace_result"`
893 
894 default: text_editor_code_execution_str_replace_result
953 - `BetaToolSearchToolSearchResultBlock object`
954 
955 - `type: "tool_search_tool_search_result"`
956 
957 default: tool_search_tool_search_result
958 
959 - `tool_references: array of BetaToolReferenceBlock`
960 
961 - `type: "tool_reference"`
962 
963 default: tool_reference
964 
965 - `tool_name: string`
966 
967 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
895968 
896969 - `tool_use_id: string`
897970 
898971 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
899972 
900 - `type: "text_editor_code_execution_tool_result"`
901 
902 default: text_editor_code_execution_tool_result
903 
904 - `BetaToolSearchToolResultBlock object`
905 
906 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
907 
908 - `BetaToolSearchToolResultError object`
909 
910 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
911 
912 - `"invalid_tool_input"`
913 
914 - `"unavailable"`
915 
916 - `"too_many_requests"`
917 
918 - `"execution_time_exceeded"`
919 
920 - `error_message: string or null`
921 
922 - `type: "tool_search_tool_result_error"`
923 
924 default: tool_search_tool_result_error
925 
926 - `BetaToolSearchToolSearchResultBlock object`
927 
928 - `tool_references: array of BetaToolReferenceBlock`
929 
930 - `tool_name: string`
931 
932 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
933 
934 - `type: "tool_reference"`
935 
936 default: tool_reference
937 
938 - `type: "tool_search_tool_search_result"`
939 
940 default: tool_search_tool_search_result
973 - `BetaMCPToolUseBlock object`
974 
975 - `type: "mcp_tool_use"`
976 
977 default: mcp_tool_use
978 
979 - `id: string`
980 
981 pattern: ^[a-zA-Z0-9_-]+$
982 
983 - `input: map[unknown]`
984 
985 - `name: string`
986 
987 The name of the MCP tool
988 
989 - `server_name: string`
990 
991 The name of the MCP server
992 
993 - `BetaMCPToolResultBlock object`
994 
995 - `type: "mcp_tool_result"`
996 
997 default: mcp_tool_result
998 
999 - `content: string or array of BetaTextBlock`
1000 
1001 - `string`
1002 
1003 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
1004 
1005 - `type: "text"`
1006 
1007 default: text
1008 
1009 - `citations: array of BetaTextCitation or null`
1010 
1011 Citations supporting the text block.
1012 
1013 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`.
1014 
1015 - `text: string`
1016 
1017 minLength: 0
1018 
1019 - `is_error: boolean`
1020 
1021 default: false
9411022 
9421023 - `tool_use_id: string`
9431024 
944 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
945 
946 - `type: "tool_search_tool_result"`
947 
948 default: tool_search_tool_result
949 
950 - `BetaMCPToolUseBlock object`
951 
952 - `id: string`
953 
9541025 pattern: ^[a-zA-Z0-9_-]+$
9551026 
956 - `input: map[unknown]`
957 
958 - `name: string`
959 
960 The name of the MCP tool
961 
962 - `server_name: string`
963 
964 The name of the MCP server
965 
966 - `type: "mcp_tool_use"`
967 
968 default: mcp_tool_use
969 
970 - `BetaMCPToolResultBlock object`
971 
972 - `content: string or array of BetaTextBlock`
973 
974 - `string`
975 
976 - `BetaMCPToolResultBlockContent = array of BetaTextBlock`
977 
978 - `citations: array of BetaTextCitation or null`
979 
980 Citations supporting the text block.
981 
982 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`.
983 
984 - `text: string`
985 
986 maxLength: 5000000, minLength: 0
987 
988 - `type: "text"`
989 
990 default: text
991 
992 - `is_error: boolean`
993 
994 default: false
995 
996 - `tool_use_id: string`
997 
998 pattern: ^[a-zA-Z0-9_-]+$
999 
1000 - `type: "mcp_tool_result"`
1001 
1002 default: mcp_tool_result
1003 
10041027 - `BetaContainerUploadBlock object`
10051028 
10061029 Response model for a file uploaded to the container.
10071030 
1031 - `type: "container_upload"`
1032 
1033 default: container_upload
1034 
10081035 - `file_id: string`
1009 
1010 - `type: "container_upload"`
1011 
1012 default: container_upload
10131036 
10141037 - `BetaCompactionBlock object`
10151038 
from line 1042
10191042 summary (e.g., malformed output from the model). Clients may round-trip
10201043 compaction blocks with null content; the server treats them as no-ops.
10211044 
1045 - `type: "compaction"`
1046 
1047 default: compaction
1048 
10221049 - `content: string or null`
10231050 
10241051 Summary of compacted content, or null if compaction failed
from line 1053
10261053 - `encrypted_content: string or null`
10271054 
10281055 Opaque metadata from prior compaction, to be round-tripped verbatim
1029 
1030 - `type: "compaction"`
1031 
1032 default: compaction
10331056 
10341057 - `BetaFallbackBlock object`
10351058 
from line 1068
10451068 arrives via the standard `content_block_start` / `content_block_stop`
10461069 pair and carries no deltas.
10471070 
1071 - `type: "fallback"`
1072 
1073 default: fallback
1074 
10481075 - `from: BetaFallbackInfo`
10491076 
10501077 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 1166
11391166 
11401167 What caused the `from` model to hand over at this hop.
11411168 
1169 - `type: "refusal"`
1170 
1171 default: refusal
1172 
11421173 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
11431174 
11441175 The policy category that triggered a refusal.
from line 1194
11631194 
11641195 The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
11651196 
1166 - `type: "refusal"`
1167 
1168 default: refusal
1169 
1170 - `type: "fallback"`
1171 
1172 default: fallback
1173 
11741197 - `context_management: BetaContextManagementResponse or null`
11751198 
11761199 Context management response.
from line 1206
11831206 
11841207 - `BetaClearToolUses20250919EditResponse object`
11851208 
1209 - `type: "clear_tool_uses_20250919"`
1210 
1211 The type of context management edit applied.
1212 
1213 default: clear_tool_uses_20250919
1214 
11861215 - `cleared_input_tokens: number`
11871216 
11881217 Number of input tokens cleared by this edit.
from line 1224
11951224 
11961225 minimum: 0
11971226 
1198 - `type: "clear_tool_uses_20250919"`
1227 - `BetaClearThinking20251015EditResponse object`
1228 
1229 - `type: "clear_thinking_20251015"`
11991230 
12001231 The type of context management edit applied.
12011232 
1202 default: clear_tool_uses_20250919
1203 
1204 - `BetaClearThinking20251015EditResponse object`
1233 default: clear_thinking_20251015
12051234 
12061235 - `cleared_input_tokens: number`
12071236 
from line 1243
12141243 Number of thinking turns that were cleared.
12151244 
12161245 minimum: 0
1217 
1218 - `type: "clear_thinking_20251015"`
1219 
1220 The type of context management edit applied.
1221 
1222 default: clear_thinking_20251015
12231246 
12241247 - `diagnostics: BetaDiagnostics or null`
12251248 
from line 1255
12321255 
12331256 - `BetaCacheMissModelChanged object`
12341257 
1258 - `type: "model_changed"`
1259 
1260 default: model_changed
1261 
12351262 - `cache_missed_input_tokens: number`
12361263 
12371264 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
12381265 
1239 - `type: "model_changed"`
1240 
1241 default: model_changed
1242 
12431266 - `BetaCacheMissSystemChanged object`
12441267 
1268 - `type: "system_changed"`
1269 
1270 default: system_changed
1271 
12451272 - `cache_missed_input_tokens: number`
12461273 
12471274 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
12481275 
1249 - `type: "system_changed"`
1250 
1251 default: system_changed
1252 
12531276 - `BetaCacheMissToolsChanged object`
12541277 
1278 - `type: "tools_changed"`
1279 
1280 default: tools_changed
1281 
12551282 - `cache_missed_input_tokens: number`
12561283 
12571284 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
12581285 
1259 - `type: "tools_changed"`
1260 
1261 default: tools_changed
1262 
12631286 - `BetaCacheMissMessagesChanged object`
12641287 
1288 - `type: "messages_changed"`
1289 
1290 default: messages_changed
1291 
12651292 - `cache_missed_input_tokens: number`
12661293 
12671294 Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
12681295 
1269 - `type: "messages_changed"`
1270 
1271 default: messages_changed
1272 
12731296 - `BetaCacheMissPreviousMessageNotFound object`
12741297 
12751298 - `type: "previous_message_not_found"`
from line 1322
12991322 - `stop_details: BetaRefusalStopDetails or null`
13001323 
13011324 Structured information about a refusal.
1325 
1326 - `type: "refusal"`
1327 
1328 default: refusal
13021329 
13031330 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
13041331 
from line 1406
13791406 
13801407 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.
13811408 
1382 - `type: "refusal"`
1383 
1384 default: refusal
1385 
13861409 - `stop_reason: BetaStopReason or null`
13871410 
13881411 The reason that we stopped.
from line 1444
14211444 
14221445 This value will be a non-null string if one of your custom stop sequences was generated.
14231446 
1424 - `type: "message"`
1425 
1426 Object type.
1427 
1428 For Messages, this is always `"message"`.
1429 
1430 default: message
1431 
14321447 - `usage: BetaUsage`
14331448 
14341449 Billing and rate-limit usage.
from line 1510
14951510 
14961511 No reprice was applied; `reason` says why.
14971512 
1513 - `type: "not_applied"`
1514 
1515 default: not_applied
1516 
14981517 - `reason: "body_mismatch" or "continuation_excluded" or "continuation_only" or 9 more`
14991518 
15001519 Why the reprice was not applied.
from line 1544
15251544 - `"wrong_platform"`
15261545 
15271546 - `"wrong_workspace"`
1528 
1529 - `type: "not_applied"`
1530 
1531 default: not_applied
15321547 
15331548 - `remove_to_redeem: optional array of string or null`
15341549 
from line 1582
15671582 
15681583 Token usage for a sampling iteration.
15691584 
1585 - `type: "message"`
1586 
1587 Usage for a sampling iteration
1588 
1589 default: message
1590 
15701591 - `cache_creation: BetaCacheCreation or null`
15711592 
15721593 Breakdown of cached tokens by TTL
from line 1622
16011622 
16021623 minimum: 0
16031624 
1604 - `type: "message"`
1605 
1606 Usage for a sampling iteration
1607 
1608 default: message
1609 
16101625 - `BetaCompactionIterationUsage object`
16111626 
16121627 Token usage for a compaction iteration.
16131628 
1629 - `type: "compaction"`
1630 
1631 Usage for a compaction iteration
1632 
1633 default: compaction
1634 
16141635 - `cache_creation: BetaCacheCreation or null`
16151636 
16161637 Breakdown of cached tokens by TTL
from line 1660
16391660 
16401661 minimum: 0
16411662 
1642 - `type: "compaction"`
1643 
1644 Usage for a compaction iteration
1645 
1646 default: compaction
1647 
16481663 - `BetaAdvisorMessageIterationUsage object`
16491664 
16501665 Token usage for an advisor sub-inference iteration.
16511666 
1667 - `type: "advisor_message"`
1668 
1669 Usage for an advisor sub-inference iteration
1670 
1671 default: advisor_message
1672 
16521673 - `cache_creation: BetaCacheCreation or null`
16531674 
16541675 Breakdown of cached tokens by TTL
from line 1703
16821703 The number of output tokens which were used.
16831704 
16841705 minimum: 0
1685 
1686 - `type: "advisor_message"`
1687 
1688 Usage for an advisor sub-inference iteration
1689 
1690 default: advisor_message
16911706 
16921707 - `BetaFallbackMessageIterationUsage object`
16931708 
from line 1713
16981713 a fallback model served the response is signalled by the presence of this
16991714 entry in `usage.iterations`.
17001715 
1716 - `type: "fallback_message"`
1717 
1718 Usage for the fallback-model attempt that served the response
1719 
1720 default: fallback_message
1721 
17011722 - `cache_creation: BetaCacheCreation or null`
17021723 
17031724 Breakdown of cached tokens by TTL
from line 1752
17311752 The number of output tokens which were used.
17321753 
17331754 minimum: 0
1734 
1735 - `type: "fallback_message"`
1736 
1737 Usage for the fallback-model attempt that served the response
1738 
1739 default: fallback_message
17401755 
17411756 - `output_tokens: number`
17421757 
from line 1832
18171832 the final `message_delta` event carries it only when a server-side model
18181833 fallback happened mid-stream, in which case it holds the serving model's
18191834 entries and replaces the one in `message_start`.
1835 
1836 - `type: "thinking_dropped"`
1837 
1838 Always `thinking_dropped` for this entry type.
1839 
1840 default: thinking_dropped
18201841 
18211842 - `path: string`
18221843 
from line 1869
18481869 
18491870 - `"end_user_binding_mismatch"`
18501871 
1851 - `type: "thinking_dropped"`
1852 
1853 Always `thinking_dropped` for this entry type.
1854 
1855 default: thinking_dropped
1856 
1857 - `type: "succeeded"`
1858 
1859 default: succeeded
1860 
18611872 - `BetaMessageBatchErroredResult object`
18621873 
1874 - `type: "errored"`
1875 
1876 default: errored
1877 
18631878 - `error: BetaErrorResponse`
18641879 
1880 - `type: "error"`
1881 
1882 default: error
1883 
18651884 - `error: BetaError`
18661885 
18671886 - `BetaInvalidRequestError object`
18681887 
1888 - `type: "invalid_request_error"`
1889 
1890 default: invalid_request_error
1891 
18691892 - `message: string`
18701893 
18711894 default: Invalid request
18721895 
1873 - `type: "invalid_request_error"`
1874 
1875 default: invalid_request_error
1876 
18771896 - `BetaAuthenticationError object`
18781897 
1898 - `type: "authentication_error"`
1899 
1900 default: authentication_error
1901 
18791902 - `message: string`
18801903 
18811904 default: Authentication error
18821905 
1883 - `type: "authentication_error"`
1884 
1885 default: authentication_error
1886 
18871906 - `BetaBillingError object`
18881907 
1908 - `type: "billing_error"`
1909 
1910 default: billing_error
1911 
18891912 - `message: string`
18901913 
18911914 default: Billing error
18921915 
1893 - `type: "billing_error"`
1894 
1895 default: billing_error
1896 
18971916 - `BetaPermissionError object`
18981917 
1918 - `type: "permission_error"`
1919 
1920 default: permission_error
1921 
18991922 - `message: string`
19001923 
19011924 default: Permission denied
19021925 
1903 - `type: "permission_error"`
1904 
1905 default: permission_error
1906 
19071926 - `BetaNotFoundError object`
19081927 
1928 - `type: "not_found_error"`
1929 
1930 default: not_found_error
1931 
19091932 - `message: string`
19101933 
19111934 default: Not found
19121935 
1913 - `type: "not_found_error"`
1914 
1915 default: not_found_error
1916 
19171936 - `BetaRateLimitError object`
19181937 
1938 - `type: "rate_limit_error"`
1939 
1940 default: rate_limit_error
1941 
19191942 - `message: string`
19201943 
19211944 default: Rate limited
19221945 
1923 - `type: "rate_limit_error"`
1924 
1925 default: rate_limit_error
1926 
19271946 - `BetaGatewayTimeoutError object`
19281947 
1948 - `type: "timeout_error"`
1949 
1950 default: timeout_error
1951 
19291952 - `message: string`
19301953 
19311954 default: Request timeout
19321955 
1933 - `type: "timeout_error"`
1934 
1935 default: timeout_error
1936 
19371956 - `BetaAPIError object`
19381957 
1958 - `type: "api_error"`
1959 
1960 default: api_error
1961 
19391962 - `message: string`
19401963 
19411964 default: Internal server error
19421965 
1943 - `type: "api_error"`
1944 
1945 default: api_error
1946 
19471966 - `BetaOverloadedError object`
19481967 
1968 - `type: "overloaded_error"`
1969 
1970 default: overloaded_error
1971 
19491972 - `message: string`
19501973 
19511974 default: Overloaded
19521975 
1953 - `type: "overloaded_error"`
1954 
1955 default: overloaded_error
1956 
19571976 - `request_id: string or null`
1958 
1959 - `type: "error"`
1960 
1961 default: error
1962 
1963 - `type: "errored"`
1964 
1965 default: errored
19661977 
19671978 - `BetaMessageBatchCanceledResult object`
19681979 
19691980 

api/beta/messages/batches/retrieve Changed · +18 / -9 lines

from line 1
1---
2title: Retrieve a Message Batch
3url: https://platform.claude.com/docs/en/api/beta/messages/batches/retrieve
4---
5 
16# Retrieve a Message Batch
27 
38**GET** `/v1/messages/batches/{message_batch_id}`
from line 25
2025 
2126 - `string`
2227 
23 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
28 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2429 
2530 - `"message-batches-2024-09-24"`
2631 
from line 73
6873 
6974 - `"user-profiles-2026-08-18"`
7075 
76 - `"user-profiles-2026-09-04"`
77 
7178 - `"advisor-tool-2026-03-01"`
7279 
7380 - `"managed-agents-2026-04-01"`
from line 117
110117 
111118 - `"mid-conversation-system-clear-at-2026-08-21"`
112119 
120- `"anthropic-workspace-id": optional string`
121 
113122## Returns
114123 
115124- `BetaMessageBatch object`
116125 
126 - `type: "message_batch"`
127 
128 Object type.
129 
130 For Message Batches, this is always `"message_batch"`.
131 
132 default: message_batch
133 
117134 - `id: string`
118135 
119136 Unique object identifier.
from line 228
211228 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
212229 
213230 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.
214 
215 - `type: "message_batch"`
216 
217 Object type.
218 
219 For Message Batches, this is always `"message_batch"`.
220 
221 default: message_batch
222231 
223232## Example
224233 

api/beta/messages/count_tokens Changed · +524 / -513 lines

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

from line 1
1---
2title: Count tokens in a Message
3url: https://platform.claude.com/docs/en/api/beta/messages/count_tokens
4---
5 
16# Count tokens in a Message
27 
38**POST** `/v1/messages/count_tokens`
from line 21
1621 
1722 - `string`
1823 
19 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
24 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2025 
2126 - `"message-batches-2024-09-24"`
2227 
from line 69
6469 
6570 - `"user-profiles-2026-08-18"`
6671 
72 - `"user-profiles-2026-09-04"`
73 
6774 - `"advisor-tool-2026-03-01"`
6875 
6976 - `"managed-agents-2026-04-01"`
from line 116
109116- `"anthropic-user-profile-id": optional string`
110117 
111118 The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.
119 
120- `"anthropic-workspace-id": optional string`
112121 
113122## Body parameters
114123 
from line 180
171180 
172181 - `BetaTextBlockParam object`
173182 
183 - `type: "text"`
184 
174185 - `text: string`
175186 
176187 minLength: 1
177 
178 - `type: "text"`
179188 
180189 - `cache_control: optional BetaCacheControlEphemeral or null`
181190 
from line 211
202211 
203212 - `BetaCitationCharLocationParam object`
204213 
214 - `type: "char_location"`
215 
205216 - `cited_text: string`
206217 
207218 - `document_index: number`
from line 229
218229 
219230 minimum: 0
220231 
221 - `type: "char_location"`
222 
223232 - `BetaCitationPageLocationParam object`
224233 
234 - `type: "page_location"`
235 
225236 - `cited_text: string`
226237 
227238 - `document_index: number`
from line 249
238249 
239250 minimum: 1
240251 
241 - `type: "page_location"`
242 
243252 - `BetaCitationContentBlockLocationParam object`
244253 
254 - `type: "content_block_location"`
255 
245256 - `cited_text: string`
246257 
247258 The full text of the cited block range, concatenated.
from line 279
268279 
269280 minimum: 0
270281 
271 - `type: "content_block_location"`
272 
273282 - `BetaCitationWebSearchResultLocationParam object`
274283 
284 - `type: "web_search_result_location"`
285 
275286 - `cited_text: string`
276287 
277288 - `encrypted_index: string`
from line 291
280291 
281292 maxLength: 512, minLength: 1
282293 
283 - `type: "web_search_result_location"`
284 
285294 - `url: string`
286295 
287296 minLength: 1
288297 
289298 - `BetaCitationSearchResultLocationParam object`
290299 
300 - `type: "search_result_location"`
301 
291302 - `cited_text: string`
292303 
293304 The full text of the cited block range, concatenated.
from line 329
318329 
319330 - `title: string or null`
320331 
321 - `type: "search_result_location"`
322 
323332 - `BetaImageBlockParam object`
324333 
334 - `type: "image"`
335 
325336 - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
326337 
327338 - `BetaBase64ImageSource object`
328339 
340 - `type: "base64"`
341 
329342 - `data: string`
330343 
331344 format: byte
from line 353
340353 
341354 - `"image/webp"`
342355 
356 - `BetaURLImageSource object`
357 
358 - `type: "url"`
359 
360 - `url: string`
361 
362 - `BetaFileImageSource object`
363 
364 - `type: "file"`
365 
366 - `file_id: string`
367 
368 - `cache_control: optional BetaCacheControlEphemeral or null`
369 
370 Create a cache control breakpoint at this content block.
371 
372 - `transformations: optional BetaImageTransformationsParam or null`
373 
374 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.
375 
376 - `oversized_image: optional "downsize" or "error"`
377 
378 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.
379 
380 - `"downsize"`
381 
382 - `"error"`
383 
384 - `BetaRequestDocumentBlock object`
385 
386 - `type: "document"`
387 
388 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
389 
390 - `BetaBase64PDFSource object`
391 
343392 - `type: "base64"`
344393 
345 - `BetaURLImageSource object`
394 - `data: string`
395 
396 format: byte
397 
398 - `media_type: "application/pdf"`
399 
400 - `BetaPlainTextSource object`
401 
402 - `type: "text"`
403 
404 - `data: string`
405 
406 - `media_type: "text/plain"`
407 
408 - `BetaContentBlockSource object`
409 
410 - `type: "content"`
411 
412 - `content: string or array of BetaContentBlockSourceContent`
413 
414 - `string`
415 
416 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
417 
418 - `BetaTextBlockParam object`
419 
420 - `BetaImageBlockParam object`
421 
422 - `BetaURLPDFSource object`
346423 
347424 - `type: "url"`
348425 
349426 - `url: string`
350427 
351 - `BetaFileImageSource object`
428 - `BetaFileDocumentSource object`
429 
430 - `type: "file"`
352431 
353432 - `file_id: string`
354433 
355 - `type: "file"`
356 
357 - `type: "image"`
358 
359434 - `cache_control: optional BetaCacheControlEphemeral or null`
360435 
361436 Create a cache control breakpoint at this content block.
362437 
363 - `transformations: optional BetaImageTransformationsParam or null`
364 
365 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.
366 
367 - `oversized_image: optional "downsize" or "error"`
368 
369 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.
370 
371 - `"downsize"`
372 
373 - `"error"`
374 
375 - `BetaRequestDocumentBlock object`
376 
377 - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
378 
379 - `BetaBase64PDFSource object`
380 
381 - `data: string`
382 
383 format: byte
384 
385 - `media_type: "application/pdf"`
386 
387 - `type: "base64"`
388 
389 - `BetaPlainTextSource object`
390 
391 - `data: string`
392 
393 - `media_type: "text/plain"`
394 
395 - `type: "text"`
396 
397 - `BetaContentBlockSource object`
398 
399 - `content: string or array of BetaContentBlockSourceContent`
400 
401 - `string`
402 
403 - `BetaContentBlockSourceContent = array of BetaContentBlockSourceContent`
404 
405 - `BetaTextBlockParam object`
406 
407 - `BetaImageBlockParam object`
408 
409 - `type: "content"`
410 
411 - `BetaURLPDFSource object`
412 
413 - `type: "url"`
414 
415 - `url: string`
416 
417 - `BetaFileDocumentSource object`
418 
419 - `file_id: string`
420 
421 - `type: "file"`
422 
423 - `type: "document"`
438 - `citations: optional BetaCitationsConfigParam or null`
439 
440 - `enabled: optional boolean`
441 
442 - `context: optional string or null`
443 
444 minLength: 1
445 
446 - `title: optional string or null`
447 
448 maxLength: 500, minLength: 1
449 
450 - `BetaSearchResultBlockParam object`
451 
452 - `type: "search_result"`
453 
454 - `content: array of BetaTextBlockParam`
455 
456 - `type: "text"`
457 
458 - `text: string`
459 
460 minLength: 1
461 
462 - `cache_control: optional BetaCacheControlEphemeral or null`
463 
464 Create a cache control breakpoint at this content block.
465 
466 - `citations: optional array of BetaTextCitationParam or null`
467 
468 - `source: string`
469 
470 - `title: string`
424471 
425472 - `cache_control: optional BetaCacheControlEphemeral or null`
426473 
427474 Create a cache control breakpoint at this content block.
428475 
429 - `citations: optional BetaCitationsConfigParam or null`
430 
431 - `enabled: optional boolean`
432 
433 - `context: optional string or null`
434 
435 minLength: 1
436 
437 - `title: optional string or null`
438 
439 maxLength: 500, minLength: 1
440 
441 - `BetaSearchResultBlockParam object`
442 
443 - `content: array of BetaTextBlockParam`
444 
445 - `text: string`
446 
447 minLength: 1
448 
449 - `type: "text"`
450 
451 - `cache_control: optional BetaCacheControlEphemeral or null`
452 
453 Create a cache control breakpoint at this content block.
454 
455 - `citations: optional array of BetaTextCitationParam or null`
456 
457 - `source: string`
458 
459 - `title: string`
460 
461 - `type: "search_result"`
476 - `citations: optional BetaCitationsConfigParam`
477 
478 - `BetaThinkingBlockParam object`
479 
480 - `type: "thinking"`
481 
482 - `signature: string`
483 
484 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.
485 
486 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
487 
488 - `thinking: string`
489 
490 The `thinking` text of this block as returned by the API.
491 
492 - `BetaRedactedThinkingBlockParam object`
493 
494 - `type: "redacted_thinking"`
495 
496 - `data: string`
497 
498 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.
499 
500 - `BetaToolUseBlockParam object`
501 
502 - `type: "tool_use"`
503 
504 - `id: string`
505 
506 pattern: ^[a-zA-Z0-9_-]+$
507 
508 - `input: map[unknown]`
509 
510 - `name: string`
511 
512 maxLength: 200, minLength: 1
462513 
463514 - `cache_control: optional BetaCacheControlEphemeral or null`
464515 
465516 Create a cache control breakpoint at this content block.
466517 
467 - `citations: optional BetaCitationsConfigParam`
468 
469 - `BetaThinkingBlockParam object`
470 
471 - `signature: string`
472 
473 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.
474 
475 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
476 
477 - `thinking: string`
478 
479 The `thinking` text of this block as returned by the API.
480 
481 - `type: "thinking"`
482 
483 - `BetaRedactedThinkingBlockParam object`
484 
485 - `data: string`
486 
487 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.
488 
489 - `type: "redacted_thinking"`
490 
491 - `BetaToolUseBlockParam object`
492 
493 - `id: string`
518 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
519 
520 Tool invocation directly from the model.
521 
522 - `BetaDirectCaller object`
523 
524 Tool invocation directly from the model.
525 
526 - `type: "direct"`
527 
528 - `BetaServerToolCaller object`
529 
530 Tool invocation generated by a server-side tool.
531 
532 - `type: "code_execution_20250825"`
533 
534 - `tool_id: string`
535 
536 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
537 
538 - `BetaServerToolCaller20260120 object`
539 
540 - `type: "code_execution_20260120"`
541 
542 - `tool_id: string`
543 
544 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
545 
546 - `toolset_name: optional string or null`
547 
548 For a toolset member tool_use, the toolset family this member belongs to.
549 
550 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
551 
552 - `BetaToolResultBlockParam object`
553 
554 - `type: "tool_result"`
555 
556 - `tool_use_id: string`
494557 
495558 pattern: ^[a-zA-Z0-9_-]+$
496559 
497 - `input: map[unknown]`
498 
499 - `name: string`
500 
501 maxLength: 200, minLength: 1
502 
503 - `type: "tool_use"`
504 
505560 - `cache_control: optional BetaCacheControlEphemeral or null`
506561 
507562 Create a cache control breakpoint at this content block.
508563 
509 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
510 
511 Tool invocation directly from the model.
512 
513 - `BetaDirectCaller object`
514 
515 Tool invocation directly from the model.
516 
517 - `type: "direct"`
518 
519 - `BetaServerToolCaller object`
520 
521 Tool invocation generated by a server-side tool.
522 
523 - `tool_id: string`
524 
525 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
526 
527 - `type: "code_execution_20250825"`
528 
529 - `BetaServerToolCaller20260120 object`
530 
531 - `tool_id: string`
532 
533 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
534 
535 - `type: "code_execution_20260120"`
536 
537 - `toolset_name: optional string or null`
538 
539 For a toolset member tool_use, the toolset family this member belongs to.
540 
541 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
542 
543 - `BetaToolResultBlockParam object`
544 
545 - `tool_use_id: string`
546 
547 pattern: ^[a-zA-Z0-9_-]+$
548 
549 - `type: "tool_result"`
550 
551 - `cache_control: optional BetaCacheControlEphemeral or null`
552 
553 Create a cache control breakpoint at this content block.
554 
555564 - `content: optional string or array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 3 more`
556565 
557566 - `string`
from line 579
570579 
571580 Tool reference block that can be included in tool_result content.
572581 
582 - `type: "tool_reference"`
583 
573584 - `tool_name: string`
574585 
575586 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
576 
577 - `type: "tool_reference"`
578587 
579588 - `cache_control: optional BetaCacheControlEphemeral or null`
580589 
from line 599
590599 browser toolset member `tool_use`. The server renders the
591600 model-visible text from it; the model never sees the raw fields.
592601 
602 - `type: "browser_state"`
603 
593604 - `tabs: array of BetaBrowserStateTabEntry`
594605 
595606 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 628
617628 - `active: optional boolean`
618629 
619630 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
620 
621 - `type: "browser_state"`
622631 
623632 - `cache_control: optional BetaCacheControlEphemeral or null`
624633 
from line 649
640649 during a failed call gets no deferred `tab_opened`; it simply appears
641650 in the next result's `tabs` inventory.
642651 
652 - `type: "tab_opened"`
653 
643654 - `tab_id: string`
644655 
645656 The `tab_id` of the opened tab, present in `tabs`.
646657 
647658 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
648659 
649 - `type: "tab_opened"`
650 
651660 - `BetaBrowserStateChangeDownloadStarted object`
652661 
653662 A file download that started during this call.
654663 
664 - `type: "download_started"`
665 
655666 - `download_id: string`
656667 
657668 The caller-assigned identifier for this download, stable across the state changes reporting it.
658669 
659670 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
660 
661 - `type: "download_started"`
662671 
663672 - `url: string`
664673 
from line 682
673682 `download_started`, when the download finished during the call that
674683 started it (at most one state change per `download_id` per result).
675684 
685 - `type: "download_completed"`
686 
676687 - `download_id: string`
677688 
678689 The caller-assigned identifier for this download, stable across the state changes reporting it.
679690 
680691 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
681692 
682 - `type: "download_completed"`
683 
684693 - `url: string`
685694 
686695 The final post-redirect URL the download was served from.
from line 712
703712 
704713 A file download that failed — or was cancelled — during this call.
705714 
715 - `type: "download_failed"`
716 
706717 - `download_id: string`
707718 
708719 The caller-assigned identifier for this download, stable across the state changes reporting it.
709720 
710721 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
711722 
712 - `type: "download_failed"`
713 
714723 - `url: string`
715724 
716725 The final post-redirect URL the download was served from.
from line 742
733742 
734743 - `BetaServerToolUseBlockParam object`
735744 
745 - `type: "server_tool_use"`
746 
736747 - `id: string`
737748 
738749 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 768
757768 
758769 - `"tool_search_tool_bm25"`
759770 
760 - `type: "server_tool_use"`
761 
762771 - `cache_control: optional BetaCacheControlEphemeral or null`
763772 
764773 Create a cache control breakpoint at this content block.
from line 788
779788 
780789 - `BetaWebSearchToolResultBlockParam object`
781790 
791 - `type: "web_search_tool_result"`
792 
782793 - `content: BetaWebSearchToolResultBlockParamContent`
783794 
784795 - `ResultBlock = array of BetaWebSearchResultBlockParam`
785796 
797 - `type: "web_search_result"`
798 
786799 - `encrypted_content: string`
787800 
788801 - `title: string`
789802 
790 - `type: "web_search_result"`
791 
792803 - `url: string`
793804 
794805 - `page_age: optional string or null`
795806 
796807 - `BetaWebSearchToolRequestError object`
797808 
809 - `type: "web_search_tool_result_error"`
810 
798811 - `error_code: BetaWebSearchToolResultErrorCode`
799812 
800813 - `"invalid_tool_input"`
from line 822
809822 
810823 - `"request_too_large"`
811824 
812 - `type: "web_search_tool_result_error"`
813 
814825 - `tool_use_id: string`
815826 
816827 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
817828 
818 - `type: "web_search_tool_result"`
819 
820829 - `cache_control: optional BetaCacheControlEphemeral or null`
821830 
822831 Create a cache control breakpoint at this content block.
from line 846
837846 
838847 - `BetaWebFetchToolResultBlockParam object`
839848 
849 - `type: "web_fetch_tool_result"`
850 
840851 - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
841852 
842853 - `BetaWebFetchToolResultErrorBlockParam object`
843854 
855 - `type: "web_fetch_tool_result_error"`
856 
844857 - `error_code: BetaWebFetchToolResultErrorCode`
845858 
846859 - `"invalid_tool_input"`
from line 874
861874 
862875 - `"unavailable"`
863876 
864 - `type: "web_fetch_tool_result_error"`
877 - `"content_too_large"`
865878 
866879 - `BetaWebFetchBlockParam object`
867880 
881 - `type: "web_fetch_result"`
882 
868883 - `content: BetaRequestDocumentBlock`
869884 
870 - `type: "web_fetch_result"`
871 
872885 - `url: string`
873886 
874887 Fetched content URL
from line 894
881894 
882895 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
883896 
884 - `type: "web_fetch_tool_result"`
885 
886897 - `cache_control: optional BetaCacheControlEphemeral or null`
887898 
888899 Create a cache control breakpoint at this content block.
from line 914
903914 
904915 - `BetaAdvisorToolResultBlockParam object`
905916 
917 - `type: "advisor_tool_result"`
918 
906919 - `content: BetaAdvisorToolResultErrorParam or BetaAdvisorResultBlockParam or BetaAdvisorRedactedResultBlockParam`
907920 
908921 - `BetaAdvisorToolResultErrorParam object`
909922 
923 - `type: "advisor_tool_result_error"`
924 
910925 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
911926 
912927 - `"max_uses_exceeded"`
from line 938
923938 
924939 - `"model_not_found"`
925940 
926 - `type: "advisor_tool_result_error"`
927 
928941 - `BetaAdvisorResultBlockParam object`
929942 
943 - `type: "advisor_result"`
944 
930945 - `text: string`
931946 
932 - `type: "advisor_result"`
933 
934947 - `stop_reason: optional string or null`
935948 
936949 - `BetaAdvisorRedactedResultBlockParam object`
937950 
951 - `type: "advisor_redacted_result"`
952 
938953 - `encrypted_content: string`
939954 
940955 Opaque blob produced by a prior response; must be round-tripped verbatim.
941956 
942 - `type: "advisor_redacted_result"`
943 
944957 - `stop_reason: optional string or null`
945958 
946959 - `tool_use_id: string`
947960 
948961 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
949962 
950 - `type: "advisor_tool_result"`
951 
952963 - `cache_control: optional BetaCacheControlEphemeral or null`
953964 
954965 Create a cache control breakpoint at this content block.
955966 
956967 - `BetaCodeExecutionToolResultBlockParam object`
957968 
969 - `type: "code_execution_tool_result"`
970 
958971 - `content: BetaCodeExecutionToolResultBlockParamContent`
959972 
960973 Code execution result with encrypted stdout for PFC + web_search results.
961974 
962975 - `BetaCodeExecutionToolResultErrorParam object`
963976 
977 - `type: "code_execution_tool_result_error"`
978 
964979 - `error_code: BetaCodeExecutionToolResultErrorCode`
965980 
966981 - `"invalid_tool_input"`
from line 986
971986 
972987 - `"execution_time_exceeded"`
973988 
974 - `type: "code_execution_tool_result_error"`
975 
976989 - `BetaCodeExecutionResultBlockParam object`
977990 
991 - `type: "code_execution_result"`
992 
978993 - `content: array of BetaCodeExecutionOutputBlockParam`
979994 
995 - `type: "code_execution_output"`
996 
980997 - `file_id: string`
981998 
999 - `return_code: number`
1000 
1001 - `stderr: string`
1002 
1003 - `stdout: string`
1004 
1005 - `BetaEncryptedCodeExecutionResultBlockParam object`
1006 
1007 Code execution result with encrypted stdout for PFC + web_search results.
1008 
1009 - `type: "encrypted_code_execution_result"`
1010 
1011 - `content: array of BetaCodeExecutionOutputBlockParam`
1012 
9821013 - `type: "code_execution_output"`
9831014 
1015 - `file_id: string`
1016 
1017 - `encrypted_stdout: string`
1018 
9841019 - `return_code: number`
9851020 
9861021 - `stderr: string`
9871022 
1023 - `tool_use_id: string`
1024 
1025 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1026 
1027 - `cache_control: optional BetaCacheControlEphemeral or null`
1028 
1029 Create a cache control breakpoint at this content block.
1030 
1031 - `BetaBashCodeExecutionToolResultBlockParam object`
1032 
1033 - `type: "bash_code_execution_tool_result"`
1034 
1035 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
1036 
1037 - `BetaBashCodeExecutionToolResultErrorParam object`
1038 
1039 - `type: "bash_code_execution_tool_result_error"`
1040 
1041 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1042 
1043 - `"invalid_tool_input"`
1044 
1045 - `"unavailable"`
1046 
1047 - `"too_many_requests"`
1048 
1049 - `"execution_time_exceeded"`
1050 
1051 - `"output_file_too_large"`
1052 
1053 - `BetaBashCodeExecutionResultBlockParam object`
1054 
1055 - `type: "bash_code_execution_result"`
1056 
1057 - `content: array of BetaBashCodeExecutionOutputBlockParam`
1058 
1059 - `type: "bash_code_execution_output"`
1060 
1061 - `file_id: string`
1062 
1063 - `return_code: number`
1064 
1065 - `stderr: string`
1066 
9881067 - `stdout: string`
9891068 
990 - `type: "code_execution_result"`
991 
992 - `BetaEncryptedCodeExecutionResultBlockParam object`
993 
994 Code execution result with encrypted stdout for PFC + web_search results.
995 
996 - `content: array of BetaCodeExecutionOutputBlockParam`
997 
998 - `file_id: string`
999 
1000 - `type: "code_execution_output"`
1001 
1002 - `encrypted_stdout: string`
1003 
1004 - `return_code: number`
1005 
1006 - `stderr: string`
1007 
1008 - `type: "encrypted_code_execution_result"`
1009 
10101069 - `tool_use_id: string`
10111070 
10121071 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10131072 
1014 - `type: "code_execution_tool_result"`
1015 
10161073 - `cache_control: optional BetaCacheControlEphemeral or null`
10171074 
10181075 Create a cache control breakpoint at this content block.
10191076 
1020 - `BetaBashCodeExecutionToolResultBlockParam object`
1021 
1022 - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
1023 
1024 - `BetaBashCodeExecutionToolResultErrorParam object`
1077 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
1078 
1079 - `type: "text_editor_code_execution_tool_result"`
1080 
1081 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
1082 
1083 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
1084 
1085 - `type: "text_editor_code_execution_tool_result_error"`
10251086 
10261087 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
10271088 
from line 1094
10331094 
10341095 - `"execution_time_exceeded"`
10351096 
1036 - `"output_file_too_large"`
1037 
1038 - `type: "bash_code_execution_tool_result_error"`
1039 
1040 - `BetaBashCodeExecutionResultBlockParam object`
1041 
1042 - `content: array of BetaBashCodeExecutionOutputBlockParam`
1043 
1044 - `file_id: string`
1045 
1046 - `type: "bash_code_execution_output"`
1047 
1048 - `return_code: number`
1049 
1050 - `stderr: string`
1051 
1052 - `stdout: string`
1053 
1054 - `type: "bash_code_execution_result"`
1097 - `"file_not_found"`
1098 
1099 - `error_message: optional string or null`
1100 
1101 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
1102 
1103 - `type: "text_editor_code_execution_view_result"`
1104 
1105 - `content: string`
1106 
1107 - `file_type: "text" or "image" or "pdf"`
1108 
1109 - `"text"`
1110 
1111 - `"image"`
1112 
1113 - `"pdf"`
1114 
1115 - `num_lines: optional number or null`
1116 
1117 - `start_line: optional number or null`
1118 
1119 - `total_lines: optional number or null`
1120 
1121 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
1122 
1123 - `type: "text_editor_code_execution_create_result"`
1124 
1125 - `is_file_update: boolean`
1126 
1127 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
1128 
1129 - `type: "text_editor_code_execution_str_replace_result"`
1130 
1131 - `lines: optional array of string or null`
1132 
1133 - `new_lines: optional number or null`
1134 
1135 - `new_start: optional number or null`
1136 
1137 - `old_lines: optional number or null`
1138 
1139 - `old_start: optional number or null`
10551140 
10561141 - `tool_use_id: string`
10571142 
10581143 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
10591144 
1060 - `type: "bash_code_execution_tool_result"`
1061 
10621145 - `cache_control: optional BetaCacheControlEphemeral or null`
10631146 
10641147 Create a cache control breakpoint at this content block.
10651148 
1066 - `BetaTextEditorCodeExecutionToolResultBlockParam object`
1067 
1068 - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
1069 
1070 - `BetaTextEditorCodeExecutionToolResultErrorParam object`
1071 
1072 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
1149 - `BetaToolSearchToolResultBlockParam object`
1150 
1151 - `type: "tool_search_tool_result"`
1152 
1153 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
1154 
1155 - `BetaToolSearchToolResultErrorParam object`
1156 
1157 - `type: "tool_search_tool_result_error"`
1158 
1159 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
10731160 
10741161 - `"invalid_tool_input"`
10751162 
from line 1166
10791166 
10801167 - `"execution_time_exceeded"`
10811168 
1082 - `"file_not_found"`
1083 
1084 - `type: "text_editor_code_execution_tool_result_error"`
1085 
10861169 - `error_message: optional string or null`
10871170 
1088 - `BetaTextEditorCodeExecutionViewResultBlockParam object`
1089 
1090 - `content: string`
1091 
1092 - `file_type: "text" or "image" or "pdf"`
1093 
1094 - `"text"`
1095 
1096 - `"image"`
1097 
1098 - `"pdf"`
1099 
1100 - `type: "text_editor_code_execution_view_result"`
1101 
1102 - `num_lines: optional number or null`
1103 
1104 - `start_line: optional number or null`
1105 
1106 - `total_lines: optional number or null`
1107 
1108 - `BetaTextEditorCodeExecutionCreateResultBlockParam object`
1109 
1110 - `is_file_update: boolean`
1111 
1112 - `type: "text_editor_code_execution_create_result"`
1113 
1114 - `BetaTextEditorCodeExecutionStrReplaceResultBlockParam object`
1115 
1116 - `type: "text_editor_code_execution_str_replace_result"`
1117 
1118 - `lines: optional array of string or null`
1119 
1120 - `new_lines: optional number or null`
1121 
1122 - `new_start: optional number or null`
1123 
1124 - `old_lines: optional number or null`
1125 
1126 - `old_start: optional number or null`
1171 - `BetaToolSearchToolSearchResultBlockParam object`
1172 
1173 - `type: "tool_search_tool_search_result"`
1174 
1175 - `tool_references: array of BetaToolReferenceBlockParam`
1176 
1177 - `type: "tool_reference"`
1178 
1179 - `tool_name: string`
1180 
1181 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1182 
1183 - `cache_control: optional BetaCacheControlEphemeral or null`
1184 
1185 Create a cache control breakpoint at this content block.
11271186 
11281187 - `tool_use_id: string`
11291188 
11301189 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
11311190 
1132 - `type: "text_editor_code_execution_tool_result"`
1133 
11341191 - `cache_control: optional BetaCacheControlEphemeral or null`
11351192 
11361193 Create a cache control breakpoint at this content block.
11371194 
1138 - `BetaToolSearchToolResultBlockParam object`
1139 
1140 - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
1141 
1142 - `BetaToolSearchToolResultErrorParam object`
1143 
1144 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
1145 
1146 - `"invalid_tool_input"`
1147 
1148 - `"unavailable"`
1149 
1150 - `"too_many_requests"`
1151 
1152 - `"execution_time_exceeded"`
1153 
1154 - `type: "tool_search_tool_result_error"`
1155 
1156 - `error_message: optional string or null`
1157 
1158 - `BetaToolSearchToolSearchResultBlockParam object`
1159 
1160 - `tool_references: array of BetaToolReferenceBlockParam`
1161 
1162 - `tool_name: string`
1163 
1164 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1165 
1166 - `type: "tool_reference"`
1167 
1168 - `cache_control: optional BetaCacheControlEphemeral or null`
1169 
1170 Create a cache control breakpoint at this content block.
1171 
1172 - `type: "tool_search_tool_search_result"`
1195 - `BetaMCPToolUseBlockParam object`
1196 
1197 - `type: "mcp_tool_use"`
1198 
1199 - `id: string`
1200 
1201 pattern: ^[a-zA-Z0-9_-]+$
1202 
1203 - `input: map[unknown]`
1204 
1205 - `name: string`
1206 
1207 - `server_name: string`
1208 
1209 The name of the MCP server
1210 
1211 - `cache_control: optional BetaCacheControlEphemeral or null`
1212 
1213 Create a cache control breakpoint at this content block.
1214 
1215 - `BetaRequestMCPToolResultBlockParam object`
1216 
1217 - `type: "mcp_tool_result"`
11731218 
11741219 - `tool_use_id: string`
11751220 
1176 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1177 
1178 - `type: "tool_search_tool_result"`
1221 pattern: ^[a-zA-Z0-9_-]+$
11791222 
11801223 - `cache_control: optional BetaCacheControlEphemeral or null`
11811224 
11821225 Create a cache control breakpoint at this content block.
11831226 
1184 - `BetaMCPToolUseBlockParam object`
1185 
1186 - `id: string`
1187 
1188 pattern: ^[a-zA-Z0-9_-]+$
1189 
1190 - `input: map[unknown]`
1191 
1192 - `name: string`
1193 
1194 - `server_name: string`
1195 
1196 The name of the MCP server
1197 
1198 - `type: "mcp_tool_use"`
1199 
1200 - `cache_control: optional BetaCacheControlEphemeral or null`
1201 
1202 Create a cache control breakpoint at this content block.
1203 
1204 - `BetaRequestMCPToolResultBlockParam object`
1205 
1206 - `tool_use_id: string`
1207 
1208 pattern: ^[a-zA-Z0-9_-]+$
1209 
1210 - `type: "mcp_tool_result"`
1211 
1212 - `cache_control: optional BetaCacheControlEphemeral or null`
1213 
1214 Create a cache control breakpoint at this content block.
1215 
12161227 - `content: optional string or array of BetaTextBlockParam`
12171228 
12181229 - `string`
12191230 
12201231 - `BetaMCPToolResultBlockParamContent = array of BetaTextBlockParam`
12211232 
1233 - `type: "text"`
1234 
12221235 - `text: string`
12231236 
12241237 minLength: 1
1225 
1226 - `type: "text"`
12271238 
12281239 - `cache_control: optional BetaCacheControlEphemeral or null`
12291240 
from line 1249
12381249 A content block that represents a file to be uploaded to the container
12391250 Files uploaded via this block will be available in the container's input directory.
12401251 
1252 - `type: "container_upload"`
1253 
12411254 - `file_id: string`
1242 
1243 - `type: "container_upload"`
12441255 
12451256 - `cache_control: optional BetaCacheControlEphemeral or null`
12461257 
from line 1288
12771288 `tool` references a tool (or MCP toolset) by name from the request's
12781289 `tools`; it is offered to the model from this point in the
12791290 conversation onward.
1291 
1292 - `type: "tool_addition"`
12801293 
12811294 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
12821295 
from line 1305
12921305 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
12931306 `mcp_toolset_reference` for those.
12941307 
1308 - `type: "tool_reference"`
1309 
12951310 - `name: string`
12961311 
12971312 pattern: ^[a-zA-Z0-9_-]{1,128}$
1298 
1299 - `type: "tool_reference"`
13001313 
13011314 - `BetaToolChangeMCPToolReference object`
13021315 
13031316 Reference to a single MCP tool by its server and remote name — the
13041317 same `server_name`/`name` pair `mcp_tool_use` carries.
13051318 
1319 - `type: "mcp_tool_reference"`
1320 
13061321 - `name: string`
13071322 
13081323 - `server_name: string`
13091324 
1310 - `type: "mcp_tool_reference"`
1311 
13121325 - `BetaToolChangeMCPToolsetReference object`
13131326 
13141327 Reference to every tool in the named MCP server's toolset.
13151328 
1329 - `type: "mcp_toolset_reference"`
1330 
13161331 - `server_name: string`
1317 
1318 - `type: "mcp_toolset_reference"`
1319 
1320 - `type: "tool_addition"`
13211332 
13221333 - `cache_control: optional BetaCacheControlEphemeral or null`
13231334 
from line 1341
13301341 `tool` references a tool (or MCP toolset) by name from the request's
13311342 `tools`; it is no longer offered to the model from this point in the
13321343 conversation onward.
1344 
1345 - `type: "tool_removal"`
13331346 
13341347 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
13351348 
from line 1366
13531366 - `BetaToolChangeMCPToolsetReference object`
13541367 
13551368 Reference to every tool in the named MCP server's toolset.
1356 
1357 - `type: "tool_removal"`
13581369 
13591370 - `cache_control: optional BetaCacheControlEphemeral or null`
13601371 
from line 1387
13761387 likewise rejected; between non-thinking blocks the block's placement has
13771388 no validation effect.
13781389 
1390 - `type: "fallback"`
1391 
13791392 - `from: BetaFallbackInfoParam`
13801393 
13811394 Identifies one hop of a fallback transition.
from line 1478
14651478 - `to: BetaFallbackInfoParam`
14661479 
14671480 Identifies one hop of a fallback transition.
1468 
1469 - `type: "fallback"`
14701481 
14711482 - `trigger: optional unknown`
14721483 
from line 1645
16341645 
16351646 maxItems: 20
16361647 
1648 - `type: "url"`
1649 
16371650 - `name: string`
16381651 
1639 - `type: "url"`
1640 
16411652 - `url: string`
16421653 
16431654 - `authorization_token: optional string or null`
from line 1681
16701681 
16711682 A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
16721683 
1684 - `type: "json_schema"`
1685 
16731686 - `schema: map[unknown]`
16741687 
16751688 The JSON schema of the format
16761689 
1677 - `type: "json_schema"`
1678 
16791690 - `task_budget: optional BetaTokenTaskBudget or null`
16801691 
16811692 User-configurable total token budget across contexts.
16821693 
1694 - `type: "tokens"`
1695 
1696 The budget type. Currently only 'tokens' is supported.
1697 
16831698 - `total: number`
16841699 
16851700 Total token budget across all contexts in the session.
16861701 
16871702 minimum: 1024
16881703 
1689 - `type: "tokens"`
1690 
1691 The budget type. Currently only 'tokens' is supported.
1692 
16931704 - `remaining: optional number or null`
16941705 
16951706 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 1725
17141725 
17151726 - `array of BetaTextBlockParam`
17161727 
1728 - `type: "text"`
1729 
17171730 - `text: string`
17181731 
17191732 minLength: 1
17201733 
1721 - `type: "text"`
1722 
17231734 - `cache_control: optional BetaCacheControlEphemeral or null`
17241735 
17251736 Create a cache control breakpoint at this content block.
from line 1747
17361747 
17371748 - `BetaThinkingConfigEnabled object`
17381749 
1750 - `type: "enabled"`
1751 
17391752 - `budget_tokens: number`
17401753 
17411754 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 1758
17451758 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
17461759 
17471760 minimum: 1024
1748 
1749 - `type: "enabled"`
17501761 
17511762 - `block_binding: optional BetaThinkingBlockBinding or null`
17521763 
from line 1843
18321843 
18331844 The model will use the specified tool with `tool_choice.name`.
18341845 
1846 - `type: "tool"`
1847 
18351848 - `name: string`
18361849 
18371850 The name of the tool to use.
1838 
1839 - `type: "tool"`
18401851 
18411852 - `disable_parallel_tool_use: optional boolean`
18421853 
from line 1927
19161927 
19171928 - `BetaTool object`
19181929 
1930 - `type: optional "custom" or null`
1931 
19191932 - `input_schema: object`
19201933 
19211934 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
from line 1983
19701983 
19711984 When true, guarantees schema validation on tool names and inputs
19721985 
1973 - `type: optional "custom" or null`
1974 
19751986 - `BetaToolBash20241022 object`
19761987 
1988 - `type: "bash_20241022"`
1989 
19771990 - `name: "bash"`
19781991 
19791992 Name of the tool.
19801993 
19811994 This is how the tool will be called by the model and in `tool_use` blocks.
19821995 
1983 - `type: "bash_20241022"`
1984 
19851996 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
19861997 
19871998 - `"direct"`
from line 2019
20082019 
20092020 - `BetaToolBash20250124 object`
20102021 
2022 - `type: "bash_20250124"`
2023 
20112024 - `name: "bash"`
20122025 
20132026 Name of the tool.
20142027 
20152028 This is how the tool will be called by the model and in `tool_use` blocks.
20162029 
2017 - `type: "bash_20250124"`
2018 
20192030 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
20202031 
20212032 - `"direct"`
from line 2053
20422053 
20432054 - `BetaCodeExecutionTool20250522 object`
20442055 
2056 - `type: "code_execution_20250522"`
2057 
20452058 - `name: "code_execution"`
20462059 
20472060 Name of the tool.
20482061 
20492062 This is how the tool will be called by the model and in `tool_use` blocks.
20502063 
2051 - `type: "code_execution_20250522"`
2052 
20532064 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
20542065 
20552066 - `"direct"`
from line 2085
20742085 
20752086 - `BetaCodeExecutionTool20250825 object`
20762087 
2088 - `type: "code_execution_20250825"`
2089 
20772090 - `name: "code_execution"`
20782091 
20792092 Name of the tool.
20802093 
20812094 This is how the tool will be called by the model and in `tool_use` blocks.
20822095 
2083 - `type: "code_execution_20250825"`
2084 
20852096 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
20862097 
20872098 - `"direct"`
from line 2119
21082119 
21092120 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
21102121 
2122 - `type: "code_execution_20260120"`
2123 
21112124 - `name: "code_execution"`
21122125 
21132126 Name of the tool.
21142127 
21152128 This is how the tool will be called by the model and in `tool_use` blocks.
21162129 
2117 - `type: "code_execution_20260120"`
2118 
21192130 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21202131 
21212132 - `"direct"`
from line 2153
21422153 
21432154 Code execution tool with REPL state persistence.
21442155 
2156 - `type: "code_execution_20260521"`
2157 
21452158 - `name: "code_execution"`
21462159 
21472160 Name of the tool.
21482161 
21492162 This is how the tool will be called by the model and in `tool_use` blocks.
2150 
2151 - `type: "code_execution_20260521"`
21522163 
21532164 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21542165 
from line 2205
21942205 absent. Unknown keys are rejected: the field set is this toolset
21952206 version's complete member set.
21962207 
2208 - `type: optional BetaBrowserTypeConfig or null`
2209 
2210 `type`'s config overrides.
2211 
2212 - `defer_loading: optional boolean or null`
2213 
2214 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2215 
2216 - `enabled: optional boolean or null`
2217 
2218 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.
2219 
21972220 - `close_tab: optional BetaBrowserCloseTabConfig or null`
21982221 
21992222 `close_tab`'s config overrides.
from line 2553
25302553 
25312554 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.
25322555 
2533 - `type: optional BetaBrowserTypeConfig or null`
2534 
2535 `type`'s config overrides.
2536 
2537 - `defer_loading: optional boolean or null`
2538 
2539 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2540 
2541 - `enabled: optional boolean or null`
2542 
2543 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.
2544 
25452556 - `wait: optional BetaBrowserWaitConfig or null`
25462557 
25472558 `wait`'s config overrides.
from line 2579
25682579 
25692580 - `BetaToolComputerUse20241022 object`
25702581 
2582 - `type: "computer_20241022"`
2583 
25712584 - `display_height_px: number`
25722585 
25732586 The height of the display in pixels.
from line 2599
25862599 
25872600 This is how the tool will be called by the model and in `tool_use` blocks.
25882601 
2589 - `type: "computer_20241022"`
2590 
25912602 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25922603 
25932604 - `"direct"`
from line 2631
26202631 
26212632 - `BetaMemoryTool20250818 object`
26222633 
2634 - `type: "memory_20250818"`
2635 
26232636 - `name: "memory"`
26242637 
26252638 Name of the tool.
26262639 
26272640 This is how the tool will be called by the model and in `tool_use` blocks.
26282641 
2629 - `type: "memory_20250818"`
2630 
26312642 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26322643 
26332644 - `"direct"`
from line 2665
26542665 
26552666 - `BetaToolComputerUse20250124 object`
26562667 
2668 - `type: "computer_20250124"`
2669 
26572670 - `display_height_px: number`
26582671 
26592672 The height of the display in pixels.
from line 2685
26722685 
26732686 This is how the tool will be called by the model and in `tool_use` blocks.
26742687 
2675 - `type: "computer_20250124"`
2676 
26772688 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26782689 
26792690 - `"direct"`
from line 2717
27062717 
27072718 - `BetaToolTextEditor20241022 object`
27082719 
2720 - `type: "text_editor_20241022"`
2721 
27092722 - `name: "str_replace_editor"`
27102723 
27112724 Name of the tool.
27122725 
27132726 This is how the tool will be called by the model and in `tool_use` blocks.
27142727 
2715 - `type: "text_editor_20241022"`
2716 
27172728 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27182729 
27192730 - `"direct"`
from line 2751
27402751 
27412752 - `BetaToolComputerUse20251124 object`
27422753 
2754 - `type: "computer_20251124"`
2755 
27432756 - `display_height_px: number`
27442757 
27452758 The height of the display in pixels.
from line 2770
27572770 Name of the tool.
27582771 
27592772 This is how the tool will be called by the model and in `tool_use` blocks.
2760 
2761 - `type: "computer_20251124"`
27622773 
27632774 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27642775 
from line 2831
28202831 absent. Unknown keys are rejected: the field set is this toolset
28212832 version's complete member set.
28222833 
2834 - `type: optional BetaComputerTypeConfig or null`
2835 
2836 `type`'s config overrides.
2837 
2838 - `defer_loading: optional boolean or null`
2839 
2840 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2841 
2842 - `enabled: optional boolean or null`
2843 
2844 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.
2845 
28232846 - `cursor_position: optional BetaComputerCursorPositionConfig or null`
28242847 
28252848 `cursor_position`'s config overrides.
from line 3011
29883011 
29893012 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.
29903013 
2991 - `type: optional BetaComputerTypeConfig or null`
2992 
2993 `type`'s config overrides.
2994 
2995 - `defer_loading: optional boolean or null`
2996 
2997 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2998 
2999 - `enabled: optional boolean or null`
3000 
3001 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.
3002 
30033014 - `wait: optional BetaComputerWaitConfig or null`
30043015 
30053016 `wait`'s config overrides.
from line 3037
30263037 
30273038 - `BetaToolTextEditor20250124 object`
30283039 
3040 - `type: "text_editor_20250124"`
3041 
30293042 - `name: "str_replace_editor"`
30303043 
30313044 Name of the tool.
30323045 
30333046 This is how the tool will be called by the model and in `tool_use` blocks.
30343047 
3035 - `type: "text_editor_20250124"`
3036 
30373048 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
30383049 
30393050 - `"direct"`
from line 3071
30603071 
30613072 - `BetaToolTextEditor20250429 object`
30623073 
3074 - `type: "text_editor_20250429"`
3075 
30633076 - `name: "str_replace_based_edit_tool"`
30643077 
30653078 Name of the tool.
30663079 
30673080 This is how the tool will be called by the model and in `tool_use` blocks.
30683081 
3069 - `type: "text_editor_20250429"`
3070 
30713082 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
30723083 
30733084 - `"direct"`
from line 3105
30943105 
30953106 - `BetaToolTextEditor20250728 object`
30963107 
3108 - `type: "text_editor_20250728"`
3109 
30973110 - `name: "str_replace_based_edit_tool"`
30983111 
30993112 Name of the tool.
31003113 
31013114 This is how the tool will be called by the model and in `tool_use` blocks.
31023115 
3103 - `type: "text_editor_20250728"`
3104 
31053116 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
31063117 
31073118 - `"direct"`
from line 3145
31343145 
31353146 - `BetaWebSearchTool20250305 object`
31363147 
3148 - `type: "web_search_20250305"`
3149 
31373150 - `name: "web_search"`
31383151 
31393152 Name of the tool.
31403153 
31413154 This is how the tool will be called by the model and in `tool_use` blocks.
31423155 
3143 - `type: "web_search_20250305"`
3144 
31453156 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
31463157 
31473158 - `"direct"`
from line 3221
32103221 
32113222 - `BetaWebFetchTool20250910 object`
32123223 
3224 - `type: "web_fetch_20250910"`
3225 
32133226 - `name: "web_fetch"`
32143227 
32153228 Name of the tool.
32163229 
32173230 This is how the tool will be called by the model and in `tool_use` blocks.
32183231 
3219 - `type: "web_fetch_20250910"`
3220 
32213232 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32223233 
32233234 - `"direct"`
from line 3277
32663277 
32673278 - `BetaWebSearchTool20260209 object`
32683279 
3280 - `type: "web_search_20260209"`
3281 
32693282 - `name: "web_search"`
32703283 
32713284 Name of the tool.
32723285 
32733286 This is how the tool will be called by the model and in `tool_use` blocks.
32743287 
3275 - `type: "web_search_20260209"`
3276 
32773288 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
32783289 
32793290 - `"direct"`
from line 3327
33163327 
33173328 - `BetaWebFetchTool20260209 object`
33183329 
3330 - `type: "web_fetch_20260209"`
3331 
33193332 - `name: "web_fetch"`
33203333 
33213334 Name of the tool.
33223335 
33233336 This is how the tool will be called by the model and in `tool_use` blocks.
33243337 
3325 - `type: "web_fetch_20260209"`
3326 
33273338 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33283339 
33293340 - `"direct"`
from line 3385
33743385 
33753386 Web fetch tool with use_cache parameter for bypassing cached content.
33763387 
3388 - `type: "web_fetch_20260309"`
3389 
33773390 - `name: "web_fetch"`
33783391 
33793392 Name of the tool.
33803393 
33813394 This is how the tool will be called by the model and in `tool_use` blocks.
33823395 
3383 - `type: "web_fetch_20260309"`
3384 
33853396 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
33863397 
33873398 - `"direct"`
from line 3445
34343445 
34353446 - `BetaWebSearchTool20260318 object`
34363447 
3448 - `type: "web_search_20260318"`
3449 
34373450 - `name: "web_search"`
34383451 
34393452 Name of the tool.
34403453 
34413454 This is how the tool will be called by the model and in `tool_use` blocks.
34423455 
3443 - `type: "web_search_20260318"`
3444 
34453456 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
34463457 
34473458 - `"direct"`
from line 3503
34923503 
34933504 - `BetaWebFetchTool20260318 object`
34943505 
3506 - `type: "web_fetch_20260318"`
3507 
34953508 - `name: "web_fetch"`
34963509 
34973510 Name of the tool.
34983511 
34993512 This is how the tool will be called by the model and in `tool_use` blocks.
35003513 
3501 - `type: "web_fetch_20260318"`
3502 
35033514 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35043515 
35053516 - `"direct"`
from line 3571
35603571 
35613572 - `BetaAdvisorTool20260301 object`
35623573 
3574 - `type: "advisor_20260301"`
3575 
35633576 - `model: Model`
35643577 
35653578 The model that will complete your prompt.
from line 3585
35723585 
35733586 This is how the tool will be called by the model and in `tool_use` blocks.
35743587 
3575 - `type: "advisor_20260301"`
3576 
35773588 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
35783589 
35793590 - `"direct"`
from line 3625
36143625 
36153626 - `BetaToolSearchToolBm25_20251119 object`
36163627 
3628 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3629 
3630 - `"tool_search_tool_bm25_20251119"`
3631 
3632 - `"tool_search_tool_bm25"`
3633 
36173634 - `name: "tool_search_tool_bm25"`
36183635 
36193636 Name of the tool.
36203637 
36213638 This is how the tool will be called by the model and in `tool_use` blocks.
36223639 
3623 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
3624 
3625 - `"tool_search_tool_bm25_20251119"`
3626 
3627 - `"tool_search_tool_bm25"`
3628 
36293640 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36303641 
36313642 - `"direct"`
from line 3661
36503661 
36513662 - `BetaToolSearchToolRegex20251119 object`
36523663 
3664 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3665 
3666 - `"tool_search_tool_regex_20251119"`
3667 
3668 - `"tool_search_tool_regex"`
3669 
36533670 - `name: "tool_search_tool_regex"`
36543671 
36553672 Name of the tool.
36563673 
36573674 This is how the tool will be called by the model and in `tool_use` blocks.
3658 
3659 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3660 
3661 - `"tool_search_tool_regex_20251119"`
3662 
3663 - `"tool_search_tool_regex"`
36643675 
36653676 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
36663677 
from line 3702
36913702 Allows configuring enabled status and defer_loading for all tools
36923703 from an MCP server, with optional per-tool overrides.
36933704 
3705 - `type: "mcp_toolset"`
3706 
36943707 - `mcp_server_name: string`
36953708 
36963709 Name of the MCP server to configure tools for
36973710 
36983711 maxLength: 255, minLength: 1
3699 
3700 - `type: "mcp_toolset"`
37013712 
37023713 - `cache_control: optional BetaCacheControlEphemeral or null`
37033714 
37043715 

api/beta/messages/create Changed · +1009 / -996 lines

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

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

api/beta/models Changed · +39 / -26 lines

from line 1
1---
2title: Models
3url: https://platform.claude.com/docs/en/api/beta/models
4---
5 
16# Models
27 
38## List Models
from line 39
3439 
3540 - `string`
3641 
37 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
42 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
3843 
3944 - `"message-batches-2024-09-24"`
4045 
from line 87
8287 
8388 - `"user-profiles-2026-08-18"`
8489 
90 - `"user-profiles-2026-09-04"`
91 
8592 - `"advisor-tool-2026-03-01"`
8693 
8794 - `"managed-agents-2026-04-01"`
from line 131
124131 
125132 - `"mid-conversation-system-clear-at-2026-08-21"`
126133 
134- `"anthropic-workspace-id": optional string`
135 
127136### Returns
128137 
129138- `data: array of BetaModelInfo`
130139 
140 - `type: "model"`
141 
142 Object type.
143 
144 For Models, this is always `"model"`.
145 
146 default: model
147 
131148 - `id: string`
132149 
133150 Unique model identifier.
from line 271
254271 
255272 Maximum value for the `max_tokens` parameter when using this model.
256273 
257 - `type: "model"`
258 
259 Object type.
260 
261 For Models, this is always `"model"`.
262 
263 default: model
264 
265274- `first_id: string or null`
266275 
267276 First ID in the `data` list. Can be used as the `before_id` for the previous page.
from line 397
388397 
389398 - `string`
390399 
391 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
400 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
392401 
393402 - `"message-batches-2024-09-24"`
394403 
from line 445
436445 
437446 - `"user-profiles-2026-08-18"`
438447 
448 - `"user-profiles-2026-09-04"`
449 
439450 - `"advisor-tool-2026-03-01"`
440451 
441452 - `"managed-agents-2026-04-01"`
from line 489
478489 
479490 - `"mid-conversation-system-clear-at-2026-08-21"`
480491 
492- `"anthropic-workspace-id": optional string`
493 
481494### Returns
482495 
483496- `BetaModelInfo object`
484497 
498 - `type: "model"`
499 
500 Object type.
501 
502 For Models, this is always `"model"`.
503 
504 default: model
505 
485506 - `id: string`
486507 
487508 Unique model identifier.
from line 629
608629 
609630 Maximum value for the `max_tokens` parameter when using this model.
610631 
611 - `type: "model"`
612 
613 Object type.
614 
615 For Models, this is always `"model"`.
616 
617 default: model
618 
619632### Example
620633 
621634```bash
from line 892
879892 
880893- `BetaModelInfo object`
881894 
895 - `type: "model"`
896 
897 Object type.
898 
899 For Models, this is always `"model"`.
900 
901 default: model
902 
882903 - `id: string`
883904 
884905 Unique model identifier.
from line 1025
10041025 - `max_tokens: number or null`
10051026 
10061027 Maximum value for the `max_tokens` parameter when using this model.
1007 
1008 - `type: "model"`
1009 
1010 Object type.
1011 
1012 For Models, this is always `"model"`.
1013 
1014 default: model
10151028 
10161029### Beta Thinking Capability
10171030 

api/beta/models/list Changed · +18 / -9 lines

from line 1
1---
2title: List Models
3url: https://platform.claude.com/docs/en/api/beta/models/list
4---
5 
16# List Models
27 
38**GET** `/v1/models`
from line 37
3237 
3338 - `string`
3439 
35 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
40 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
3641 
3742 - `"message-batches-2024-09-24"`
3843 
from line 85
8085 
8186 - `"user-profiles-2026-08-18"`
8287 
88 - `"user-profiles-2026-09-04"`
89 
8390 - `"advisor-tool-2026-03-01"`
8491 
8592 - `"managed-agents-2026-04-01"`
from line 129
122129 
123130 - `"mid-conversation-system-clear-at-2026-08-21"`
124131 
132- `"anthropic-workspace-id": optional string`
133 
125134## Returns
126135 
127136- `data: array of BetaModelInfo`
128137 
138 - `type: "model"`
139 
140 Object type.
141 
142 For Models, this is always `"model"`.
143 
144 default: model
145 
129146 - `id: string`
130147 
131148 Unique model identifier.
from line 268
251268 - `max_tokens: number or null`
252269 
253270 Maximum value for the `max_tokens` parameter when using this model.
254 
255 - `type: "model"`
256 
257 Object type.
258 
259 For Models, this is always `"model"`.
260 
261 default: model
262271 
263272- `first_id: string or null`
264273 

api/beta/models/retrieve Changed · +18 / -9 lines

from line 1
1---
2title: Get a Model
3url: https://platform.claude.com/docs/en/api/beta/models/retrieve
4---
5 
16# Get a Model
27 
38**GET** `/v1/models/{model_id}`
from line 25
2025 
2126 - `string`
2227 
23 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 41 more`
28 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 42 more`
2429 
2530 - `"message-batches-2024-09-24"`
2631 
from line 73
6873 
6974 - `"user-profiles-2026-08-18"`
7075 
76 - `"user-profiles-2026-09-04"`
77 
7178 - `"advisor-tool-2026-03-01"`
7279 
7380 - `"managed-agents-2026-04-01"`
from line 117
110117 
111118 - `"mid-conversation-system-clear-at-2026-08-21"`
112119 
120- `"anthropic-workspace-id": optional string`
121 
113122## Returns
114123 
115124- `BetaModelInfo object`
116125 
126 - `type: "model"`
127 
128 Object type.
129 
130 For Models, this is always `"model"`.
131 
132 default: model
133 
117134 - `id: string`
118135 
119136 Unique model identifier.
from line 256
239256 - `max_tokens: number or null`
240257 
241258 Maximum value for the `max_tokens` parameter when using this model.
242 
243 - `type: "model"`
244 
245 Object type.
246 
247 For Models, this is always `"model"`.
248 
249 default: model
250259 
251260## Example
252261 

api/beta/organization Changed · +9382 / -502 lines

### Retrieve API Key (Admin API) ## Organization › Usage Report ### Get Messages Usage Report ### Get Claude Code Usage Report ## Organization › Cost Report ### Get Cost Report ## Organization › MCP Tunnels ### List Tunnels ### Get Tunnel ### Archive Tunnel ### Reveal Tunnel Token ### Rotate Tunnel Token ## Organization › MCP Tunnels › Tunnel Certificates ### Create Tunnel Certificate ### List Tunnel Certificates ### Get Tunnel Certificate ### Archive Tunnel Certificate ## Organization › Analytics ### Get Activity Summaries ## Organization › Analytics › Usage ### Get Token Usage Over Time ### Get Per-User Token Usage ## Organization › Analytics › Cost ### Get Cost Over Time ### Get Per-User Cost ## Organization › Analytics › Users ### List User Activity ## Organization › Analytics › Skills ### Get Skill Usage ## Organization › Analytics › Connectors ### Get Connector Usage ## Organization › Analytics › Chat Projects ### Get Chat Project Usage ## Organization › Analytics › Plugins ### Get Plugin Usage ## Organization › Analytics › Artifacts ### Get Artifact Activity ## Organization › Spend Limits ### Set Spend Limit ### Get Spend Limit ### Delete Spend Limit ### List Effective Spend Limits ## Organization › Spend Limits › Increase Requests ### List Spend Limit Increase Requests ### Get Spend Limit Increase Request ### Approve Spend Limit Increase Request ### Deny Spend Limit Increase Request ## Organization › RBAC Groups ### List RBAC Groups ### Get RBAC Group ### Create RBAC Group ### Update RBAC Group ### Delete RBAC Group ## Organization › RBAC Groups › Members ### List RBAC Group Members ### Add RBAC Group Member ### Remove RBAC Group Member ## Organization › RBAC Roles ### List RBAC Roles ### Get RBAC Role ## Organization › RBAC Roles › Permissions ### List RBAC Role Permissions ### Get API Key

This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.

Nothing in the body moved in this read. What changed is above.

api/beta/organization/analytics New page · 3517 lines, new page

# Analytics ## Get Activity Summaries ### Query parameters ### Returns ### Example #### Response (200) ## Domain types ### Beta Activity Summary ### Beta Analytics User ### Beta Analytics User Actor ### Beta Connector Office Product Metrics ### Beta Office Product Metrics ### Beta Skill Office Product Metrics ### Beta Tool Action Counts ## Analytics › Usage ### Get Token Usage Over Time #### Query parameters #### Returns #### Example ##### Response (200) ### Get Per-User Token Usage #### Query parameters #### Returns #### Example ##### Response (200) ## Analytics › Cost ### Get Cost Over Time #### Query parameters #### Returns #### Example ##### Response (200) ### Get Per-User Cost #### Query parameters #### Returns #### Example ##### Response (200) ## Analytics › Users ### List User Activity #### Query parameters #### Returns #### Example ##### Response (200) ## Analytics › Skills ### Get Skill Usage #### Query parameters #### Returns #### Example ##### Response (200) ## Analytics › Connectors ### Get Connector Usage #### Query parameters #### Returns #### Example ##### Response (200) ## Analytics › Chat Projects ### Get Chat Project Usage #### Query parameters #### Returns #### Example ##### Response (200) ## Analytics › Plugins ### Get Plugin Usage #### Query parameters #### Returns #### Example ##### Response (200) ## Analytics › Artifacts ### Get Artifact Activity #### Query parameters #### Returns #### Example ##### Response (200)

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Analytics
url: https://platform.claude.com/docs/en/api/beta/organization/analytics
---

# Analytics

## Get Activity Summaries

**GET** `/v1/organizations/analytics/summaries`

Get organization-wide activity summaries for a date range.

Returns one entry per day from `starting_date` (inclusive) to `ending_date`
(exclusive). Data is typically available with a 1-day lag and may be
revised by a few percent over the following days: when `ending_date` is
omitted it defaults to the most recent available day + 1, so the last
entry covers the most recent available day. The series can be scoped to
an RBAC group via `filter[]=rbac_group_id:{id}`. Available to
organizations on a Claude Enterprise plan. Requires an API key with the
`read:analytics` scope.

### Query parameters

- `starting_date: string`

  UTC date in YYYY-MM-DD format. Start of the date range (inclusive). Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `ending_date: optional string`

  UTC date in YYYY-MM-DD format. End of the date range (exclusive). Data is typically available with a 1-day lag, so this can be at most today — which is also the default when omitted, making the last entry cover the most recent available day. Data may be revised by a few percent over the following days. The range may span at most 366 days.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`. Only `rbac_group_id` is supported (e.g. `filter[]=rbac_group_id:{id}`); repeat the param to OR across groups. Scopes the whole day series to members of the matching group(s), re-aggregated from member-level activity — org-wide seat/invite fields and the adoption rates derived from them are null on scoped rows. `rbac_group_id` accepts the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each UTC day (time-of-usage attribution). At most 100 entries.

  maxItems: 100

### Returns

- `BetaActivitySummary object`

  Response for GET /v1/organizations/analytics/summaries.

  - `summaries: array of object`

    - `assigned_seat_count: number or null`

      Number of seats currently assigned to members. Null when the response is scoped to an RBAC group — seat assignment is org-wide and has no per-group analogue.

    - `cowork_daily_active_user_count: number`

      Number of users with Cowork activity on the requested day

    - `cowork_monthly_active_user_count: number`

      Number of users with Cowork activity in the 30-day rolling window

    - `cowork_weekly_active_user_count: number`

      Number of users with Cowork activity in the 7-day rolling window

    - `daily_active_user_count: number`

      Number of users with token consumption on the requested day

    - `daily_adoption_rate: number or null`

      Percentage of assigned seats with activity on the requested day (`DAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

    - `ending_at: string`

      End of the aggregation period (exclusive), UTC midnight in RFC 3339 format (e.g. `2026-01-16T00:00:00Z`).

      format: date-time

    - `monthly_active_user_count: number`

      Number of users with token consumption in the 30-day rolling window

    - `monthly_adoption_rate: number or null`

      Percentage of assigned seats with activity in the 30-day rolling window (`MAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

    - `pending_invite_count: number or null`

      Number of pending invitations to join the organization. Null when the response is scoped to an RBAC group.

    - `starting_at: string`

      Start of the aggregation period (inclusive), UTC midnight in RFC 3339 format (e.g. `2026-01-15T00:00:00Z`).

      format: date-time

    - `weekly_active_user_count: number`

      Number of users with token consumption in the 7-day rolling window

    - `weekly_adoption_rate: number or null`

      Percentage of assigned seats with activity in the 7-day rolling window (`WAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

    - `chat_daily_active_user_count: optional number or null`

      Number of users with claude.ai (chat) activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `chat_monthly_active_user_count: optional number or null`

      Number of users with claude.ai (chat) activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `chat_weekly_active_user_count: optional number or null`

      Number of users with claude.ai (chat) activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `claude_code_daily_active_user_count: optional number or null`

      Number of users with Claude Code activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `claude_code_monthly_active_user_count: optional number or null`

      Number of users with Claude Code activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `claude_code_weekly_active_user_count: optional number or null`

      Number of users with Claude Code activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `claude_design_daily_active_user_count: optional number or null`

      Number of users with Claude Design activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `claude_design_monthly_active_user_count: optional number or null`

      Number of users with Claude Design activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `claude_design_weekly_active_user_count: optional number or null`

      Number of users with Claude Design activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `office_agent_daily_active_user_count: optional number or null`

      Number of users with Claude in Office activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `office_agent_monthly_active_user_count: optional number or null`

      Number of users with Claude in Office activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `office_agent_weekly_active_user_count: optional number or null`

      Number of users with Claude in Office activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `science_daily_active_user_count: optional number or null`

      Number of users with Claude Science activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `science_entitled_user_count: optional number or null`

      Number of users with a Claude Science seat entitlement (per-seat RBAC) at the time of the daily snapshot. The funnel top; independent of the org-level Claude Science toggle. Null when the response is scoped to an RBAC group — entitlement is org-wide and has no per-group analogue. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `science_monthly_active_user_count: optional number or null`

      Number of users with Claude Science activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `science_weekly_active_user_count: optional number or null`

      Number of users with Claude Science activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

### Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/summaries \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response (200)

```json
{
  "summaries": [
    {
      "assigned_seat_count": 0,
      "cowork_daily_active_user_count": 0,
      "cowork_monthly_active_user_count": 0,
      "cowork_weekly_active_user_count": 0,
      "daily_active_user_count": 0,
      "daily_adoption_rate": 0,
      "ending_at": "2019-12-27T18:11:19.117Z",
      "monthly_active_user_count": 0,
      "monthly_adoption_rate": 0,
      "pending_invite_count": 0,
      "starting_at": "2019-12-27T18:11:19.117Z",
      "weekly_active_user_count": 0,
      "weekly_adoption_rate": 0,
      "chat_daily_active_user_count": 0,
      "chat_monthly_active_user_count": 0,
      "chat_weekly_active_user_count": 0,
      "claude_code_daily_active_user_count": 0,
      "claude_code_monthly_active_user_count": 0,
      "claude_code_weekly_active_user_count": 0,
      "claude_design_daily_active_user_count": 0,
      "claude_design_monthly_active_user_count": 0,
      "claude_design_weekly_active_user_count": 0,
      "office_agent_daily_active_user_count": 0,
      "office_agent_monthly_active_user_count": 0,
      "office_agent_weekly_active_user_count": 0,
      "science_daily_active_user_count": 0,
      "science_entitled_user_count": 0,
      "science_monthly_active_user_count": 0,
      "science_weekly_active_user_count": 0
    }
  ]
}
```

## Domain types

### Beta Activity Summary

- `BetaActivitySummary object`

  Response for GET /v1/organizations/analytics/summaries.

  - `summaries: array of object`

    - `assigned_seat_count: number or null`

      Number of seats currently assigned to members. Null when the response is scoped to an RBAC group — seat assignment is org-wide and has no per-group analogue.

    - `cowork_daily_active_user_count: number`

      Number of users with Cowork activity on the requested day

    - `cowork_monthly_active_user_count: number`

      Number of users with Cowork activity in the 30-day rolling window

    - `cowork_weekly_active_user_count: number`

      Number of users with Cowork activity in the 7-day rolling window

    - `daily_active_user_count: number`

      Number of users with token consumption on the requested day

    - `daily_adoption_rate: number or null`

      Percentage of assigned seats with activity on the requested day (`DAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

    - `ending_at: string`

      End of the aggregation period (exclusive), UTC midnight in RFC 3339 format (e.g. `2026-01-16T00:00:00Z`).

      format: date-time

    - `monthly_active_user_count: number`

      Number of users with token consumption in the 30-day rolling window

    - `monthly_adoption_rate: number or null`

      Percentage of assigned seats with activity in the 30-day rolling window (`MAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

    - `pending_invite_count: number or null`

      Number of pending invitations to join the organization. Null when the response is scoped to an RBAC group.

    - `starting_at: string`

      Start of the aggregation period (inclusive), UTC midnight in RFC 3339 format (e.g. `2026-01-15T00:00:00Z`).

      format: date-time

    - `weekly_active_user_count: number`

      Number of users with token consumption in the 7-day rolling window

    - `weekly_adoption_rate: number or null`

      Percentage of assigned seats with activity in the 7-day rolling window (`WAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

    - `chat_daily_active_user_count: optional number or null`

      Number of users with claude.ai (chat) activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `chat_monthly_active_user_count: optional number or null`

      Number of users with claude.ai (chat) activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `chat_weekly_active_user_count: optional number or null`

      Number of users with claude.ai (chat) activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

    - `claude_code_daily_active_user_count: optional number or null`

      Number of users with Claude Code activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

Cut at 300 lines. The page has the rest.

api/beta/organization/analytics/artifacts New page · 191 lines, new page

# Artifacts ## Get Artifact Activity ### Query parameters ### Returns ### Example #### Response (200) ## Domain types ### Beta Artifact Usage

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Artifacts
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/artifacts
---

# Artifacts

## Get Artifact Activity

**GET** `/v1/organizations/analytics/artifacts`

Get artifact-creation activity for a given day, broken out by MIME type.

Returns the full (`artifact_type`, `is_shared`) cube for the organization;
`next_page` is null except for grouped queries, which paginate. The cube
can be broken out per product, per member, or per RBAC group via
`group_by[]`, and scoped via `filter[]`. Requires an API key with the
`read:analytics` scope.

### Query parameters

- `date: string`

  UTC date in YYYY-MM-DD format. The day to get artifact activity for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `artifact_type`, `is_shared`, `product`, `rbac_group_id`, `user_id`. Value forms: `artifact_type` is a canonical artifact MIME type (e.g. `text/markdown`) or `other`; `is_shared` is `true` or `false`; `product` is `chat`, `claude_code`, or `cowork` (the surfaces that create artifacts); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

  maxItems: 100

- `group_by: optional array of "product" or "rbac_group_id" or "user_id"`

  Dimensions to break results out by: `product`, `user_id` and/or `rbac_group_id`. The ungrouped artifact-type cube is finite and returned in full; grouped queries multiply the cube and paginate via `next_page`. `product` takes the values `chat`, `claude_code`, or `cowork` (the surfaces that create artifacts). `rbac_group_id` attributes a user to every group they held at any point during the requested UTC day, so grouped rows are not an exclusive partition. At most 100 entries.

  maxItems: 100

  - `"product"`

  - `"rbac_group_id"`

  - `"user_id"`

- `limit: optional number`

  Maximum rows to return (1-1000, default 100). The ungrouped artifact-type cube is finite and returned in full; `limit` is the page size only when `group_by[]` multiplies the cube.

  minimum: 1, maximum: 1000

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field. Only valid with `group_by[]` — the ungrouped cube is never paginated.

### Returns

- `BetaArtifactUsage object`

  Response for GET /v1/organizations/analytics/artifacts.

  `next_page` is null on ungrouped queries — the artifact-type cube is
  finite and returned in full. Grouped queries (`group_by[]` on `product` /
  `user_id` / `rbac_group_id`) multiply the cube and paginate like the other
  analytics list endpoints.

  - `data: array of object`

    - `artifact_type: string`

      Canonical artifact MIME type (e.g. `text/markdown`, `application/vnd.ant.react`, `image/svg+xml`), or `other`. Claude Code and Cowork artifacts report as `text/html`.

    - `artifacts_created_count: number`

      Number of artifacts created in this bucket on the requested day

    - `distinct_user_count: number`

      Number of distinct users who created artifacts in this bucket on the requested day

    - `is_shared: boolean`

      Whether the artifacts in this bucket have ever been shared (a Claude Code / Cowork artifact is shared once anyone beyond its creator may open it: named members, the whole organization, or anyone with the link).

    - `published_artifacts_created_count: number`

      Number of those artifacts that have been published (for Claude Code / Cowork artifacts: open to anyone with the link); never exceeds `artifacts_created_count`

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Cursor for the next page of a grouped query; always null for the ungrouped artifact-type cube, which is returned in full.

### Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/artifacts \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response (200)

```json
{
  "data": [
    {
      "artifact_type": "artifact_type",
      "artifacts_created_count": 0,
      "distinct_user_count": 0,
      "is_shared": true,
      "published_artifacts_created_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

## Domain types

### Beta Artifact Usage

- `BetaArtifactUsage object`

  Response for GET /v1/organizations/analytics/artifacts.

  `next_page` is null on ungrouped queries — the artifact-type cube is
  finite and returned in full. Grouped queries (`group_by[]` on `product` /
  `user_id` / `rbac_group_id`) multiply the cube and paginate like the other
  analytics list endpoints.

  - `data: array of object`

    - `artifact_type: string`

      Canonical artifact MIME type (e.g. `text/markdown`, `application/vnd.ant.react`, `image/svg+xml`), or `other`. Claude Code and Cowork artifacts report as `text/html`.

    - `artifacts_created_count: number`

      Number of artifacts created in this bucket on the requested day

    - `distinct_user_count: number`

      Number of distinct users who created artifacts in this bucket on the requested day

    - `is_shared: boolean`

      Whether the artifacts in this bucket have ever been shared (a Claude Code / Cowork artifact is shared once anyone beyond its creator may open it: named members, the whole organization, or anyone with the link).

    - `published_artifacts_created_count: number`

      Number of those artifacts that have been published (for Claude Code / Cowork artifacts: open to anyone with the link); never exceeds `artifacts_created_count`

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Cursor for the next page of a grouped query; always null for the ungrouped artifact-type cube, which is returned in full.

api/beta/organization/analytics/artifacts/list New page · 134 lines, new page

# Get Artifact Activity ## Query parameters ## Returns ## Example ### Response (200)

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Get Artifact Activity
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/artifacts/list
---

# Get Artifact Activity

**GET** `/v1/organizations/analytics/artifacts`

Get artifact-creation activity for a given day, broken out by MIME type.

Returns the full (`artifact_type`, `is_shared`) cube for the organization;
`next_page` is null except for grouped queries, which paginate. The cube
can be broken out per product, per member, or per RBAC group via
`group_by[]`, and scoped via `filter[]`. Requires an API key with the
`read:analytics` scope.

## Query parameters

- `date: string`

  UTC date in YYYY-MM-DD format. The day to get artifact activity for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `artifact_type`, `is_shared`, `product`, `rbac_group_id`, `user_id`. Value forms: `artifact_type` is a canonical artifact MIME type (e.g. `text/markdown`) or `other`; `is_shared` is `true` or `false`; `product` is `chat`, `claude_code`, or `cowork` (the surfaces that create artifacts); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

  maxItems: 100

- `group_by: optional array of "product" or "rbac_group_id" or "user_id"`

  Dimensions to break results out by: `product`, `user_id` and/or `rbac_group_id`. The ungrouped artifact-type cube is finite and returned in full; grouped queries multiply the cube and paginate via `next_page`. `product` takes the values `chat`, `claude_code`, or `cowork` (the surfaces that create artifacts). `rbac_group_id` attributes a user to every group they held at any point during the requested UTC day, so grouped rows are not an exclusive partition. At most 100 entries.

  maxItems: 100

  - `"product"`

  - `"rbac_group_id"`

  - `"user_id"`

- `limit: optional number`

  Maximum rows to return (1-1000, default 100). The ungrouped artifact-type cube is finite and returned in full; `limit` is the page size only when `group_by[]` multiplies the cube.

  minimum: 1, maximum: 1000

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field. Only valid with `group_by[]` — the ungrouped cube is never paginated.

## Returns

- `BetaArtifactUsage object`

  Response for GET /v1/organizations/analytics/artifacts.

  `next_page` is null on ungrouped queries — the artifact-type cube is
  finite and returned in full. Grouped queries (`group_by[]` on `product` /
  `user_id` / `rbac_group_id`) multiply the cube and paginate like the other
  analytics list endpoints.

  - `data: array of object`

    - `artifact_type: string`

      Canonical artifact MIME type (e.g. `text/markdown`, `application/vnd.ant.react`, `image/svg+xml`), or `other`. Claude Code and Cowork artifacts report as `text/html`.

    - `artifacts_created_count: number`

      Number of artifacts created in this bucket on the requested day

    - `distinct_user_count: number`

      Number of distinct users who created artifacts in this bucket on the requested day

    - `is_shared: boolean`

      Whether the artifacts in this bucket have ever been shared (a Claude Code / Cowork artifact is shared once anyone beyond its creator may open it: named members, the whole organization, or anyone with the link).

    - `published_artifacts_created_count: number`

      Number of those artifacts that have been published (for Claude Code / Cowork artifacts: open to anyone with the link); never exceeds `artifacts_created_count`

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Cursor for the next page of a grouped query; always null for the ungrouped artifact-type cube, which is returned in full.

## Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/artifacts \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

### Response (200)

```json
{
  "data": [
    {
      "artifact_type": "artifact_type",
      "artifacts_created_count": 0,
      "distinct_user_count": 0,
      "is_shared": true,
      "published_artifacts_created_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

api/beta/organization/analytics/chat_projects New page · 257 lines, new page

# Chat Projects ## Get Chat Project Usage ### Query parameters ### Returns ### Example #### Response (200) ## Domain types ### Beta Chat Project Usage

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Chat Projects
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/chat_projects
---

# Chat Projects

## Get Chat Project Usage

**GET** `/v1/organizations/analytics/apps/chat/projects`

Get per-project activity for a given day, with cursor-based pagination.

Returns activity metrics for each project in the organization, sorted by
project ID. Use `group_by[]` to break projects out per member or per RBAC
group, and `filter[]` to scope results; the parameter descriptions list the
supported dimensions. Available to organizations on a Claude Enterprise
plan. Requires an API key with the `read:analytics` scope.

### Query parameters

- `date: optional string`

  UTC date in YYYY-MM-DD format. The day to get project activity for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `ending_date: optional string`

  UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `project_id`, `rbac_group_id`, `user_id`. Value forms: `project_id` takes a tagged project id (`claude_proj_...`); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

  maxItems: 100

- `group_by: optional array of "rbac_group_id" or "user_id"`

  Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `rbac_group_id`, `user_id`. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

  maxItems: 100

  - `"rbac_group_id"`

  - `"user_id"`

- `limit: optional number`

  Number of results per page (1-1000, default 100).

  minimum: 1, maximum: 1000

- `order: optional "asc" or "desc"`

  Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

  - `"asc"`

  - `"desc"`

- `order_by: optional string`

  Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `starting_date: optional string`

  UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

### Returns

- `BetaChatProjectUsage object`

  Response for GET /v1/organizations/analytics/apps/chat/projects.

  - `data: array of object`

    - `distinct_user_count: number`

      Number of distinct users who used the project on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `message_count: number`

      Number of messages sent in the project on the requested day

    - `project_id: string`

      Tagged project identifier (e.g. `claude_proj_...`)

    - `project_name: string`

      Name of the project

    - `created_at: optional string or null`

      Project creation timestamp in RFC 3339 format. Null if the project was deleted before attribution was recorded.

      format: date-time

    - `created_by: optional BetaAnalyticsUser or null`

      A user in the organization, identified by tagged id and email address.

      - `type: "user"`

        Object type. Always `user`.

        default: user

      - `id: string`

        Tagged user identifier (e.g. `user_...`)

      - `email_address: string`

        Email address of the user

    - `distinct_conversation_count: optional number or null`

      Number of distinct conversations in the project. Null on aggregated rows where a distinct count cannot be computed.

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Opaque cursor for the next page, or null if no more results

### Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/apps/chat/projects \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response (200)

```json
{
  "data": [
    {
      "distinct_user_count": 0,
      "message_count": 0,
      "project_id": "project_id",
      "project_name": "project_name",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "email_address": "email_address",
        "type": "user"
      },
      "distinct_conversation_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

## Domain types

### Beta Chat Project Usage

- `BetaChatProjectUsage object`

  Response for GET /v1/organizations/analytics/apps/chat/projects.

  - `data: array of object`

    - `distinct_user_count: number`

      Number of distinct users who used the project on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `message_count: number`

      Number of messages sent in the project on the requested day

    - `project_id: string`

      Tagged project identifier (e.g. `claude_proj_...`)

    - `project_name: string`

      Name of the project

    - `created_at: optional string or null`

      Project creation timestamp in RFC 3339 format. Null if the project was deleted before attribution was recorded.

      format: date-time

    - `created_by: optional BetaAnalyticsUser or null`

      A user in the organization, identified by tagged id and email address.

      - `type: "user"`

        Object type. Always `user`.

        default: user

      - `id: string`

        Tagged user identifier (e.g. `user_...`)

      - `email_address: string`

        Email address of the user

    - `distinct_conversation_count: optional number or null`

      Number of distinct conversations in the project. Null on aggregated rows where a distinct count cannot be computed.

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Opaque cursor for the next page, or null if no more results

api/beta/organization/analytics/chat_projects/list New page · 181 lines, new page

# Get Chat Project Usage ## Query parameters ## Returns ## Example ### Response (200)

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Get Chat Project Usage
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/chat_projects/list
---

# Get Chat Project Usage

**GET** `/v1/organizations/analytics/apps/chat/projects`

Get per-project activity for a given day, with cursor-based pagination.

Returns activity metrics for each project in the organization, sorted by
project ID. Use `group_by[]` to break projects out per member or per RBAC
group, and `filter[]` to scope results; the parameter descriptions list the
supported dimensions. Available to organizations on a Claude Enterprise
plan. Requires an API key with the `read:analytics` scope.

## Query parameters

- `date: optional string`

  UTC date in YYYY-MM-DD format. The day to get project activity for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `ending_date: optional string`

  UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `project_id`, `rbac_group_id`, `user_id`. Value forms: `project_id` takes a tagged project id (`claude_proj_...`); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

  maxItems: 100

- `group_by: optional array of "rbac_group_id" or "user_id"`

  Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `rbac_group_id`, `user_id`. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

  maxItems: 100

  - `"rbac_group_id"`

  - `"user_id"`

- `limit: optional number`

  Number of results per page (1-1000, default 100).

  minimum: 1, maximum: 1000

- `order: optional "asc" or "desc"`

  Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

  - `"asc"`

  - `"desc"`

- `order_by: optional string`

  Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `starting_date: optional string`

  UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

## Returns

- `BetaChatProjectUsage object`

  Response for GET /v1/organizations/analytics/apps/chat/projects.

  - `data: array of object`

    - `distinct_user_count: number`

      Number of distinct users who used the project on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `message_count: number`

      Number of messages sent in the project on the requested day

    - `project_id: string`

      Tagged project identifier (e.g. `claude_proj_...`)

    - `project_name: string`

      Name of the project

    - `created_at: optional string or null`

      Project creation timestamp in RFC 3339 format. Null if the project was deleted before attribution was recorded.

      format: date-time

    - `created_by: optional BetaAnalyticsUser or null`

      A user in the organization, identified by tagged id and email address.

      - `type: "user"`

        Object type. Always `user`.

        default: user

      - `id: string`

        Tagged user identifier (e.g. `user_...`)

      - `email_address: string`

        Email address of the user

    - `distinct_conversation_count: optional number or null`

      Number of distinct conversations in the project. Null on aggregated rows where a distinct count cannot be computed.

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Opaque cursor for the next page, or null if no more results

## Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/apps/chat/projects \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

### Response (200)

```json
{
  "data": [
    {
      "distinct_user_count": 0,
      "message_count": 0,
      "project_id": "project_id",
      "project_name": "project_name",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "email_address": "email_address",
        "type": "user"
      },
      "distinct_conversation_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

api/beta/organization/analytics/connectors New page · 354 lines, new page

# Connectors ## Get Connector Usage ### Query parameters ### Returns ### Example #### Response (200) ## Domain types ### Beta Connector Usage

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Connectors
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/connectors
---

# Connectors

## Get Connector Usage

**GET** `/v1/organizations/analytics/connectors`

Get per-connector usage for a given day, with cursor-based pagination.

Returns connector usage metrics for the organization, sorted by connector
name. Connector names are normalized from their various sources — for
example, "Atlassian MCP server" and "mcp-atlassian" both appear as
"atlassian". Use `group_by[]` to break usage out per member, per RBAC
group, or per product surface, and `filter[]` to scope results; the
parameter descriptions list the supported dimensions. Available to
organizations on a Claude Enterprise plan. Requires an API key with the
`read:analytics` scope.

### Query parameters

- `date: optional string`

  UTC date in YYYY-MM-DD format. The day to get connector usage for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `ending_date: optional string`

  UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `connector_name`, `product`, `rbac_group_id`, `user_id`. Value forms: `connector_name` matches case-insensitively, a display name such as 'GitHub MCP' also matches its normalized stored form ('github'), and for rows whose `connector_name` is an opaque connector id the connector's display name (`connector_display_name`) also matches; `product` is one of `chat`, `claude_code`, `cowork`, or `office_agent`; `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

  maxItems: 100

- `group_by: optional array of "product" or "rbac_group_id" or "user_id"`

  Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, `user_id`. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

  maxItems: 100

  - `"product"`

  - `"rbac_group_id"`

  - `"user_id"`

- `limit: optional number`

  Number of results per page (1-1000, default 100).

  minimum: 1, maximum: 1000

- `order: optional "asc" or "desc"`

  Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

  - `"asc"`

  - `"desc"`

- `order_by: optional string`

  Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `starting_date: optional string`

  UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

### Returns

- `BetaConnectorUsage object`

  Response for GET /v1/organizations/analytics/connectors.

  - `data: array of object`

    - `chat_metrics: object`

      Claude.ai activity metrics for a single connector on a given day.

      - `distinct_conversation_connector_used_count: number or null`

        Number of distinct conversations in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `claude_code_metrics: object`

      Claude Code activity metrics for a single connector on a given day.

      - `distinct_session_connector_used_count: number or null`

        Number of distinct Claude Code sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `connector_name: string`

      Name of the connector. Some rows carry an opaque connector id here instead of a readable name; `connector_display_name` holds the resolved name for those rows.

    - `cowork_metrics: object`

      Cowork activity metrics for a single connector on a given day.

      - `distinct_session_connector_used_count: number or null`

        Number of distinct Cowork sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `distinct_user_count: number`

      Number of distinct users who used the connector on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `office_metrics: object`

      Office Agent activity metrics for a single connector on a given day, broken out by Office product.

      - `excel: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

        - `distinct_session_connector_used_count: number or null`

          Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `outlook: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

      - `powerpoint: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

      - `word: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

    - `connector_display_name: optional string or null`

      Human-readable display name for rows whose `connector_name` is an opaque connector id rather than a readable name, resolved at request time from the organization's connectors (including connectors that have since been removed). `connector_name` remains the row's stable key for sorting and pagination, and `filter[]=connector_name:{value}` also matches these rows by display name. Display names are not unique, and the same connector's claude.ai usage can appear under a separate row with a readable `connector_name`. Null when `connector_name` is already a readable name, when the id cannot be resolved to one of the organization's connectors, or when display-name resolution is not enabled for this organization.

    - `individual_auth_distinct_user_count: optional number or null`

      Number of distinct users whose use of this connector on the requested day ran on their own individual credential, connected through their own consent flow. Companion bucket to `managed_auth_distinct_user_count`, which carries the measurement, attribution, and null rules. Users whose requests used no stored credential count in neither bucket.

    - `managed_auth_distinct_user_count: optional number or null`

      Number of distinct users whose use of this connector on the requested day ran on Enterprise Managed Auth (an organization-managed credential provisioned through the organization's identity provider), read from the token record each request used. Null, never 0, when managed-auth reporting is not enabled for the organization, the value cannot be attributed to the row, no credentialed requests and no managed-token mint events (a managed credential being provisioned for a user's use of the connector) were observed that day, or the day predates 2026-07-01, the first day the backing data exists (forward-only data, no backfill). When credentialed requests or mint events were observed and attributed, both managed-auth fields populate, reporting 0 for a bucket with no users; the two counts are independent, not a partition — a user whose requests that day used both kinds of credential counts in both. Mint events carry user but not surface attribution, so they count as observed auth activity on `user_id` and `rbac_group_id` cuts — attributed to the user the credential was provisioned for — but never on a cut that references `product` (group or filter). Date-range rollup mode (`starting_date`/`ending_date`) computes both fields exactly over the window — distinct users with at least one qualifying day — when the whole window starts on or after 2026-07-01, with the null-versus-0 and mint-event rules applying with the window in place of the day; a range starting earlier reports every managed-auth field as null, never a partial-window value.

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `read_call_count: optional number or null`

      Number of connector tool calls on the requested day whose trusted read-only annotation marked them read-only. Call count, not distinct users. Every call recorded on a classified surface lands in exactly one of `read_call_count`, `write_call_count`, or `unclassified_call_count`, so the three sum to the day's classified calls. Classification is forward-only per surface: claude.ai from 2026-06-01, Claude Code from 2026-05-30, Claude in Office from 2026-05-29, Cowork from 2026-06-02 (Cowork clients predating annotation forwarding land in `unclassified_call_count`). Null, never 0, when the value cannot be stated: the read/write split is not enabled for this organization, or the day predates 2026-05-29. For a date-range total, sum the per-day values, but treat a window that extends before 2026-05-29 as null rather than summing only its covered days — date-range rollup mode (`starting_date`/`ending_date`) applies both rules server-side.

    - `unclassified_call_count: optional number or null`

      Number of connector tool calls on the requested day with no trusted read-only annotation — the annotation is optional in the MCP spec and is discarded when connector access controls are active, so unclassified calls are common. This field shows how much of the day's classified activity the read/write split actually covers. Call count, not distinct users. One of the three call-classification buckets; see `read_call_count` for the per-surface data-start dates, null conditions, and date-range guidance.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

    - `write_call_count: optional number or null`

      Number of connector tool calls on the requested day whose trusted read-only annotation marked them not read-only. Call count, not distinct users. One of the three call-classification buckets; see `read_call_count` for the per-surface data-start dates, null conditions, and date-range guidance.

  - `next_page: string or null`

    Opaque cursor for the next page, or null if no more results

### Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/connectors \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response (200)

```json
{
  "data": [
    {
      "chat_metrics": {
        "distinct_conversation_connector_used_count": 0
      },
      "claude_code_metrics": {
        "distinct_session_connector_used_count": 0
      },
      "connector_name": "connector_name",
      "cowork_metrics": {
        "distinct_session_connector_used_count": 0
      },
      "distinct_user_count": 0,
      "office_metrics": {
        "excel": {
          "distinct_session_connector_used_count": 0
        },
        "outlook": {
          "distinct_session_connector_used_count": 0
        },
        "powerpoint": {
          "distinct_session_connector_used_count": 0
        },
        "word": {
          "distinct_session_connector_used_count": 0
        }
      },
      "connector_display_name": "connector_display_name",
      "individual_auth_distinct_user_count": 0,
      "managed_auth_distinct_user_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "read_call_count": 0,
      "unclassified_call_count": 0,
      "user_id": "user_id",
      "write_call_count": 0
    }
  ],
  "next_page": "next_page"
}
```

## Domain types

### Beta Connector Usage

- `BetaConnectorUsage object`

  Response for GET /v1/organizations/analytics/connectors.

  - `data: array of object`

    - `chat_metrics: object`

      Claude.ai activity metrics for a single connector on a given day.

      - `distinct_conversation_connector_used_count: number or null`

        Number of distinct conversations in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `claude_code_metrics: object`

      Claude Code activity metrics for a single connector on a given day.

      - `distinct_session_connector_used_count: number or null`

        Number of distinct Claude Code sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `connector_name: string`

      Name of the connector. Some rows carry an opaque connector id here instead of a readable name; `connector_display_name` holds the resolved name for those rows.

    - `cowork_metrics: object`

      Cowork activity metrics for a single connector on a given day.

      - `distinct_session_connector_used_count: number or null`

        Number of distinct Cowork sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `distinct_user_count: number`

      Number of distinct users who used the connector on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `office_metrics: object`

      Office Agent activity metrics for a single connector on a given day, broken out by Office product.

      - `excel: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

        - `distinct_session_connector_used_count: number or null`

          Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `outlook: BetaConnectorOfficeProductMetrics`

Cut at 300 lines. The page has the rest.

api/beta/organization/analytics/connectors/list New page · 242 lines, new page

# Get Connector Usage ## Query parameters ## Returns ## Example ### Response (200)

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Get Connector Usage
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/connectors/list
---

# Get Connector Usage

**GET** `/v1/organizations/analytics/connectors`

Get per-connector usage for a given day, with cursor-based pagination.

Returns connector usage metrics for the organization, sorted by connector
name. Connector names are normalized from their various sources — for
example, "Atlassian MCP server" and "mcp-atlassian" both appear as
"atlassian". Use `group_by[]` to break usage out per member, per RBAC
group, or per product surface, and `filter[]` to scope results; the
parameter descriptions list the supported dimensions. Available to
organizations on a Claude Enterprise plan. Requires an API key with the
`read:analytics` scope.

## Query parameters

- `date: optional string`

  UTC date in YYYY-MM-DD format. The day to get connector usage for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `ending_date: optional string`

  UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `connector_name`, `product`, `rbac_group_id`, `user_id`. Value forms: `connector_name` matches case-insensitively, a display name such as 'GitHub MCP' also matches its normalized stored form ('github'), and for rows whose `connector_name` is an opaque connector id the connector's display name (`connector_display_name`) also matches; `product` is one of `chat`, `claude_code`, `cowork`, or `office_agent`; `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

  maxItems: 100

- `group_by: optional array of "product" or "rbac_group_id" or "user_id"`

  Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, `user_id`. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

  maxItems: 100

  - `"product"`

  - `"rbac_group_id"`

  - `"user_id"`

- `limit: optional number`

  Number of results per page (1-1000, default 100).

  minimum: 1, maximum: 1000

- `order: optional "asc" or "desc"`

  Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

  - `"asc"`

  - `"desc"`

- `order_by: optional string`

  Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `starting_date: optional string`

  UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

## Returns

- `BetaConnectorUsage object`

  Response for GET /v1/organizations/analytics/connectors.

  - `data: array of object`

    - `chat_metrics: object`

      Claude.ai activity metrics for a single connector on a given day.

      - `distinct_conversation_connector_used_count: number or null`

        Number of distinct conversations in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `claude_code_metrics: object`

      Claude Code activity metrics for a single connector on a given day.

      - `distinct_session_connector_used_count: number or null`

        Number of distinct Claude Code sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `connector_name: string`

      Name of the connector. Some rows carry an opaque connector id here instead of a readable name; `connector_display_name` holds the resolved name for those rows.

    - `cowork_metrics: object`

      Cowork activity metrics for a single connector on a given day.

      - `distinct_session_connector_used_count: number or null`

        Number of distinct Cowork sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `distinct_user_count: number`

      Number of distinct users who used the connector on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `office_metrics: object`

      Office Agent activity metrics for a single connector on a given day, broken out by Office product.

      - `excel: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

        - `distinct_session_connector_used_count: number or null`

          Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `outlook: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

      - `powerpoint: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

      - `word: BetaConnectorOfficeProductMetrics`

        Office Agent activity metrics for a single connector on a given day within one Office product.

    - `connector_display_name: optional string or null`

      Human-readable display name for rows whose `connector_name` is an opaque connector id rather than a readable name, resolved at request time from the organization's connectors (including connectors that have since been removed). `connector_name` remains the row's stable key for sorting and pagination, and `filter[]=connector_name:{value}` also matches these rows by display name. Display names are not unique, and the same connector's claude.ai usage can appear under a separate row with a readable `connector_name`. Null when `connector_name` is already a readable name, when the id cannot be resolved to one of the organization's connectors, or when display-name resolution is not enabled for this organization.

    - `individual_auth_distinct_user_count: optional number or null`

      Number of distinct users whose use of this connector on the requested day ran on their own individual credential, connected through their own consent flow. Companion bucket to `managed_auth_distinct_user_count`, which carries the measurement, attribution, and null rules. Users whose requests used no stored credential count in neither bucket.

    - `managed_auth_distinct_user_count: optional number or null`

      Number of distinct users whose use of this connector on the requested day ran on Enterprise Managed Auth (an organization-managed credential provisioned through the organization's identity provider), read from the token record each request used. Null, never 0, when managed-auth reporting is not enabled for the organization, the value cannot be attributed to the row, no credentialed requests and no managed-token mint events (a managed credential being provisioned for a user's use of the connector) were observed that day, or the day predates 2026-07-01, the first day the backing data exists (forward-only data, no backfill). When credentialed requests or mint events were observed and attributed, both managed-auth fields populate, reporting 0 for a bucket with no users; the two counts are independent, not a partition — a user whose requests that day used both kinds of credential counts in both. Mint events carry user but not surface attribution, so they count as observed auth activity on `user_id` and `rbac_group_id` cuts — attributed to the user the credential was provisioned for — but never on a cut that references `product` (group or filter). Date-range rollup mode (`starting_date`/`ending_date`) computes both fields exactly over the window — distinct users with at least one qualifying day — when the whole window starts on or after 2026-07-01, with the null-versus-0 and mint-event rules applying with the window in place of the day; a range starting earlier reports every managed-auth field as null, never a partial-window value.

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `read_call_count: optional number or null`

      Number of connector tool calls on the requested day whose trusted read-only annotation marked them read-only. Call count, not distinct users. Every call recorded on a classified surface lands in exactly one of `read_call_count`, `write_call_count`, or `unclassified_call_count`, so the three sum to the day's classified calls. Classification is forward-only per surface: claude.ai from 2026-06-01, Claude Code from 2026-05-30, Claude in Office from 2026-05-29, Cowork from 2026-06-02 (Cowork clients predating annotation forwarding land in `unclassified_call_count`). Null, never 0, when the value cannot be stated: the read/write split is not enabled for this organization, or the day predates 2026-05-29. For a date-range total, sum the per-day values, but treat a window that extends before 2026-05-29 as null rather than summing only its covered days — date-range rollup mode (`starting_date`/`ending_date`) applies both rules server-side.

    - `unclassified_call_count: optional number or null`

      Number of connector tool calls on the requested day with no trusted read-only annotation — the annotation is optional in the MCP spec and is discarded when connector access controls are active, so unclassified calls are common. This field shows how much of the day's classified activity the read/write split actually covers. Call count, not distinct users. One of the three call-classification buckets; see `read_call_count` for the per-surface data-start dates, null conditions, and date-range guidance.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

    - `write_call_count: optional number or null`

      Number of connector tool calls on the requested day whose trusted read-only annotation marked them not read-only. Call count, not distinct users. One of the three call-classification buckets; see `read_call_count` for the per-surface data-start dates, null conditions, and date-range guidance.

  - `next_page: string or null`

    Opaque cursor for the next page, or null if no more results

## Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/connectors \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

### Response (200)

```json
{
  "data": [
    {
      "chat_metrics": {
        "distinct_conversation_connector_used_count": 0
      },
      "claude_code_metrics": {
        "distinct_session_connector_used_count": 0
      },
      "connector_name": "connector_name",
      "cowork_metrics": {
        "distinct_session_connector_used_count": 0
      },
      "distinct_user_count": 0,
      "office_metrics": {
        "excel": {
          "distinct_session_connector_used_count": 0
        },
        "outlook": {
          "distinct_session_connector_used_count": 0
        },
        "powerpoint": {
          "distinct_session_connector_used_count": 0
        },
        "word": {
          "distinct_session_connector_used_count": 0
        }
      },
      "connector_display_name": "connector_display_name",
      "individual_auth_distinct_user_count": 0,
      "managed_auth_distinct_user_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "read_call_count": 0,
      "unclassified_call_count": 0,
      "user_id": "user_id",
      "write_call_count": 0
    }
  ],
  "next_page": "next_page"
}
```

api/beta/organization/analytics/cost New page · 1080 lines, new page

# Cost ## Get Cost Over Time ### Query parameters ### Returns ### Example #### Response (200) ## Get Per-User Cost ### Query parameters ### Returns ### Example #### Response (200) ## Domain types ### Beta Cost Bucket ### Beta User Cost

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Cost
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/cost
---

# Cost

## Get Cost Over Time

**GET** `/v1/organizations/analytics/cost_report`

Get cost in USD over time across a date range.

Returns cost bucketed by minute, hour, or day, optionally broken down by
product, model, context window, inference region, speed, cost type, or
token type. Available to organizations on a Claude Enterprise plan.
Requires an API key with the `read:analytics` scope.

### Query parameters

- `starting_at: string`

  Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.

  format: date-time

- `bucket_width: optional "1d" or "1h" or "1m"`

  Time bucket granularity.

  default: 1d

  - `"1d"`

  - `"1h"`

  - `"1m"`

- `claude_tag_categories: optional array of "dm" or "engaged" or "monitoring" or 2 more`

  Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage with no category never matches. `dm` usage is reported under the user's product rather than `claude-tag`, so combining this filter with `products[]=claude-tag` excludes it. Use `group_by[]=claude_tag_category` to break out per-category values.

  maxItems: 100

  - `"dm"`

  - `"engaged"`

  - `"monitoring"`

  - `"proactive"`

  - `"scheduled"`

- `claude_tag_user_ids: optional array of string`

  Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that is not Claude Tag, and Claude Tag usage not attributed to a single user, never matches. Use `group_by[]=claude_tag_user_id` to break out per-user values.

  maxItems: 100

- `context_windows: optional array of "0-200k" or "200k-1M"`

  Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.

  maxItems: 100

  - `"0-200k"`

  - `"200k-1M"`

- `ending_at: optional string`

  End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.

  format: date-time

- `group_by: optional array of "claude_tag_category" or "claude_tag_user_id" or "context_window" or 8 more`

  Dimensions to break each time bucket out by. Defaults to no grouping (one total per bucket). Each bucket reports at most its top 100 groups; a group beyond that cap has no row in that bucket (there is no remainder row), so grouped buckets are not exhaustive when a dimension has more than 100 distinct values.

  maxItems: 100

  - `"claude_tag_category"`

  - `"claude_tag_user_id"`

  - `"context_window"`

  - `"cost_type"`

  - `"inference_geo"`

  - `"model"`

  - `"product"`

  - `"rbac_group_id"`

  - `"slack_channel_id"`

  - `"speed"`

  - `"token_type"`

- `inference_geos: optional array of "global" or "not_available" or "us"`

  Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.

  maxItems: 100

  - `"global"`

  - `"not_available"`

  - `"us"`

- `limit: optional number`

  Maximum number of time buckets per page. Defaults and caps vary by `bucket_width` (`1d`: default 7, max 31; `1h`: default 24, max 168; `1m`: default 60, max 256).

  minimum: 1

- `models: optional array of string`

  Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.

  maxItems: 100

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `products: optional array of "chat" or "claude-tag" or "claude_code" or 4 more`

  Product surfaces to include. Defaults to all products. Use `group_by[]=product` to break out per-product values.

  maxItems: 100

  - `"chat"`

  - `"claude-tag"`

  - `"claude_code"`

  - `"claude_design"`

  - `"claude_in_chrome"`

  - `"cowork"`

  - `"office_agent"`

- `rbac_group_ids: optional array of string`

  Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.

  maxItems: 100

- `slack_channel_ids: optional array of string`

  Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.

  maxItems: 100

- `speeds: optional array of "fast" or "standard"`

  Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.

  maxItems: 100

  - `"fast"`

  - `"standard"`

- `user_ids: optional array of string`

  Filter to specific users by tagged user ID.

  maxItems: 100

### Returns

- `BetaCostBucket object`

  - `data: array of object`

    Time buckets for this page, oldest first: one per `bucket_width` interval, including intervals with no data (their `results` list is empty). A page holds at most `limit` buckets.

    - `ending_at: string`

      End of the time bucket (exclusive) in RFC 3339 format.

      format: date-time

    - `results: array of object`

      Rows for this time bucket. Empty when the bucket has no data; otherwise a single combined row when `group_by[]` is omitted, or one row per group (subject to the per-bucket group cap described on the `group_by[]` parameter).

      - `amount: string`

        Amount (post-discount, pre-credit) in fractional cents.

      - `claude_tag_category: "dm" or "engaged" or "monitoring" or 2 more or null`

        Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed Claude in a channel or thread), `proactive` (Claude responded without being addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching a channel it was asked to monitor), or `dm` (direct messages with Claude). Populated only when `claude_tag_category` is in `group_by[]`; null for usage that is not Claude Tag. Direct-message usage is billed to the individual user and is reported under that user's product, not under `claude-tag`. New categories may be added over time.

        - `"dm"`

        - `"engaged"`

        - `"monitoring"`

        - `"proactive"`

        - `"scheduled"`

      - `claude_tag_user_id: string or null`

        Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only when `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for example `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined with `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter.

      - `context_window: "0-200k" or "200k-1M" or null`

        Context-window pricing tier of the usage or cost. Null unless `context_window` is in `group_by[]`; it can also be null on grouped rows with no context-window tier, such as code execution.

        - `"0-200k"`

        - `"200k-1M"`

      - `cost_type: "code_execution" or "tokens" or "web_search" or null`

        Cost component when `group_by[]=cost_type`; null otherwise (amount is the combined total).

        - `"code_execution"`

        - `"tokens"`

        - `"web_search"`

      - `currency: "USD"`

        Currency code for the cost amount. Currently always `"USD"`.

        default: USD

      - `inference_geo: "global" or "us" or null`

        Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).

        - `"global"`

        - `"us"`

      - `list_amount: string`

        List-price amount (pre-discount) in fractional cents.

      - `model: string or null`

        Model that produced the usage or cost, as a model name in the form the `models[]` filter accepts (for example, `claude-opus-5`). Null unless `model` is in `group_by[]`; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.

      - `product: string or null`

        Product surface that produced the usage or cost. Null unless product is in `group_by[]`; it can also be null on grouped rows whose usage cannot be attributed to a known surface. Values include `chat`, `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, and `claude-tag`. `claude-tag` is Claude Tag, the Claude product in Slack. Some unattributed usage is reported as "other".

      - `rbac_group_id: string or null`

        RBAC group (team) the usage is attributed to, in the public tagged `rbac_group_...` spelling — the same spelling the activity resources use for this key, so the same team has one id across resources and it round-trips as an `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in `group_by[]`. Any-membership semantics: a user in several groups contributes their full usage to each of those groups' rows, so the named-group rows overlap and their sum can exceed the org total. A null value is the single unassigned row: users in no group on that (UTC) day. For the true org total, run the same query without `group_by[]`.

      - `requests: number or null`

        Number of API requests in this row's scope. Null when `group_by` includes `cost_type` or `token_type` (the count has no per-component attribution; read it from the ungrouped response). For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface with `product: null`).

      - `slack_channel_id: string or null`

        Slack channel the usage originated from. Populated only when `slack_channel_id` is in `group_by[]`; null for usage outside Slack (and for rows recorded before channel attribution was enabled).

      - `speed: "fast" or "standard" or null`

        Inference speed mode of the usage or cost: `fast` or `standard`. Null unless `speed` is in `group_by[]`.

        - `"fast"`

        - `"standard"`

      - `token_type: "cache_creation.ephemeral_1h_input_tokens" or "cache_creation.ephemeral_5m_input_tokens" or "cache_read_input_tokens" or 2 more or null`

        Token type when `group_by[]=token_type` and `cost_type=tokens`; null otherwise.

        - `"cache_creation.ephemeral_1h_input_tokens"`

        - `"cache_creation.ephemeral_5m_input_tokens"`

        - `"cache_read_input_tokens"`

        - `"output_tokens"`

        - `"uncached_input_tokens"`

    - `starting_at: string`

Cut at 300 lines. The page has the rest.

api/beta/organization/analytics/cost/list New page · 363 lines, new page

# Get Cost Over Time ## Query parameters ## Returns ## Example ### Response (200)

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Get Cost Over Time
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/cost/list
---

# Get Cost Over Time

**GET** `/v1/organizations/analytics/cost_report`

Get cost in USD over time across a date range.

Returns cost bucketed by minute, hour, or day, optionally broken down by
product, model, context window, inference region, speed, cost type, or
token type. Available to organizations on a Claude Enterprise plan.
Requires an API key with the `read:analytics` scope.

## Query parameters

- `starting_at: string`

  Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.

  format: date-time

- `bucket_width: optional "1d" or "1h" or "1m"`

  Time bucket granularity.

  default: 1d

  - `"1d"`

  - `"1h"`

  - `"1m"`

- `claude_tag_categories: optional array of "dm" or "engaged" or "monitoring" or 2 more`

  Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage with no category never matches. `dm` usage is reported under the user's product rather than `claude-tag`, so combining this filter with `products[]=claude-tag` excludes it. Use `group_by[]=claude_tag_category` to break out per-category values.

  maxItems: 100

  - `"dm"`

  - `"engaged"`

  - `"monitoring"`

  - `"proactive"`

  - `"scheduled"`

- `claude_tag_user_ids: optional array of string`

  Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that is not Claude Tag, and Claude Tag usage not attributed to a single user, never matches. Use `group_by[]=claude_tag_user_id` to break out per-user values.

  maxItems: 100

- `context_windows: optional array of "0-200k" or "200k-1M"`

  Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.

  maxItems: 100

  - `"0-200k"`

  - `"200k-1M"`

- `ending_at: optional string`

  End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.

  format: date-time

- `group_by: optional array of "claude_tag_category" or "claude_tag_user_id" or "context_window" or 8 more`

  Dimensions to break each time bucket out by. Defaults to no grouping (one total per bucket). Each bucket reports at most its top 100 groups; a group beyond that cap has no row in that bucket (there is no remainder row), so grouped buckets are not exhaustive when a dimension has more than 100 distinct values.

  maxItems: 100

  - `"claude_tag_category"`

  - `"claude_tag_user_id"`

  - `"context_window"`

  - `"cost_type"`

  - `"inference_geo"`

  - `"model"`

  - `"product"`

  - `"rbac_group_id"`

  - `"slack_channel_id"`

  - `"speed"`

  - `"token_type"`

- `inference_geos: optional array of "global" or "not_available" or "us"`

  Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.

  maxItems: 100

  - `"global"`

  - `"not_available"`

  - `"us"`

- `limit: optional number`

  Maximum number of time buckets per page. Defaults and caps vary by `bucket_width` (`1d`: default 7, max 31; `1h`: default 24, max 168; `1m`: default 60, max 256).

  minimum: 1

- `models: optional array of string`

  Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.

  maxItems: 100

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `products: optional array of "chat" or "claude-tag" or "claude_code" or 4 more`

  Product surfaces to include. Defaults to all products. Use `group_by[]=product` to break out per-product values.

  maxItems: 100

  - `"chat"`

  - `"claude-tag"`

  - `"claude_code"`

  - `"claude_design"`

  - `"claude_in_chrome"`

  - `"cowork"`

  - `"office_agent"`

- `rbac_group_ids: optional array of string`

  Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.

  maxItems: 100

- `slack_channel_ids: optional array of string`

  Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.

  maxItems: 100

- `speeds: optional array of "fast" or "standard"`

  Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.

  maxItems: 100

  - `"fast"`

  - `"standard"`

- `user_ids: optional array of string`

  Filter to specific users by tagged user ID.

  maxItems: 100

## Returns

- `BetaCostBucket object`

  - `data: array of object`

    Time buckets for this page, oldest first: one per `bucket_width` interval, including intervals with no data (their `results` list is empty). A page holds at most `limit` buckets.

    - `ending_at: string`

      End of the time bucket (exclusive) in RFC 3339 format.

      format: date-time

    - `results: array of object`

      Rows for this time bucket. Empty when the bucket has no data; otherwise a single combined row when `group_by[]` is omitted, or one row per group (subject to the per-bucket group cap described on the `group_by[]` parameter).

      - `amount: string`

        Amount (post-discount, pre-credit) in fractional cents.

      - `claude_tag_category: "dm" or "engaged" or "monitoring" or 2 more or null`

        Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed Claude in a channel or thread), `proactive` (Claude responded without being addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching a channel it was asked to monitor), or `dm` (direct messages with Claude). Populated only when `claude_tag_category` is in `group_by[]`; null for usage that is not Claude Tag. Direct-message usage is billed to the individual user and is reported under that user's product, not under `claude-tag`. New categories may be added over time.

        - `"dm"`

        - `"engaged"`

        - `"monitoring"`

        - `"proactive"`

        - `"scheduled"`

      - `claude_tag_user_id: string or null`

        Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only when `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for example `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined with `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter.

      - `context_window: "0-200k" or "200k-1M" or null`

        Context-window pricing tier of the usage or cost. Null unless `context_window` is in `group_by[]`; it can also be null on grouped rows with no context-window tier, such as code execution.

        - `"0-200k"`

        - `"200k-1M"`

      - `cost_type: "code_execution" or "tokens" or "web_search" or null`

        Cost component when `group_by[]=cost_type`; null otherwise (amount is the combined total).

        - `"code_execution"`

        - `"tokens"`

        - `"web_search"`

      - `currency: "USD"`

        Currency code for the cost amount. Currently always `"USD"`.

        default: USD

      - `inference_geo: "global" or "us" or null`

        Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).

        - `"global"`

        - `"us"`

      - `list_amount: string`

        List-price amount (pre-discount) in fractional cents.

      - `model: string or null`

        Model that produced the usage or cost, as a model name in the form the `models[]` filter accepts (for example, `claude-opus-5`). Null unless `model` is in `group_by[]`; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.

      - `product: string or null`

        Product surface that produced the usage or cost. Null unless product is in `group_by[]`; it can also be null on grouped rows whose usage cannot be attributed to a known surface. Values include `chat`, `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, and `claude-tag`. `claude-tag` is Claude Tag, the Claude product in Slack. Some unattributed usage is reported as "other".

      - `rbac_group_id: string or null`

        RBAC group (team) the usage is attributed to, in the public tagged `rbac_group_...` spelling — the same spelling the activity resources use for this key, so the same team has one id across resources and it round-trips as an `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in `group_by[]`. Any-membership semantics: a user in several groups contributes their full usage to each of those groups' rows, so the named-group rows overlap and their sum can exceed the org total. A null value is the single unassigned row: users in no group on that (UTC) day. For the true org total, run the same query without `group_by[]`.

      - `requests: number or null`

        Number of API requests in this row's scope. Null when `group_by` includes `cost_type` or `token_type` (the count has no per-component attribution; read it from the ungrouped response). For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface with `product: null`).

      - `slack_channel_id: string or null`

        Slack channel the usage originated from. Populated only when `slack_channel_id` is in `group_by[]`; null for usage outside Slack (and for rows recorded before channel attribution was enabled).

      - `speed: "fast" or "standard" or null`

        Inference speed mode of the usage or cost: `fast` or `standard`. Null unless `speed` is in `group_by[]`.

        - `"fast"`

        - `"standard"`

      - `token_type: "cache_creation.ephemeral_1h_input_tokens" or "cache_creation.ephemeral_5m_input_tokens" or "cache_read_input_tokens" or 2 more or null`

        Token type when `group_by[]=token_type` and `cost_type=tokens`; null otherwise.

        - `"cache_creation.ephemeral_1h_input_tokens"`

        - `"cache_creation.ephemeral_5m_input_tokens"`

        - `"cache_read_input_tokens"`

        - `"output_tokens"`

        - `"uncached_input_tokens"`

    - `starting_at: string`

      Start of the time bucket (inclusive) in RFC 3339 format.

Cut at 300 lines. The page has the rest.

api/beta/organization/analytics/cost/list_by_user New page · 413 lines, new page

# Get Per-User Cost ## Query parameters ## Returns ## Example ### Response (200)

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Get Per-User Cost
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/cost/list_by_user
---

# Get Per-User Cost

**GET** `/v1/organizations/analytics/user_cost_report`

Get per-user cost in USD across a date range.

Returns one row per user, ranked by spend. Use this to see which users
account for the most cost. Only cost attributable to a seat user is
included; for organization-wide totals including direct API-key and
automation traffic, use the bucketed
`/v1/organizations/analytics/cost_report` endpoint. Available to
organizations on a Claude Enterprise plan. Requires an API key with the
`read:analytics` scope.

## Query parameters

- `starting_at: string`

  Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.

  format: date-time

- `bucket_width: optional "1d" or "1h" or "1m"`

  Time-bucket granularity. When set, each row's `starting_at` and `ending_at` are populated and one actor may span several rows (one per time bucket with usage). The time bucket counts toward `limit`, so one page can return multiple rows for the same actor. `ending_at` is required when `bucket_width` is set, and with `bucket_width="1m"` the range may span at most 24 hours. When omitted, each row aggregates the full `[starting_at, ending_at)` range.

  - `"1d"`

  - `"1h"`

  - `"1m"`

- `claude_tag_categories: optional array of "dm" or "engaged" or "monitoring" or 2 more`

  Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage with no category never matches. `dm` usage is reported under the user's product rather than `claude-tag`, so combining this filter with `products[]=claude-tag` excludes it. Use `group_by[]=claude_tag_category` to break out per-category values.

  maxItems: 100

  - `"dm"`

  - `"engaged"`

  - `"monitoring"`

  - `"proactive"`

  - `"scheduled"`

- `claude_tag_user_ids: optional array of string`

  Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that is not Claude Tag, and Claude Tag usage not attributed to a single user, never matches. Use `group_by[]=claude_tag_user_id` to break out per-user values.

  maxItems: 100

- `context_windows: optional array of "0-200k" or "200k-1M"`

  Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.

  maxItems: 100

  - `"0-200k"`

  - `"200k-1M"`

- `ending_at: optional string`

  End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.

  format: date-time

- `exclude_deleted_users: optional boolean`

  If true, omit rows for users who are deleted (`deleted: true`). A page may contain fewer than `limit` rows; use `has_more` and `next_page` to paginate as usual.

  default: false

- `group_by: optional array of "claude_tag_category" or "claude_tag_user_id" or "context_window" or 8 more`

  Break each actor's row out by the given dimensions. Accepts the same values as the bucketed `/cost_report` endpoint. The `product`, `model`, `context_window`, `inference_geo`, and `speed` dimensions — and the time bucket, when `bucket_width` is set — count toward `limit`. `cost_type` and `token_type` do not: `cost_type` returns one row per cost component (tokens, web search, code execution); `token_type` returns one row per token type, each with `cost_type: "tokens"`; combining both returns the per-token-type rows plus the web-search and code-execution rows. A page can therefore contain more rows than `limit` when `cost_type` or `token_type` is requested.

  maxItems: 100

  - `"claude_tag_category"`

  - `"claude_tag_user_id"`

  - `"context_window"`

  - `"cost_type"`

  - `"inference_geo"`

  - `"model"`

  - `"product"`

  - `"rbac_group_id"`

  - `"slack_channel_id"`

  - `"speed"`

  - `"token_type"`

- `inference_geos: optional array of "global" or "not_available" or "us"`

  Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.

  maxItems: 100

  - `"global"`

  - `"not_available"`

  - `"us"`

- `limit: optional number`

  Number of rows per page (1-1000, default 20). One row per actor unless `group_by[]` or `bucket_width` splits an actor across rows; `cost_type`/`token_type` fan-out rows (cost endpoint only) are the exception — they do not count toward this limit, so `data` can exceed it.

  default: 20, maximum: 1000, minimum: 1

- `models: optional array of string`

  Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.

  maxItems: 100

- `order: optional "asc" or "desc"`

  Sort direction. Defaults to `desc`.

  default: desc

  - `"asc"`

  - `"desc"`

- `order_by: optional "amount" or "list_amount"`

  Metric to rank actors by. Defaults to `amount`.

  default: amount

  - `"amount"`

  - `"list_amount"`

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `products: optional array of "chat" or "claude-tag" or "claude_code" or 4 more`

  Product surfaces to include. Defaults to all products.

  maxItems: 100

  - `"chat"`

  - `"claude-tag"`

  - `"claude_code"`

  - `"claude_design"`

  - `"claude_in_chrome"`

  - `"cowork"`

  - `"office_agent"`

- `rbac_group_ids: optional array of string`

  Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.

  maxItems: 100

- `slack_channel_ids: optional array of string`

  Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.

  maxItems: 100

- `speeds: optional array of "fast" or "standard"`

  Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.

  maxItems: 100

  - `"fast"`

  - `"standard"`

- `user_ids: optional array of string`

  Filter to specific users by tagged user ID.

  maxItems: 100

## Returns

- `BetaUserCost object`

  - `data: array of object`

    Rows for this page, ranked by `order_by` in the `order` direction. One row per user, or several per user when `group_by[]` or `bucket_width` breaks that user's usage or cost out across rows. Rows split out by `cost_type` or `token_type` (cost endpoint only) stay adjacent and are ranked as one unit.

    - `actor: BetaAnalyticsUserActor`

      The user this row's usage or cost is attributed to. Always a `user_actor`.

      - `type: "user_actor"`

        Actor type. Always `"user_actor"`.

      - `deleted: boolean`

        True when the account has been deleted, or when the user is no longer a member of the organization or its associated organizations (for example, their membership was removed or they were deprovisioned via your identity provider). `email` stays populated for removed users and is null when the account has been deleted. `name` follows the rules described on that field. The `user_id` is still populated for reconciliation.

      - `email: string or null`

        The user's email address, including for users who are no longer members of the organization or its associated organizations. Null when the account has been deleted (check `deleted`) and for system-minted service accounts, which have no person's mailbox behind them (check `name`).

      - `name: string or null`

        The user's full name. Null when the user has not set a name. Returns `"Deleted User"` when the account itself has been deleted, or when the user is no longer a member of the organization or its associated organizations and the organization has chosen to hide the names of removed users. Otherwise, the name stays populated for removed users. Rows for system-minted service accounts render the service name (for example, `"Claude Security"` for usage by Anthropic's security-patching service) or null.

      - `user_id: string`

        Tagged user ID.

    - `amount: string`

      Amount (post-discount, pre-credit) in fractional cents (minor units).

    - `claude_tag_category: "dm" or "engaged" or "monitoring" or 2 more or null`

      Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed Claude in a channel or thread), `proactive` (Claude responded without being addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching a channel it was asked to monitor), or `dm` (direct messages with Claude). Populated only when `claude_tag_category` is in `group_by[]`; null for usage that is not Claude Tag. Direct-message usage is billed to the individual user and is reported under that user's product, not under `claude-tag`. New categories may be added over time.

      - `"dm"`

      - `"engaged"`

      - `"monitoring"`

      - `"proactive"`

      - `"scheduled"`

    - `claude_tag_user_id: string or null`

      Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only when `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for example `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined with `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter.

    - `context_window: "0-200k" or "200k-1M" or null`

      Context-window pricing tier of the usage or cost. Null unless `context_window` is in `group_by[]`; it can also be null on grouped rows with no context-window tier, such as code execution.

      - `"0-200k"`

      - `"200k-1M"`

    - `cost_type: "code_execution" or "tokens" or "web_search" or null`

      Cost component breakdown; null when returning the combined total.

      - `"code_execution"`

      - `"tokens"`

      - `"web_search"`

    - `currency: "USD"`

      Currency code for the cost amount. Currently always `"USD"`.

      default: USD

    - `ending_at: string or null`

      End of the row's UTC time bucket (exclusive), as an RFC 3339 timestamp; equal to `starting_at` plus one `bucket_width`. Null unless `bucket_width` is set.

      format: date-time

    - `inference_geo: "global" or "us" or null`

      Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).

      - `"global"`

      - `"us"`

    - `list_amount: string`

      List-price amount (pre-discount) in fractional cents.

Cut at 300 lines. The page has the rest.

api/beta/organization/analytics/plugins New page · 249 lines, new page

# Plugins ## Get Plugin Usage ### Query parameters ### Returns ### Example #### Response (200) ## Domain types ### Beta Plugin Usage

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Plugins
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/plugins
---

# Plugins

## Get Plugin Usage

**GET** `/v1/organizations/analytics/plugins`

Get per-plugin install + invocation usage for a given day, with pagination.

Returns plugin usage metrics for the organization across Cowork and Claude
Code, sorted by plugin name. The `plugin_name` value `third-party` is
an aggregate bucket, not a plugin: it collects plugin activity, from
either surface, for which the reporting client did not provide a plugin
name — so an organization's own plugins can contribute both to their own
named rows and to this bucket. Use `group_by[]` to break usage out per
member, per RBAC group, or per product surface (Cowork / Claude Code),
and `filter[]` to scope results; the parameter descriptions list the
supported dimensions. Requires an API key with the
`read:analytics` scope. `starting_date` / `ending_date` select
range-rollup mode like `/skills`.

### Query parameters

- `date: optional string`

  UTC date in YYYY-MM-DD format. The day to get plugin usage for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `ending_date: optional string`

  UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `plugin_name`, `product`, `rbac_group_id`, `user_id`. Value forms: `plugin_name` matches case-insensitively; `product` is `claude_code` or `cowork` (the only surfaces with plugin attribution); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

  maxItems: 100

- `group_by: optional array of "product" or "rbac_group_id" or "user_id"`

  Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, `user_id`. On this endpoint `product` takes the values `claude_code` or `cowork` only (the surfaces with plugin attribution). Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

  maxItems: 100

  - `"product"`

  - `"rbac_group_id"`

  - `"user_id"`

- `limit: optional number`

  Number of results per page (1-1000, default 100).

  minimum: 1, maximum: 1000

- `order: optional "asc" or "desc"`

  Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

  - `"asc"`

  - `"desc"`

- `order_by: optional string`

  Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `starting_date: optional string`

  UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

### Returns

- `BetaPluginUsage object`

  Response for GET /v1/organizations/analytics/plugins.

  - `data: array of object`

    - `claude_code_metrics: object`

      Claude Code activity metrics for a single plugin on a given day.

      - `distinct_session_plugin_used_count: number or null`

        Number of distinct Claude Code sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

    - `cowork_metrics: object`

      Cowork activity metrics for a single plugin on a given day.

      - `distinct_session_plugin_used_count: number or null`

        Number of distinct Cowork sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

    - `distinct_user_count: number`

      Number of distinct users with recorded install or invocation activity for the plugin on the requested day (install-only users count), or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `install_count: number or null`

      Number of distinct users who installed the plugin on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `invocation_count: number`

      Number of plugin invocations on the requested day

    - `plugin_name: string`

      Name of the plugin

    - `plugin_id: optional string or null`

      Stable plugin identifier when available (e.g. `serena@claude-plugins-official`). Null for third-party Claude Code plugins (redacted at the source) and Cowork slash commands that carry only a hashed id.

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Opaque cursor for the next page, or null if no more results

### Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/plugins \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response (200)

```json
{
  "data": [
    {
      "claude_code_metrics": {
        "distinct_session_plugin_used_count": 0
      },
      "cowork_metrics": {
        "distinct_session_plugin_used_count": 0
      },
      "distinct_user_count": 0,
      "install_count": 0,
      "invocation_count": 0,
      "plugin_name": "plugin_name",
      "plugin_id": "plugin_id",
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

## Domain types

### Beta Plugin Usage

- `BetaPluginUsage object`

  Response for GET /v1/organizations/analytics/plugins.

  - `data: array of object`

    - `claude_code_metrics: object`

      Claude Code activity metrics for a single plugin on a given day.

      - `distinct_session_plugin_used_count: number or null`

        Number of distinct Claude Code sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

    - `cowork_metrics: object`

      Cowork activity metrics for a single plugin on a given day.

      - `distinct_session_plugin_used_count: number or null`

        Number of distinct Cowork sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

    - `distinct_user_count: number`

      Number of distinct users with recorded install or invocation activity for the plugin on the requested day (install-only users count), or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `install_count: number or null`

      Number of distinct users who installed the plugin on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `invocation_count: number`

      Number of plugin invocations on the requested day

    - `plugin_name: string`

      Name of the plugin

    - `plugin_id: optional string or null`

      Stable plugin identifier when available (e.g. `serena@claude-plugins-official`). Null for third-party Claude Code plugins (redacted at the source) and Cowork slash commands that carry only a hashed id.

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Opaque cursor for the next page, or null if no more results

api/beta/organization/analytics/plugins/list New page · 181 lines, new page

# Get Plugin Usage ## Query parameters ## Returns ## Example ### Response (200)

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Get Plugin Usage
url: https://platform.claude.com/docs/en/api/beta/organization/analytics/plugins/list
---

# Get Plugin Usage

**GET** `/v1/organizations/analytics/plugins`

Get per-plugin install + invocation usage for a given day, with pagination.

Returns plugin usage metrics for the organization across Cowork and Claude
Code, sorted by plugin name. The `plugin_name` value `third-party` is
an aggregate bucket, not a plugin: it collects plugin activity, from
either surface, for which the reporting client did not provide a plugin
name — so an organization's own plugins can contribute both to their own
named rows and to this bucket. Use `group_by[]` to break usage out per
member, per RBAC group, or per product surface (Cowork / Claude Code),
and `filter[]` to scope results; the parameter descriptions list the
supported dimensions. Requires an API key with the
`read:analytics` scope. `starting_date` / `ending_date` select
range-rollup mode like `/skills`.

## Query parameters

- `date: optional string`

  UTC date in YYYY-MM-DD format. The day to get plugin usage for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

- `ending_date: optional string`

  UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

  format: date

- `filter: optional array of string`

  Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `plugin_name`, `product`, `rbac_group_id`, `user_id`. Value forms: `plugin_name` matches case-insensitively; `product` is `claude_code` or `cowork` (the only surfaces with plugin attribution); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

  maxItems: 100

- `group_by: optional array of "product" or "rbac_group_id" or "user_id"`

  Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, `user_id`. On this endpoint `product` takes the values `claude_code` or `cowork` only (the surfaces with plugin attribution). Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

  maxItems: 100

  - `"product"`

  - `"rbac_group_id"`

  - `"user_id"`

- `limit: optional number`

  Number of results per page (1-1000, default 100).

  minimum: 1, maximum: 1000

- `order: optional "asc" or "desc"`

  Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

  - `"asc"`

  - `"desc"`

- `order_by: optional string`

  Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

- `page: optional string`

  Opaque cursor from a previous response's `next_page` field.

- `starting_date: optional string`

  UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

  format: date

## Returns

- `BetaPluginUsage object`

  Response for GET /v1/organizations/analytics/plugins.

  - `data: array of object`

    - `claude_code_metrics: object`

      Claude Code activity metrics for a single plugin on a given day.

      - `distinct_session_plugin_used_count: number or null`

        Number of distinct Claude Code sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

    - `cowork_metrics: object`

      Cowork activity metrics for a single plugin on a given day.

      - `distinct_session_plugin_used_count: number or null`

        Number of distinct Cowork sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

    - `distinct_user_count: number`

      Number of distinct users with recorded install or invocation activity for the plugin on the requested day (install-only users count), or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `install_count: number or null`

      Number of distinct users who installed the plugin on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

    - `invocation_count: number`

      Number of plugin invocations on the requested day

    - `plugin_name: string`

      Name of the plugin

    - `plugin_id: optional string or null`

      Stable plugin identifier when available (e.g. `serena@claude-plugins-official`). Null for third-party Claude Code plugins (redacted at the source) and Cowork slash commands that carry only a hashed id.

    - `product: optional string or null`

      Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, or `office_agent` (the canonical Cost & Usage product naming; an `office_agent` row's per-surface breakdown is in its `office_metrics`). On `/plugins` only `cowork` and `claude_code` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, and `cowork` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

    - `rbac_group_id: optional string or null`

      Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

    - `rbac_group_name: optional string or null`

      Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

    - `user_id: optional string or null`

      Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `next_page: string or null`

    Opaque cursor for the next page, or null if no more results

## Example

```bash
curl https://api.anthropic.com/v1/organizations/analytics/plugins \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

### Response (200)

```json
{
  "data": [
    {
      "claude_code_metrics": {
        "distinct_session_plugin_used_count": 0
      },
      "cowork_metrics": {
        "distinct_session_plugin_used_count": 0
      },
      "distinct_user_count": 0,
      "install_count": 0,
      "invocation_count": 0,
      "plugin_name": "plugin_name",
      "plugin_id": "plugin_id",
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```