Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.309 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One capture · api

One read of Claude Developer Platformapi-20261022T173720Z

461 pages moved out of 808 read.

Pages moved 461 significant first
Pages read 808 in this capture
Captured 17:37 UTC
Corpus hash e3e9c53ea786 corpus-hash

What this read moved

101-125 of 461, page 5 of 19

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

api/messages/batches Changed · +1000 / -1012 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 114
114114 
115115 See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages?sdk_languages=http).
116116 
117 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
117 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter.
118118 
119119 There is a limit of 100,000 messages in a single request.
120120 
121 - `content: string or array of ContentBlockParam`
122 
123 - `string`
124 
125 - `array of ContentBlockParam`
126 
127 - `TextBlockParam object`
121 - `UserMessageParam object`
122 
123 - `content: MessageContentParam`
124 
125 - `string`
126 
127 - `array of ContentBlockParam`
128 
129 - `TextBlockParam object`
130 
131 - `type: "text"`
132 
133 - `text: string`
134 
135 minLength: 1
136 
137 - `cache_control: optional CacheControlEphemeral or null`
138 
139 Create a cache control breakpoint at this content block.
140 
141 - `type: "ephemeral"`
142 
143 - `ttl: optional "5m" or "1h"`
144 
145 The time-to-live for the cache control breakpoint.
146 
147 This may be one the following values:
148 
149 - `5m`: 5 minutes
150 - `1h`: 1 hour
151 
152 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
153 
154 - `"5m"`
155 
156 - `"1h"`
157 
158 - `citations: optional array of TextCitationParam or null`
159 
160 - `CitationCharLocationParam object`
161 
162 - `type: "char_location"`
163 
164 - `cited_text: string`
165 
166 - `document_index: number`
167 
168 minimum: 0
169 
170 - `document_title: string or null`
171 
172 minLength: 1, maxLength: 500
173 
174 - `end_char_index: number`
175 
176 - `start_char_index: number`
177 
178 minimum: 0
179 
180 - `CitationPageLocationParam object`
181 
182 - `type: "page_location"`
183 
184 - `cited_text: string`
185 
186 - `document_index: number`
187 
188 minimum: 0
189 
190 - `document_title: string or null`
191 
192 minLength: 1, maxLength: 500
193 
194 - `end_page_number: number`
195 
196 - `start_page_number: number`
197 
198 minimum: 1
199 
200 - `CitationContentBlockLocationParam object`
201 
202 - `type: "content_block_location"`
203 
204 - `cited_text: string`
205 
206 The full text of the cited block range, concatenated.
207 
208 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
209 
210 - `document_index: number`
211 
212 minimum: 0
213 
214 - `document_title: string or null`
215 
216 minLength: 1, maxLength: 500
217 
218 - `end_block_index: number`
219 
220 Exclusive 0-based end index of the cited block range in the source's `content` array.
221 
222 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
223 
224 - `start_block_index: number`
225 
226 0-based index of the first cited block in the source's `content` array.
227 
228 minimum: 0
229 
230 - `CitationWebSearchResultLocationParam object`
231 
232 - `type: "web_search_result_location"`
233 
234 - `cited_text: string`
235 
236 - `encrypted_index: string`
237 
238 - `title: string or null`
239 
240 minLength: 1, maxLength: 512
241 
242 - `url: string`
243 
244 minLength: 1
245 
246 - `CitationSearchResultLocationParam object`
247 
248 - `type: "search_result_location"`
249 
250 - `cited_text: string`
251 
252 The full text of the cited block range, concatenated.
253 
254 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
255 
256 - `end_block_index: number`
257 
258 Exclusive 0-based end index of the cited block range in the source's `content` array.
259 
260 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
261 
262 - `search_result_index: number`
263 
264 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
265 
266 Counted separately from `document_index`; server-side web search results are not included in this count.
267 
268 minimum: 0
269 
270 - `source: string`
271 
272 - `start_block_index: number`
273 
274 0-based index of the first cited block in the source's `content` array.
275 
276 minimum: 0
277 
278 - `title: string or null`
279 
280 - `ImageBlockParam object`
281 
282 - `type: "image"`
283 
284 - `source: Base64ImageSource or URLImageSource or FileImageSource`
285 
286 - `Base64ImageSource object`
287 
288 - `type: "base64"`
289 
290 - `data: string`
291 
292 format: byte
293 
294 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
295 
296 - `"image/jpeg"`
297 
298 - `"image/png"`
299 
300 - `"image/gif"`
301 
302 - `"image/webp"`
303 
304 - `URLImageSource object`
305 
306 - `type: "url"`
307 
308 - `url: string`
309 
310 - `FileImageSource object`
311 
312 - `type: "file"`
313 
314 - `file_id: string`
315 
316 - `cache_control: optional CacheControlEphemeral or null`
317 
318 Create a cache control breakpoint at this content block.
319 
320 - `transformations: optional ImageTransformationsParam or null`
321 
322 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.
323 
324 - `oversized_image: optional "downsize" or "error"`
325 
326 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.
327 
328 - `"downsize"`
329 
330 - `"error"`
331 
332 - `DocumentBlockParam object`
333 
334 - `type: "document"`
335 
336 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
337 
338 - `Base64PDFSource object`
339 
340 - `type: "base64"`
341 
342 - `data: string`
343 
344 format: byte
345 
346 - `media_type: "application/pdf"`
347 
348 - `PlainTextSource object`
349 
350 - `type: "text"`
351 
352 - `data: string`
353 
354 - `media_type: "text/plain"`
355 
356 - `ContentBlockSource object`
357 
358 - `type: "content"`
359 
360 - `content: string or array of ContentBlockSourceContent`
361 
362 - `string`
363 
364 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
365 
366 - `TextBlockParam object`
367 
368 - `ImageBlockParam object`
369 
370 - `URLPDFSource object`
371 
372 - `type: "url"`
373 
374 - `url: string`
375 
376 - `FileDocumentSource object`
377 
378 - `type: "file"`
379 
380 - `file_id: string`
381 
382 - `cache_control: optional CacheControlEphemeral or null`
383 
384 Create a cache control breakpoint at this content block.
385 
386 - `citations: optional CitationsConfigParam or null`
387 
388 - `enabled: optional boolean`
389 
390 - `context: optional string or null`
391 
392 minLength: 1
393 
394 - `title: optional string or null`
395 
396 minLength: 1, maxLength: 500
397 
398 - `SearchResultBlockParam object`
399 
400 - `type: "search_result"`
401 
402 - `content: array of TextBlockParam`
403 
404 - `type: "text"`
405 
406 - `text: string`
407 
408 minLength: 1
409 
410 - `cache_control: optional CacheControlEphemeral or null`
411 
412 Create a cache control breakpoint at this content block.
413 
414 - `citations: optional array of TextCitationParam or null`
415 
416 - `source: string`
417 
418 - `title: string`
419 
420 - `cache_control: optional CacheControlEphemeral or null`
421 
422 Create a cache control breakpoint at this content block.
423 
424 - `citations: optional CitationsConfigParam`
425 
426 - `ThinkingBlockParam object`
427 
428 - `type: "thinking"`
429 
430 - `signature: string`
431 
432 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.
433 
434 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
435 
436 - `thinking: string`
437 
438 The `thinking` text of this block as returned by the API.
439 
440 - `RedactedThinkingBlockParam object`
441 
442 - `type: "redacted_thinking"`
443 
444 - `data: string`
445 
446 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.
447 
448 - `ToolUseBlockParam object`
449 
450 - `type: "tool_use"`
451 
452 - `id: string`
453 
454 pattern: ^[a-zA-Z0-9_-]+$
455 
456 - `input: map[unknown]`
457 
458 - `name: string`
459 
460 minLength: 1, maxLength: 200
461 
462 - `cache_control: optional CacheControlEphemeral or null`
463 
464 Create a cache control breakpoint at this content block.
465 
466 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
467 
468 - `DirectCaller object`
469 
470 Tool invocation directly from the model.
471 
472 - `type: "direct"`
473 
474 - `ServerToolCaller object`
475 
476 Tool invocation generated by a server-side tool.
477 
478 - `type: "code_execution_20250825"`
479 
480 - `tool_id: string`
481 
482 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
483 
484 - `ServerToolCaller20260120 object`
485 
486 - `type: "code_execution_20260120"`
487 
488 - `tool_id: string`
489 
490 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
491 
492 - `toolset_name: optional string or null`
493 
494 For a toolset member tool_use, the toolset family this member belongs to.
495 
496 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
497 
498 - `ToolResultBlockParam object`
499 
500 - `type: "tool_result"`
501 
502 - `tool_use_id: string`
503 
504 pattern: ^[a-zA-Z0-9_-]+$
505 
506 - `cache_control: optional CacheControlEphemeral or null`
507 
508 Create a cache control breakpoint at this content block.
509 
510 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
511 
512 - `string`
513 
514 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
515 
516 - `TextBlockParam object`
517 
518 - `ImageBlockParam object`
519 
520 - `SearchResultBlockParam object`
521 
522 - `DocumentBlockParam object`
523 
524 - `ToolReferenceBlockParam object`
525 
526 Tool reference block that can be included in tool_result content.
527 
528 - `type: "tool_reference"`
529 
530 - `tool_name: string`
531 
532 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
533 
534 - `cache_control: optional CacheControlEphemeral or null`
535 
536 Create a cache control breakpoint at this content block.
537 
538 - `BrowserStateBlockParam object`
539 
540 The caller's browser state after a browser toolset member call —
541 the full inventory of open tabs, which tab is active, and any side
542 effects (tabs opened, download state changes) the call produced.
543 
544 At most one per `tool_result`, only on a non-error result answering a
545 browser toolset member `tool_use`. The server renders the
546 model-visible text from it; the model never sees the raw fields.
547 
548 - `type: "browser_state"`
549 
550 - `tabs: array of BrowserStateTabEntry`
551 
552 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`.
553 
554 maxItems: 100
555 
556 - `tab_id: string`
557 
558 The caller-assigned identifier for this tab, unique within the inventory.
559 
560 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
561 
562 - `title: string`
563 
564 The title of the page the tab is showing. May be empty.
565 
566 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
567 
568 - `url: string`
569 
570 The URL of the page the tab is showing. May be empty.
571 
572 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
573 
574 - `active: optional boolean`
575 
576 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
577 
578 - `cache_control: optional CacheControlEphemeral or null`
579 
580 Create a cache control breakpoint at this content block.
581 
582 - `state_changes: optional array of BrowserStateChange or null`
583 
584 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
585 
586 minItems: 1, maxItems: 200
587 
588 - `BrowserStateChangeTabOpened object`
589 
590 A tab this call's execution opened that remains open at its end —
591 the creation delta of the `tabs` inventory, not an event log.
592 
593 Carries only the `tab_id`; the tab's `title` and `url` live on its
594 `tabs` entry, which must include the same `tab_id`. A tab opened
595 during a failed call gets no deferred `tab_opened`; it simply appears
596 in the next result's `tabs` inventory.
597 
598 - `type: "tab_opened"`
599 
600 - `tab_id: string`
601 
602 The `tab_id` of the opened tab, present in `tabs`.
603 
604 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
605 
606 - `BrowserStateChangeDownloadStarted object`
607 
608 A file download that started during this call.
609 
610 - `type: "download_started"`
611 
612 - `download_id: string`
613 
614 The caller-assigned identifier for this download, stable across the state changes reporting it.
615 
616 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
617 
618 - `url: string`
619 
620 The final post-redirect URL the download was served from.
621 
622 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
623 
624 - `BrowserStateChangeDownloadCompleted object`
625 
626 A file download that finished during this call, reported with the
627 same `download_id` as its `download_started` — or without a prior
628 `download_started`, when the download finished during the call that
629 started it (at most one state change per `download_id` per result).
630 
631 - `type: "download_completed"`
632 
633 - `download_id: string`
634 
635 The caller-assigned identifier for this download, stable across the state changes reporting it.
636 
637 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
638 
639 - `url: string`
640 
641 The final post-redirect URL the download was served from.
642 
643 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
644 
645 - `path: optional string or null`
646 
647 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
648 
649 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
650 
651 - `size_bytes: optional number or null`
652 
653 The completed download's size.
654 
655 minimum: 0
656 
657 - `BrowserStateChangeDownloadFailed object`
658 
659 A file download that failed — or was cancelled — during this call.
660 
661 - `type: "download_failed"`
662 
663 - `download_id: string`
664 
665 The caller-assigned identifier for this download, stable across the state changes reporting it.
666 
667 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
668 
669 - `url: string`
670 
671 The final post-redirect URL the download was served from.
672 
673 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
674 
675 - `error: optional string or null`
676 
677 The failure or cancellation detail, when known.
678 
679 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
680 
681 - `is_error: optional boolean`
682 
683 - `toolset_name: optional string or null`
684 
685 For a toolset member tool_result, the toolset family of the paired tool_use.
686 
687 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
688 
689 - `ServerToolUseBlockParam object`
690 
691 - `type: "server_tool_use"`
692 
693 - `id: string`
694 
695 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
696 
697 - `input: map[unknown]`
698 
699 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
700 
701 - `"web_search"`
702 
703 - `"web_fetch"`
704 
705 - `"code_execution"`
706 
707 - `"bash_code_execution"`
708 
709 - `"text_editor_code_execution"`
710 
711 - `"tool_search_tool_regex"`
712 
713 - `"tool_search_tool_bm25"`
714 
715 - `cache_control: optional CacheControlEphemeral or null`
716 
717 Create a cache control breakpoint at this content block.
718 
719 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
720 
721 - `DirectCaller object`
722 
723 Tool invocation directly from the model.
724 
725 - `ServerToolCaller object`
726 
727 Tool invocation generated by a server-side tool.
728 
729 - `ServerToolCaller20260120 object`
730 
731 - `WebSearchToolResultBlockParam object`
732 
733 - `type: "web_search_tool_result"`
734 
735 - `content: WebSearchToolResultBlockParamContent`
736 
737 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
738 
739 - `type: "web_search_result"`
740 
741 - `encrypted_content: string`
742 
743 - `title: string`
744 
745 - `url: string`
746 
747 - `page_age: optional string or null`
748 
749 - `WebSearchToolRequestError object`
750 
751 - `type: "web_search_tool_result_error"`
752 
753 - `error_code: WebSearchToolResultErrorCode`
754 
755 - `"invalid_tool_input"`
756 
757 - `"unavailable"`
758 
759 - `"max_uses_exceeded"`
760 
761 - `"too_many_requests"`
762 
763 - `"query_too_long"`
764 
765 - `"request_too_large"`
766 
767 - `tool_use_id: string`
768 
769 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
770 
771 - `cache_control: optional CacheControlEphemeral or null`
772 
773 Create a cache control breakpoint at this content block.
774 
775 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
776 
777 - `DirectCaller object`
778 
779 Tool invocation directly from the model.
780 
781 - `ServerToolCaller object`
782 
783 Tool invocation generated by a server-side tool.
784 
785 - `ServerToolCaller20260120 object`
786 
787 - `WebFetchToolResultBlockParam object`
788 
789 - `type: "web_fetch_tool_result"`
790 
791 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
792 
793 - `WebFetchToolResultErrorBlockParam object`
794 
795 - `type: "web_fetch_tool_result_error"`
796 
797 - `error_code: WebFetchToolResultErrorCode`
798 
799 - `"invalid_tool_input"`
800 
801 - `"url_too_long"`
802 
803 - `"url_not_allowed"`
804 
805 - `"url_not_in_prior_context"`
806 
807 - `"url_not_accessible"`
808 
809 - `"unsupported_content_type"`
810 
811 - `"too_many_requests"`
812 
813 - `"max_uses_exceeded"`
814 
815 - `"unavailable"`
816 
817 - `"content_too_large"`
818 
819 - `WebFetchBlockParam object`
820 
821 - `type: "web_fetch_result"`
822 
823 - `content: DocumentBlockParam`
824 
825 - `url: string`
826 
827 Fetched content URL
828 
829 - `retrieved_at: optional string or null`
830 
831 ISO 8601 timestamp when the content was retrieved
832 
833 - `tool_use_id: string`
834 
835 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
836 
837 - `cache_control: optional CacheControlEphemeral or null`
838 
839 Create a cache control breakpoint at this content block.
840 
841 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
842 
843 - `DirectCaller object`
844 
845 Tool invocation directly from the model.
846 
847 - `ServerToolCaller object`
848 
849 Tool invocation generated by a server-side tool.
850 
851 - `ServerToolCaller20260120 object`
852 
853 - `CodeExecutionToolResultBlockParam object`
854 
855 - `type: "code_execution_tool_result"`
856 
857 - `content: CodeExecutionToolResultBlockParamContent`
858 
859 - `CodeExecutionToolResultErrorParam object`
860 
861 - `type: "code_execution_tool_result_error"`
862 
863 - `error_code: CodeExecutionToolResultErrorCode`
864 
865 - `"invalid_tool_input"`
866 
867 - `"unavailable"`
868 
869 - `"too_many_requests"`
870 
871 - `"execution_time_exceeded"`
872 
873 - `CodeExecutionResultBlockParam object`
874 
875 - `type: "code_execution_result"`
876 
877 - `content: array of CodeExecutionOutputBlockParam`
878 
879 - `type: "code_execution_output"`
880 
881 - `file_id: string`
882 
883 - `return_code: number`
884 
885 - `stderr: string`
886 
887 - `stdout: string`
888 
889 - `EncryptedCodeExecutionResultBlockParam object`
890 
891 Code execution result with encrypted stdout for PFC + web_search results.
892 
893 - `type: "encrypted_code_execution_result"`
894 
895 - `content: array of CodeExecutionOutputBlockParam`
896 
897 - `type: "code_execution_output"`
898 
899 - `file_id: string`
900 
901 - `encrypted_stdout: string`
902 
903 - `return_code: number`
904 
905 - `stderr: string`
906 
907 - `tool_use_id: string`
908 
909 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
910 
911 - `cache_control: optional CacheControlEphemeral or null`
912 
913 Create a cache control breakpoint at this content block.
914 
915 - `BashCodeExecutionToolResultBlockParam object`
916 
917 - `type: "bash_code_execution_tool_result"`
918 
919 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
920 
921 - `BashCodeExecutionToolResultErrorParam object`
922 
923 - `type: "bash_code_execution_tool_result_error"`
924 
925 - `error_code: BashCodeExecutionToolResultErrorCode`
926 
927 - `"invalid_tool_input"`
928 
929 - `"unavailable"`
930 
931 - `"too_many_requests"`
932 
933 - `"execution_time_exceeded"`
934 
935 - `"output_file_too_large"`
936 
937 - `BashCodeExecutionResultBlockParam object`
938 
939 - `type: "bash_code_execution_result"`
940 
941 - `content: array of BashCodeExecutionOutputBlockParam`
942 
943 - `type: "bash_code_execution_output"`
944 
945 - `file_id: string`
946 
947 - `return_code: number`
948 
949 - `stderr: string`
950 
951 - `stdout: string`
952 
953 - `tool_use_id: string`
954 
955 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
956 
957 - `cache_control: optional CacheControlEphemeral or null`
958 
959 Create a cache control breakpoint at this content block.
960 
961 - `TextEditorCodeExecutionToolResultBlockParam object`
962 
963 - `type: "text_editor_code_execution_tool_result"`
964 
965 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
966 
967 - `TextEditorCodeExecutionToolResultErrorParam object`
968 
969 - `type: "text_editor_code_execution_tool_result_error"`
970 
971 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
972 
973 - `"invalid_tool_input"`
974 
975 - `"unavailable"`
976 
977 - `"too_many_requests"`
978 
979 - `"execution_time_exceeded"`
980 
981 - `"file_not_found"`
982 
983 - `error_message: optional string or null`
984 
985 - `TextEditorCodeExecutionViewResultBlockParam object`
986 
987 - `type: "text_editor_code_execution_view_result"`
988 
989 - `content: string`
990 
991 - `file_type: "text" or "image" or "pdf"`
992 
993 - `"text"`
994 
995 - `"image"`
996 
997 - `"pdf"`
998 
999 - `num_lines: optional number or null`
1000 
1001 - `start_line: optional number or null`
1002 
1003 - `total_lines: optional number or null`
1004 
1005 - `TextEditorCodeExecutionCreateResultBlockParam object`
1006 
1007 - `type: "text_editor_code_execution_create_result"`
1008 
1009 - `is_file_update: boolean`
1010 
1011 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1012 
1013 - `type: "text_editor_code_execution_str_replace_result"`
1014 
1015 - `lines: optional array of string or null`
1016 
1017 - `new_lines: optional number or null`
1018 
1019 - `new_start: optional number or null`
1020 
1021 - `old_lines: optional number or null`
1022 
1023 - `old_start: optional number or null`
1024 
1025 - `tool_use_id: string`
1026 
1027 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1028 
1029 - `cache_control: optional CacheControlEphemeral or null`
1030 
1031 Create a cache control breakpoint at this content block.
1032 
1033 - `ToolSearchToolResultBlockParam object`
1034 
1035 - `type: "tool_search_tool_result"`
1036 
1037 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1038 
1039 - `ToolSearchToolResultErrorParam object`
1040 
1041 - `type: "tool_search_tool_result_error"`
1042 
1043 - `error_code: ToolSearchToolResultErrorCode`
1044 
1045 - `"invalid_tool_input"`
1046 
1047 - `"unavailable"`
1048 
1049 - `"too_many_requests"`
1050 
1051 - `"execution_time_exceeded"`
1052 
1053 - `error_message: optional string or null`
1054 
1055 - `ToolSearchToolSearchResultBlockParam object`
1056 
1057 - `type: "tool_search_tool_search_result"`
1058 
1059 - `tool_references: array of ToolReferenceBlockParam`
1060 
1061 - `type: "tool_reference"`
1062 
1063 - `tool_name: string`
1064 
1065 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1066 
1067 - `cache_control: optional CacheControlEphemeral or null`
1068 
1069 Create a cache control breakpoint at this content block.
1070 
1071 - `tool_use_id: string`
1072 
1073 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1074 
1075 - `cache_control: optional CacheControlEphemeral or null`
1076 
1077 Create a cache control breakpoint at this content block.
1078 
1079 - `ContainerUploadBlockParam object`
1080 
1081 A content block that represents a file to be uploaded to the container
1082 Files uploaded via this block will be available in the container's input directory.
1083 
1084 - `type: "container_upload"`
1085 
1086 - `file_id: string`
1087 
1088 - `cache_control: optional CacheControlEphemeral or null`
1089 
1090 Create a cache control breakpoint at this content block.
1091 
1092 - `role: "user"`
1093 
1094 - `AssistantMessageParam object`
1095 
1096 - `content: MessageContentParam`
1097 
1098 - `role: "assistant"`
1099 
1100 - `SystemMessageParam object`
1101 
1102 - `content: string or array of TextBlockParam`
1103 
1104 - `string`
1105 
1106 - `Blocks = array of TextBlockParam`
1281107 
1291108 - `type: "text"`
1301109 
from line 1115
1361115 
1371116 Create a cache control breakpoint at this content block.
1381117 
139 - `type: "ephemeral"`
140 
141 - `ttl: optional "5m" or "1h"`
142 
143 The time-to-live for the cache control breakpoint.
144 
145 This may be one the following values:
146 
147 - `5m`: 5 minutes
148 - `1h`: 1 hour
149 
150 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
151 
152 - `"5m"`
153 
154 - `"1h"`
155 
1561118 - `citations: optional array of TextCitationParam or null`
1571119 
158 - `CitationCharLocationParam object`
159 
160 - `type: "char_location"`
161 
162 - `cited_text: string`
163 
164 - `document_index: number`
165 
166 minimum: 0
167 
168 - `document_title: string or null`
169 
170 minLength: 1, maxLength: 500
171 
172 - `end_char_index: number`
173 
174 - `start_char_index: number`
175 
176 minimum: 0
177 
178 - `CitationPageLocationParam object`
179 
180 - `type: "page_location"`
181 
182 - `cited_text: string`
183 
184 - `document_index: number`
185 
186 minimum: 0
187 
188 - `document_title: string or null`
189 
190 minLength: 1, maxLength: 500
191 
192 - `end_page_number: number`
193 
194 - `start_page_number: number`
195 
196 minimum: 1
197 
198 - `CitationContentBlockLocationParam object`
199 
200 - `type: "content_block_location"`
201 
202 - `cited_text: string`
203 
204 The full text of the cited block range, concatenated.
205 
206 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
207 
208 - `document_index: number`
209 
210 minimum: 0
211 
212 - `document_title: string or null`
213 
214 minLength: 1, maxLength: 500
215 
216 - `end_block_index: number`
217 
218 Exclusive 0-based end index of the cited block range in the source's `content` array.
219 
220 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
221 
222 - `start_block_index: number`
223 
224 0-based index of the first cited block in the source's `content` array.
225 
226 minimum: 0
227 
228 - `CitationWebSearchResultLocationParam object`
229 
230 - `type: "web_search_result_location"`
231 
232 - `cited_text: string`
233 
234 - `encrypted_index: string`
235 
236 - `title: string or null`
237 
238 minLength: 1, maxLength: 512
239 
240 - `url: string`
241 
242 minLength: 1
243 
244 - `CitationSearchResultLocationParam object`
245 
246 - `type: "search_result_location"`
247 
248 - `cited_text: string`
249 
250 The full text of the cited block range, concatenated.
251 
252 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
253 
254 - `end_block_index: number`
255 
256 Exclusive 0-based end index of the cited block range in the source's `content` array.
257 
258 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
259 
260 - `search_result_index: number`
261 
262 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
263 
264 Counted separately from `document_index`; server-side web search results are not included in this count.
265 
266 minimum: 0
267 
268 - `source: string`
269 
270 - `start_block_index: number`
271 
272 0-based index of the first cited block in the source's `content` array.
273 
274 minimum: 0
275 
276 - `title: string or null`
277 
278 - `ImageBlockParam object`
279 
280 - `type: "image"`
281 
282 - `source: Base64ImageSource or URLImageSource or FileImageSource`
283 
284 - `Base64ImageSource object`
285 
286 - `type: "base64"`
287 
288 - `data: string`
289 
290 format: byte
291 
292 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
293 
294 - `"image/jpeg"`
295 
296 - `"image/png"`
297 
298 - `"image/gif"`
299 
300 - `"image/webp"`
301 
302 - `URLImageSource object`
303 
304 - `type: "url"`
305 
306 - `url: string`
307 
308 - `FileImageSource object`
309 
310 - `type: "file"`
311 
312 - `file_id: string`
313 
314 - `cache_control: optional CacheControlEphemeral or null`
315 
316 Create a cache control breakpoint at this content block.
317 
318 - `transformations: optional ImageTransformationsParam or null`
319 
320 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.
321 
322 - `oversized_image: optional "downsize" or "error"`
323 
324 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.
325 
326 - `"downsize"`
327 
328 - `"error"`
329 
330 - `DocumentBlockParam object`
331 
332 - `type: "document"`
333 
334 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
335 
336 - `Base64PDFSource object`
337 
338 - `type: "base64"`
339 
340 - `data: string`
341 
342 format: byte
343 
344 - `media_type: "application/pdf"`
345 
346 - `PlainTextSource object`
347 
348 - `type: "text"`
349 
350 - `data: string`
351 
352 - `media_type: "text/plain"`
353 
354 - `ContentBlockSource object`
355 
356 - `type: "content"`
357 
358 - `content: string or array of ContentBlockSourceContent`
359 
360 - `string`
361 
362 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
363 
364 - `TextBlockParam object`
365 
366 - `ImageBlockParam object`
367 
368 - `URLPDFSource object`
369 
370 - `type: "url"`
371 
372 - `url: string`
373 
374 - `FileDocumentSource object`
375 
376 - `type: "file"`
377 
378 - `file_id: string`
379 
380 - `cache_control: optional CacheControlEphemeral or null`
381 
382 Create a cache control breakpoint at this content block.
383 
384 - `citations: optional CitationsConfigParam or null`
385 
386 - `enabled: optional boolean`
387 
388 - `context: optional string or null`
389 
390 minLength: 1
391 
392 - `title: optional string or null`
393 
394 minLength: 1, maxLength: 500
395 
396 - `SearchResultBlockParam object`
397 
398 - `type: "search_result"`
399 
400 - `content: array of TextBlockParam`
401 
402 - `type: "text"`
403 
404 - `text: string`
405 
406 minLength: 1
407 
408 - `cache_control: optional CacheControlEphemeral or null`
409 
410 Create a cache control breakpoint at this content block.
411 
412 - `citations: optional array of TextCitationParam or null`
413 
414 - `source: string`
415 
416 - `title: string`
417 
418 - `cache_control: optional CacheControlEphemeral or null`
419 
420 Create a cache control breakpoint at this content block.
421 
422 - `citations: optional CitationsConfigParam`
423 
424 - `ThinkingBlockParam object`
425 
426 - `type: "thinking"`
427 
428 - `signature: string`
429 
430 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.
431 
432 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
433 
434 - `thinking: string`
435 
436 The `thinking` text of this block as returned by the API.
437 
438 - `RedactedThinkingBlockParam object`
439 
440 - `type: "redacted_thinking"`
441 
442 - `data: string`
443 
444 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.
445 
446 - `ToolUseBlockParam object`
447 
448 - `type: "tool_use"`
449 
450 - `id: string`
451 
452 pattern: ^[a-zA-Z0-9_-]+$
453 
454 - `input: map[unknown]`
455 
456 - `name: string`
457 
458 minLength: 1, maxLength: 200
459 
460 - `cache_control: optional CacheControlEphemeral or null`
461 
462 Create a cache control breakpoint at this content block.
463 
464 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
465 
466 - `DirectCaller object`
467 
468 Tool invocation directly from the model.
469 
470 - `type: "direct"`
471 
472 - `ServerToolCaller object`
473 
474 Tool invocation generated by a server-side tool.
475 
476 - `type: "code_execution_20250825"`
477 
478 - `tool_id: string`
479 
480 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
481 
482 - `ServerToolCaller20260120 object`
483 
484 - `type: "code_execution_20260120"`
485 
486 - `tool_id: string`
487 
488 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
489 
490 - `toolset_name: optional string or null`
491 
492 For a toolset member tool_use, the toolset family this member belongs to.
493 
494 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
495 
496 - `ToolResultBlockParam object`
497 
498 - `type: "tool_result"`
499 
500 - `tool_use_id: string`
501 
502 pattern: ^[a-zA-Z0-9_-]+$
503 
504 - `cache_control: optional CacheControlEphemeral or null`
505 
506 Create a cache control breakpoint at this content block.
507 
508 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
509 
510 - `string`
511 
512 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
513 
514 - `TextBlockParam object`
515 
516 - `ImageBlockParam object`
517 
518 - `SearchResultBlockParam object`
519 
520 - `DocumentBlockParam object`
521 
522 - `ToolReferenceBlockParam object`
523 
524 Tool reference block that can be included in tool_result content.
525 
526 - `type: "tool_reference"`
527 
528 - `tool_name: string`
529 
530 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
531 
532 - `cache_control: optional CacheControlEphemeral or null`
533 
534 Create a cache control breakpoint at this content block.
535 
536 - `BrowserStateBlockParam object`
537 
538 The caller's browser state after a browser toolset member call —
539 the full inventory of open tabs, which tab is active, and any side
540 effects (tabs opened, download state changes) the call produced.
541 
542 At most one per `tool_result`, only on a non-error result answering a
543 browser toolset member `tool_use`. The server renders the
544 model-visible text from it; the model never sees the raw fields.
545 
546 - `type: "browser_state"`
547 
548 - `tabs: array of BrowserStateTabEntry`
549 
550 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`.
551 
552 maxItems: 100
553 
554 - `tab_id: string`
555 
556 The caller-assigned identifier for this tab, unique within the inventory.
557 
558 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
559 
560 - `title: string`
561 
562 The title of the page the tab is showing. May be empty.
563 
564 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
565 
566 - `url: string`
567 
568 The URL of the page the tab is showing. May be empty.
569 
570 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
571 
572 - `active: optional boolean`
573 
574 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
575 
576 - `cache_control: optional CacheControlEphemeral or null`
577 
578 Create a cache control breakpoint at this content block.
579 
580 - `state_changes: optional array of BrowserStateChange or null`
581 
582 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
583 
584 minItems: 1, maxItems: 200
585 
586 - `BrowserStateChangeTabOpened object`
587 
588 A tab this call's execution opened that remains open at its end —
589 the creation delta of the `tabs` inventory, not an event log.
590 
591 Carries only the `tab_id`; the tab's `title` and `url` live on its
592 `tabs` entry, which must include the same `tab_id`. A tab opened
593 during a failed call gets no deferred `tab_opened`; it simply appears
594 in the next result's `tabs` inventory.
595 
596 - `type: "tab_opened"`
597 
598 - `tab_id: string`
599 
600 The `tab_id` of the opened tab, present in `tabs`.
601 
602 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
603 
604 - `BrowserStateChangeDownloadStarted object`
605 
606 A file download that started during this call.
607 
608 - `type: "download_started"`
609 
610 - `download_id: string`
611 
612 The caller-assigned identifier for this download, stable across the state changes reporting it.
613 
614 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
615 
616 - `url: string`
617 
618 The final post-redirect URL the download was served from.
619 
620 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
621 
622 - `BrowserStateChangeDownloadCompleted object`
623 
624 A file download that finished during this call, reported with the
625 same `download_id` as its `download_started` — or without a prior
626 `download_started`, when the download finished during the call that
627 started it (at most one state change per `download_id` per result).
628 
629 - `type: "download_completed"`
630 
631 - `download_id: string`
632 
633 The caller-assigned identifier for this download, stable across the state changes reporting it.
634 
635 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
636 
637 - `url: string`
638 
639 The final post-redirect URL the download was served from.
640 
641 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
642 
643 - `path: optional string or null`
644 
645 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
646 
647 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
648 
649 - `size_bytes: optional number or null`
650 
651 The completed download's size.
652 
653 minimum: 0
654 
655 - `BrowserStateChangeDownloadFailed object`
656 
657 A file download that failed — or was cancelled — during this call.
658 
659 - `type: "download_failed"`
660 
661 - `download_id: string`
662 
663 The caller-assigned identifier for this download, stable across the state changes reporting it.
664 
665 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
666 
667 - `url: string`
668 
669 The final post-redirect URL the download was served from.
670 
671 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
672 
673 - `error: optional string or null`
674 
675 The failure or cancellation detail, when known.
676 
677 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
678 
679 - `is_error: optional boolean`
680 
681 - `toolset_name: optional string or null`
682 
683 For a toolset member tool_result, the toolset family of the paired tool_use.
684 
685 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
686 
687 - `ServerToolUseBlockParam object`
688 
689 - `type: "server_tool_use"`
690 
691 - `id: string`
692 
693 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
694 
695 - `input: map[unknown]`
696 
697 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
698 
699 - `"web_search"`
700 
701 - `"web_fetch"`
702 
703 - `"code_execution"`
704 
705 - `"bash_code_execution"`
706 
707 - `"text_editor_code_execution"`
708 
709 - `"tool_search_tool_regex"`
710 
711 - `"tool_search_tool_bm25"`
712 
713 - `cache_control: optional CacheControlEphemeral or null`
714 
715 Create a cache control breakpoint at this content block.
716 
717 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
718 
719 - `DirectCaller object`
720 
721 Tool invocation directly from the model.
722 
723 - `ServerToolCaller object`
724 
725 Tool invocation generated by a server-side tool.
726 
727 - `ServerToolCaller20260120 object`
728 
729 - `WebSearchToolResultBlockParam object`
730 
731 - `type: "web_search_tool_result"`
732 
733 - `content: WebSearchToolResultBlockParamContent`
734 
735 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
736 
737 - `type: "web_search_result"`
738 
739 - `encrypted_content: string`
740 
741 - `title: string`
742 
743 - `url: string`
744 
745 - `page_age: optional string or null`
746 
747 - `WebSearchToolRequestError object`
748 
749 - `type: "web_search_tool_result_error"`
750 
751 - `error_code: WebSearchToolResultErrorCode`
752 
753 - `"invalid_tool_input"`
754 
755 - `"unavailable"`
756 
757 - `"max_uses_exceeded"`
758 
759 - `"too_many_requests"`
760 
761 - `"query_too_long"`
762 
763 - `"request_too_large"`
764 
765 - `tool_use_id: string`
766 
767 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
768 
769 - `cache_control: optional CacheControlEphemeral or null`
770 
771 Create a cache control breakpoint at this content block.
772 
773 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
774 
775 - `DirectCaller object`
776 
777 Tool invocation directly from the model.
778 
779 - `ServerToolCaller object`
780 
781 Tool invocation generated by a server-side tool.
782 
783 - `ServerToolCaller20260120 object`
784 
785 - `WebFetchToolResultBlockParam object`
786 
787 - `type: "web_fetch_tool_result"`
788 
789 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
790 
791 - `WebFetchToolResultErrorBlockParam object`
792 
793 - `type: "web_fetch_tool_result_error"`
794 
795 - `error_code: WebFetchToolResultErrorCode`
796 
797 - `"invalid_tool_input"`
798 
799 - `"url_too_long"`
800 
801 - `"url_not_allowed"`
802 
803 - `"url_not_in_prior_context"`
804 
805 - `"url_not_accessible"`
806 
807 - `"unsupported_content_type"`
808 
809 - `"too_many_requests"`
810 
811 - `"max_uses_exceeded"`
812 
813 - `"unavailable"`
814 
815 - `"content_too_large"`
816 
817 - `WebFetchBlockParam object`
818 
819 - `type: "web_fetch_result"`
820 
821 - `content: DocumentBlockParam`
822 
823 - `url: string`
824 
825 Fetched content URL
826 
827 - `retrieved_at: optional string or null`
828 
829 ISO 8601 timestamp when the content was retrieved
830 
831 - `tool_use_id: string`
832 
833 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
834 
835 - `cache_control: optional CacheControlEphemeral or null`
836 
837 Create a cache control breakpoint at this content block.
838 
839 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
840 
841 - `DirectCaller object`
842 
843 Tool invocation directly from the model.
844 
845 - `ServerToolCaller object`
846 
847 Tool invocation generated by a server-side tool.
848 
849 - `ServerToolCaller20260120 object`
850 
851 - `CodeExecutionToolResultBlockParam object`
852 
853 - `type: "code_execution_tool_result"`
854 
855 - `content: CodeExecutionToolResultBlockParamContent`
856 
857 - `CodeExecutionToolResultErrorParam object`
858 
859 - `type: "code_execution_tool_result_error"`
860 
861 - `error_code: CodeExecutionToolResultErrorCode`
862 
863 - `"invalid_tool_input"`
864 
865 - `"unavailable"`
866 
867 - `"too_many_requests"`
868 
869 - `"execution_time_exceeded"`
870 
871 - `CodeExecutionResultBlockParam object`
872 
873 - `type: "code_execution_result"`
874 
875 - `content: array of CodeExecutionOutputBlockParam`
876 
877 - `type: "code_execution_output"`
878 
879 - `file_id: string`
880 
881 - `return_code: number`
882 
883 - `stderr: string`
884 
885 - `stdout: string`
886 
887 - `EncryptedCodeExecutionResultBlockParam object`
888 
889 Code execution result with encrypted stdout for PFC + web_search results.
890 
891 - `type: "encrypted_code_execution_result"`
892 
893 - `content: array of CodeExecutionOutputBlockParam`
894 
895 - `type: "code_execution_output"`
896 
897 - `file_id: string`
898 
899 - `encrypted_stdout: string`
900 
901 - `return_code: number`
902 
903 - `stderr: string`
904 
905 - `tool_use_id: string`
906 
907 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
908 
909 - `cache_control: optional CacheControlEphemeral or null`
910 
911 Create a cache control breakpoint at this content block.
912 
913 - `BashCodeExecutionToolResultBlockParam object`
914 
915 - `type: "bash_code_execution_tool_result"`
916 
917 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
918 
919 - `BashCodeExecutionToolResultErrorParam object`
920 
921 - `type: "bash_code_execution_tool_result_error"`
922 
923 - `error_code: BashCodeExecutionToolResultErrorCode`
924 
925 - `"invalid_tool_input"`
926 
927 - `"unavailable"`
928 
929 - `"too_many_requests"`
930 
931 - `"execution_time_exceeded"`
932 
933 - `"output_file_too_large"`
934 
935 - `BashCodeExecutionResultBlockParam object`
936 
937 - `type: "bash_code_execution_result"`
938 
939 - `content: array of BashCodeExecutionOutputBlockParam`
940 
941 - `type: "bash_code_execution_output"`
942 
943 - `file_id: string`
944 
945 - `return_code: number`
946 
947 - `stderr: string`
948 
949 - `stdout: string`
950 
951 - `tool_use_id: string`
952 
953 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
954 
955 - `cache_control: optional CacheControlEphemeral or null`
956 
957 Create a cache control breakpoint at this content block.
958 
959 - `TextEditorCodeExecutionToolResultBlockParam object`
960 
961 - `type: "text_editor_code_execution_tool_result"`
962 
963 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
964 
965 - `TextEditorCodeExecutionToolResultErrorParam object`
966 
967 - `type: "text_editor_code_execution_tool_result_error"`
968 
969 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
970 
971 - `"invalid_tool_input"`
972 
973 - `"unavailable"`
974 
975 - `"too_many_requests"`
976 
977 - `"execution_time_exceeded"`
978 
979 - `"file_not_found"`
980 
981 - `error_message: optional string or null`
982 
983 - `TextEditorCodeExecutionViewResultBlockParam object`
984 
985 - `type: "text_editor_code_execution_view_result"`
986 
987 - `content: string`
988 
989 - `file_type: "text" or "image" or "pdf"`
990 
991 - `"text"`
992 
993 - `"image"`
994 
995 - `"pdf"`
996 
997 - `num_lines: optional number or null`
998 
999 - `start_line: optional number or null`
1000 
1001 - `total_lines: optional number or null`
1002 
1003 - `TextEditorCodeExecutionCreateResultBlockParam object`
1004 
1005 - `type: "text_editor_code_execution_create_result"`
1006 
1007 - `is_file_update: boolean`
1008 
1009 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1010 
1011 - `type: "text_editor_code_execution_str_replace_result"`
1012 
1013 - `lines: optional array of string or null`
1014 
1015 - `new_lines: optional number or null`
1016 
1017 - `new_start: optional number or null`
1018 
1019 - `old_lines: optional number or null`
1020 
1021 - `old_start: optional number or null`
1022 
1023 - `tool_use_id: string`
1024 
1025 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1026 
1027 - `cache_control: optional CacheControlEphemeral or null`
1028 
1029 Create a cache control breakpoint at this content block.
1030 
1031 - `ToolSearchToolResultBlockParam object`
1032 
1033 - `type: "tool_search_tool_result"`
1034 
1035 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1036 
1037 - `ToolSearchToolResultErrorParam object`
1038 
1039 - `type: "tool_search_tool_result_error"`
1040 
1041 - `error_code: ToolSearchToolResultErrorCode`
1042 
1043 - `"invalid_tool_input"`
1044 
1045 - `"unavailable"`
1046 
1047 - `"too_many_requests"`
1048 
1049 - `"execution_time_exceeded"`
1050 
1051 - `error_message: optional string or null`
1052 
1053 - `ToolSearchToolSearchResultBlockParam object`
1054 
1055 - `type: "tool_search_tool_search_result"`
1056 
1057 - `tool_references: array of ToolReferenceBlockParam`
1058 
1059 - `type: "tool_reference"`
1060 
1061 - `tool_name: string`
1062 
1063 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1064 
1065 - `cache_control: optional CacheControlEphemeral or null`
1066 
1067 Create a cache control breakpoint at this content block.
1068 
1069 - `tool_use_id: string`
1070 
1071 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1072 
1073 - `cache_control: optional CacheControlEphemeral or null`
1074 
1075 Create a cache control breakpoint at this content block.
1076 
1077 - `ContainerUploadBlockParam object`
1078 
1079 A content block that represents a file to be uploaded to the container
1080 Files uploaded via this block will be available in the container's input directory.
1081 
1082 - `type: "container_upload"`
1083 
1084 - `file_id: string`
1085 
1086 - `cache_control: optional CacheControlEphemeral or null`
1087 
1088 Create a cache control breakpoint at this content block.
1089 
1090 - `role: "user" or "assistant" or "system"`
1091 
1092 - `"user"`
1093 
1094 - `"assistant"`
1095 
1096 - `"system"`
1120 - `role: "system"`
10971121 
10981122 - `model: Model`
10991123 
from line 3105
30813105 
30823106 When true, guarantees schema validation on tool names and inputs
30833107 
3084 - `temperature: optional number`
3085 
3086 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
3087 
3088 Amount of randomness injected into the response.
3089 
3090 Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
3091 
3092 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
3093 
3094 minimum: 0, maximum: 1
3095 
3096 - `top_k: optional number`
3097 
3098 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
3099 
3100 Only sample from the top K options for each subsequent token.
3101 
3102 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
3103 
3104 Recommended for advanced use cases only.
3105 
3106 minimum: 0
3107 
3108 - `top_p: optional number`
3109 
3110 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
3111 
3112 Use nucleus sampling.
3113 
3114 In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`.
3115 
3116 Recommended for advanced use cases only.
3117 
3118 minimum: 0, maximum: 1
3119 
31203108### Returns
31213109 
31223110- `MessageBatch object`
from line 3220
32323220```bash
32333221curl https://api.anthropic.com/v1/messages/batches \
32343222 -H 'Content-Type: application/json' \
3235 -H 'anthropic-version: 2023-06-01' \
3236 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
3223 -H 'anthropic-version: 2026-10-21' \
3224 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
32373225 -d '{
32383226 "requests": [
32393227 {
from line 3406
34183406 
34193407```bash
34203408curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
3421 -H 'anthropic-version: 2023-06-01' \
3422 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3409 -H 'anthropic-version: 2026-10-21' \
3410 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
34233411```
34243412 
34253413#### Response (200)
from line 3599
36113599 
36123600```bash
36133601curl https://api.anthropic.com/v1/messages/batches \
3614 -H 'anthropic-version: 2023-06-01' \
3615 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3602 -H 'anthropic-version: 2026-10-21' \
3603 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
36163604```
36173605 
36183606#### Response (200)
from line 3778
37903778```bash
37913779curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \
37923780 -X POST \
3793 -H 'anthropic-version: 2023-06-01' \
3794 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3781 -H 'anthropic-version: 2026-10-21' \
3782 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
37953783```
37963784 
37973785#### Response (200)
from line 3856
38683856```bash
38693857curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
38703858 -X DELETE \
3871 -H 'anthropic-version: 2023-06-01' \
3872 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3859 -H 'anthropic-version: 2026-10-21' \
3860 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
38733861```
38743862 
38753863#### Response (200)
from line 5192
52045192 
52055193```bash
52065194curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/results \
5207 -H 'anthropic-version: 2023-06-01' \
5208 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5195 -H 'anthropic-version: 2026-10-21' \
5196 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
52095197```
52105198 
52115199## Domain types
52125200 

api/messages/batches/create Changed · +990 / -1002 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 112
112112 
113113 See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages?sdk_languages=http).
114114 
115 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
115 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter.
116116 
117117 There is a limit of 100,000 messages in a single request.
118118 
119 - `content: string or array of ContentBlockParam`
120 
121 - `string`
122 
123 - `array of ContentBlockParam`
124 
125 - `TextBlockParam object`
119 - `UserMessageParam object`
120 
121 - `content: MessageContentParam`
122 
123 - `string`
124 
125 - `array of ContentBlockParam`
126 
127 - `TextBlockParam object`
128 
129 - `type: "text"`
130 
131 - `text: string`
132 
133 minLength: 1
134 
135 - `cache_control: optional CacheControlEphemeral or null`
136 
137 Create a cache control breakpoint at this content block.
138 
139 - `type: "ephemeral"`
140 
141 - `ttl: optional "5m" or "1h"`
142 
143 The time-to-live for the cache control breakpoint.
144 
145 This may be one the following values:
146 
147 - `5m`: 5 minutes
148 - `1h`: 1 hour
149 
150 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
151 
152 - `"5m"`
153 
154 - `"1h"`
155 
156 - `citations: optional array of TextCitationParam or null`
157 
158 - `CitationCharLocationParam object`
159 
160 - `type: "char_location"`
161 
162 - `cited_text: string`
163 
164 - `document_index: number`
165 
166 minimum: 0
167 
168 - `document_title: string or null`
169 
170 minLength: 1, maxLength: 500
171 
172 - `end_char_index: number`
173 
174 - `start_char_index: number`
175 
176 minimum: 0
177 
178 - `CitationPageLocationParam object`
179 
180 - `type: "page_location"`
181 
182 - `cited_text: string`
183 
184 - `document_index: number`
185 
186 minimum: 0
187 
188 - `document_title: string or null`
189 
190 minLength: 1, maxLength: 500
191 
192 - `end_page_number: number`
193 
194 - `start_page_number: number`
195 
196 minimum: 1
197 
198 - `CitationContentBlockLocationParam object`
199 
200 - `type: "content_block_location"`
201 
202 - `cited_text: string`
203 
204 The full text of the cited block range, concatenated.
205 
206 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
207 
208 - `document_index: number`
209 
210 minimum: 0
211 
212 - `document_title: string or null`
213 
214 minLength: 1, maxLength: 500
215 
216 - `end_block_index: number`
217 
218 Exclusive 0-based end index of the cited block range in the source's `content` array.
219 
220 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
221 
222 - `start_block_index: number`
223 
224 0-based index of the first cited block in the source's `content` array.
225 
226 minimum: 0
227 
228 - `CitationWebSearchResultLocationParam object`
229 
230 - `type: "web_search_result_location"`
231 
232 - `cited_text: string`
233 
234 - `encrypted_index: string`
235 
236 - `title: string or null`
237 
238 minLength: 1, maxLength: 512
239 
240 - `url: string`
241 
242 minLength: 1
243 
244 - `CitationSearchResultLocationParam object`
245 
246 - `type: "search_result_location"`
247 
248 - `cited_text: string`
249 
250 The full text of the cited block range, concatenated.
251 
252 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
253 
254 - `end_block_index: number`
255 
256 Exclusive 0-based end index of the cited block range in the source's `content` array.
257 
258 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
259 
260 - `search_result_index: number`
261 
262 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
263 
264 Counted separately from `document_index`; server-side web search results are not included in this count.
265 
266 minimum: 0
267 
268 - `source: string`
269 
270 - `start_block_index: number`
271 
272 0-based index of the first cited block in the source's `content` array.
273 
274 minimum: 0
275 
276 - `title: string or null`
277 
278 - `ImageBlockParam object`
279 
280 - `type: "image"`
281 
282 - `source: Base64ImageSource or URLImageSource or FileImageSource`
283 
284 - `Base64ImageSource object`
285 
286 - `type: "base64"`
287 
288 - `data: string`
289 
290 format: byte
291 
292 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
293 
294 - `"image/jpeg"`
295 
296 - `"image/png"`
297 
298 - `"image/gif"`
299 
300 - `"image/webp"`
301 
302 - `URLImageSource object`
303 
304 - `type: "url"`
305 
306 - `url: string`
307 
308 - `FileImageSource object`
309 
310 - `type: "file"`
311 
312 - `file_id: string`
313 
314 - `cache_control: optional CacheControlEphemeral or null`
315 
316 Create a cache control breakpoint at this content block.
317 
318 - `transformations: optional ImageTransformationsParam or null`
319 
320 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.
321 
322 - `oversized_image: optional "downsize" or "error"`
323 
324 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.
325 
326 - `"downsize"`
327 
328 - `"error"`
329 
330 - `DocumentBlockParam object`
331 
332 - `type: "document"`
333 
334 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
335 
336 - `Base64PDFSource object`
337 
338 - `type: "base64"`
339 
340 - `data: string`
341 
342 format: byte
343 
344 - `media_type: "application/pdf"`
345 
346 - `PlainTextSource object`
347 
348 - `type: "text"`
349 
350 - `data: string`
351 
352 - `media_type: "text/plain"`
353 
354 - `ContentBlockSource object`
355 
356 - `type: "content"`
357 
358 - `content: string or array of ContentBlockSourceContent`
359 
360 - `string`
361 
362 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
363 
364 - `TextBlockParam object`
365 
366 - `ImageBlockParam object`
367 
368 - `URLPDFSource object`
369 
370 - `type: "url"`
371 
372 - `url: string`
373 
374 - `FileDocumentSource object`
375 
376 - `type: "file"`
377 
378 - `file_id: string`
379 
380 - `cache_control: optional CacheControlEphemeral or null`
381 
382 Create a cache control breakpoint at this content block.
383 
384 - `citations: optional CitationsConfigParam or null`
385 
386 - `enabled: optional boolean`
387 
388 - `context: optional string or null`
389 
390 minLength: 1
391 
392 - `title: optional string or null`
393 
394 minLength: 1, maxLength: 500
395 
396 - `SearchResultBlockParam object`
397 
398 - `type: "search_result"`
399 
400 - `content: array of TextBlockParam`
401 
402 - `type: "text"`
403 
404 - `text: string`
405 
406 minLength: 1
407 
408 - `cache_control: optional CacheControlEphemeral or null`
409 
410 Create a cache control breakpoint at this content block.
411 
412 - `citations: optional array of TextCitationParam or null`
413 
414 - `source: string`
415 
416 - `title: string`
417 
418 - `cache_control: optional CacheControlEphemeral or null`
419 
420 Create a cache control breakpoint at this content block.
421 
422 - `citations: optional CitationsConfigParam`
423 
424 - `ThinkingBlockParam object`
425 
426 - `type: "thinking"`
427 
428 - `signature: string`
429 
430 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.
431 
432 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
433 
434 - `thinking: string`
435 
436 The `thinking` text of this block as returned by the API.
437 
438 - `RedactedThinkingBlockParam object`
439 
440 - `type: "redacted_thinking"`
441 
442 - `data: string`
443 
444 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.
445 
446 - `ToolUseBlockParam object`
447 
448 - `type: "tool_use"`
449 
450 - `id: string`
451 
452 pattern: ^[a-zA-Z0-9_-]+$
453 
454 - `input: map[unknown]`
455 
456 - `name: string`
457 
458 minLength: 1, maxLength: 200
459 
460 - `cache_control: optional CacheControlEphemeral or null`
461 
462 Create a cache control breakpoint at this content block.
463 
464 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
465 
466 - `DirectCaller object`
467 
468 Tool invocation directly from the model.
469 
470 - `type: "direct"`
471 
472 - `ServerToolCaller object`
473 
474 Tool invocation generated by a server-side tool.
475 
476 - `type: "code_execution_20250825"`
477 
478 - `tool_id: string`
479 
480 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
481 
482 - `ServerToolCaller20260120 object`
483 
484 - `type: "code_execution_20260120"`
485 
486 - `tool_id: string`
487 
488 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
489 
490 - `toolset_name: optional string or null`
491 
492 For a toolset member tool_use, the toolset family this member belongs to.
493 
494 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
495 
496 - `ToolResultBlockParam object`
497 
498 - `type: "tool_result"`
499 
500 - `tool_use_id: string`
501 
502 pattern: ^[a-zA-Z0-9_-]+$
503 
504 - `cache_control: optional CacheControlEphemeral or null`
505 
506 Create a cache control breakpoint at this content block.
507 
508 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
509 
510 - `string`
511 
512 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
513 
514 - `TextBlockParam object`
515 
516 - `ImageBlockParam object`
517 
518 - `SearchResultBlockParam object`
519 
520 - `DocumentBlockParam object`
521 
522 - `ToolReferenceBlockParam object`
523 
524 Tool reference block that can be included in tool_result content.
525 
526 - `type: "tool_reference"`
527 
528 - `tool_name: string`
529 
530 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
531 
532 - `cache_control: optional CacheControlEphemeral or null`
533 
534 Create a cache control breakpoint at this content block.
535 
536 - `BrowserStateBlockParam object`
537 
538 The caller's browser state after a browser toolset member call —
539 the full inventory of open tabs, which tab is active, and any side
540 effects (tabs opened, download state changes) the call produced.
541 
542 At most one per `tool_result`, only on a non-error result answering a
543 browser toolset member `tool_use`. The server renders the
544 model-visible text from it; the model never sees the raw fields.
545 
546 - `type: "browser_state"`
547 
548 - `tabs: array of BrowserStateTabEntry`
549 
550 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`.
551 
552 maxItems: 100
553 
554 - `tab_id: string`
555 
556 The caller-assigned identifier for this tab, unique within the inventory.
557 
558 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
559 
560 - `title: string`
561 
562 The title of the page the tab is showing. May be empty.
563 
564 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
565 
566 - `url: string`
567 
568 The URL of the page the tab is showing. May be empty.
569 
570 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
571 
572 - `active: optional boolean`
573 
574 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
575 
576 - `cache_control: optional CacheControlEphemeral or null`
577 
578 Create a cache control breakpoint at this content block.
579 
580 - `state_changes: optional array of BrowserStateChange or null`
581 
582 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
583 
584 minItems: 1, maxItems: 200
585 
586 - `BrowserStateChangeTabOpened object`
587 
588 A tab this call's execution opened that remains open at its end —
589 the creation delta of the `tabs` inventory, not an event log.
590 
591 Carries only the `tab_id`; the tab's `title` and `url` live on its
592 `tabs` entry, which must include the same `tab_id`. A tab opened
593 during a failed call gets no deferred `tab_opened`; it simply appears
594 in the next result's `tabs` inventory.
595 
596 - `type: "tab_opened"`
597 
598 - `tab_id: string`
599 
600 The `tab_id` of the opened tab, present in `tabs`.
601 
602 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
603 
604 - `BrowserStateChangeDownloadStarted object`
605 
606 A file download that started during this call.
607 
608 - `type: "download_started"`
609 
610 - `download_id: string`
611 
612 The caller-assigned identifier for this download, stable across the state changes reporting it.
613 
614 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
615 
616 - `url: string`
617 
618 The final post-redirect URL the download was served from.
619 
620 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
621 
622 - `BrowserStateChangeDownloadCompleted object`
623 
624 A file download that finished during this call, reported with the
625 same `download_id` as its `download_started` — or without a prior
626 `download_started`, when the download finished during the call that
627 started it (at most one state change per `download_id` per result).
628 
629 - `type: "download_completed"`
630 
631 - `download_id: string`
632 
633 The caller-assigned identifier for this download, stable across the state changes reporting it.
634 
635 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
636 
637 - `url: string`
638 
639 The final post-redirect URL the download was served from.
640 
641 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
642 
643 - `path: optional string or null`
644 
645 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
646 
647 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
648 
649 - `size_bytes: optional number or null`
650 
651 The completed download's size.
652 
653 minimum: 0
654 
655 - `BrowserStateChangeDownloadFailed object`
656 
657 A file download that failed — or was cancelled — during this call.
658 
659 - `type: "download_failed"`
660 
661 - `download_id: string`
662 
663 The caller-assigned identifier for this download, stable across the state changes reporting it.
664 
665 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
666 
667 - `url: string`
668 
669 The final post-redirect URL the download was served from.
670 
671 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
672 
673 - `error: optional string or null`
674 
675 The failure or cancellation detail, when known.
676 
677 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
678 
679 - `is_error: optional boolean`
680 
681 - `toolset_name: optional string or null`
682 
683 For a toolset member tool_result, the toolset family of the paired tool_use.
684 
685 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
686 
687 - `ServerToolUseBlockParam object`
688 
689 - `type: "server_tool_use"`
690 
691 - `id: string`
692 
693 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
694 
695 - `input: map[unknown]`
696 
697 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
698 
699 - `"web_search"`
700 
701 - `"web_fetch"`
702 
703 - `"code_execution"`
704 
705 - `"bash_code_execution"`
706 
707 - `"text_editor_code_execution"`
708 
709 - `"tool_search_tool_regex"`
710 
711 - `"tool_search_tool_bm25"`
712 
713 - `cache_control: optional CacheControlEphemeral or null`
714 
715 Create a cache control breakpoint at this content block.
716 
717 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
718 
719 - `DirectCaller object`
720 
721 Tool invocation directly from the model.
722 
723 - `ServerToolCaller object`
724 
725 Tool invocation generated by a server-side tool.
726 
727 - `ServerToolCaller20260120 object`
728 
729 - `WebSearchToolResultBlockParam object`
730 
731 - `type: "web_search_tool_result"`
732 
733 - `content: WebSearchToolResultBlockParamContent`
734 
735 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
736 
737 - `type: "web_search_result"`
738 
739 - `encrypted_content: string`
740 
741 - `title: string`
742 
743 - `url: string`
744 
745 - `page_age: optional string or null`
746 
747 - `WebSearchToolRequestError object`
748 
749 - `type: "web_search_tool_result_error"`
750 
751 - `error_code: WebSearchToolResultErrorCode`
752 
753 - `"invalid_tool_input"`
754 
755 - `"unavailable"`
756 
757 - `"max_uses_exceeded"`
758 
759 - `"too_many_requests"`
760 
761 - `"query_too_long"`
762 
763 - `"request_too_large"`
764 
765 - `tool_use_id: string`
766 
767 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
768 
769 - `cache_control: optional CacheControlEphemeral or null`
770 
771 Create a cache control breakpoint at this content block.
772 
773 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
774 
775 - `DirectCaller object`
776 
777 Tool invocation directly from the model.
778 
779 - `ServerToolCaller object`
780 
781 Tool invocation generated by a server-side tool.
782 
783 - `ServerToolCaller20260120 object`
784 
785 - `WebFetchToolResultBlockParam object`
786 
787 - `type: "web_fetch_tool_result"`
788 
789 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
790 
791 - `WebFetchToolResultErrorBlockParam object`
792 
793 - `type: "web_fetch_tool_result_error"`
794 
795 - `error_code: WebFetchToolResultErrorCode`
796 
797 - `"invalid_tool_input"`
798 
799 - `"url_too_long"`
800 
801 - `"url_not_allowed"`
802 
803 - `"url_not_in_prior_context"`
804 
805 - `"url_not_accessible"`
806 
807 - `"unsupported_content_type"`
808 
809 - `"too_many_requests"`
810 
811 - `"max_uses_exceeded"`
812 
813 - `"unavailable"`
814 
815 - `"content_too_large"`
816 
817 - `WebFetchBlockParam object`
818 
819 - `type: "web_fetch_result"`
820 
821 - `content: DocumentBlockParam`
822 
823 - `url: string`
824 
825 Fetched content URL
826 
827 - `retrieved_at: optional string or null`
828 
829 ISO 8601 timestamp when the content was retrieved
830 
831 - `tool_use_id: string`
832 
833 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
834 
835 - `cache_control: optional CacheControlEphemeral or null`
836 
837 Create a cache control breakpoint at this content block.
838 
839 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
840 
841 - `DirectCaller object`
842 
843 Tool invocation directly from the model.
844 
845 - `ServerToolCaller object`
846 
847 Tool invocation generated by a server-side tool.
848 
849 - `ServerToolCaller20260120 object`
850 
851 - `CodeExecutionToolResultBlockParam object`
852 
853 - `type: "code_execution_tool_result"`
854 
855 - `content: CodeExecutionToolResultBlockParamContent`
856 
857 - `CodeExecutionToolResultErrorParam object`
858 
859 - `type: "code_execution_tool_result_error"`
860 
861 - `error_code: CodeExecutionToolResultErrorCode`
862 
863 - `"invalid_tool_input"`
864 
865 - `"unavailable"`
866 
867 - `"too_many_requests"`
868 
869 - `"execution_time_exceeded"`
870 
871 - `CodeExecutionResultBlockParam object`
872 
873 - `type: "code_execution_result"`
874 
875 - `content: array of CodeExecutionOutputBlockParam`
876 
877 - `type: "code_execution_output"`
878 
879 - `file_id: string`
880 
881 - `return_code: number`
882 
883 - `stderr: string`
884 
885 - `stdout: string`
886 
887 - `EncryptedCodeExecutionResultBlockParam object`
888 
889 Code execution result with encrypted stdout for PFC + web_search results.
890 
891 - `type: "encrypted_code_execution_result"`
892 
893 - `content: array of CodeExecutionOutputBlockParam`
894 
895 - `type: "code_execution_output"`
896 
897 - `file_id: string`
898 
899 - `encrypted_stdout: string`
900 
901 - `return_code: number`
902 
903 - `stderr: string`
904 
905 - `tool_use_id: string`
906 
907 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
908 
909 - `cache_control: optional CacheControlEphemeral or null`
910 
911 Create a cache control breakpoint at this content block.
912 
913 - `BashCodeExecutionToolResultBlockParam object`
914 
915 - `type: "bash_code_execution_tool_result"`
916 
917 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
918 
919 - `BashCodeExecutionToolResultErrorParam object`
920 
921 - `type: "bash_code_execution_tool_result_error"`
922 
923 - `error_code: BashCodeExecutionToolResultErrorCode`
924 
925 - `"invalid_tool_input"`
926 
927 - `"unavailable"`
928 
929 - `"too_many_requests"`
930 
931 - `"execution_time_exceeded"`
932 
933 - `"output_file_too_large"`
934 
935 - `BashCodeExecutionResultBlockParam object`
936 
937 - `type: "bash_code_execution_result"`
938 
939 - `content: array of BashCodeExecutionOutputBlockParam`
940 
941 - `type: "bash_code_execution_output"`
942 
943 - `file_id: string`
944 
945 - `return_code: number`
946 
947 - `stderr: string`
948 
949 - `stdout: string`
950 
951 - `tool_use_id: string`
952 
953 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
954 
955 - `cache_control: optional CacheControlEphemeral or null`
956 
957 Create a cache control breakpoint at this content block.
958 
959 - `TextEditorCodeExecutionToolResultBlockParam object`
960 
961 - `type: "text_editor_code_execution_tool_result"`
962 
963 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
964 
965 - `TextEditorCodeExecutionToolResultErrorParam object`
966 
967 - `type: "text_editor_code_execution_tool_result_error"`
968 
969 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
970 
971 - `"invalid_tool_input"`
972 
973 - `"unavailable"`
974 
975 - `"too_many_requests"`
976 
977 - `"execution_time_exceeded"`
978 
979 - `"file_not_found"`
980 
981 - `error_message: optional string or null`
982 
983 - `TextEditorCodeExecutionViewResultBlockParam object`
984 
985 - `type: "text_editor_code_execution_view_result"`
986 
987 - `content: string`
988 
989 - `file_type: "text" or "image" or "pdf"`
990 
991 - `"text"`
992 
993 - `"image"`
994 
995 - `"pdf"`
996 
997 - `num_lines: optional number or null`
998 
999 - `start_line: optional number or null`
1000 
1001 - `total_lines: optional number or null`
1002 
1003 - `TextEditorCodeExecutionCreateResultBlockParam object`
1004 
1005 - `type: "text_editor_code_execution_create_result"`
1006 
1007 - `is_file_update: boolean`
1008 
1009 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1010 
1011 - `type: "text_editor_code_execution_str_replace_result"`
1012 
1013 - `lines: optional array of string or null`
1014 
1015 - `new_lines: optional number or null`
1016 
1017 - `new_start: optional number or null`
1018 
1019 - `old_lines: optional number or null`
1020 
1021 - `old_start: optional number or null`
1022 
1023 - `tool_use_id: string`
1024 
1025 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1026 
1027 - `cache_control: optional CacheControlEphemeral or null`
1028 
1029 Create a cache control breakpoint at this content block.
1030 
1031 - `ToolSearchToolResultBlockParam object`
1032 
1033 - `type: "tool_search_tool_result"`
1034 
1035 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1036 
1037 - `ToolSearchToolResultErrorParam object`
1038 
1039 - `type: "tool_search_tool_result_error"`
1040 
1041 - `error_code: ToolSearchToolResultErrorCode`
1042 
1043 - `"invalid_tool_input"`
1044 
1045 - `"unavailable"`
1046 
1047 - `"too_many_requests"`
1048 
1049 - `"execution_time_exceeded"`
1050 
1051 - `error_message: optional string or null`
1052 
1053 - `ToolSearchToolSearchResultBlockParam object`
1054 
1055 - `type: "tool_search_tool_search_result"`
1056 
1057 - `tool_references: array of ToolReferenceBlockParam`
1058 
1059 - `type: "tool_reference"`
1060 
1061 - `tool_name: string`
1062 
1063 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1064 
1065 - `cache_control: optional CacheControlEphemeral or null`
1066 
1067 Create a cache control breakpoint at this content block.
1068 
1069 - `tool_use_id: string`
1070 
1071 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1072 
1073 - `cache_control: optional CacheControlEphemeral or null`
1074 
1075 Create a cache control breakpoint at this content block.
1076 
1077 - `ContainerUploadBlockParam object`
1078 
1079 A content block that represents a file to be uploaded to the container
1080 Files uploaded via this block will be available in the container's input directory.
1081 
1082 - `type: "container_upload"`
1083 
1084 - `file_id: string`
1085 
1086 - `cache_control: optional CacheControlEphemeral or null`
1087 
1088 Create a cache control breakpoint at this content block.
1089 
1090 - `role: "user"`
1091 
1092 - `AssistantMessageParam object`
1093 
1094 - `content: MessageContentParam`
1095 
1096 - `role: "assistant"`
1097 
1098 - `SystemMessageParam object`
1099 
1100 - `content: string or array of TextBlockParam`
1101 
1102 - `string`
1103 
1104 - `Blocks = array of TextBlockParam`
1261105 
1271106 - `type: "text"`
1281107 
from line 1113
1341113 
1351114 Create a cache control breakpoint at this content block.
1361115 
137 - `type: "ephemeral"`
138 
139 - `ttl: optional "5m" or "1h"`
140 
141 The time-to-live for the cache control breakpoint.
142 
143 This may be one the following values:
144 
145 - `5m`: 5 minutes
146 - `1h`: 1 hour
147 
148 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
149 
150 - `"5m"`
151 
152 - `"1h"`
153 
1541116 - `citations: optional array of TextCitationParam or null`
1551117 
156 - `CitationCharLocationParam object`
157 
158 - `type: "char_location"`
159 
160 - `cited_text: string`
161 
162 - `document_index: number`
163 
164 minimum: 0
165 
166 - `document_title: string or null`
167 
168 minLength: 1, maxLength: 500
169 
170 - `end_char_index: number`
171 
172 - `start_char_index: number`
173 
174 minimum: 0
175 
176 - `CitationPageLocationParam object`
177 
178 - `type: "page_location"`
179 
180 - `cited_text: string`
181 
182 - `document_index: number`
183 
184 minimum: 0
185 
186 - `document_title: string or null`
187 
188 minLength: 1, maxLength: 500
189 
190 - `end_page_number: number`
191 
192 - `start_page_number: number`
193 
194 minimum: 1
195 
196 - `CitationContentBlockLocationParam object`
197 
198 - `type: "content_block_location"`
199 
200 - `cited_text: string`
201 
202 The full text of the cited block range, concatenated.
203 
204 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
205 
206 - `document_index: number`
207 
208 minimum: 0
209 
210 - `document_title: string or null`
211 
212 minLength: 1, maxLength: 500
213 
214 - `end_block_index: number`
215 
216 Exclusive 0-based end index of the cited block range in the source's `content` array.
217 
218 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
219 
220 - `start_block_index: number`
221 
222 0-based index of the first cited block in the source's `content` array.
223 
224 minimum: 0
225 
226 - `CitationWebSearchResultLocationParam object`
227 
228 - `type: "web_search_result_location"`
229 
230 - `cited_text: string`
231 
232 - `encrypted_index: string`
233 
234 - `title: string or null`
235 
236 minLength: 1, maxLength: 512
237 
238 - `url: string`
239 
240 minLength: 1
241 
242 - `CitationSearchResultLocationParam object`
243 
244 - `type: "search_result_location"`
245 
246 - `cited_text: string`
247 
248 The full text of the cited block range, concatenated.
249 
250 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
251 
252 - `end_block_index: number`
253 
254 Exclusive 0-based end index of the cited block range in the source's `content` array.
255 
256 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
257 
258 - `search_result_index: number`
259 
260 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
261 
262 Counted separately from `document_index`; server-side web search results are not included in this count.
263 
264 minimum: 0
265 
266 - `source: string`
267 
268 - `start_block_index: number`
269 
270 0-based index of the first cited block in the source's `content` array.
271 
272 minimum: 0
273 
274 - `title: string or null`
275 
276 - `ImageBlockParam object`
277 
278 - `type: "image"`
279 
280 - `source: Base64ImageSource or URLImageSource or FileImageSource`
281 
282 - `Base64ImageSource object`
283 
284 - `type: "base64"`
285 
286 - `data: string`
287 
288 format: byte
289 
290 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
291 
292 - `"image/jpeg"`
293 
294 - `"image/png"`
295 
296 - `"image/gif"`
297 
298 - `"image/webp"`
299 
300 - `URLImageSource object`
301 
302 - `type: "url"`
303 
304 - `url: string`
305 
306 - `FileImageSource object`
307 
308 - `type: "file"`
309 
310 - `file_id: string`
311 
312 - `cache_control: optional CacheControlEphemeral or null`
313 
314 Create a cache control breakpoint at this content block.
315 
316 - `transformations: optional ImageTransformationsParam or null`
317 
318 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.
319 
320 - `oversized_image: optional "downsize" or "error"`
321 
322 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.
323 
324 - `"downsize"`
325 
326 - `"error"`
327 
328 - `DocumentBlockParam object`
329 
330 - `type: "document"`
331 
332 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
333 
334 - `Base64PDFSource object`
335 
336 - `type: "base64"`
337 
338 - `data: string`
339 
340 format: byte
341 
342 - `media_type: "application/pdf"`
343 
344 - `PlainTextSource object`
345 
346 - `type: "text"`
347 
348 - `data: string`
349 
350 - `media_type: "text/plain"`
351 
352 - `ContentBlockSource object`
353 
354 - `type: "content"`
355 
356 - `content: string or array of ContentBlockSourceContent`
357 
358 - `string`
359 
360 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
361 
362 - `TextBlockParam object`
363 
364 - `ImageBlockParam object`
365 
366 - `URLPDFSource object`
367 
368 - `type: "url"`
369 
370 - `url: string`
371 
372 - `FileDocumentSource object`
373 
374 - `type: "file"`
375 
376 - `file_id: string`
377 
378 - `cache_control: optional CacheControlEphemeral or null`
379 
380 Create a cache control breakpoint at this content block.
381 
382 - `citations: optional CitationsConfigParam or null`
383 
384 - `enabled: optional boolean`
385 
386 - `context: optional string or null`
387 
388 minLength: 1
389 
390 - `title: optional string or null`
391 
392 minLength: 1, maxLength: 500
393 
394 - `SearchResultBlockParam object`
395 
396 - `type: "search_result"`
397 
398 - `content: array of TextBlockParam`
399 
400 - `type: "text"`
401 
402 - `text: string`
403 
404 minLength: 1
405 
406 - `cache_control: optional CacheControlEphemeral or null`
407 
408 Create a cache control breakpoint at this content block.
409 
410 - `citations: optional array of TextCitationParam or null`
411 
412 - `source: string`
413 
414 - `title: string`
415 
416 - `cache_control: optional CacheControlEphemeral or null`
417 
418 Create a cache control breakpoint at this content block.
419 
420 - `citations: optional CitationsConfigParam`
421 
422 - `ThinkingBlockParam object`
423 
424 - `type: "thinking"`
425 
426 - `signature: string`
427 
428 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.
429 
430 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
431 
432 - `thinking: string`
433 
434 The `thinking` text of this block as returned by the API.
435 
436 - `RedactedThinkingBlockParam object`
437 
438 - `type: "redacted_thinking"`
439 
440 - `data: string`
441 
442 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.
443 
444 - `ToolUseBlockParam object`
445 
446 - `type: "tool_use"`
447 
448 - `id: string`
449 
450 pattern: ^[a-zA-Z0-9_-]+$
451 
452 - `input: map[unknown]`
453 
454 - `name: string`
455 
456 minLength: 1, maxLength: 200
457 
458 - `cache_control: optional CacheControlEphemeral or null`
459 
460 Create a cache control breakpoint at this content block.
461 
462 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
463 
464 - `DirectCaller object`
465 
466 Tool invocation directly from the model.
467 
468 - `type: "direct"`
469 
470 - `ServerToolCaller object`
471 
472 Tool invocation generated by a server-side tool.
473 
474 - `type: "code_execution_20250825"`
475 
476 - `tool_id: string`
477 
478 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
479 
480 - `ServerToolCaller20260120 object`
481 
482 - `type: "code_execution_20260120"`
483 
484 - `tool_id: string`
485 
486 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
487 
488 - `toolset_name: optional string or null`
489 
490 For a toolset member tool_use, the toolset family this member belongs to.
491 
492 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
493 
494 - `ToolResultBlockParam object`
495 
496 - `type: "tool_result"`
497 
498 - `tool_use_id: string`
499 
500 pattern: ^[a-zA-Z0-9_-]+$
501 
502 - `cache_control: optional CacheControlEphemeral or null`
503 
504 Create a cache control breakpoint at this content block.
505 
506 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
507 
508 - `string`
509 
510 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
511 
512 - `TextBlockParam object`
513 
514 - `ImageBlockParam object`
515 
516 - `SearchResultBlockParam object`
517 
518 - `DocumentBlockParam object`
519 
520 - `ToolReferenceBlockParam object`
521 
522 Tool reference block that can be included in tool_result content.
523 
524 - `type: "tool_reference"`
525 
526 - `tool_name: string`
527 
528 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
529 
530 - `cache_control: optional CacheControlEphemeral or null`
531 
532 Create a cache control breakpoint at this content block.
533 
534 - `BrowserStateBlockParam object`
535 
536 The caller's browser state after a browser toolset member call —
537 the full inventory of open tabs, which tab is active, and any side
538 effects (tabs opened, download state changes) the call produced.
539 
540 At most one per `tool_result`, only on a non-error result answering a
541 browser toolset member `tool_use`. The server renders the
542 model-visible text from it; the model never sees the raw fields.
543 
544 - `type: "browser_state"`
545 
546 - `tabs: array of BrowserStateTabEntry`
547 
548 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`.
549 
550 maxItems: 100
551 
552 - `tab_id: string`
553 
554 The caller-assigned identifier for this tab, unique within the inventory.
555 
556 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
557 
558 - `title: string`
559 
560 The title of the page the tab is showing. May be empty.
561 
562 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
563 
564 - `url: string`
565 
566 The URL of the page the tab is showing. May be empty.
567 
568 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
569 
570 - `active: optional boolean`
571 
572 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
573 
574 - `cache_control: optional CacheControlEphemeral or null`
575 
576 Create a cache control breakpoint at this content block.
577 
578 - `state_changes: optional array of BrowserStateChange or null`
579 
580 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
581 
582 minItems: 1, maxItems: 200
583 
584 - `BrowserStateChangeTabOpened object`
585 
586 A tab this call's execution opened that remains open at its end —
587 the creation delta of the `tabs` inventory, not an event log.
588 
589 Carries only the `tab_id`; the tab's `title` and `url` live on its
590 `tabs` entry, which must include the same `tab_id`. A tab opened
591 during a failed call gets no deferred `tab_opened`; it simply appears
592 in the next result's `tabs` inventory.
593 
594 - `type: "tab_opened"`
595 
596 - `tab_id: string`
597 
598 The `tab_id` of the opened tab, present in `tabs`.
599 
600 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
601 
602 - `BrowserStateChangeDownloadStarted object`
603 
604 A file download that started during this call.
605 
606 - `type: "download_started"`
607 
608 - `download_id: string`
609 
610 The caller-assigned identifier for this download, stable across the state changes reporting it.
611 
612 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
613 
614 - `url: string`
615 
616 The final post-redirect URL the download was served from.
617 
618 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
619 
620 - `BrowserStateChangeDownloadCompleted object`
621 
622 A file download that finished during this call, reported with the
623 same `download_id` as its `download_started` — or without a prior
624 `download_started`, when the download finished during the call that
625 started it (at most one state change per `download_id` per result).
626 
627 - `type: "download_completed"`
628 
629 - `download_id: string`
630 
631 The caller-assigned identifier for this download, stable across the state changes reporting it.
632 
633 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
634 
635 - `url: string`
636 
637 The final post-redirect URL the download was served from.
638 
639 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
640 
641 - `path: optional string or null`
642 
643 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
644 
645 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
646 
647 - `size_bytes: optional number or null`
648 
649 The completed download's size.
650 
651 minimum: 0
652 
653 - `BrowserStateChangeDownloadFailed object`
654 
655 A file download that failed — or was cancelled — during this call.
656 
657 - `type: "download_failed"`
658 
659 - `download_id: string`
660 
661 The caller-assigned identifier for this download, stable across the state changes reporting it.
662 
663 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
664 
665 - `url: string`
666 
667 The final post-redirect URL the download was served from.
668 
669 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
670 
671 - `error: optional string or null`
672 
673 The failure or cancellation detail, when known.
674 
675 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
676 
677 - `is_error: optional boolean`
678 
679 - `toolset_name: optional string or null`
680 
681 For a toolset member tool_result, the toolset family of the paired tool_use.
682 
683 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
684 
685 - `ServerToolUseBlockParam object`
686 
687 - `type: "server_tool_use"`
688 
689 - `id: string`
690 
691 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
692 
693 - `input: map[unknown]`
694 
695 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
696 
697 - `"web_search"`
698 
699 - `"web_fetch"`
700 
701 - `"code_execution"`
702 
703 - `"bash_code_execution"`
704 
705 - `"text_editor_code_execution"`
706 
707 - `"tool_search_tool_regex"`
708 
709 - `"tool_search_tool_bm25"`
710 
711 - `cache_control: optional CacheControlEphemeral or null`
712 
713 Create a cache control breakpoint at this content block.
714 
715 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
716 
717 - `DirectCaller object`
718 
719 Tool invocation directly from the model.
720 
721 - `ServerToolCaller object`
722 
723 Tool invocation generated by a server-side tool.
724 
725 - `ServerToolCaller20260120 object`
726 
727 - `WebSearchToolResultBlockParam object`
728 
729 - `type: "web_search_tool_result"`
730 
731 - `content: WebSearchToolResultBlockParamContent`
732 
733 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
734 
735 - `type: "web_search_result"`
736 
737 - `encrypted_content: string`
738 
739 - `title: string`
740 
741 - `url: string`
742 
743 - `page_age: optional string or null`
744 
745 - `WebSearchToolRequestError object`
746 
747 - `type: "web_search_tool_result_error"`
748 
749 - `error_code: WebSearchToolResultErrorCode`
750 
751 - `"invalid_tool_input"`
752 
753 - `"unavailable"`
754 
755 - `"max_uses_exceeded"`
756 
757 - `"too_many_requests"`
758 
759 - `"query_too_long"`
760 
761 - `"request_too_large"`
762 
763 - `tool_use_id: string`
764 
765 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
766 
767 - `cache_control: optional CacheControlEphemeral or null`
768 
769 Create a cache control breakpoint at this content block.
770 
771 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
772 
773 - `DirectCaller object`
774 
775 Tool invocation directly from the model.
776 
777 - `ServerToolCaller object`
778 
779 Tool invocation generated by a server-side tool.
780 
781 - `ServerToolCaller20260120 object`
782 
783 - `WebFetchToolResultBlockParam object`
784 
785 - `type: "web_fetch_tool_result"`
786 
787 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
788 
789 - `WebFetchToolResultErrorBlockParam object`
790 
791 - `type: "web_fetch_tool_result_error"`
792 
793 - `error_code: WebFetchToolResultErrorCode`
794 
795 - `"invalid_tool_input"`
796 
797 - `"url_too_long"`
798 
799 - `"url_not_allowed"`
800 
801 - `"url_not_in_prior_context"`
802 
803 - `"url_not_accessible"`
804 
805 - `"unsupported_content_type"`
806 
807 - `"too_many_requests"`
808 
809 - `"max_uses_exceeded"`
810 
811 - `"unavailable"`
812 
813 - `"content_too_large"`
814 
815 - `WebFetchBlockParam object`
816 
817 - `type: "web_fetch_result"`
818 
819 - `content: DocumentBlockParam`
820 
821 - `url: string`
822 
823 Fetched content URL
824 
825 - `retrieved_at: optional string or null`
826 
827 ISO 8601 timestamp when the content was retrieved
828 
829 - `tool_use_id: string`
830 
831 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
832 
833 - `cache_control: optional CacheControlEphemeral or null`
834 
835 Create a cache control breakpoint at this content block.
836 
837 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
838 
839 - `DirectCaller object`
840 
841 Tool invocation directly from the model.
842 
843 - `ServerToolCaller object`
844 
845 Tool invocation generated by a server-side tool.
846 
847 - `ServerToolCaller20260120 object`
848 
849 - `CodeExecutionToolResultBlockParam object`
850 
851 - `type: "code_execution_tool_result"`
852 
853 - `content: CodeExecutionToolResultBlockParamContent`
854 
855 - `CodeExecutionToolResultErrorParam object`
856 
857 - `type: "code_execution_tool_result_error"`
858 
859 - `error_code: CodeExecutionToolResultErrorCode`
860 
861 - `"invalid_tool_input"`
862 
863 - `"unavailable"`
864 
865 - `"too_many_requests"`
866 
867 - `"execution_time_exceeded"`
868 
869 - `CodeExecutionResultBlockParam object`
870 
871 - `type: "code_execution_result"`
872 
873 - `content: array of CodeExecutionOutputBlockParam`
874 
875 - `type: "code_execution_output"`
876 
877 - `file_id: string`
878 
879 - `return_code: number`
880 
881 - `stderr: string`
882 
883 - `stdout: string`
884 
885 - `EncryptedCodeExecutionResultBlockParam object`
886 
887 Code execution result with encrypted stdout for PFC + web_search results.
888 
889 - `type: "encrypted_code_execution_result"`
890 
891 - `content: array of CodeExecutionOutputBlockParam`
892 
893 - `type: "code_execution_output"`
894 
895 - `file_id: string`
896 
897 - `encrypted_stdout: string`
898 
899 - `return_code: number`
900 
901 - `stderr: string`
902 
903 - `tool_use_id: string`
904 
905 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
906 
907 - `cache_control: optional CacheControlEphemeral or null`
908 
909 Create a cache control breakpoint at this content block.
910 
911 - `BashCodeExecutionToolResultBlockParam object`
912 
913 - `type: "bash_code_execution_tool_result"`
914 
915 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
916 
917 - `BashCodeExecutionToolResultErrorParam object`
918 
919 - `type: "bash_code_execution_tool_result_error"`
920 
921 - `error_code: BashCodeExecutionToolResultErrorCode`
922 
923 - `"invalid_tool_input"`
924 
925 - `"unavailable"`
926 
927 - `"too_many_requests"`
928 
929 - `"execution_time_exceeded"`
930 
931 - `"output_file_too_large"`
932 
933 - `BashCodeExecutionResultBlockParam object`
934 
935 - `type: "bash_code_execution_result"`
936 
937 - `content: array of BashCodeExecutionOutputBlockParam`
938 
939 - `type: "bash_code_execution_output"`
940 
941 - `file_id: string`
942 
943 - `return_code: number`
944 
945 - `stderr: string`
946 
947 - `stdout: string`
948 
949 - `tool_use_id: string`
950 
951 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
952 
953 - `cache_control: optional CacheControlEphemeral or null`
954 
955 Create a cache control breakpoint at this content block.
956 
957 - `TextEditorCodeExecutionToolResultBlockParam object`
958 
959 - `type: "text_editor_code_execution_tool_result"`
960 
961 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
962 
963 - `TextEditorCodeExecutionToolResultErrorParam object`
964 
965 - `type: "text_editor_code_execution_tool_result_error"`
966 
967 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
968 
969 - `"invalid_tool_input"`
970 
971 - `"unavailable"`
972 
973 - `"too_many_requests"`
974 
975 - `"execution_time_exceeded"`
976 
977 - `"file_not_found"`
978 
979 - `error_message: optional string or null`
980 
981 - `TextEditorCodeExecutionViewResultBlockParam object`
982 
983 - `type: "text_editor_code_execution_view_result"`
984 
985 - `content: string`
986 
987 - `file_type: "text" or "image" or "pdf"`
988 
989 - `"text"`
990 
991 - `"image"`
992 
993 - `"pdf"`
994 
995 - `num_lines: optional number or null`
996 
997 - `start_line: optional number or null`
998 
999 - `total_lines: optional number or null`
1000 
1001 - `TextEditorCodeExecutionCreateResultBlockParam object`
1002 
1003 - `type: "text_editor_code_execution_create_result"`
1004 
1005 - `is_file_update: boolean`
1006 
1007 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1008 
1009 - `type: "text_editor_code_execution_str_replace_result"`
1010 
1011 - `lines: optional array of string or null`
1012 
1013 - `new_lines: optional number or null`
1014 
1015 - `new_start: optional number or null`
1016 
1017 - `old_lines: optional number or null`
1018 
1019 - `old_start: optional number or null`
1020 
1021 - `tool_use_id: string`
1022 
1023 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1024 
1025 - `cache_control: optional CacheControlEphemeral or null`
1026 
1027 Create a cache control breakpoint at this content block.
1028 
1029 - `ToolSearchToolResultBlockParam object`
1030 
1031 - `type: "tool_search_tool_result"`
1032 
1033 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1034 
1035 - `ToolSearchToolResultErrorParam object`
1036 
1037 - `type: "tool_search_tool_result_error"`
1038 
1039 - `error_code: ToolSearchToolResultErrorCode`
1040 
1041 - `"invalid_tool_input"`
1042 
1043 - `"unavailable"`
1044 
1045 - `"too_many_requests"`
1046 
1047 - `"execution_time_exceeded"`
1048 
1049 - `error_message: optional string or null`
1050 
1051 - `ToolSearchToolSearchResultBlockParam object`
1052 
1053 - `type: "tool_search_tool_search_result"`
1054 
1055 - `tool_references: array of ToolReferenceBlockParam`
1056 
1057 - `type: "tool_reference"`
1058 
1059 - `tool_name: string`
1060 
1061 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1062 
1063 - `cache_control: optional CacheControlEphemeral or null`
1064 
1065 Create a cache control breakpoint at this content block.
1066 
1067 - `tool_use_id: string`
1068 
1069 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1070 
1071 - `cache_control: optional CacheControlEphemeral or null`
1072 
1073 Create a cache control breakpoint at this content block.
1074 
1075 - `ContainerUploadBlockParam object`
1076 
1077 A content block that represents a file to be uploaded to the container
1078 Files uploaded via this block will be available in the container's input directory.
1079 
1080 - `type: "container_upload"`
1081 
1082 - `file_id: string`
1083 
1084 - `cache_control: optional CacheControlEphemeral or null`
1085 
1086 Create a cache control breakpoint at this content block.
1087 
1088 - `role: "user" or "assistant" or "system"`
1089 
1090 - `"user"`
1091 
1092 - `"assistant"`
1093 
1094 - `"system"`
1118 - `role: "system"`
10951119 
10961120 - `model: Model`
10971121 
from line 3103
30793103 
30803104 When true, guarantees schema validation on tool names and inputs
30813105 
3082 - `temperature: optional number`
3083 
3084 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
3085 
3086 Amount of randomness injected into the response.
3087 
3088 Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
3089 
3090 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
3091 
3092 minimum: 0, maximum: 1
3093 
3094 - `top_k: optional number`
3095 
3096 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
3097 
3098 Only sample from the top K options for each subsequent token.
3099 
3100 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
3101 
3102 Recommended for advanced use cases only.
3103 
3104 minimum: 0
3105 
3106 - `top_p: optional number`
3107 
3108 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
3109 
3110 Use nucleus sampling.
3111 
3112 In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`.
3113 
3114 Recommended for advanced use cases only.
3115 
3116 minimum: 0, maximum: 1
3117 
31183106## Returns
31193107 
31203108- `MessageBatch object`
from line 3218
32303218```bash
32313219curl https://api.anthropic.com/v1/messages/batches \
32323220 -H 'Content-Type: application/json' \
3233 -H 'anthropic-version: 2023-06-01' \
3234 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
3221 -H 'anthropic-version: 2026-10-21' \
3222 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
32353223 -d '{
32363224 "requests": [
32373225 {
32383226 

api/messages/count_tokens Changed · +990 / -966 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 80
8080 
8181 See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages?sdk_languages=http).
8282 
83 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
83 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter.
8484 
8585 There is a limit of 100,000 messages in a single request.
8686 
87 - `content: string or array of ContentBlockParam`
88 
89 - `string`
90 
91 - `array of ContentBlockParam`
92 
93 - `TextBlockParam object`
87 - `UserMessageParam object`
88 
89 - `content: MessageContentParam`
90 
91 - `string`
92 
93 - `array of ContentBlockParam`
94 
95 - `TextBlockParam object`
96 
97 - `type: "text"`
98 
99 - `text: string`
100 
101 minLength: 1
102 
103 - `cache_control: optional CacheControlEphemeral or null`
104 
105 Create a cache control breakpoint at this content block.
106 
107 - `type: "ephemeral"`
108 
109 - `ttl: optional "5m" or "1h"`
110 
111 The time-to-live for the cache control breakpoint.
112 
113 This may be one the following values:
114 
115 - `5m`: 5 minutes
116 - `1h`: 1 hour
117 
118 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
119 
120 - `"5m"`
121 
122 - `"1h"`
123 
124 - `citations: optional array of TextCitationParam or null`
125 
126 - `CitationCharLocationParam object`
127 
128 - `type: "char_location"`
129 
130 - `cited_text: string`
131 
132 - `document_index: number`
133 
134 minimum: 0
135 
136 - `document_title: string or null`
137 
138 minLength: 1, maxLength: 500
139 
140 - `end_char_index: number`
141 
142 - `start_char_index: number`
143 
144 minimum: 0
145 
146 - `CitationPageLocationParam object`
147 
148 - `type: "page_location"`
149 
150 - `cited_text: string`
151 
152 - `document_index: number`
153 
154 minimum: 0
155 
156 - `document_title: string or null`
157 
158 minLength: 1, maxLength: 500
159 
160 - `end_page_number: number`
161 
162 - `start_page_number: number`
163 
164 minimum: 1
165 
166 - `CitationContentBlockLocationParam object`
167 
168 - `type: "content_block_location"`
169 
170 - `cited_text: string`
171 
172 The full text of the cited block range, concatenated.
173 
174 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
175 
176 - `document_index: number`
177 
178 minimum: 0
179 
180 - `document_title: string or null`
181 
182 minLength: 1, maxLength: 500
183 
184 - `end_block_index: number`
185 
186 Exclusive 0-based end index of the cited block range in the source's `content` array.
187 
188 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
189 
190 - `start_block_index: number`
191 
192 0-based index of the first cited block in the source's `content` array.
193 
194 minimum: 0
195 
196 - `CitationWebSearchResultLocationParam object`
197 
198 - `type: "web_search_result_location"`
199 
200 - `cited_text: string`
201 
202 - `encrypted_index: string`
203 
204 - `title: string or null`
205 
206 minLength: 1, maxLength: 512
207 
208 - `url: string`
209 
210 minLength: 1
211 
212 - `CitationSearchResultLocationParam object`
213 
214 - `type: "search_result_location"`
215 
216 - `cited_text: string`
217 
218 The full text of the cited block range, concatenated.
219 
220 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
221 
222 - `end_block_index: number`
223 
224 Exclusive 0-based end index of the cited block range in the source's `content` array.
225 
226 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
227 
228 - `search_result_index: number`
229 
230 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
231 
232 Counted separately from `document_index`; server-side web search results are not included in this count.
233 
234 minimum: 0
235 
236 - `source: string`
237 
238 - `start_block_index: number`
239 
240 0-based index of the first cited block in the source's `content` array.
241 
242 minimum: 0
243 
244 - `title: string or null`
245 
246 - `ImageBlockParam object`
247 
248 - `type: "image"`
249 
250 - `source: Base64ImageSource or URLImageSource or FileImageSource`
251 
252 - `Base64ImageSource object`
253 
254 - `type: "base64"`
255 
256 - `data: string`
257 
258 format: byte
259 
260 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
261 
262 - `"image/jpeg"`
263 
264 - `"image/png"`
265 
266 - `"image/gif"`
267 
268 - `"image/webp"`
269 
270 - `URLImageSource object`
271 
272 - `type: "url"`
273 
274 - `url: string`
275 
276 - `FileImageSource object`
277 
278 - `type: "file"`
279 
280 - `file_id: string`
281 
282 - `cache_control: optional CacheControlEphemeral or null`
283 
284 Create a cache control breakpoint at this content block.
285 
286 - `transformations: optional ImageTransformationsParam or null`
287 
288 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.
289 
290 - `oversized_image: optional "downsize" or "error"`
291 
292 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.
293 
294 - `"downsize"`
295 
296 - `"error"`
297 
298 - `DocumentBlockParam object`
299 
300 - `type: "document"`
301 
302 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
303 
304 - `Base64PDFSource object`
305 
306 - `type: "base64"`
307 
308 - `data: string`
309 
310 format: byte
311 
312 - `media_type: "application/pdf"`
313 
314 - `PlainTextSource object`
315 
316 - `type: "text"`
317 
318 - `data: string`
319 
320 - `media_type: "text/plain"`
321 
322 - `ContentBlockSource object`
323 
324 - `type: "content"`
325 
326 - `content: string or array of ContentBlockSourceContent`
327 
328 - `string`
329 
330 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
331 
332 - `TextBlockParam object`
333 
334 - `ImageBlockParam object`
335 
336 - `URLPDFSource object`
337 
338 - `type: "url"`
339 
340 - `url: string`
341 
342 - `FileDocumentSource object`
343 
344 - `type: "file"`
345 
346 - `file_id: string`
347 
348 - `cache_control: optional CacheControlEphemeral or null`
349 
350 Create a cache control breakpoint at this content block.
351 
352 - `citations: optional CitationsConfigParam or null`
353 
354 - `enabled: optional boolean`
355 
356 - `context: optional string or null`
357 
358 minLength: 1
359 
360 - `title: optional string or null`
361 
362 minLength: 1, maxLength: 500
363 
364 - `SearchResultBlockParam object`
365 
366 - `type: "search_result"`
367 
368 - `content: array of TextBlockParam`
369 
370 - `type: "text"`
371 
372 - `text: string`
373 
374 minLength: 1
375 
376 - `cache_control: optional CacheControlEphemeral or null`
377 
378 Create a cache control breakpoint at this content block.
379 
380 - `citations: optional array of TextCitationParam or null`
381 
382 - `source: string`
383 
384 - `title: string`
385 
386 - `cache_control: optional CacheControlEphemeral or null`
387 
388 Create a cache control breakpoint at this content block.
389 
390 - `citations: optional CitationsConfigParam`
391 
392 - `ThinkingBlockParam object`
393 
394 - `type: "thinking"`
395 
396 - `signature: string`
397 
398 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.
399 
400 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
401 
402 - `thinking: string`
403 
404 The `thinking` text of this block as returned by the API.
405 
406 - `RedactedThinkingBlockParam object`
407 
408 - `type: "redacted_thinking"`
409 
410 - `data: string`
411 
412 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.
413 
414 - `ToolUseBlockParam object`
415 
416 - `type: "tool_use"`
417 
418 - `id: string`
419 
420 pattern: ^[a-zA-Z0-9_-]+$
421 
422 - `input: map[unknown]`
423 
424 - `name: string`
425 
426 minLength: 1, maxLength: 200
427 
428 - `cache_control: optional CacheControlEphemeral or null`
429 
430 Create a cache control breakpoint at this content block.
431 
432 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
433 
434 - `DirectCaller object`
435 
436 Tool invocation directly from the model.
437 
438 - `type: "direct"`
439 
440 - `ServerToolCaller object`
441 
442 Tool invocation generated by a server-side tool.
443 
444 - `type: "code_execution_20250825"`
445 
446 - `tool_id: string`
447 
448 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
449 
450 - `ServerToolCaller20260120 object`
451 
452 - `type: "code_execution_20260120"`
453 
454 - `tool_id: string`
455 
456 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
457 
458 - `toolset_name: optional string or null`
459 
460 For a toolset member tool_use, the toolset family this member belongs to.
461 
462 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
463 
464 - `ToolResultBlockParam object`
465 
466 - `type: "tool_result"`
467 
468 - `tool_use_id: string`
469 
470 pattern: ^[a-zA-Z0-9_-]+$
471 
472 - `cache_control: optional CacheControlEphemeral or null`
473 
474 Create a cache control breakpoint at this content block.
475 
476 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
477 
478 - `string`
479 
480 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
481 
482 - `TextBlockParam object`
483 
484 - `ImageBlockParam object`
485 
486 - `SearchResultBlockParam object`
487 
488 - `DocumentBlockParam object`
489 
490 - `ToolReferenceBlockParam object`
491 
492 Tool reference block that can be included in tool_result content.
493 
494 - `type: "tool_reference"`
495 
496 - `tool_name: string`
497 
498 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
499 
500 - `cache_control: optional CacheControlEphemeral or null`
501 
502 Create a cache control breakpoint at this content block.
503 
504 - `BrowserStateBlockParam object`
505 
506 The caller's browser state after a browser toolset member call —
507 the full inventory of open tabs, which tab is active, and any side
508 effects (tabs opened, download state changes) the call produced.
509 
510 At most one per `tool_result`, only on a non-error result answering a
511 browser toolset member `tool_use`. The server renders the
512 model-visible text from it; the model never sees the raw fields.
513 
514 - `type: "browser_state"`
515 
516 - `tabs: array of BrowserStateTabEntry`
517 
518 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`.
519 
520 maxItems: 100
521 
522 - `tab_id: string`
523 
524 The caller-assigned identifier for this tab, unique within the inventory.
525 
526 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
527 
528 - `title: string`
529 
530 The title of the page the tab is showing. May be empty.
531 
532 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
533 
534 - `url: string`
535 
536 The URL of the page the tab is showing. May be empty.
537 
538 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
539 
540 - `active: optional boolean`
541 
542 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
543 
544 - `cache_control: optional CacheControlEphemeral or null`
545 
546 Create a cache control breakpoint at this content block.
547 
548 - `state_changes: optional array of BrowserStateChange or null`
549 
550 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
551 
552 minItems: 1, maxItems: 200
553 
554 - `BrowserStateChangeTabOpened object`
555 
556 A tab this call's execution opened that remains open at its end —
557 the creation delta of the `tabs` inventory, not an event log.
558 
559 Carries only the `tab_id`; the tab's `title` and `url` live on its
560 `tabs` entry, which must include the same `tab_id`. A tab opened
561 during a failed call gets no deferred `tab_opened`; it simply appears
562 in the next result's `tabs` inventory.
563 
564 - `type: "tab_opened"`
565 
566 - `tab_id: string`
567 
568 The `tab_id` of the opened tab, present in `tabs`.
569 
570 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
571 
572 - `BrowserStateChangeDownloadStarted object`
573 
574 A file download that started during this call.
575 
576 - `type: "download_started"`
577 
578 - `download_id: string`
579 
580 The caller-assigned identifier for this download, stable across the state changes reporting it.
581 
582 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
583 
584 - `url: string`
585 
586 The final post-redirect URL the download was served from.
587 
588 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
589 
590 - `BrowserStateChangeDownloadCompleted object`
591 
592 A file download that finished during this call, reported with the
593 same `download_id` as its `download_started` — or without a prior
594 `download_started`, when the download finished during the call that
595 started it (at most one state change per `download_id` per result).
596 
597 - `type: "download_completed"`
598 
599 - `download_id: string`
600 
601 The caller-assigned identifier for this download, stable across the state changes reporting it.
602 
603 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
604 
605 - `url: string`
606 
607 The final post-redirect URL the download was served from.
608 
609 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
610 
611 - `path: optional string or null`
612 
613 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
614 
615 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
616 
617 - `size_bytes: optional number or null`
618 
619 The completed download's size.
620 
621 minimum: 0
622 
623 - `BrowserStateChangeDownloadFailed object`
624 
625 A file download that failed — or was cancelled — during this call.
626 
627 - `type: "download_failed"`
628 
629 - `download_id: string`
630 
631 The caller-assigned identifier for this download, stable across the state changes reporting it.
632 
633 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
634 
635 - `url: string`
636 
637 The final post-redirect URL the download was served from.
638 
639 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
640 
641 - `error: optional string or null`
642 
643 The failure or cancellation detail, when known.
644 
645 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
646 
647 - `is_error: optional boolean`
648 
649 - `toolset_name: optional string or null`
650 
651 For a toolset member tool_result, the toolset family of the paired tool_use.
652 
653 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
654 
655 - `ServerToolUseBlockParam object`
656 
657 - `type: "server_tool_use"`
658 
659 - `id: string`
660 
661 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
662 
663 - `input: map[unknown]`
664 
665 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
666 
667 - `"web_search"`
668 
669 - `"web_fetch"`
670 
671 - `"code_execution"`
672 
673 - `"bash_code_execution"`
674 
675 - `"text_editor_code_execution"`
676 
677 - `"tool_search_tool_regex"`
678 
679 - `"tool_search_tool_bm25"`
680 
681 - `cache_control: optional CacheControlEphemeral or null`
682 
683 Create a cache control breakpoint at this content block.
684 
685 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
686 
687 - `DirectCaller object`
688 
689 Tool invocation directly from the model.
690 
691 - `ServerToolCaller object`
692 
693 Tool invocation generated by a server-side tool.
694 
695 - `ServerToolCaller20260120 object`
696 
697 - `WebSearchToolResultBlockParam object`
698 
699 - `type: "web_search_tool_result"`
700 
701 - `content: WebSearchToolResultBlockParamContent`
702 
703 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
704 
705 - `type: "web_search_result"`
706 
707 - `encrypted_content: string`
708 
709 - `title: string`
710 
711 - `url: string`
712 
713 - `page_age: optional string or null`
714 
715 - `WebSearchToolRequestError object`
716 
717 - `type: "web_search_tool_result_error"`
718 
719 - `error_code: WebSearchToolResultErrorCode`
720 
721 - `"invalid_tool_input"`
722 
723 - `"unavailable"`
724 
725 - `"max_uses_exceeded"`
726 
727 - `"too_many_requests"`
728 
729 - `"query_too_long"`
730 
731 - `"request_too_large"`
732 
733 - `tool_use_id: string`
734 
735 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
736 
737 - `cache_control: optional CacheControlEphemeral or null`
738 
739 Create a cache control breakpoint at this content block.
740 
741 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
742 
743 - `DirectCaller object`
744 
745 Tool invocation directly from the model.
746 
747 - `ServerToolCaller object`
748 
749 Tool invocation generated by a server-side tool.
750 
751 - `ServerToolCaller20260120 object`
752 
753 - `WebFetchToolResultBlockParam object`
754 
755 - `type: "web_fetch_tool_result"`
756 
757 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
758 
759 - `WebFetchToolResultErrorBlockParam object`
760 
761 - `type: "web_fetch_tool_result_error"`
762 
763 - `error_code: WebFetchToolResultErrorCode`
764 
765 - `"invalid_tool_input"`
766 
767 - `"url_too_long"`
768 
769 - `"url_not_allowed"`
770 
771 - `"url_not_in_prior_context"`
772 
773 - `"url_not_accessible"`
774 
775 - `"unsupported_content_type"`
776 
777 - `"too_many_requests"`
778 
779 - `"max_uses_exceeded"`
780 
781 - `"unavailable"`
782 
783 - `"content_too_large"`
784 
785 - `WebFetchBlockParam object`
786 
787 - `type: "web_fetch_result"`
788 
789 - `content: DocumentBlockParam`
790 
791 - `url: string`
792 
793 Fetched content URL
794 
795 - `retrieved_at: optional string or null`
796 
797 ISO 8601 timestamp when the content was retrieved
798 
799 - `tool_use_id: string`
800 
801 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
802 
803 - `cache_control: optional CacheControlEphemeral or null`
804 
805 Create a cache control breakpoint at this content block.
806 
807 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
808 
809 - `DirectCaller object`
810 
811 Tool invocation directly from the model.
812 
813 - `ServerToolCaller object`
814 
815 Tool invocation generated by a server-side tool.
816 
817 - `ServerToolCaller20260120 object`
818 
819 - `CodeExecutionToolResultBlockParam object`
820 
821 - `type: "code_execution_tool_result"`
822 
823 - `content: CodeExecutionToolResultBlockParamContent`
824 
825 - `CodeExecutionToolResultErrorParam object`
826 
827 - `type: "code_execution_tool_result_error"`
828 
829 - `error_code: CodeExecutionToolResultErrorCode`
830 
831 - `"invalid_tool_input"`
832 
833 - `"unavailable"`
834 
835 - `"too_many_requests"`
836 
837 - `"execution_time_exceeded"`
838 
839 - `CodeExecutionResultBlockParam object`
840 
841 - `type: "code_execution_result"`
842 
843 - `content: array of CodeExecutionOutputBlockParam`
844 
845 - `type: "code_execution_output"`
846 
847 - `file_id: string`
848 
849 - `return_code: number`
850 
851 - `stderr: string`
852 
853 - `stdout: string`
854 
855 - `EncryptedCodeExecutionResultBlockParam object`
856 
857 Code execution result with encrypted stdout for PFC + web_search results.
858 
859 - `type: "encrypted_code_execution_result"`
860 
861 - `content: array of CodeExecutionOutputBlockParam`
862 
863 - `type: "code_execution_output"`
864 
865 - `file_id: string`
866 
867 - `encrypted_stdout: string`
868 
869 - `return_code: number`
870 
871 - `stderr: string`
872 
873 - `tool_use_id: string`
874 
875 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
876 
877 - `cache_control: optional CacheControlEphemeral or null`
878 
879 Create a cache control breakpoint at this content block.
880 
881 - `BashCodeExecutionToolResultBlockParam object`
882 
883 - `type: "bash_code_execution_tool_result"`
884 
885 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
886 
887 - `BashCodeExecutionToolResultErrorParam object`
888 
889 - `type: "bash_code_execution_tool_result_error"`
890 
891 - `error_code: BashCodeExecutionToolResultErrorCode`
892 
893 - `"invalid_tool_input"`
894 
895 - `"unavailable"`
896 
897 - `"too_many_requests"`
898 
899 - `"execution_time_exceeded"`
900 
901 - `"output_file_too_large"`
902 
903 - `BashCodeExecutionResultBlockParam object`
904 
905 - `type: "bash_code_execution_result"`
906 
907 - `content: array of BashCodeExecutionOutputBlockParam`
908 
909 - `type: "bash_code_execution_output"`
910 
911 - `file_id: string`
912 
913 - `return_code: number`
914 
915 - `stderr: string`
916 
917 - `stdout: string`
918 
919 - `tool_use_id: string`
920 
921 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
922 
923 - `cache_control: optional CacheControlEphemeral or null`
924 
925 Create a cache control breakpoint at this content block.
926 
927 - `TextEditorCodeExecutionToolResultBlockParam object`
928 
929 - `type: "text_editor_code_execution_tool_result"`
930 
931 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
932 
933 - `TextEditorCodeExecutionToolResultErrorParam object`
934 
935 - `type: "text_editor_code_execution_tool_result_error"`
936 
937 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
938 
939 - `"invalid_tool_input"`
940 
941 - `"unavailable"`
942 
943 - `"too_many_requests"`
944 
945 - `"execution_time_exceeded"`
946 
947 - `"file_not_found"`
948 
949 - `error_message: optional string or null`
950 
951 - `TextEditorCodeExecutionViewResultBlockParam object`
952 
953 - `type: "text_editor_code_execution_view_result"`
954 
955 - `content: string`
956 
957 - `file_type: "text" or "image" or "pdf"`
958 
959 - `"text"`
960 
961 - `"image"`
962 
963 - `"pdf"`
964 
965 - `num_lines: optional number or null`
966 
967 - `start_line: optional number or null`
968 
969 - `total_lines: optional number or null`
970 
971 - `TextEditorCodeExecutionCreateResultBlockParam object`
972 
973 - `type: "text_editor_code_execution_create_result"`
974 
975 - `is_file_update: boolean`
976 
977 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
978 
979 - `type: "text_editor_code_execution_str_replace_result"`
980 
981 - `lines: optional array of string or null`
982 
983 - `new_lines: optional number or null`
984 
985 - `new_start: optional number or null`
986 
987 - `old_lines: optional number or null`
988 
989 - `old_start: optional number or null`
990 
991 - `tool_use_id: string`
992 
993 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
994 
995 - `cache_control: optional CacheControlEphemeral or null`
996 
997 Create a cache control breakpoint at this content block.
998 
999 - `ToolSearchToolResultBlockParam object`
1000 
1001 - `type: "tool_search_tool_result"`
1002 
1003 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1004 
1005 - `ToolSearchToolResultErrorParam object`
1006 
1007 - `type: "tool_search_tool_result_error"`
1008 
1009 - `error_code: ToolSearchToolResultErrorCode`
1010 
1011 - `"invalid_tool_input"`
1012 
1013 - `"unavailable"`
1014 
1015 - `"too_many_requests"`
1016 
1017 - `"execution_time_exceeded"`
1018 
1019 - `error_message: optional string or null`
1020 
1021 - `ToolSearchToolSearchResultBlockParam object`
1022 
1023 - `type: "tool_search_tool_search_result"`
1024 
1025 - `tool_references: array of ToolReferenceBlockParam`
1026 
1027 - `type: "tool_reference"`
1028 
1029 - `tool_name: string`
1030 
1031 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1032 
1033 - `cache_control: optional CacheControlEphemeral or null`
1034 
1035 Create a cache control breakpoint at this content block.
1036 
1037 - `tool_use_id: string`
1038 
1039 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1040 
1041 - `cache_control: optional CacheControlEphemeral or null`
1042 
1043 Create a cache control breakpoint at this content block.
1044 
1045 - `ContainerUploadBlockParam object`
1046 
1047 A content block that represents a file to be uploaded to the container
1048 Files uploaded via this block will be available in the container's input directory.
1049 
1050 - `type: "container_upload"`
1051 
1052 - `file_id: string`
1053 
1054 - `cache_control: optional CacheControlEphemeral or null`
1055 
1056 Create a cache control breakpoint at this content block.
1057 
1058 - `role: "user"`
1059 
1060 - `AssistantMessageParam object`
1061 
1062 - `content: MessageContentParam`
1063 
1064 - `role: "assistant"`
1065 
1066 - `SystemMessageParam object`
1067 
1068 - `content: string or array of TextBlockParam`
1069 
1070 - `string`
1071 
1072 - `Blocks = array of TextBlockParam`
941073 
951074 - `type: "text"`
961075 
from line 1081
1021081 
1031082 Create a cache control breakpoint at this content block.
1041083 
105 - `type: "ephemeral"`
106 
107 - `ttl: optional "5m" or "1h"`
108 
109 The time-to-live for the cache control breakpoint.
110 
111 This may be one the following values:
112 
113 - `5m`: 5 minutes
114 - `1h`: 1 hour
115 
116 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
117 
118 - `"5m"`
119 
120 - `"1h"`
121 
1221084 - `citations: optional array of TextCitationParam or null`
1231085 
124 - `CitationCharLocationParam object`
125 
126 - `type: "char_location"`
127 
128 - `cited_text: string`
129 
130 - `document_index: number`
131 
132 minimum: 0
133 
134 - `document_title: string or null`
135 
136 minLength: 1, maxLength: 500
137 
138 - `end_char_index: number`
139 
140 - `start_char_index: number`
141 
142 minimum: 0
143 
144 - `CitationPageLocationParam object`
145 
146 - `type: "page_location"`
147 
148 - `cited_text: string`
149 
150 - `document_index: number`
151 
152 minimum: 0
153 
154 - `document_title: string or null`
155 
156 minLength: 1, maxLength: 500
157 
158 - `end_page_number: number`
159 
160 - `start_page_number: number`
161 
162 minimum: 1
163 
164 - `CitationContentBlockLocationParam object`
165 
166 - `type: "content_block_location"`
167 
168 - `cited_text: string`
169 
170 The full text of the cited block range, concatenated.
171 
172 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
173 
174 - `document_index: number`
175 
176 minimum: 0
177 
178 - `document_title: string or null`
179 
180 minLength: 1, maxLength: 500
181 
182 - `end_block_index: number`
183 
184 Exclusive 0-based end index of the cited block range in the source's `content` array.
185 
186 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
187 
188 - `start_block_index: number`
189 
190 0-based index of the first cited block in the source's `content` array.
191 
192 minimum: 0
193 
194 - `CitationWebSearchResultLocationParam object`
195 
196 - `type: "web_search_result_location"`
197 
198 - `cited_text: string`
199 
200 - `encrypted_index: string`
201 
202 - `title: string or null`
203 
204 minLength: 1, maxLength: 512
205 
206 - `url: string`
207 
208 minLength: 1
209 
210 - `CitationSearchResultLocationParam object`
211 
212 - `type: "search_result_location"`
213 
214 - `cited_text: string`
215 
216 The full text of the cited block range, concatenated.
217 
218 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
219 
220 - `end_block_index: number`
221 
222 Exclusive 0-based end index of the cited block range in the source's `content` array.
223 
224 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
225 
226 - `search_result_index: number`
227 
228 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
229 
230 Counted separately from `document_index`; server-side web search results are not included in this count.
231 
232 minimum: 0
233 
234 - `source: string`
235 
236 - `start_block_index: number`
237 
238 0-based index of the first cited block in the source's `content` array.
239 
240 minimum: 0
241 
242 - `title: string or null`
243 
244 - `ImageBlockParam object`
245 
246 - `type: "image"`
247 
248 - `source: Base64ImageSource or URLImageSource or FileImageSource`
249 
250 - `Base64ImageSource object`
251 
252 - `type: "base64"`
253 
254 - `data: string`
255 
256 format: byte
257 
258 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
259 
260 - `"image/jpeg"`
261 
262 - `"image/png"`
263 
264 - `"image/gif"`
265 
266 - `"image/webp"`
267 
268 - `URLImageSource object`
269 
270 - `type: "url"`
271 
272 - `url: string`
273 
274 - `FileImageSource object`
275 
276 - `type: "file"`
277 
278 - `file_id: string`
279 
280 - `cache_control: optional CacheControlEphemeral or null`
281 
282 Create a cache control breakpoint at this content block.
283 
284 - `transformations: optional ImageTransformationsParam or null`
285 
286 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.
287 
288 - `oversized_image: optional "downsize" or "error"`
289 
290 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.
291 
292 - `"downsize"`
293 
294 - `"error"`
295 
296 - `DocumentBlockParam object`
297 
298 - `type: "document"`
299 
300 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
301 
302 - `Base64PDFSource object`
303 
304 - `type: "base64"`
305 
306 - `data: string`
307 
308 format: byte
309 
310 - `media_type: "application/pdf"`
311 
312 - `PlainTextSource object`
313 
314 - `type: "text"`
315 
316 - `data: string`
317 
318 - `media_type: "text/plain"`
319 
320 - `ContentBlockSource object`
321 
322 - `type: "content"`
323 
324 - `content: string or array of ContentBlockSourceContent`
325 
326 - `string`
327 
328 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
329 
330 - `TextBlockParam object`
331 
332 - `ImageBlockParam object`
333 
334 - `URLPDFSource object`
335 
336 - `type: "url"`
337 
338 - `url: string`
339 
340 - `FileDocumentSource object`
341 
342 - `type: "file"`
343 
344 - `file_id: string`
345 
346 - `cache_control: optional CacheControlEphemeral or null`
347 
348 Create a cache control breakpoint at this content block.
349 
350 - `citations: optional CitationsConfigParam or null`
351 
352 - `enabled: optional boolean`
353 
354 - `context: optional string or null`
355 
356 minLength: 1
357 
358 - `title: optional string or null`
359 
360 minLength: 1, maxLength: 500
361 
362 - `SearchResultBlockParam object`
363 
364 - `type: "search_result"`
365 
366 - `content: array of TextBlockParam`
367 
368 - `type: "text"`
369 
370 - `text: string`
371 
372 minLength: 1
373 
374 - `cache_control: optional CacheControlEphemeral or null`
375 
376 Create a cache control breakpoint at this content block.
377 
378 - `citations: optional array of TextCitationParam or null`
379 
380 - `source: string`
381 
382 - `title: string`
383 
384 - `cache_control: optional CacheControlEphemeral or null`
385 
386 Create a cache control breakpoint at this content block.
387 
388 - `citations: optional CitationsConfigParam`
389 
390 - `ThinkingBlockParam object`
391 
392 - `type: "thinking"`
393 
394 - `signature: string`
395 
396 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.
397 
398 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
399 
400 - `thinking: string`
401 
402 The `thinking` text of this block as returned by the API.
403 
404 - `RedactedThinkingBlockParam object`
405 
406 - `type: "redacted_thinking"`
407 
408 - `data: string`
409 
410 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.
411 
412 - `ToolUseBlockParam object`
413 
414 - `type: "tool_use"`
415 
416 - `id: string`
417 
418 pattern: ^[a-zA-Z0-9_-]+$
419 
420 - `input: map[unknown]`
421 
422 - `name: string`
423 
424 minLength: 1, maxLength: 200
425 
426 - `cache_control: optional CacheControlEphemeral or null`
427 
428 Create a cache control breakpoint at this content block.
429 
430 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
431 
432 - `DirectCaller object`
433 
434 Tool invocation directly from the model.
435 
436 - `type: "direct"`
437 
438 - `ServerToolCaller object`
439 
440 Tool invocation generated by a server-side tool.
441 
442 - `type: "code_execution_20250825"`
443 
444 - `tool_id: string`
445 
446 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
447 
448 - `ServerToolCaller20260120 object`
449 
450 - `type: "code_execution_20260120"`
451 
452 - `tool_id: string`
453 
454 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
455 
456 - `toolset_name: optional string or null`
457 
458 For a toolset member tool_use, the toolset family this member belongs to.
459 
460 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
461 
462 - `ToolResultBlockParam object`
463 
464 - `type: "tool_result"`
465 
466 - `tool_use_id: string`
467 
468 pattern: ^[a-zA-Z0-9_-]+$
469 
470 - `cache_control: optional CacheControlEphemeral or null`
471 
472 Create a cache control breakpoint at this content block.
473 
474 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
475 
476 - `string`
477 
478 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
479 
480 - `TextBlockParam object`
481 
482 - `ImageBlockParam object`
483 
484 - `SearchResultBlockParam object`
485 
486 - `DocumentBlockParam object`
487 
488 - `ToolReferenceBlockParam object`
489 
490 Tool reference block that can be included in tool_result content.
491 
492 - `type: "tool_reference"`
493 
494 - `tool_name: string`
495 
496 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
497 
498 - `cache_control: optional CacheControlEphemeral or null`
499 
500 Create a cache control breakpoint at this content block.
501 
502 - `BrowserStateBlockParam object`
503 
504 The caller's browser state after a browser toolset member call —
505 the full inventory of open tabs, which tab is active, and any side
506 effects (tabs opened, download state changes) the call produced.
507 
508 At most one per `tool_result`, only on a non-error result answering a
509 browser toolset member `tool_use`. The server renders the
510 model-visible text from it; the model never sees the raw fields.
511 
512 - `type: "browser_state"`
513 
514 - `tabs: array of BrowserStateTabEntry`
515 
516 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`.
517 
518 maxItems: 100
519 
520 - `tab_id: string`
521 
522 The caller-assigned identifier for this tab, unique within the inventory.
523 
524 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
525 
526 - `title: string`
527 
528 The title of the page the tab is showing. May be empty.
529 
530 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
531 
532 - `url: string`
533 
534 The URL of the page the tab is showing. May be empty.
535 
536 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
537 
538 - `active: optional boolean`
539 
540 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
541 
542 - `cache_control: optional CacheControlEphemeral or null`
543 
544 Create a cache control breakpoint at this content block.
545 
546 - `state_changes: optional array of BrowserStateChange or null`
547 
548 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
549 
550 minItems: 1, maxItems: 200
551 
552 - `BrowserStateChangeTabOpened object`
553 
554 A tab this call's execution opened that remains open at its end —
555 the creation delta of the `tabs` inventory, not an event log.
556 
557 Carries only the `tab_id`; the tab's `title` and `url` live on its
558 `tabs` entry, which must include the same `tab_id`. A tab opened
559 during a failed call gets no deferred `tab_opened`; it simply appears
560 in the next result's `tabs` inventory.
561 
562 - `type: "tab_opened"`
563 
564 - `tab_id: string`
565 
566 The `tab_id` of the opened tab, present in `tabs`.
567 
568 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
569 
570 - `BrowserStateChangeDownloadStarted object`
571 
572 A file download that started during this call.
573 
574 - `type: "download_started"`
575 
576 - `download_id: string`
577 
578 The caller-assigned identifier for this download, stable across the state changes reporting it.
579 
580 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
581 
582 - `url: string`
583 
584 The final post-redirect URL the download was served from.
585 
586 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
587 
588 - `BrowserStateChangeDownloadCompleted object`
589 
590 A file download that finished during this call, reported with the
591 same `download_id` as its `download_started` — or without a prior
592 `download_started`, when the download finished during the call that
593 started it (at most one state change per `download_id` per result).
594 
595 - `type: "download_completed"`
596 
597 - `download_id: string`
598 
599 The caller-assigned identifier for this download, stable across the state changes reporting it.
600 
601 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
602 
603 - `url: string`
604 
605 The final post-redirect URL the download was served from.
606 
607 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
608 
609 - `path: optional string or null`
610 
611 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
612 
613 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
614 
615 - `size_bytes: optional number or null`
616 
617 The completed download's size.
618 
619 minimum: 0
620 
621 - `BrowserStateChangeDownloadFailed object`
622 
623 A file download that failed — or was cancelled — during this call.
624 
625 - `type: "download_failed"`
626 
627 - `download_id: string`
628 
629 The caller-assigned identifier for this download, stable across the state changes reporting it.
630 
631 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
632 
633 - `url: string`
634 
635 The final post-redirect URL the download was served from.
636 
637 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
638 
639 - `error: optional string or null`
640 
641 The failure or cancellation detail, when known.
642 
643 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
644 
645 - `is_error: optional boolean`
646 
647 - `toolset_name: optional string or null`
648 
649 For a toolset member tool_result, the toolset family of the paired tool_use.
650 
651 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
652 
653 - `ServerToolUseBlockParam object`
654 
655 - `type: "server_tool_use"`
656 
657 - `id: string`
658 
659 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
660 
661 - `input: map[unknown]`
662 
663 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
664 
665 - `"web_search"`
666 
667 - `"web_fetch"`
668 
669 - `"code_execution"`
670 
671 - `"bash_code_execution"`
672 
673 - `"text_editor_code_execution"`
674 
675 - `"tool_search_tool_regex"`
676 
677 - `"tool_search_tool_bm25"`
678 
679 - `cache_control: optional CacheControlEphemeral or null`
680 
681 Create a cache control breakpoint at this content block.
682 
683 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
684 
685 - `DirectCaller object`
686 
687 Tool invocation directly from the model.
688 
689 - `ServerToolCaller object`
690 
691 Tool invocation generated by a server-side tool.
692 
693 - `ServerToolCaller20260120 object`
694 
695 - `WebSearchToolResultBlockParam object`
696 
697 - `type: "web_search_tool_result"`
698 
699 - `content: WebSearchToolResultBlockParamContent`
700 
701 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
702 
703 - `type: "web_search_result"`
704 
705 - `encrypted_content: string`
706 
707 - `title: string`
708 
709 - `url: string`
710 
711 - `page_age: optional string or null`
712 
713 - `WebSearchToolRequestError object`
714 
715 - `type: "web_search_tool_result_error"`
716 
717 - `error_code: WebSearchToolResultErrorCode`
718 
719 - `"invalid_tool_input"`
720 
721 - `"unavailable"`
722 
723 - `"max_uses_exceeded"`
724 
725 - `"too_many_requests"`
726 
727 - `"query_too_long"`
728 
729 - `"request_too_large"`
730 
731 - `tool_use_id: string`
732 
733 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
734 
735 - `cache_control: optional CacheControlEphemeral or null`
736 
737 Create a cache control breakpoint at this content block.
738 
739 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
740 
741 - `DirectCaller object`
742 
743 Tool invocation directly from the model.
744 
745 - `ServerToolCaller object`
746 
747 Tool invocation generated by a server-side tool.
748 
749 - `ServerToolCaller20260120 object`
750 
751 - `WebFetchToolResultBlockParam object`
752 
753 - `type: "web_fetch_tool_result"`
754 
755 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
756 
757 - `WebFetchToolResultErrorBlockParam object`
758 
759 - `type: "web_fetch_tool_result_error"`
760 
761 - `error_code: WebFetchToolResultErrorCode`
762 
763 - `"invalid_tool_input"`
764 
765 - `"url_too_long"`
766 
767 - `"url_not_allowed"`
768 
769 - `"url_not_in_prior_context"`
770 
771 - `"url_not_accessible"`
772 
773 - `"unsupported_content_type"`
774 
775 - `"too_many_requests"`
776 
777 - `"max_uses_exceeded"`
778 
779 - `"unavailable"`
780 
781 - `"content_too_large"`
782 
783 - `WebFetchBlockParam object`
784 
785 - `type: "web_fetch_result"`
786 
787 - `content: DocumentBlockParam`
788 
789 - `url: string`
790 
791 Fetched content URL
792 
793 - `retrieved_at: optional string or null`
794 
795 ISO 8601 timestamp when the content was retrieved
796 
797 - `tool_use_id: string`
798 
799 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
800 
801 - `cache_control: optional CacheControlEphemeral or null`
802 
803 Create a cache control breakpoint at this content block.
804 
805 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
806 
807 - `DirectCaller object`
808 
809 Tool invocation directly from the model.
810 
811 - `ServerToolCaller object`
812 
813 Tool invocation generated by a server-side tool.
814 
815 - `ServerToolCaller20260120 object`
816 
817 - `CodeExecutionToolResultBlockParam object`
818 
819 - `type: "code_execution_tool_result"`
820 
821 - `content: CodeExecutionToolResultBlockParamContent`
822 
823 - `CodeExecutionToolResultErrorParam object`
824 
825 - `type: "code_execution_tool_result_error"`
826 
827 - `error_code: CodeExecutionToolResultErrorCode`
828 
829 - `"invalid_tool_input"`
830 
831 - `"unavailable"`
832 
833 - `"too_many_requests"`
834 
835 - `"execution_time_exceeded"`
836 
837 - `CodeExecutionResultBlockParam object`
838 
839 - `type: "code_execution_result"`
840 
841 - `content: array of CodeExecutionOutputBlockParam`
842 
843 - `type: "code_execution_output"`
844 
845 - `file_id: string`
846 
847 - `return_code: number`
848 
849 - `stderr: string`
850 
851 - `stdout: string`
852 
853 - `EncryptedCodeExecutionResultBlockParam object`
854 
855 Code execution result with encrypted stdout for PFC + web_search results.
856 
857 - `type: "encrypted_code_execution_result"`
858 
859 - `content: array of CodeExecutionOutputBlockParam`
860 
861 - `type: "code_execution_output"`
862 
863 - `file_id: string`
864 
865 - `encrypted_stdout: string`
866 
867 - `return_code: number`
868 
869 - `stderr: string`
870 
871 - `tool_use_id: string`
872 
873 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
874 
875 - `cache_control: optional CacheControlEphemeral or null`
876 
877 Create a cache control breakpoint at this content block.
878 
879 - `BashCodeExecutionToolResultBlockParam object`
880 
881 - `type: "bash_code_execution_tool_result"`
882 
883 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
884 
885 - `BashCodeExecutionToolResultErrorParam object`
886 
887 - `type: "bash_code_execution_tool_result_error"`
888 
889 - `error_code: BashCodeExecutionToolResultErrorCode`
890 
891 - `"invalid_tool_input"`
892 
893 - `"unavailable"`
894 
895 - `"too_many_requests"`
896 
897 - `"execution_time_exceeded"`
898 
899 - `"output_file_too_large"`
900 
901 - `BashCodeExecutionResultBlockParam object`
902 
903 - `type: "bash_code_execution_result"`
904 
905 - `content: array of BashCodeExecutionOutputBlockParam`
906 
907 - `type: "bash_code_execution_output"`
908 
909 - `file_id: string`
910 
911 - `return_code: number`
912 
913 - `stderr: string`
914 
915 - `stdout: string`
916 
917 - `tool_use_id: string`
918 
919 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
920 
921 - `cache_control: optional CacheControlEphemeral or null`
922 
923 Create a cache control breakpoint at this content block.
924 
925 - `TextEditorCodeExecutionToolResultBlockParam object`
926 
927 - `type: "text_editor_code_execution_tool_result"`
928 
929 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
930 
931 - `TextEditorCodeExecutionToolResultErrorParam object`
932 
933 - `type: "text_editor_code_execution_tool_result_error"`
934 
935 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
936 
937 - `"invalid_tool_input"`
938 
939 - `"unavailable"`
940 
941 - `"too_many_requests"`
942 
943 - `"execution_time_exceeded"`
944 
945 - `"file_not_found"`
946 
947 - `error_message: optional string or null`
948 
949 - `TextEditorCodeExecutionViewResultBlockParam object`
950 
951 - `type: "text_editor_code_execution_view_result"`
952 
953 - `content: string`
954 
955 - `file_type: "text" or "image" or "pdf"`
956 
957 - `"text"`
958 
959 - `"image"`
960 
961 - `"pdf"`
962 
963 - `num_lines: optional number or null`
964 
965 - `start_line: optional number or null`
966 
967 - `total_lines: optional number or null`
968 
969 - `TextEditorCodeExecutionCreateResultBlockParam object`
970 
971 - `type: "text_editor_code_execution_create_result"`
972 
973 - `is_file_update: boolean`
974 
975 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
976 
977 - `type: "text_editor_code_execution_str_replace_result"`
978 
979 - `lines: optional array of string or null`
980 
981 - `new_lines: optional number or null`
982 
983 - `new_start: optional number or null`
984 
985 - `old_lines: optional number or null`
986 
987 - `old_start: optional number or null`
988 
989 - `tool_use_id: string`
990 
991 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
992 
993 - `cache_control: optional CacheControlEphemeral or null`
994 
995 Create a cache control breakpoint at this content block.
996 
997 - `ToolSearchToolResultBlockParam object`
998 
999 - `type: "tool_search_tool_result"`
1000 
1001 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1002 
1003 - `ToolSearchToolResultErrorParam object`
1004 
1005 - `type: "tool_search_tool_result_error"`
1006 
1007 - `error_code: ToolSearchToolResultErrorCode`
1008 
1009 - `"invalid_tool_input"`
1010 
1011 - `"unavailable"`
1012 
1013 - `"too_many_requests"`
1014 
1015 - `"execution_time_exceeded"`
1016 
1017 - `error_message: optional string or null`
1018 
1019 - `ToolSearchToolSearchResultBlockParam object`
1020 
1021 - `type: "tool_search_tool_search_result"`
1022 
1023 - `tool_references: array of ToolReferenceBlockParam`
1024 
1025 - `type: "tool_reference"`
1026 
1027 - `tool_name: string`
1028 
1029 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1030 
1031 - `cache_control: optional CacheControlEphemeral or null`
1032 
1033 Create a cache control breakpoint at this content block.
1034 
1035 - `tool_use_id: string`
1036 
1037 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1038 
1039 - `cache_control: optional CacheControlEphemeral or null`
1040 
1041 Create a cache control breakpoint at this content block.
1042 
1043 - `ContainerUploadBlockParam object`
1044 
1045 A content block that represents a file to be uploaded to the container
1046 Files uploaded via this block will be available in the container's input directory.
1047 
1048 - `type: "container_upload"`
1049 
1050 - `file_id: string`
1051 
1052 - `cache_control: optional CacheControlEphemeral or null`
1053 
1054 Create a cache control breakpoint at this content block.
1055 
1056 - `role: "user" or "assistant" or "system"`
1057 
1058 - `"user"`
1059 
1060 - `"assistant"`
1061 
1062 - `"system"`
1086 - `role: "system"`
10631087 
10641088- `model: Model`
10651089 
from line 2994
29702994```bash
29712995curl https://api.anthropic.com/v1/messages/count_tokens \
29722996 -H 'Content-Type: application/json' \
2973 -H 'anthropic-version: 2023-06-01' \
2974 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
2997 -H 'anthropic-version: 2026-10-21' \
2998 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
29752999 -d '{
29763000 "messages": [
29773001 {
29783002 

api/messages/create Changed · +991 / -1006 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 92
9292 
9393 See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages?sdk_languages=http).
9494 
95 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
95 Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=http#give-claude-a-role), you can use the top-level `system` parameter.
9696 
9797 There is a limit of 100,000 messages in a single request.
9898 
99 - `content: string or array of ContentBlockParam`
100 
101 - `string`
102 
103 - `array of ContentBlockParam`
104 
105 - `TextBlockParam object`
99 - `UserMessageParam object`
100 
101 - `content: MessageContentParam`
102 
103 - `string`
104 
105 - `array of ContentBlockParam`
106 
107 - `TextBlockParam object`
108 
109 - `type: "text"`
110 
111 - `text: string`
112 
113 minLength: 1
114 
115 - `cache_control: optional CacheControlEphemeral or null`
116 
117 Create a cache control breakpoint at this content block.
118 
119 - `type: "ephemeral"`
120 
121 - `ttl: optional "5m" or "1h"`
122 
123 The time-to-live for the cache control breakpoint.
124 
125 This may be one the following values:
126 
127 - `5m`: 5 minutes
128 - `1h`: 1 hour
129 
130 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
131 
132 - `"5m"`
133 
134 - `"1h"`
135 
136 - `citations: optional array of TextCitationParam or null`
137 
138 - `CitationCharLocationParam object`
139 
140 - `type: "char_location"`
141 
142 - `cited_text: string`
143 
144 - `document_index: number`
145 
146 minimum: 0
147 
148 - `document_title: string or null`
149 
150 minLength: 1, maxLength: 500
151 
152 - `end_char_index: number`
153 
154 - `start_char_index: number`
155 
156 minimum: 0
157 
158 - `CitationPageLocationParam object`
159 
160 - `type: "page_location"`
161 
162 - `cited_text: string`
163 
164 - `document_index: number`
165 
166 minimum: 0
167 
168 - `document_title: string or null`
169 
170 minLength: 1, maxLength: 500
171 
172 - `end_page_number: number`
173 
174 - `start_page_number: number`
175 
176 minimum: 1
177 
178 - `CitationContentBlockLocationParam object`
179 
180 - `type: "content_block_location"`
181 
182 - `cited_text: string`
183 
184 The full text of the cited block range, concatenated.
185 
186 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
187 
188 - `document_index: number`
189 
190 minimum: 0
191 
192 - `document_title: string or null`
193 
194 minLength: 1, maxLength: 500
195 
196 - `end_block_index: number`
197 
198 Exclusive 0-based end index of the cited block range in the source's `content` array.
199 
200 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
201 
202 - `start_block_index: number`
203 
204 0-based index of the first cited block in the source's `content` array.
205 
206 minimum: 0
207 
208 - `CitationWebSearchResultLocationParam object`
209 
210 - `type: "web_search_result_location"`
211 
212 - `cited_text: string`
213 
214 - `encrypted_index: string`
215 
216 - `title: string or null`
217 
218 minLength: 1, maxLength: 512
219 
220 - `url: string`
221 
222 minLength: 1
223 
224 - `CitationSearchResultLocationParam object`
225 
226 - `type: "search_result_location"`
227 
228 - `cited_text: string`
229 
230 The full text of the cited block range, concatenated.
231 
232 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
233 
234 - `end_block_index: number`
235 
236 Exclusive 0-based end index of the cited block range in the source's `content` array.
237 
238 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
239 
240 - `search_result_index: number`
241 
242 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
243 
244 Counted separately from `document_index`; server-side web search results are not included in this count.
245 
246 minimum: 0
247 
248 - `source: string`
249 
250 - `start_block_index: number`
251 
252 0-based index of the first cited block in the source's `content` array.
253 
254 minimum: 0
255 
256 - `title: string or null`
257 
258 - `ImageBlockParam object`
259 
260 - `type: "image"`
261 
262 - `source: Base64ImageSource or URLImageSource or FileImageSource`
263 
264 - `Base64ImageSource object`
265 
266 - `type: "base64"`
267 
268 - `data: string`
269 
270 format: byte
271 
272 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
273 
274 - `"image/jpeg"`
275 
276 - `"image/png"`
277 
278 - `"image/gif"`
279 
280 - `"image/webp"`
281 
282 - `URLImageSource object`
283 
284 - `type: "url"`
285 
286 - `url: string`
287 
288 - `FileImageSource object`
289 
290 - `type: "file"`
291 
292 - `file_id: string`
293 
294 - `cache_control: optional CacheControlEphemeral or null`
295 
296 Create a cache control breakpoint at this content block.
297 
298 - `transformations: optional ImageTransformationsParam or null`
299 
300 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.
301 
302 - `oversized_image: optional "downsize" or "error"`
303 
304 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.
305 
306 - `"downsize"`
307 
308 - `"error"`
309 
310 - `DocumentBlockParam object`
311 
312 - `type: "document"`
313 
314 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
315 
316 - `Base64PDFSource object`
317 
318 - `type: "base64"`
319 
320 - `data: string`
321 
322 format: byte
323 
324 - `media_type: "application/pdf"`
325 
326 - `PlainTextSource object`
327 
328 - `type: "text"`
329 
330 - `data: string`
331 
332 - `media_type: "text/plain"`
333 
334 - `ContentBlockSource object`
335 
336 - `type: "content"`
337 
338 - `content: string or array of ContentBlockSourceContent`
339 
340 - `string`
341 
342 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
343 
344 - `TextBlockParam object`
345 
346 - `ImageBlockParam object`
347 
348 - `URLPDFSource object`
349 
350 - `type: "url"`
351 
352 - `url: string`
353 
354 - `FileDocumentSource object`
355 
356 - `type: "file"`
357 
358 - `file_id: string`
359 
360 - `cache_control: optional CacheControlEphemeral or null`
361 
362 Create a cache control breakpoint at this content block.
363 
364 - `citations: optional CitationsConfigParam or null`
365 
366 - `enabled: optional boolean`
367 
368 - `context: optional string or null`
369 
370 minLength: 1
371 
372 - `title: optional string or null`
373 
374 minLength: 1, maxLength: 500
375 
376 - `SearchResultBlockParam object`
377 
378 - `type: "search_result"`
379 
380 - `content: array of TextBlockParam`
381 
382 - `type: "text"`
383 
384 - `text: string`
385 
386 minLength: 1
387 
388 - `cache_control: optional CacheControlEphemeral or null`
389 
390 Create a cache control breakpoint at this content block.
391 
392 - `citations: optional array of TextCitationParam or null`
393 
394 - `source: string`
395 
396 - `title: string`
397 
398 - `cache_control: optional CacheControlEphemeral or null`
399 
400 Create a cache control breakpoint at this content block.
401 
402 - `citations: optional CitationsConfigParam`
403 
404 - `ThinkingBlockParam object`
405 
406 - `type: "thinking"`
407 
408 - `signature: string`
409 
410 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.
411 
412 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
413 
414 - `thinking: string`
415 
416 The `thinking` text of this block as returned by the API.
417 
418 - `RedactedThinkingBlockParam object`
419 
420 - `type: "redacted_thinking"`
421 
422 - `data: string`
423 
424 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.
425 
426 - `ToolUseBlockParam object`
427 
428 - `type: "tool_use"`
429 
430 - `id: string`
431 
432 pattern: ^[a-zA-Z0-9_-]+$
433 
434 - `input: map[unknown]`
435 
436 - `name: string`
437 
438 minLength: 1, maxLength: 200
439 
440 - `cache_control: optional CacheControlEphemeral or null`
441 
442 Create a cache control breakpoint at this content block.
443 
444 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
445 
446 - `DirectCaller object`
447 
448 Tool invocation directly from the model.
449 
450 - `type: "direct"`
451 
452 - `ServerToolCaller object`
453 
454 Tool invocation generated by a server-side tool.
455 
456 - `type: "code_execution_20250825"`
457 
458 - `tool_id: string`
459 
460 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
461 
462 - `ServerToolCaller20260120 object`
463 
464 - `type: "code_execution_20260120"`
465 
466 - `tool_id: string`
467 
468 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
469 
470 - `toolset_name: optional string or null`
471 
472 For a toolset member tool_use, the toolset family this member belongs to.
473 
474 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
475 
476 - `ToolResultBlockParam object`
477 
478 - `type: "tool_result"`
479 
480 - `tool_use_id: string`
481 
482 pattern: ^[a-zA-Z0-9_-]+$
483 
484 - `cache_control: optional CacheControlEphemeral or null`
485 
486 Create a cache control breakpoint at this content block.
487 
488 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
489 
490 - `string`
491 
492 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
493 
494 - `TextBlockParam object`
495 
496 - `ImageBlockParam object`
497 
498 - `SearchResultBlockParam object`
499 
500 - `DocumentBlockParam object`
501 
502 - `ToolReferenceBlockParam object`
503 
504 Tool reference block that can be included in tool_result content.
505 
506 - `type: "tool_reference"`
507 
508 - `tool_name: string`
509 
510 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
511 
512 - `cache_control: optional CacheControlEphemeral or null`
513 
514 Create a cache control breakpoint at this content block.
515 
516 - `BrowserStateBlockParam object`
517 
518 The caller's browser state after a browser toolset member call —
519 the full inventory of open tabs, which tab is active, and any side
520 effects (tabs opened, download state changes) the call produced.
521 
522 At most one per `tool_result`, only on a non-error result answering a
523 browser toolset member `tool_use`. The server renders the
524 model-visible text from it; the model never sees the raw fields.
525 
526 - `type: "browser_state"`
527 
528 - `tabs: array of BrowserStateTabEntry`
529 
530 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`.
531 
532 maxItems: 100
533 
534 - `tab_id: string`
535 
536 The caller-assigned identifier for this tab, unique within the inventory.
537 
538 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
539 
540 - `title: string`
541 
542 The title of the page the tab is showing. May be empty.
543 
544 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
545 
546 - `url: string`
547 
548 The URL of the page the tab is showing. May be empty.
549 
550 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
551 
552 - `active: optional boolean`
553 
554 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
555 
556 - `cache_control: optional CacheControlEphemeral or null`
557 
558 Create a cache control breakpoint at this content block.
559 
560 - `state_changes: optional array of BrowserStateChange or null`
561 
562 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
563 
564 minItems: 1, maxItems: 200
565 
566 - `BrowserStateChangeTabOpened object`
567 
568 A tab this call's execution opened that remains open at its end —
569 the creation delta of the `tabs` inventory, not an event log.
570 
571 Carries only the `tab_id`; the tab's `title` and `url` live on its
572 `tabs` entry, which must include the same `tab_id`. A tab opened
573 during a failed call gets no deferred `tab_opened`; it simply appears
574 in the next result's `tabs` inventory.
575 
576 - `type: "tab_opened"`
577 
578 - `tab_id: string`
579 
580 The `tab_id` of the opened tab, present in `tabs`.
581 
582 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
583 
584 - `BrowserStateChangeDownloadStarted object`
585 
586 A file download that started during this call.
587 
588 - `type: "download_started"`
589 
590 - `download_id: string`
591 
592 The caller-assigned identifier for this download, stable across the state changes reporting it.
593 
594 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
595 
596 - `url: string`
597 
598 The final post-redirect URL the download was served from.
599 
600 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
601 
602 - `BrowserStateChangeDownloadCompleted object`
603 
604 A file download that finished during this call, reported with the
605 same `download_id` as its `download_started` — or without a prior
606 `download_started`, when the download finished during the call that
607 started it (at most one state change per `download_id` per result).
608 
609 - `type: "download_completed"`
610 
611 - `download_id: string`
612 
613 The caller-assigned identifier for this download, stable across the state changes reporting it.
614 
615 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
616 
617 - `url: string`
618 
619 The final post-redirect URL the download was served from.
620 
621 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
622 
623 - `path: optional string or null`
624 
625 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
626 
627 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
628 
629 - `size_bytes: optional number or null`
630 
631 The completed download's size.
632 
633 minimum: 0
634 
635 - `BrowserStateChangeDownloadFailed object`
636 
637 A file download that failed — or was cancelled — during this call.
638 
639 - `type: "download_failed"`
640 
641 - `download_id: string`
642 
643 The caller-assigned identifier for this download, stable across the state changes reporting it.
644 
645 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
646 
647 - `url: string`
648 
649 The final post-redirect URL the download was served from.
650 
651 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
652 
653 - `error: optional string or null`
654 
655 The failure or cancellation detail, when known.
656 
657 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
658 
659 - `is_error: optional boolean`
660 
661 - `toolset_name: optional string or null`
662 
663 For a toolset member tool_result, the toolset family of the paired tool_use.
664 
665 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
666 
667 - `ServerToolUseBlockParam object`
668 
669 - `type: "server_tool_use"`
670 
671 - `id: string`
672 
673 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
674 
675 - `input: map[unknown]`
676 
677 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
678 
679 - `"web_search"`
680 
681 - `"web_fetch"`
682 
683 - `"code_execution"`
684 
685 - `"bash_code_execution"`
686 
687 - `"text_editor_code_execution"`
688 
689 - `"tool_search_tool_regex"`
690 
691 - `"tool_search_tool_bm25"`
692 
693 - `cache_control: optional CacheControlEphemeral or null`
694 
695 Create a cache control breakpoint at this content block.
696 
697 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
698 
699 - `DirectCaller object`
700 
701 Tool invocation directly from the model.
702 
703 - `ServerToolCaller object`
704 
705 Tool invocation generated by a server-side tool.
706 
707 - `ServerToolCaller20260120 object`
708 
709 - `WebSearchToolResultBlockParam object`
710 
711 - `type: "web_search_tool_result"`
712 
713 - `content: WebSearchToolResultBlockParamContent`
714 
715 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
716 
717 - `type: "web_search_result"`
718 
719 - `encrypted_content: string`
720 
721 - `title: string`
722 
723 - `url: string`
724 
725 - `page_age: optional string or null`
726 
727 - `WebSearchToolRequestError object`
728 
729 - `type: "web_search_tool_result_error"`
730 
731 - `error_code: WebSearchToolResultErrorCode`
732 
733 - `"invalid_tool_input"`
734 
735 - `"unavailable"`
736 
737 - `"max_uses_exceeded"`
738 
739 - `"too_many_requests"`
740 
741 - `"query_too_long"`
742 
743 - `"request_too_large"`
744 
745 - `tool_use_id: string`
746 
747 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
748 
749 - `cache_control: optional CacheControlEphemeral or null`
750 
751 Create a cache control breakpoint at this content block.
752 
753 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
754 
755 - `DirectCaller object`
756 
757 Tool invocation directly from the model.
758 
759 - `ServerToolCaller object`
760 
761 Tool invocation generated by a server-side tool.
762 
763 - `ServerToolCaller20260120 object`
764 
765 - `WebFetchToolResultBlockParam object`
766 
767 - `type: "web_fetch_tool_result"`
768 
769 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
770 
771 - `WebFetchToolResultErrorBlockParam object`
772 
773 - `type: "web_fetch_tool_result_error"`
774 
775 - `error_code: WebFetchToolResultErrorCode`
776 
777 - `"invalid_tool_input"`
778 
779 - `"url_too_long"`
780 
781 - `"url_not_allowed"`
782 
783 - `"url_not_in_prior_context"`
784 
785 - `"url_not_accessible"`
786 
787 - `"unsupported_content_type"`
788 
789 - `"too_many_requests"`
790 
791 - `"max_uses_exceeded"`
792 
793 - `"unavailable"`
794 
795 - `"content_too_large"`
796 
797 - `WebFetchBlockParam object`
798 
799 - `type: "web_fetch_result"`
800 
801 - `content: DocumentBlockParam`
802 
803 - `url: string`
804 
805 Fetched content URL
806 
807 - `retrieved_at: optional string or null`
808 
809 ISO 8601 timestamp when the content was retrieved
810 
811 - `tool_use_id: string`
812 
813 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
814 
815 - `cache_control: optional CacheControlEphemeral or null`
816 
817 Create a cache control breakpoint at this content block.
818 
819 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
820 
821 - `DirectCaller object`
822 
823 Tool invocation directly from the model.
824 
825 - `ServerToolCaller object`
826 
827 Tool invocation generated by a server-side tool.
828 
829 - `ServerToolCaller20260120 object`
830 
831 - `CodeExecutionToolResultBlockParam object`
832 
833 - `type: "code_execution_tool_result"`
834 
835 - `content: CodeExecutionToolResultBlockParamContent`
836 
837 - `CodeExecutionToolResultErrorParam object`
838 
839 - `type: "code_execution_tool_result_error"`
840 
841 - `error_code: CodeExecutionToolResultErrorCode`
842 
843 - `"invalid_tool_input"`
844 
845 - `"unavailable"`
846 
847 - `"too_many_requests"`
848 
849 - `"execution_time_exceeded"`
850 
851 - `CodeExecutionResultBlockParam object`
852 
853 - `type: "code_execution_result"`
854 
855 - `content: array of CodeExecutionOutputBlockParam`
856 
857 - `type: "code_execution_output"`
858 
859 - `file_id: string`
860 
861 - `return_code: number`
862 
863 - `stderr: string`
864 
865 - `stdout: string`
866 
867 - `EncryptedCodeExecutionResultBlockParam object`
868 
869 Code execution result with encrypted stdout for PFC + web_search results.
870 
871 - `type: "encrypted_code_execution_result"`
872 
873 - `content: array of CodeExecutionOutputBlockParam`
874 
875 - `type: "code_execution_output"`
876 
877 - `file_id: string`
878 
879 - `encrypted_stdout: string`
880 
881 - `return_code: number`
882 
883 - `stderr: string`
884 
885 - `tool_use_id: string`
886 
887 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
888 
889 - `cache_control: optional CacheControlEphemeral or null`
890 
891 Create a cache control breakpoint at this content block.
892 
893 - `BashCodeExecutionToolResultBlockParam object`
894 
895 - `type: "bash_code_execution_tool_result"`
896 
897 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
898 
899 - `BashCodeExecutionToolResultErrorParam object`
900 
901 - `type: "bash_code_execution_tool_result_error"`
902 
903 - `error_code: BashCodeExecutionToolResultErrorCode`
904 
905 - `"invalid_tool_input"`
906 
907 - `"unavailable"`
908 
909 - `"too_many_requests"`
910 
911 - `"execution_time_exceeded"`
912 
913 - `"output_file_too_large"`
914 
915 - `BashCodeExecutionResultBlockParam object`
916 
917 - `type: "bash_code_execution_result"`
918 
919 - `content: array of BashCodeExecutionOutputBlockParam`
920 
921 - `type: "bash_code_execution_output"`
922 
923 - `file_id: string`
924 
925 - `return_code: number`
926 
927 - `stderr: string`
928 
929 - `stdout: string`
930 
931 - `tool_use_id: string`
932 
933 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
934 
935 - `cache_control: optional CacheControlEphemeral or null`
936 
937 Create a cache control breakpoint at this content block.
938 
939 - `TextEditorCodeExecutionToolResultBlockParam object`
940 
941 - `type: "text_editor_code_execution_tool_result"`
942 
943 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
944 
945 - `TextEditorCodeExecutionToolResultErrorParam object`
946 
947 - `type: "text_editor_code_execution_tool_result_error"`
948 
949 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
950 
951 - `"invalid_tool_input"`
952 
953 - `"unavailable"`
954 
955 - `"too_many_requests"`
956 
957 - `"execution_time_exceeded"`
958 
959 - `"file_not_found"`
960 
961 - `error_message: optional string or null`
962 
963 - `TextEditorCodeExecutionViewResultBlockParam object`
964 
965 - `type: "text_editor_code_execution_view_result"`
966 
967 - `content: string`
968 
969 - `file_type: "text" or "image" or "pdf"`
970 
971 - `"text"`
972 
973 - `"image"`
974 
975 - `"pdf"`
976 
977 - `num_lines: optional number or null`
978 
979 - `start_line: optional number or null`
980 
981 - `total_lines: optional number or null`
982 
983 - `TextEditorCodeExecutionCreateResultBlockParam object`
984 
985 - `type: "text_editor_code_execution_create_result"`
986 
987 - `is_file_update: boolean`
988 
989 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
990 
991 - `type: "text_editor_code_execution_str_replace_result"`
992 
993 - `lines: optional array of string or null`
994 
995 - `new_lines: optional number or null`
996 
997 - `new_start: optional number or null`
998 
999 - `old_lines: optional number or null`
1000 
1001 - `old_start: optional number or null`
1002 
1003 - `tool_use_id: string`
1004 
1005 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1006 
1007 - `cache_control: optional CacheControlEphemeral or null`
1008 
1009 Create a cache control breakpoint at this content block.
1010 
1011 - `ToolSearchToolResultBlockParam object`
1012 
1013 - `type: "tool_search_tool_result"`
1014 
1015 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1016 
1017 - `ToolSearchToolResultErrorParam object`
1018 
1019 - `type: "tool_search_tool_result_error"`
1020 
1021 - `error_code: ToolSearchToolResultErrorCode`
1022 
1023 - `"invalid_tool_input"`
1024 
1025 - `"unavailable"`
1026 
1027 - `"too_many_requests"`
1028 
1029 - `"execution_time_exceeded"`
1030 
1031 - `error_message: optional string or null`
1032 
1033 - `ToolSearchToolSearchResultBlockParam object`
1034 
1035 - `type: "tool_search_tool_search_result"`
1036 
1037 - `tool_references: array of ToolReferenceBlockParam`
1038 
1039 - `type: "tool_reference"`
1040 
1041 - `tool_name: string`
1042 
1043 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1044 
1045 - `cache_control: optional CacheControlEphemeral or null`
1046 
1047 Create a cache control breakpoint at this content block.
1048 
1049 - `tool_use_id: string`
1050 
1051 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1052 
1053 - `cache_control: optional CacheControlEphemeral or null`
1054 
1055 Create a cache control breakpoint at this content block.
1056 
1057 - `ContainerUploadBlockParam object`
1058 
1059 A content block that represents a file to be uploaded to the container
1060 Files uploaded via this block will be available in the container's input directory.
1061 
1062 - `type: "container_upload"`
1063 
1064 - `file_id: string`
1065 
1066 - `cache_control: optional CacheControlEphemeral or null`
1067 
1068 Create a cache control breakpoint at this content block.
1069 
1070 - `role: "user"`
1071 
1072 - `AssistantMessageParam object`
1073 
1074 - `content: MessageContentParam`
1075 
1076 - `role: "assistant"`
1077 
1078 - `SystemMessageParam object`
1079 
1080 - `content: string or array of TextBlockParam`
1081 
1082 - `string`
1083 
1084 - `Blocks = array of TextBlockParam`
1061085 
1071086 - `type: "text"`
1081087 
from line 1093
1141093 
1151094 Create a cache control breakpoint at this content block.
1161095 
117 - `type: "ephemeral"`
118 
119 - `ttl: optional "5m" or "1h"`
120 
121 The time-to-live for the cache control breakpoint.
122 
123 This may be one the following values:
124 
125 - `5m`: 5 minutes
126 - `1h`: 1 hour
127 
128 Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=http) for details.
129 
130 - `"5m"`
131 
132 - `"1h"`
133 
1341096 - `citations: optional array of TextCitationParam or null`
1351097 
136 - `CitationCharLocationParam object`
137 
138 - `type: "char_location"`
139 
140 - `cited_text: string`
141 
142 - `document_index: number`
143 
144 minimum: 0
145 
146 - `document_title: string or null`
147 
148 minLength: 1, maxLength: 500
149 
150 - `end_char_index: number`
151 
152 - `start_char_index: number`
153 
154 minimum: 0
155 
156 - `CitationPageLocationParam object`
157 
158 - `type: "page_location"`
159 
160 - `cited_text: string`
161 
162 - `document_index: number`
163 
164 minimum: 0
165 
166 - `document_title: string or null`
167 
168 minLength: 1, maxLength: 500
169 
170 - `end_page_number: number`
171 
172 - `start_page_number: number`
173 
174 minimum: 1
175 
176 - `CitationContentBlockLocationParam object`
177 
178 - `type: "content_block_location"`
179 
180 - `cited_text: string`
181 
182 The full text of the cited block range, concatenated.
183 
184 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
185 
186 - `document_index: number`
187 
188 minimum: 0
189 
190 - `document_title: string or null`
191 
192 minLength: 1, maxLength: 500
193 
194 - `end_block_index: number`
195 
196 Exclusive 0-based end index of the cited block range in the source's `content` array.
197 
198 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
199 
200 - `start_block_index: number`
201 
202 0-based index of the first cited block in the source's `content` array.
203 
204 minimum: 0
205 
206 - `CitationWebSearchResultLocationParam object`
207 
208 - `type: "web_search_result_location"`
209 
210 - `cited_text: string`
211 
212 - `encrypted_index: string`
213 
214 - `title: string or null`
215 
216 minLength: 1, maxLength: 512
217 
218 - `url: string`
219 
220 minLength: 1
221 
222 - `CitationSearchResultLocationParam object`
223 
224 - `type: "search_result_location"`
225 
226 - `cited_text: string`
227 
228 The full text of the cited block range, concatenated.
229 
230 Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
231 
232 - `end_block_index: number`
233 
234 Exclusive 0-based end index of the cited block range in the source's `content` array.
235 
236 Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
237 
238 - `search_result_index: number`
239 
240 0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
241 
242 Counted separately from `document_index`; server-side web search results are not included in this count.
243 
244 minimum: 0
245 
246 - `source: string`
247 
248 - `start_block_index: number`
249 
250 0-based index of the first cited block in the source's `content` array.
251 
252 minimum: 0
253 
254 - `title: string or null`
255 
256 - `ImageBlockParam object`
257 
258 - `type: "image"`
259 
260 - `source: Base64ImageSource or URLImageSource or FileImageSource`
261 
262 - `Base64ImageSource object`
263 
264 - `type: "base64"`
265 
266 - `data: string`
267 
268 format: byte
269 
270 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
271 
272 - `"image/jpeg"`
273 
274 - `"image/png"`
275 
276 - `"image/gif"`
277 
278 - `"image/webp"`
279 
280 - `URLImageSource object`
281 
282 - `type: "url"`
283 
284 - `url: string`
285 
286 - `FileImageSource object`
287 
288 - `type: "file"`
289 
290 - `file_id: string`
291 
292 - `cache_control: optional CacheControlEphemeral or null`
293 
294 Create a cache control breakpoint at this content block.
295 
296 - `transformations: optional ImageTransformationsParam or null`
297 
298 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.
299 
300 - `oversized_image: optional "downsize" or "error"`
301 
302 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.
303 
304 - `"downsize"`
305 
306 - `"error"`
307 
308 - `DocumentBlockParam object`
309 
310 - `type: "document"`
311 
312 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
313 
314 - `Base64PDFSource object`
315 
316 - `type: "base64"`
317 
318 - `data: string`
319 
320 format: byte
321 
322 - `media_type: "application/pdf"`
323 
324 - `PlainTextSource object`
325 
326 - `type: "text"`
327 
328 - `data: string`
329 
330 - `media_type: "text/plain"`
331 
332 - `ContentBlockSource object`
333 
334 - `type: "content"`
335 
336 - `content: string or array of ContentBlockSourceContent`
337 
338 - `string`
339 
340 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
341 
342 - `TextBlockParam object`
343 
344 - `ImageBlockParam object`
345 
346 - `URLPDFSource object`
347 
348 - `type: "url"`
349 
350 - `url: string`
351 
352 - `FileDocumentSource object`
353 
354 - `type: "file"`
355 
356 - `file_id: string`
357 
358 - `cache_control: optional CacheControlEphemeral or null`
359 
360 Create a cache control breakpoint at this content block.
361 
362 - `citations: optional CitationsConfigParam or null`
363 
364 - `enabled: optional boolean`
365 
366 - `context: optional string or null`
367 
368 minLength: 1
369 
370 - `title: optional string or null`
371 
372 minLength: 1, maxLength: 500
373 
374 - `SearchResultBlockParam object`
375 
376 - `type: "search_result"`
377 
378 - `content: array of TextBlockParam`
379 
380 - `type: "text"`
381 
382 - `text: string`
383 
384 minLength: 1
385 
386 - `cache_control: optional CacheControlEphemeral or null`
387 
388 Create a cache control breakpoint at this content block.
389 
390 - `citations: optional array of TextCitationParam or null`
391 
392 - `source: string`
393 
394 - `title: string`
395 
396 - `cache_control: optional CacheControlEphemeral or null`
397 
398 Create a cache control breakpoint at this content block.
399 
400 - `citations: optional CitationsConfigParam`
401 
402 - `ThinkingBlockParam object`
403 
404 - `type: "thinking"`
405 
406 - `signature: string`
407 
408 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.
409 
410 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
411 
412 - `thinking: string`
413 
414 The `thinking` text of this block as returned by the API.
415 
416 - `RedactedThinkingBlockParam object`
417 
418 - `type: "redacted_thinking"`
419 
420 - `data: string`
421 
422 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.
423 
424 - `ToolUseBlockParam object`
425 
426 - `type: "tool_use"`
427 
428 - `id: string`
429 
430 pattern: ^[a-zA-Z0-9_-]+$
431 
432 - `input: map[unknown]`
433 
434 - `name: string`
435 
436 minLength: 1, maxLength: 200
437 
438 - `cache_control: optional CacheControlEphemeral or null`
439 
440 Create a cache control breakpoint at this content block.
441 
442 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
443 
444 - `DirectCaller object`
445 
446 Tool invocation directly from the model.
447 
448 - `type: "direct"`
449 
450 - `ServerToolCaller object`
451 
452 Tool invocation generated by a server-side tool.
453 
454 - `type: "code_execution_20250825"`
455 
456 - `tool_id: string`
457 
458 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
459 
460 - `ServerToolCaller20260120 object`
461 
462 - `type: "code_execution_20260120"`
463 
464 - `tool_id: string`
465 
466 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
467 
468 - `toolset_name: optional string or null`
469 
470 For a toolset member tool_use, the toolset family this member belongs to.
471 
472 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
473 
474 - `ToolResultBlockParam object`
475 
476 - `type: "tool_result"`
477 
478 - `tool_use_id: string`
479 
480 pattern: ^[a-zA-Z0-9_-]+$
481 
482 - `cache_control: optional CacheControlEphemeral or null`
483 
484 Create a cache control breakpoint at this content block.
485 
486 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
487 
488 - `string`
489 
490 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
491 
492 - `TextBlockParam object`
493 
494 - `ImageBlockParam object`
495 
496 - `SearchResultBlockParam object`
497 
498 - `DocumentBlockParam object`
499 
500 - `ToolReferenceBlockParam object`
501 
502 Tool reference block that can be included in tool_result content.
503 
504 - `type: "tool_reference"`
505 
506 - `tool_name: string`
507 
508 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
509 
510 - `cache_control: optional CacheControlEphemeral or null`
511 
512 Create a cache control breakpoint at this content block.
513 
514 - `BrowserStateBlockParam object`
515 
516 The caller's browser state after a browser toolset member call —
517 the full inventory of open tabs, which tab is active, and any side
518 effects (tabs opened, download state changes) the call produced.
519 
520 At most one per `tool_result`, only on a non-error result answering a
521 browser toolset member `tool_use`. The server renders the
522 model-visible text from it; the model never sees the raw fields.
523 
524 - `type: "browser_state"`
525 
526 - `tabs: array of BrowserStateTabEntry`
527 
528 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`.
529 
530 maxItems: 100
531 
532 - `tab_id: string`
533 
534 The caller-assigned identifier for this tab, unique within the inventory.
535 
536 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
537 
538 - `title: string`
539 
540 The title of the page the tab is showing. May be empty.
541 
542 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
543 
544 - `url: string`
545 
546 The URL of the page the tab is showing. May be empty.
547 
548 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
549 
550 - `active: optional boolean`
551 
552 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
553 
554 - `cache_control: optional CacheControlEphemeral or null`
555 
556 Create a cache control breakpoint at this content block.
557 
558 - `state_changes: optional array of BrowserStateChange or null`
559 
560 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
561 
562 minItems: 1, maxItems: 200
563 
564 - `BrowserStateChangeTabOpened object`
565 
566 A tab this call's execution opened that remains open at its end —
567 the creation delta of the `tabs` inventory, not an event log.
568 
569 Carries only the `tab_id`; the tab's `title` and `url` live on its
570 `tabs` entry, which must include the same `tab_id`. A tab opened
571 during a failed call gets no deferred `tab_opened`; it simply appears
572 in the next result's `tabs` inventory.
573 
574 - `type: "tab_opened"`
575 
576 - `tab_id: string`
577 
578 The `tab_id` of the opened tab, present in `tabs`.
579 
580 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
581 
582 - `BrowserStateChangeDownloadStarted object`
583 
584 A file download that started during this call.
585 
586 - `type: "download_started"`
587 
588 - `download_id: string`
589 
590 The caller-assigned identifier for this download, stable across the state changes reporting it.
591 
592 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
593 
594 - `url: string`
595 
596 The final post-redirect URL the download was served from.
597 
598 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
599 
600 - `BrowserStateChangeDownloadCompleted object`
601 
602 A file download that finished during this call, reported with the
603 same `download_id` as its `download_started` — or without a prior
604 `download_started`, when the download finished during the call that
605 started it (at most one state change per `download_id` per result).
606 
607 - `type: "download_completed"`
608 
609 - `download_id: string`
610 
611 The caller-assigned identifier for this download, stable across the state changes reporting it.
612 
613 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
614 
615 - `url: string`
616 
617 The final post-redirect URL the download was served from.
618 
619 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
620 
621 - `path: optional string or null`
622 
623 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
624 
625 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
626 
627 - `size_bytes: optional number or null`
628 
629 The completed download's size.
630 
631 minimum: 0
632 
633 - `BrowserStateChangeDownloadFailed object`
634 
635 A file download that failed — or was cancelled — during this call.
636 
637 - `type: "download_failed"`
638 
639 - `download_id: string`
640 
641 The caller-assigned identifier for this download, stable across the state changes reporting it.
642 
643 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
644 
645 - `url: string`
646 
647 The final post-redirect URL the download was served from.
648 
649 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
650 
651 - `error: optional string or null`
652 
653 The failure or cancellation detail, when known.
654 
655 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
656 
657 - `is_error: optional boolean`
658 
659 - `toolset_name: optional string or null`
660 
661 For a toolset member tool_result, the toolset family of the paired tool_use.
662 
663 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
664 
665 - `ServerToolUseBlockParam object`
666 
667 - `type: "server_tool_use"`
668 
669 - `id: string`
670 
671 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
672 
673 - `input: map[unknown]`
674 
675 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
676 
677 - `"web_search"`
678 
679 - `"web_fetch"`
680 
681 - `"code_execution"`
682 
683 - `"bash_code_execution"`
684 
685 - `"text_editor_code_execution"`
686 
687 - `"tool_search_tool_regex"`
688 
689 - `"tool_search_tool_bm25"`
690 
691 - `cache_control: optional CacheControlEphemeral or null`
692 
693 Create a cache control breakpoint at this content block.
694 
695 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
696 
697 - `DirectCaller object`
698 
699 Tool invocation directly from the model.
700 
701 - `ServerToolCaller object`
702 
703 Tool invocation generated by a server-side tool.
704 
705 - `ServerToolCaller20260120 object`
706 
707 - `WebSearchToolResultBlockParam object`
708 
709 - `type: "web_search_tool_result"`
710 
711 - `content: WebSearchToolResultBlockParamContent`
712 
713 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
714 
715 - `type: "web_search_result"`
716 
717 - `encrypted_content: string`
718 
719 - `title: string`
720 
721 - `url: string`
722 
723 - `page_age: optional string or null`
724 
725 - `WebSearchToolRequestError object`
726 
727 - `type: "web_search_tool_result_error"`
728 
729 - `error_code: WebSearchToolResultErrorCode`
730 
731 - `"invalid_tool_input"`
732 
733 - `"unavailable"`
734 
735 - `"max_uses_exceeded"`
736 
737 - `"too_many_requests"`
738 
739 - `"query_too_long"`
740 
741 - `"request_too_large"`
742 
743 - `tool_use_id: string`
744 
745 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
746 
747 - `cache_control: optional CacheControlEphemeral or null`
748 
749 Create a cache control breakpoint at this content block.
750 
751 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
752 
753 - `DirectCaller object`
754 
755 Tool invocation directly from the model.
756 
757 - `ServerToolCaller object`
758 
759 Tool invocation generated by a server-side tool.
760 
761 - `ServerToolCaller20260120 object`
762 
763 - `WebFetchToolResultBlockParam object`
764 
765 - `type: "web_fetch_tool_result"`
766 
767 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
768 
769 - `WebFetchToolResultErrorBlockParam object`
770 
771 - `type: "web_fetch_tool_result_error"`
772 
773 - `error_code: WebFetchToolResultErrorCode`
774 
775 - `"invalid_tool_input"`
776 
777 - `"url_too_long"`
778 
779 - `"url_not_allowed"`
780 
781 - `"url_not_in_prior_context"`
782 
783 - `"url_not_accessible"`
784 
785 - `"unsupported_content_type"`
786 
787 - `"too_many_requests"`
788 
789 - `"max_uses_exceeded"`
790 
791 - `"unavailable"`
792 
793 - `"content_too_large"`
794 
795 - `WebFetchBlockParam object`
796 
797 - `type: "web_fetch_result"`
798 
799 - `content: DocumentBlockParam`
800 
801 - `url: string`
802 
803 Fetched content URL
804 
805 - `retrieved_at: optional string or null`
806 
807 ISO 8601 timestamp when the content was retrieved
808 
809 - `tool_use_id: string`
810 
811 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
812 
813 - `cache_control: optional CacheControlEphemeral or null`
814 
815 Create a cache control breakpoint at this content block.
816 
817 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
818 
819 - `DirectCaller object`
820 
821 Tool invocation directly from the model.
822 
823 - `ServerToolCaller object`
824 
825 Tool invocation generated by a server-side tool.
826 
827 - `ServerToolCaller20260120 object`
828 
829 - `CodeExecutionToolResultBlockParam object`
830 
831 - `type: "code_execution_tool_result"`
832 
833 - `content: CodeExecutionToolResultBlockParamContent`
834 
835 - `CodeExecutionToolResultErrorParam object`
836 
837 - `type: "code_execution_tool_result_error"`
838 
839 - `error_code: CodeExecutionToolResultErrorCode`
840 
841 - `"invalid_tool_input"`
842 
843 - `"unavailable"`
844 
845 - `"too_many_requests"`
846 
847 - `"execution_time_exceeded"`
848 
849 - `CodeExecutionResultBlockParam object`
850 
851 - `type: "code_execution_result"`
852 
853 - `content: array of CodeExecutionOutputBlockParam`
854 
855 - `type: "code_execution_output"`
856 
857 - `file_id: string`
858 
859 - `return_code: number`
860 
861 - `stderr: string`
862 
863 - `stdout: string`
864 
865 - `EncryptedCodeExecutionResultBlockParam object`
866 
867 Code execution result with encrypted stdout for PFC + web_search results.
868 
869 - `type: "encrypted_code_execution_result"`
870 
871 - `content: array of CodeExecutionOutputBlockParam`
872 
873 - `type: "code_execution_output"`
874 
875 - `file_id: string`
876 
877 - `encrypted_stdout: string`
878 
879 - `return_code: number`
880 
881 - `stderr: string`
882 
883 - `tool_use_id: string`
884 
885 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
886 
887 - `cache_control: optional CacheControlEphemeral or null`
888 
889 Create a cache control breakpoint at this content block.
890 
891 - `BashCodeExecutionToolResultBlockParam object`
892 
893 - `type: "bash_code_execution_tool_result"`
894 
895 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
896 
897 - `BashCodeExecutionToolResultErrorParam object`
898 
899 - `type: "bash_code_execution_tool_result_error"`
900 
901 - `error_code: BashCodeExecutionToolResultErrorCode`
902 
903 - `"invalid_tool_input"`
904 
905 - `"unavailable"`
906 
907 - `"too_many_requests"`
908 
909 - `"execution_time_exceeded"`
910 
911 - `"output_file_too_large"`
912 
913 - `BashCodeExecutionResultBlockParam object`
914 
915 - `type: "bash_code_execution_result"`
916 
917 - `content: array of BashCodeExecutionOutputBlockParam`
918 
919 - `type: "bash_code_execution_output"`
920 
921 - `file_id: string`
922 
923 - `return_code: number`
924 
925 - `stderr: string`
926 
927 - `stdout: string`
928 
929 - `tool_use_id: string`
930 
931 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
932 
933 - `cache_control: optional CacheControlEphemeral or null`
934 
935 Create a cache control breakpoint at this content block.
936 
937 - `TextEditorCodeExecutionToolResultBlockParam object`
938 
939 - `type: "text_editor_code_execution_tool_result"`
940 
941 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
942 
943 - `TextEditorCodeExecutionToolResultErrorParam object`
944 
945 - `type: "text_editor_code_execution_tool_result_error"`
946 
947 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
948 
949 - `"invalid_tool_input"`
950 
951 - `"unavailable"`
952 
953 - `"too_many_requests"`
954 
955 - `"execution_time_exceeded"`
956 
957 - `"file_not_found"`
958 
959 - `error_message: optional string or null`
960 
961 - `TextEditorCodeExecutionViewResultBlockParam object`
962 
963 - `type: "text_editor_code_execution_view_result"`
964 
965 - `content: string`
966 
967 - `file_type: "text" or "image" or "pdf"`
968 
969 - `"text"`
970 
971 - `"image"`
972 
973 - `"pdf"`
974 
975 - `num_lines: optional number or null`
976 
977 - `start_line: optional number or null`
978 
979 - `total_lines: optional number or null`
980 
981 - `TextEditorCodeExecutionCreateResultBlockParam object`
982 
983 - `type: "text_editor_code_execution_create_result"`
984 
985 - `is_file_update: boolean`
986 
987 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
988 
989 - `type: "text_editor_code_execution_str_replace_result"`
990 
991 - `lines: optional array of string or null`
992 
993 - `new_lines: optional number or null`
994 
995 - `new_start: optional number or null`
996 
997 - `old_lines: optional number or null`
998 
999 - `old_start: optional number or null`
1000 
1001 - `tool_use_id: string`
1002 
1003 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1004 
1005 - `cache_control: optional CacheControlEphemeral or null`
1006 
1007 Create a cache control breakpoint at this content block.
1008 
1009 - `ToolSearchToolResultBlockParam object`
1010 
1011 - `type: "tool_search_tool_result"`
1012 
1013 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1014 
1015 - `ToolSearchToolResultErrorParam object`
1016 
1017 - `type: "tool_search_tool_result_error"`
1018 
1019 - `error_code: ToolSearchToolResultErrorCode`
1020 
1021 - `"invalid_tool_input"`
1022 
1023 - `"unavailable"`
1024 
1025 - `"too_many_requests"`
1026 
1027 - `"execution_time_exceeded"`
1028 
1029 - `error_message: optional string or null`
1030 
1031 - `ToolSearchToolSearchResultBlockParam object`
1032 
1033 - `type: "tool_search_tool_search_result"`
1034 
1035 - `tool_references: array of ToolReferenceBlockParam`
1036 
1037 - `type: "tool_reference"`
1038 
1039 - `tool_name: string`
1040 
1041 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
1042 
1043 - `cache_control: optional CacheControlEphemeral or null`
1044 
1045 Create a cache control breakpoint at this content block.
1046 
1047 - `tool_use_id: string`
1048 
1049 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1050 
1051 - `cache_control: optional CacheControlEphemeral or null`
1052 
1053 Create a cache control breakpoint at this content block.
1054 
1055 - `ContainerUploadBlockParam object`
1056 
1057 A content block that represents a file to be uploaded to the container
1058 Files uploaded via this block will be available in the container's input directory.
1059 
1060 - `type: "container_upload"`
1061 
1062 - `file_id: string`
1063 
1064 - `cache_control: optional CacheControlEphemeral or null`
1065 
1066 Create a cache control breakpoint at this content block.
1067 
1068 - `role: "user" or "assistant" or "system"`
1069 
1070 - `"user"`
1071 
1072 - `"assistant"`
1073 
1074 - `"system"`
1098 - `role: "system"`
10751099 
10761100- `model: Model`
10771101 
from line 3083
30593083 
30603084 When true, guarantees schema validation on tool names and inputs
30613085 
3062- `temperature: optional number`
3063 
3064 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
3065 
3066 Amount of randomness injected into the response.
3067 
3068 Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
3069 
3070 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
3071 
3072 minimum: 0, maximum: 1
3073 
3074- `top_k: optional number`
3075 
3076 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
3077 
3078 Only sample from the top K options for each subsequent token.
3079 
3080 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
3081 
3082 Recommended for advanced use cases only.
3083 
3084 minimum: 0
3085 
3086- `top_p: optional number`
3087 
3088 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
3089 
3090 Use nucleus sampling.
3091 
3092 In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`.
3093 
3094 Recommended for advanced use cases only.
3095 
3096 minimum: 0, maximum: 1
3097 
30983086## Returns
30993087 
31003088- `Message object`
from line 4432
44444432```bash
44454433curl https://api.anthropic.com/v1/messages \
44464434 -H 'Content-Type: application/json' \
4447 -H 'anthropic-version: 2023-06-01' \
4448 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
4435 -H 'anthropic-version: 2026-10-21' \
4436 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
44494437 --max-time 600 \
44504438 -d '{
44514439 "max_tokens": 1024,
from line 4451
44634451 "type": "text"
44644452 }
44654453 ],
4466 "temperature": 1,
44674454 "thinking": {
44684455 "type": "adaptive"
44694456 },
from line 4468
44814468 },
44824469 "name": "name"
44834470 }
4484 ],
4485 "top_k": 5,
4486 "top_p": 0.7
4471 ]
44874472 }'
44884473```
44894474 
44904475 

api/models Changed · +4 / -228 lines

from line 57
5757 
5858 Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
5959 
60- `"anthropic-beta": optional array of AnthropicBeta`
61 
62 **Deprecated**: Deprecated. This parameter will be removed from this method in a future release. To use beta features, call the beta models methods (`client.beta.models`) instead.
63 
64 Optional header to specify the beta version(s) you want to use.
65 
66 - `string`
67 
68 - `"message-batches-2024-09-24"`
69 
70 - `"prompt-caching-2024-07-31"`
71 
72 - `"computer-use-2024-10-22"`
73 
74 - `"computer-use-2025-01-24"`
75 
76 - `"pdfs-2024-09-25"`
77 
78 - `"token-counting-2024-11-01"`
79 
80 - `"token-efficient-tools-2025-02-19"`
81 
82 - `"output-128k-2025-02-19"`
83 
84 - `"files-api-2025-04-14"`
85 
86 - `"mcp-client-2025-04-04"`
87 
88 - `"mcp-client-2025-11-20"`
89 
90 - `"dev-full-thinking-2025-05-14"`
91 
92 - `"interleaved-thinking-2025-05-14"`
93 
94 - `"code-execution-2025-05-22"`
95 
96 - `"extended-cache-ttl-2025-04-11"`
97 
98 - `"context-1m-2025-08-07"`
99 
100 - `"context-management-2025-06-27"`
101 
102 - `"model-context-window-exceeded-2025-08-26"`
103 
104 - `"skills-2025-10-02"`
105 
106 - `"fast-mode-2026-02-01"`
107 
108 - `"output-300k-2026-03-24"`
109 
110 - `"user-profiles-2026-03-24"`
111 
112 - `"user-profiles-2026-08-18"`
113 
114 - `"user-profiles-2026-09-04"`
115 
116 - `"advisor-tool-2026-03-01"`
117 
118 - `"managed-agents-2026-04-01"`
119 
120 - `"cache-diagnosis-2026-04-07"`
121 
122 - `"dreaming-2026-04-21"`
123 
124 - `"thinking-token-count-2026-05-13"`
125 
126 - `"server-side-fallback-2026-06-01"`
127 
128 - `"server-side-fallback-2026-07-01"`
129 
130 - `"fallback-credit-2026-06-01"`
131 
132 - `"fallback-credit-2026-07-01"`
133 
134 - `"agent-memory-2026-07-22"`
135 
136 - `"mid-conversation-tool-changes-2026-07-01"`
137 
138 - `"compact-2026-01-12"`
139 
140 - `"computer-use-2025-11-24"`
141 
142 - `"mcp-tunnels-2026-06-22"`
143 
144 - `"structured-outputs-2025-11-13"`
145 
146 - `"task-budgets-2026-03-13"`
147 
148 - `"thinking-display-updates-2026-08-18"`
149 
150 - `"ce-user-management-2026-07-13"`
151 
152 - `"mid-conversation-output-config-2026-07-01"`
153 
154 - `"thinking-binding-controls-2026-08-01"`
155 
156 - `"mid-conversation-system-clear-at-2026-08-21"`
157 
158 - `"compact-2026-09-04"`
159 
160 - `"inline-tools-2026-09-15"`
161 
162 - `"mcp-client-2026-09-15"`
163 
164 - `"ce-plugins-2026-09-01"`
165 
166 - `"spend-limit-reads-2026-09-26"`
167 
168 - `"telemetry-destinations-2026-08-11"`
169 
170 - `"webhooks-2026-10-07"`
171 
17260### Returns
17361 
17462- `data: array of ModelInfo`
from line 273
385273 
386274```bash
387275curl https://api.anthropic.com/v1/models \
388 -H 'anthropic-version: 2023-06-01' \
389 -H "X-Api-Key: $ANTHROPIC_API_KEY"
276 -H 'anthropic-version: 2026-10-21' \
277 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
390278```
391279 
392280#### Response (200)
from line 405
517405 
518406 Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
519407 
520- `"anthropic-beta": optional array of AnthropicBeta`
521 
522 **Deprecated**: Deprecated. This parameter will be removed from this method in a future release. To use beta features, call the beta models methods (`client.beta.models`) instead.
523 
524 Optional header to specify the beta version(s) you want to use.
525 
526 - `string`
527 
528 - `"message-batches-2024-09-24"`
529 
530 - `"prompt-caching-2024-07-31"`
531 
532 - `"computer-use-2024-10-22"`
533 
534 - `"computer-use-2025-01-24"`
535 
536 - `"pdfs-2024-09-25"`
537 
538 - `"token-counting-2024-11-01"`
539 
540 - `"token-efficient-tools-2025-02-19"`
541 
542 - `"output-128k-2025-02-19"`
543 
544 - `"files-api-2025-04-14"`
545 
546 - `"mcp-client-2025-04-04"`
547 
548 - `"mcp-client-2025-11-20"`
549 
550 - `"dev-full-thinking-2025-05-14"`
551 
552 - `"interleaved-thinking-2025-05-14"`
553 
554 - `"code-execution-2025-05-22"`
555 
556 - `"extended-cache-ttl-2025-04-11"`
557 
558 - `"context-1m-2025-08-07"`
559 
560 - `"context-management-2025-06-27"`
561 
562 - `"model-context-window-exceeded-2025-08-26"`
563 
564 - `"skills-2025-10-02"`
565 
566 - `"fast-mode-2026-02-01"`
567 
568 - `"output-300k-2026-03-24"`
569 
570 - `"user-profiles-2026-03-24"`
571 
572 - `"user-profiles-2026-08-18"`
573 
574 - `"user-profiles-2026-09-04"`
575 
576 - `"advisor-tool-2026-03-01"`
577 
578 - `"managed-agents-2026-04-01"`
579 
580 - `"cache-diagnosis-2026-04-07"`
581 
582 - `"dreaming-2026-04-21"`
583 
584 - `"thinking-token-count-2026-05-13"`
585 
586 - `"server-side-fallback-2026-06-01"`
587 
588 - `"server-side-fallback-2026-07-01"`
589 
590 - `"fallback-credit-2026-06-01"`
591 
592 - `"fallback-credit-2026-07-01"`
593 
594 - `"agent-memory-2026-07-22"`
595 
596 - `"mid-conversation-tool-changes-2026-07-01"`
597 
598 - `"compact-2026-01-12"`
599 
600 - `"computer-use-2025-11-24"`
601 
602 - `"mcp-tunnels-2026-06-22"`
603 
604 - `"structured-outputs-2025-11-13"`
605 
606 - `"task-budgets-2026-03-13"`
607 
608 - `"thinking-display-updates-2026-08-18"`
609 
610 - `"ce-user-management-2026-07-13"`
611 
612 - `"mid-conversation-output-config-2026-07-01"`
613 
614 - `"thinking-binding-controls-2026-08-01"`
615 
616 - `"mid-conversation-system-clear-at-2026-08-21"`
617 
618 - `"compact-2026-09-04"`
619 
620 - `"inline-tools-2026-09-15"`
621 
622 - `"mcp-client-2026-09-15"`
623 
624 - `"ce-plugins-2026-09-01"`
625 
626 - `"spend-limit-reads-2026-09-26"`
627 
628 - `"telemetry-destinations-2026-08-11"`
629 
630 - `"webhooks-2026-10-07"`
631 
632408### Returns
633409 
634410- `ModelInfo object`
from line 609
833609 
834610```bash
835611curl https://api.anthropic.com/v1/models/$MODEL_ID \
836 -H 'anthropic-version: 2023-06-01' \
837 -H "X-Api-Key: $ANTHROPIC_API_KEY"
612 -H 'anthropic-version: 2026-10-21' \
613 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
838614```
839615 
840616#### Response (200)

api/models/list Changed · +2 / -114 lines

from line 55
5555 
5656 Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
5757 
58- `"anthropic-beta": optional array of AnthropicBeta`
59 
60 **Deprecated**: Deprecated. This parameter will be removed from this method in a future release. To use beta features, call the beta models methods (`client.beta.models`) instead.
61 
62 Optional header to specify the beta version(s) you want to use.
63 
64 - `string`
65 
66 - `"message-batches-2024-09-24"`
67 
68 - `"prompt-caching-2024-07-31"`
69 
70 - `"computer-use-2024-10-22"`
71 
72 - `"computer-use-2025-01-24"`
73 
74 - `"pdfs-2024-09-25"`
75 
76 - `"token-counting-2024-11-01"`
77 
78 - `"token-efficient-tools-2025-02-19"`
79 
80 - `"output-128k-2025-02-19"`
81 
82 - `"files-api-2025-04-14"`
83 
84 - `"mcp-client-2025-04-04"`
85 
86 - `"mcp-client-2025-11-20"`
87 
88 - `"dev-full-thinking-2025-05-14"`
89 
90 - `"interleaved-thinking-2025-05-14"`
91 
92 - `"code-execution-2025-05-22"`
93 
94 - `"extended-cache-ttl-2025-04-11"`
95 
96 - `"context-1m-2025-08-07"`
97 
98 - `"context-management-2025-06-27"`
99 
100 - `"model-context-window-exceeded-2025-08-26"`
101 
102 - `"skills-2025-10-02"`
103 
104 - `"fast-mode-2026-02-01"`
105 
106 - `"output-300k-2026-03-24"`
107 
108 - `"user-profiles-2026-03-24"`
109 
110 - `"user-profiles-2026-08-18"`
111 
112 - `"user-profiles-2026-09-04"`
113 
114 - `"advisor-tool-2026-03-01"`
115 
116 - `"managed-agents-2026-04-01"`
117 
118 - `"cache-diagnosis-2026-04-07"`
119 
120 - `"dreaming-2026-04-21"`
121 
122 - `"thinking-token-count-2026-05-13"`
123 
124 - `"server-side-fallback-2026-06-01"`
125 
126 - `"server-side-fallback-2026-07-01"`
127 
128 - `"fallback-credit-2026-06-01"`
129 
130 - `"fallback-credit-2026-07-01"`
131 
132 - `"agent-memory-2026-07-22"`
133 
134 - `"mid-conversation-tool-changes-2026-07-01"`
135 
136 - `"compact-2026-01-12"`
137 
138 - `"computer-use-2025-11-24"`
139 
140 - `"mcp-tunnels-2026-06-22"`
141 
142 - `"structured-outputs-2025-11-13"`
143 
144 - `"task-budgets-2026-03-13"`
145 
146 - `"thinking-display-updates-2026-08-18"`
147 
148 - `"ce-user-management-2026-07-13"`
149 
150 - `"mid-conversation-output-config-2026-07-01"`
151 
152 - `"thinking-binding-controls-2026-08-01"`
153 
154 - `"mid-conversation-system-clear-at-2026-08-21"`
155 
156 - `"compact-2026-09-04"`
157 
158 - `"inline-tools-2026-09-15"`
159 
160 - `"mcp-client-2026-09-15"`
161 
162 - `"ce-plugins-2026-09-01"`
163 
164 - `"spend-limit-reads-2026-09-26"`
165 
166 - `"telemetry-destinations-2026-08-11"`
167 
168 - `"webhooks-2026-10-07"`
169 
17058## Returns
17159 
17260- `data: array of ModelInfo`
from line 271
383271 
384272```bash
385273curl https://api.anthropic.com/v1/models \
386 -H 'anthropic-version: 2023-06-01' \
387 -H "X-Api-Key: $ANTHROPIC_API_KEY"
274 -H 'anthropic-version: 2026-10-21' \
275 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
388276```
389277 
390278### Response (200)

api/models/retrieve Changed · +2 / -114 lines

from line 31
3131 
3232 Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
3333 
34- `"anthropic-beta": optional array of AnthropicBeta`
35 
36 **Deprecated**: Deprecated. This parameter will be removed from this method in a future release. To use beta features, call the beta models methods (`client.beta.models`) instead.
37 
38 Optional header to specify the beta version(s) you want to use.
39 
40 - `string`
41 
42 - `"message-batches-2024-09-24"`
43 
44 - `"prompt-caching-2024-07-31"`
45 
46 - `"computer-use-2024-10-22"`
47 
48 - `"computer-use-2025-01-24"`
49 
50 - `"pdfs-2024-09-25"`
51 
52 - `"token-counting-2024-11-01"`
53 
54 - `"token-efficient-tools-2025-02-19"`
55 
56 - `"output-128k-2025-02-19"`
57 
58 - `"files-api-2025-04-14"`
59 
60 - `"mcp-client-2025-04-04"`
61 
62 - `"mcp-client-2025-11-20"`
63 
64 - `"dev-full-thinking-2025-05-14"`
65 
66 - `"interleaved-thinking-2025-05-14"`
67 
68 - `"code-execution-2025-05-22"`
69 
70 - `"extended-cache-ttl-2025-04-11"`
71 
72 - `"context-1m-2025-08-07"`
73 
74 - `"context-management-2025-06-27"`
75 
76 - `"model-context-window-exceeded-2025-08-26"`
77 
78 - `"skills-2025-10-02"`
79 
80 - `"fast-mode-2026-02-01"`
81 
82 - `"output-300k-2026-03-24"`
83 
84 - `"user-profiles-2026-03-24"`
85 
86 - `"user-profiles-2026-08-18"`
87 
88 - `"user-profiles-2026-09-04"`
89 
90 - `"advisor-tool-2026-03-01"`
91 
92 - `"managed-agents-2026-04-01"`
93 
94 - `"cache-diagnosis-2026-04-07"`
95 
96 - `"dreaming-2026-04-21"`
97 
98 - `"thinking-token-count-2026-05-13"`
99 
100 - `"server-side-fallback-2026-06-01"`
101 
102 - `"server-side-fallback-2026-07-01"`
103 
104 - `"fallback-credit-2026-06-01"`
105 
106 - `"fallback-credit-2026-07-01"`
107 
108 - `"agent-memory-2026-07-22"`
109 
110 - `"mid-conversation-tool-changes-2026-07-01"`
111 
112 - `"compact-2026-01-12"`
113 
114 - `"computer-use-2025-11-24"`
115 
116 - `"mcp-tunnels-2026-06-22"`
117 
118 - `"structured-outputs-2025-11-13"`
119 
120 - `"task-budgets-2026-03-13"`
121 
122 - `"thinking-display-updates-2026-08-18"`
123 
124 - `"ce-user-management-2026-07-13"`
125 
126 - `"mid-conversation-output-config-2026-07-01"`
127 
128 - `"thinking-binding-controls-2026-08-01"`
129 
130 - `"mid-conversation-system-clear-at-2026-08-21"`
131 
132 - `"compact-2026-09-04"`
133 
134 - `"inline-tools-2026-09-15"`
135 
136 - `"mcp-client-2026-09-15"`
137 
138 - `"ce-plugins-2026-09-01"`
139 
140 - `"spend-limit-reads-2026-09-26"`
141 
142 - `"telemetry-destinations-2026-08-11"`
143 
144 - `"webhooks-2026-10-07"`
145 
14634## Returns
14735 
14836- `ModelInfo object`
from line 235
347235 
348236```bash
349237curl https://api.anthropic.com/v1/models/$MODEL_ID \
350 -H 'anthropic-version: 2023-06-01' \
351 -H "X-Api-Key: $ANTHROPIC_API_KEY"
238 -H 'anthropic-version: 2026-10-21' \
239 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
352240```
353241 
354242### Response (200)

api/opentelemetry/spans Changed · +3 / -3 lines

from line 140
140140| `anthropic.usage.compaction.input_tokens` | `int` | Input tokens of the request's [compactions](https://platform.claude.com/docs/en/build-with-claude/compaction), including cache reads and writes. Not part of `gen_ai.usage.input_tokens`. Absent when the response has no compaction. |
141141| `anthropic.usage.compaction.output_tokens` | `int` | Output tokens of the request's compactions. Not part of `gen_ai.usage.output_tokens`. Absent when the response has no compaction. |
142142| `gen_ai.request.max_tokens` | `int` | The request's [`max_tokens`](https://platform.claude.com/docs/en/api/messages/create#create.max_tokens). |
143| `gen_ai.request.temperature` | `double` | The request's [`temperature`](https://platform.claude.com/docs/en/api/messages/create#create.temperature). Absent when the request doesn't set it. |
144| `gen_ai.request.top_p` | `double` | The request's [`top_p`](https://platform.claude.com/docs/en/api/messages/create#create.top_p). Absent when the request doesn't set it. |
145| `gen_ai.request.top_k` | `int` | The request's [`top_k`](https://platform.claude.com/docs/en/api/messages/create#create.top_k). Absent when the request doesn't set it. |
143| `gen_ai.request.temperature` | `double` | The request's [`temperature`](https://platform.claude.com/docs/en/api/messages/create?version=2023-06-01#create.temperature). Absent when the request doesn't set it. |
144| `gen_ai.request.top_p` | `double` | The request's [`top_p`](https://platform.claude.com/docs/en/api/messages/create?version=2023-06-01#create.top_p). Absent when the request doesn't set it. |
145| `gen_ai.request.top_k` | `int` | The request's [`top_k`](https://platform.claude.com/docs/en/api/messages/create?version=2023-06-01#create.top_k). Absent when the request doesn't set it. |
146146| `gen_ai.request.stream` | `boolean` | `true` when the request sets [`stream: true`](https://platform.claude.com/docs/en/api/messages/create#create.stream). Absent otherwise. |
147147| `gen_ai.request.reasoning.level` | `string` | The [`effort`](https://platform.claude.com/docs/en/api/messages/create#create.output_config.effort) in the request's [`output_config`](https://platform.claude.com/docs/en/api/messages/create#create.output_config). Absent when the request doesn't set it. |
148148| `gen_ai.output.type` | `string` | `json` when the request sets the output format to JSON. Absent otherwise. |

api/organization Changed · +130 / -208 lines

from line 45
4545 
4646```bash
4747curl https://api.anthropic.com/v1/organizations/me \
48 -H 'anthropic-version: 2023-06-01' \
49 -H "X-Api-Key: $ANTHROPIC_API_KEY"
48 -H 'anthropic-version: 2026-10-21' \
49 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
5050```
5151 
5252#### Response (200)
from line 263
263263 
264264 - `workspace_id: string`
265265 
266 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
266 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
267267 
268268 - `status: "active" or "archived" or "expired" or "inactive"`
269269 
from line 277
277277 
278278 - `"inactive"`
279279 
280 - `workspace_id: string or null`
281 
282 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
283 
284 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
285 
286280- `first_id: string or null`
287281 
288282 First ID in the `data` list. Can be used as the `before_id` for the previous page.
from line 293
299293 
300294```bash
301295curl https://api.anthropic.com/v1/organizations/api_keys \
302 -H 'anthropic-version: 2023-06-01' \
303 -H "X-Api-Key: $ANTHROPIC_API_KEY"
296 -H 'anthropic-version: 2026-10-21' \
297 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
304298```
305299 
306300##### Response (200)
from line 321
327321 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
328322 },
329323 "status": "active",
330 "type": "api_key",
331 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
324 "type": "api_key"
332325 }
333326 ],
334327 "first_id": "first_id",
from line 454
461454 
462455 - `workspace_id: string`
463456 
464 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
457 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
465458 
466459 - `status: "active" or "archived" or "expired" or "inactive"`
467460 
from line 468
475468 
476469 - `"inactive"`
477470 
478 - `workspace_id: string or null`
479 
480 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
481 
482 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
483 
484471#### Example
485472 
486473```bash
487474curl https://api.anthropic.com/v1/organizations/api_keys/$API_KEY_ID \
488 -H 'anthropic-version: 2023-06-01' \
489 -H "X-Api-Key: $ANTHROPIC_API_KEY"
475 -H 'anthropic-version: 2026-10-21' \
476 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
490477```
491478 
492479##### Response (200)
from line 498
511498 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
512499 },
513500 "status": "active",
514 "type": "api_key",
515 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
501 "type": "api_key"
516502}
517503```
518504 
from line 644
658644 
659645 - `workspace_id: string`
660646 
661 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
647 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
662648 
663649 - `status: "active" or "archived" or "expired" or "inactive"`
664650 
from line 658
672658 
673659 - `"inactive"`
674660 
675 - `workspace_id: string or null`
676 
677 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
678 
679 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
680 
681661#### Example
682662 
683663```bash
684664curl https://api.anthropic.com/v1/organizations/api_keys/$API_KEY_ID \
685665 -H 'Content-Type: application/json' \
686 -H 'anthropic-version: 2023-06-01' \
687 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
666 -H 'anthropic-version: 2026-10-21' \
667 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
688668 -d '{}'
689669```
690670 
from line 690
710690 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
711691 },
712692 "status": "active",
713 "type": "api_key",
714 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
693 "type": "api_key"
715694}
716695```
717696 
from line 883
904883```bash
905884curl https://api.anthropic.com/v1/organizations/external_keys \
906885 -H 'Content-Type: application/json' \
907 -H 'anthropic-version: 2023-06-01' \
908 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
886 -H 'anthropic-version: 2026-10-21' \
887 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
909888 -d '{
910889 "provider_config": {
911890 "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
from line 1048
10691048 
10701049```bash
10711050curl https://api.anthropic.com/v1/organizations/external_keys \
1072 -H 'anthropic-version: 2023-06-01' \
1073 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1051 -H 'anthropic-version: 2026-10-21' \
1052 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
10741053```
10751054 
10761055##### Response (200)
from line 1207
12281207 
12291208```bash
12301209curl https://api.anthropic.com/v1/organizations/external_keys/$EXTERNAL_KEY_ID \
1231 -H 'anthropic-version: 2023-06-01' \
1232 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1210 -H 'anthropic-version: 2026-10-21' \
1211 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
12331212```
12341213 
12351214##### Response (200)
from line 1432
14531432```bash
14541433curl https://api.anthropic.com/v1/organizations/external_keys/$EXTERNAL_KEY_ID \
14551434 -H 'Content-Type: application/json' \
1456 -H 'anthropic-version: 2023-06-01' \
1457 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
1435 -H 'anthropic-version: 2026-10-21' \
1436 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
14581437 -d '{}'
14591438```
14601439 
from line 1498
15191498```bash
15201499curl https://api.anthropic.com/v1/organizations/external_keys/$EXTERNAL_KEY_ID \
15211500 -X DELETE \
1522 -H 'anthropic-version: 2023-06-01' \
1523 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1501 -H 'anthropic-version: 2026-10-21' \
1502 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
15241503```
15251504 
15261505##### Response (200)
from line 1561
15821561```bash
15831562curl https://api.anthropic.com/v1/organizations/external_keys/$EXTERNAL_KEY_ID/validate \
15841563 -X POST \
1585 -H 'anthropic-version: 2023-06-01' \
1586 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1564 -H 'anthropic-version: 2026-10-21' \
1565 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
15871566```
15881567 
15891568##### Response (200)
from line 1821
18421821```bash
18431822curl https://api.anthropic.com/v1/organizations/federation_issuers \
18441823 -H 'Content-Type: application/json' \
1845 -H 'anthropic-version: 2023-06-01' \
1846 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
1824 -H 'anthropic-version: 2026-10-21' \
1825 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
18471826 -d '{
18481827 "issuer_url": "x",
18491828 "name": "x"
from line 2037
20582037 
20592038```bash
20602039curl https://api.anthropic.com/v1/organizations/federation_issuers \
2061 -H 'anthropic-version: 2023-06-01' \
2062 -H "X-Api-Key: $ANTHROPIC_API_KEY"
2040 -H 'anthropic-version: 2026-10-21' \
2041 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
20632042```
20642043 
20652044##### Response (200)
from line 2241
22622241 
22632242```bash
22642243curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID \
2265 -H 'anthropic-version: 2023-06-01' \
2266 -H "X-Api-Key: $ANTHROPIC_API_KEY"
2244 -H 'anthropic-version: 2026-10-21' \
2245 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
22672246```
22682247 
22692248##### Response (200)
from line 2526
25472526```bash
25482527curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID \
25492528 -H 'Content-Type: application/json' \
2550 -H 'anthropic-version: 2023-06-01' \
2551 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
2529 -H 'anthropic-version: 2026-10-21' \
2530 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
25522531 -d '{}'
25532532```
25542533 
from line 2732
27532732```bash
27542733curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID/archive \
27552734 -X POST \
2756 -H 'anthropic-version: 2023-06-01' \
2757 -H "X-Api-Key: $ANTHROPIC_API_KEY"
2735 -H 'anthropic-version: 2026-10-21' \
2736 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
27582737```
27592738 
27602739##### Response (200)
from line 3018
30393018```bash
30403019curl https://api.anthropic.com/v1/organizations/federation_rules \
30413020 -H 'Content-Type: application/json' \
3042 -H 'anthropic-version: 2023-06-01' \
3043 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
3021 -H 'anthropic-version: 2026-10-21' \
3022 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
30443023 -d '{
30453024 "issuer_id": "issuer_id",
30463025 "match": {},
from line 3245
32663245 
32673246```bash
32683247curl https://api.anthropic.com/v1/organizations/federation_rules \
3269 -H 'anthropic-version: 2023-06-01' \
3270 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3248 -H 'anthropic-version: 2026-10-21' \
3249 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
32713250```
32723251 
32733252##### Response (200)
from line 3455
34763455 
34773456```bash
34783457curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID \
3479 -H 'anthropic-version: 2023-06-01' \
3480 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3458 -H 'anthropic-version: 2026-10-21' \
3459 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
34813460```
34823461 
34833462##### Response (200)
from line 3755
37763755```bash
37773756curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID \
37783757 -H 'Content-Type: application/json' \
3779 -H 'anthropic-version: 2023-06-01' \
3780 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
3758 -H 'anthropic-version: 2026-10-21' \
3759 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
37813760 -d '{}'
37823761```
37833762 
from line 3970
39913970```bash
39923971curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/archive \
39933972 -X POST \
3994 -H 'anthropic-version: 2023-06-01' \
3995 -H "X-Api-Key: $ANTHROPIC_API_KEY"
3973 -H 'anthropic-version: 2026-10-21' \
3974 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
39963975```
39973976 
39983977##### Response (200)
from line 4090
41114090```bash
41124091curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces \
41134092 -H 'Content-Type: application/json' \
4114 -H 'anthropic-version: 2023-06-01' \
4115 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
4093 -H 'anthropic-version: 2026-10-21' \
4094 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
41164095 -d '{
41174096 "workspace_id": "workspace_id"
41184097 }'
from line 4188
42094188 
42104189```bash
42114190curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces \
4212 -H 'anthropic-version: 2023-06-01' \
4213 -H "X-Api-Key: $ANTHROPIC_API_KEY"
4191 -H 'anthropic-version: 2026-10-21' \
4192 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
42144193```
42154194 
42164195##### Response (200)
from line 4260
42814260```bash
42824261curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces/$WORKSPACE_ID \
42834262 -X DELETE \
4284 -H 'anthropic-version: 2023-06-01' \
4285 -H "X-Api-Key: $ANTHROPIC_API_KEY"
4263 -H 'anthropic-version: 2026-10-21' \
4264 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
42864265```
42874266 
42884267##### Response (200)
from line 4403
44244403```bash
44254404curl https://api.anthropic.com/v1/organizations/invites \
44264405 -H 'Content-Type: application/json' \
4427 -H 'anthropic-version: 2023-06-01' \
4428 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
4406 -H 'anthropic-version: 2026-10-21' \
4407 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
44294408 -d '{
44304409 "email": "[email protected]",
44314410 "role": "user"
from line 4575
45964575 
45974576```bash
45984577curl https://api.anthropic.com/v1/organizations/invites \
4599 -H 'anthropic-version: 2023-06-01' \
4600 -H "X-Api-Key: $ANTHROPIC_API_KEY"
4578 -H 'anthropic-version: 2026-10-21' \
4579 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
46014580```
46024581 
46034582##### Response (200)
from line 4704
47254704 
47264705```bash
47274706curl https://api.anthropic.com/v1/organizations/invites/$INVITE_ID \
4728 -H 'anthropic-version: 2023-06-01' \
4729 -H "X-Api-Key: $ANTHROPIC_API_KEY"
4707 -H 'anthropic-version: 2026-10-21' \
4708 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
47304709```
47314710 
47324711##### Response (200)
from line 4765
47864765```bash
47874766curl https://api.anthropic.com/v1/organizations/invites/$INVITE_ID \
47884767 -X DELETE \
4789 -H 'anthropic-version: 2023-06-01' \
4790 -H "X-Api-Key: $ANTHROPIC_API_KEY"
4768 -H 'anthropic-version: 2026-10-21' \
4769 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
47914770```
47924771 
47934772##### Response (200)
from line 4894
49154894```bash
49164895curl https://api.anthropic.com/v1/organizations/service_accounts \
49174896 -H 'Content-Type: application/json' \
4918 -H 'anthropic-version: 2023-06-01' \
4919 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
4897 -H 'anthropic-version: 2026-10-21' \
4898 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
49204899 -d '{
49214900 "name": "ci-deploy-bot"
49224901 }'
from line 5023
50445023 
50455024```bash
50465025curl https://api.anthropic.com/v1/organizations/service_accounts \
5047 -H 'anthropic-version: 2023-06-01' \
5048 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5026 -H 'anthropic-version: 2026-10-21' \
5027 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
50495028```
50505029 
50515030##### Response (200)
from line 5139
51605139 
51615140```bash
51625141curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID \
5163 -H 'anthropic-version: 2023-06-01' \
5164 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5142 -H 'anthropic-version: 2026-10-21' \
5143 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
51655144```
51665145 
51675146##### Response (200)
from line 5272
52935272```bash
52945273curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID \
52955274 -H 'Content-Type: application/json' \
5296 -H 'anthropic-version: 2023-06-01' \
5297 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
5275 -H 'anthropic-version: 2026-10-21' \
5276 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
52985277 -d '{}'
52995278```
53005279 
from line 5390
54115390```bash
54125391curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/archive \
54135392 -X POST \
5414 -H 'anthropic-version: 2023-06-01' \
5415 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5393 -H 'anthropic-version: 2026-10-21' \
5394 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
54165395```
54175396 
54185397##### Response (200)
from line 5504
55255504```bash
55265505curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces \
55275506 -H 'Content-Type: application/json' \
5528 -H 'anthropic-version: 2023-06-01' \
5529 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
5507 -H 'anthropic-version: 2026-10-21' \
5508 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
55305509 -d '{
55315510 "workspace_id": "workspace_id",
55325511 "workspace_role": "workspace_admin"
from line 5619
56405619 
56415620```bash
56425621curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces \
5643 -H 'anthropic-version: 2023-06-01' \
5644 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5622 -H 'anthropic-version: 2026-10-21' \
5623 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
56455624```
56465625 
56475626##### Response (200)
from line 5694
57155694```bash
57165695curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces/$WORKSPACE_ID \
57175696 -X DELETE \
5718 -H 'anthropic-version: 2023-06-01' \
5719 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5697 -H 'anthropic-version: 2026-10-21' \
5698 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
57205699```
57215700 
57225701##### Response (200)
from line 5822
58435822 
58445823```bash
58455824curl https://api.anthropic.com/v1/organizations/users \
5846 -H 'anthropic-version: 2023-06-01' \
5847 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5825 -H 'anthropic-version: 2026-10-21' \
5826 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
58485827```
58495828 
58505829##### Response (200)
from line 5922
59435922 
59445923```bash
59455924curl https://api.anthropic.com/v1/organizations/users/$USER_ID \
5946 -H 'anthropic-version: 2023-06-01' \
5947 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5925 -H 'anthropic-version: 2026-10-21' \
5926 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
59485927```
59495928 
59505929##### Response (200)
from line 6034
60556034```bash
60566035curl https://api.anthropic.com/v1/organizations/users/$USER_ID \
60576036 -H 'Content-Type: application/json' \
6058 -H 'anthropic-version: 2023-06-01' \
6059 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
6037 -H 'anthropic-version: 2026-10-21' \
6038 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
60606039 -d '{
60616040 "role": "user"
60626041 }'
from line 6093
61146093```bash
61156094curl https://api.anthropic.com/v1/organizations/users/$USER_ID \
61166095 -X DELETE \
6117 -H 'anthropic-version: 2023-06-01' \
6118 -H "X-Api-Key: $ANTHROPIC_API_KEY"
6096 -H 'anthropic-version: 2026-10-21' \
6097 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
61196098```
61206099 
61216100##### Response (200)
from line 6264
62856264 
62866265```bash
62876266curl https://api.anthropic.com/v1/organizations/workspaces \
6288 -H 'anthropic-version: 2023-06-01' \
6289 -H "X-Api-Key: $ANTHROPIC_API_KEY"
6267 -H 'anthropic-version: 2026-10-21' \
6268 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
62906269```
62916270 
62926271##### Response (200)
from line 6474
64956474```bash
64966475curl https://api.anthropic.com/v1/organizations/workspaces \
64976476 -H 'Content-Type: application/json' \
6498 -H 'anthropic-version: 2023-06-01' \
6499 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
6477 -H 'anthropic-version: 2026-10-21' \
6478 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
65006479 -d '{
65016480 "name": "x",
65026481 "display_color": "#6C5BB9",
from line 6631
66526631 
66536632```bash
66546633curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID \
6655 -H 'anthropic-version: 2023-06-01' \
6656 -H "X-Api-Key: $ANTHROPIC_API_KEY"
6634 -H 'anthropic-version: 2026-10-21' \
6635 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
66576636```
66586637 
66596638##### Response (200)
from line 6834
68556834```bash
68566835curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID \
68576836 -H 'Content-Type: application/json' \
6858 -H 'anthropic-version: 2023-06-01' \
6859 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
6837 -H 'anthropic-version: 2026-10-21' \
6838 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
68606839 -d '{
68616840 "display_color": "#6C5BB9",
68626841 "external_key_id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
from line 6989
70106989```bash
70116990curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/archive \
70126991 -X POST \
7013 -H 'anthropic-version: 2023-06-01' \
7014 -H "X-Api-Key: $ANTHROPIC_API_KEY"
6992 -H 'anthropic-version: 2026-10-21' \
6993 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
70156994```
70166995 
70176996##### Response (200)
from line 7099
71207099 
71217100 - `group: OrganizationRateLimitModelGroup or OrganizationRateLimitBatchGroup or OrganizationRateLimitTokenCountGroup or 3 more`
71227101 
7123 The rate-limit group this entry's limits apply to. Its `type` equals `group_type`.
7102 The rate-limit group this entry's limits apply to.
71247103 
71257104 - `OrganizationRateLimitModelGroup object`
71267105 
from line 7215
72367215 
72377216 - `models: array of string or null`
72387217 
7239 Model names this entry's limits apply to, including aliases. `null` when `group_type` is not `"model_group"`.
7218 Model names this entry's limits apply to, including aliases. `null` when `group.type` is not `"model_group"`.
72407219 
72417220 - `rate_limit_id: string`
72427221 
from line 7225
72467225 
72477226 ID of the Workspace this entry applies to.
72487227 
7249 - `group_type: "batch" or "files" or "model_group" or 3 more`
7250 
7251 **Deprecated**: Use `group.type` instead. `group_type` is still returned and always equals `group.type`.
7252 
7253 Deprecated: use `group.type` instead. The kind of rate-limit group this entry represents. `model_group` entries apply to a family of models (listed in `models`); other values apply to an API-surface category and have `models` set to `null`. Always equal to `group.type`.
7254 
7255 - `"batch"`
7256 
7257 - `"files"`
7258 
7259 - `"model_group"`
7260 
7261 - `"skills"`
7262 
7263 - `"token_count"`
7264 
7265 - `"web_search"`
7266 
72677228- `next_page: string or null`
72687229 
72697230 Opaque cursor for the next page of results, or `null` when no entries remain beyond this response.
from line 7233
72727233 
72737234```bash
72747235curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/rate_limits \
7275 -H 'anthropic-version: 2023-06-01' \
7276 -H "X-Api-Key: $ANTHROPIC_API_KEY"
7236 -H 'anthropic-version: 2026-10-21' \
7237 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
72777238```
72787239 
72797240##### Response (200)
from line 7248
72877248 "display_name": "display_name",
72887249 "type": "model_group"
72897250 },
7290 "group_type": "batch",
72917251 "limits": [
72927252 {
72937253 "org_limit": 0,
from line 7352
73927352 
73937353 - `group: OrganizationRateLimitModelGroup or OrganizationRateLimitBatchGroup or OrganizationRateLimitTokenCountGroup or 3 more`
73947354 
7395 The rate-limit group this entry's limits apply to. Its `type` equals `group_type`.
7355 The rate-limit group this entry's limits apply to.
73967356 
73977357 - `OrganizationRateLimitModelGroup object`
73987358 
from line 7468
75087468 
75097469 - `models: array of string or null`
75107470 
7511 Model names this entry's limits apply to, including aliases. `null` when `group_type` is not `"model_group"`.
7471 Model names this entry's limits apply to, including aliases. `null` when `group.type` is not `"model_group"`.
75127472 
75137473 - `rate_limit_id: string`
75147474 
from line 7478
75187478 
75197479 ID of the Workspace this entry applies to.
75207480 
7521 - `group_type: "batch" or "files" or "model_group" or 3 more`
7522 
7523 **Deprecated**: Use `group.type` instead. `group_type` is still returned and always equals `group.type`.
7524 
7525 Deprecated: use `group.type` instead. The kind of rate-limit group this entry represents. `model_group` entries apply to a family of models (listed in `models`); other values apply to an API-surface category and have `models` set to `null`. Always equal to `group.type`.
7526 
7527 - `"batch"`
7528 
7529 - `"files"`
7530 
7531 - `"model_group"`
7532 
7533 - `"skills"`
7534 
7535 - `"token_count"`
7536 
7537 - `"web_search"`
7538 
75397481#### Example
75407482 
75417483```bash
75427484curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/rate_limits/$RATE_LIMIT_ID \
75437485 -H 'Content-Type: application/json' \
7544 -H 'anthropic-version: 2023-06-01' \
7545 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
7486 -H 'anthropic-version: 2026-10-21' \
7487 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
75467488 -d '{
75477489 "limits": [
75487490 {
from line 7504
75627504 "display_name": "display_name",
75637505 "type": "model_group"
75647506 },
7565 "group_type": "batch",
75667507 "limits": [
75677508 {
75687509 "org_limit": 0,
from line 7613
76727613 
76737614```bash
76747615curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members \
7675 -H 'anthropic-version: 2023-06-01' \
7676 -H "X-Api-Key: $ANTHROPIC_API_KEY"
7616 -H 'anthropic-version: 2026-10-21' \
7617 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
76777618```
76787619 
76797620##### Response (200)
from line 7712
77717712```bash
77727713curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members \
77737714 -H 'Content-Type: application/json' \
7774 -H 'anthropic-version: 2023-06-01' \
7775 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
7715 -H 'anthropic-version: 2026-10-21' \
7716 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
77767717 -d '{
77777718 "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
77787719 "workspace_role": "workspace_admin"
from line 7793
78527793 
78537794```bash
78547795curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members/$USER_ID \
7855 -H 'anthropic-version: 2023-06-01' \
7856 -H "X-Api-Key: $ANTHROPIC_API_KEY"
7796 -H 'anthropic-version: 2026-10-21' \
7797 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
78577798```
78587799 
78597800##### Response (200)
from line 7887
79467887```bash
79477888curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members/$USER_ID \
79487889 -H 'Content-Type: application/json' \
7949 -H 'anthropic-version: 2023-06-01' \
7950 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
7890 -H 'anthropic-version: 2026-10-21' \
7891 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
79517892 -d '{
79527893 "workspace_role": "workspace_admin"
79537894 }'
from line 7952
80117952```bash
80127953curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members/$USER_ID \
80137954 -X DELETE \
8014 -H 'anthropic-version: 2023-06-01' \
8015 -H "X-Api-Key: $ANTHROPIC_API_KEY"
7955 -H 'anthropic-version: 2026-10-21' \
7956 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
80167957```
80177958 
80187959##### Response (200)
from line 8055
81148055 
81158056```bash
81168057curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/service_accounts \
8117 -H 'anthropic-version: 2023-06-01' \
8118 -H "X-Api-Key: $ANTHROPIC_API_KEY"
8058 -H 'anthropic-version: 2026-10-21' \
8059 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
81198060```
81208061 
81218062##### Response (200)
from line 8169
82288169```bash
82298170curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/service_accounts \
82308171 -H 'Content-Type: application/json' \
8231 -H 'anthropic-version: 2023-06-01' \
8232 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
8172 -H 'anthropic-version: 2026-10-21' \
8173 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
82338174 -d '{
82348175 "service_account_id": "service_account_id",
82358176 "workspace_role": "workspace_admin"
from line 8265
83248265 
83258266```bash
83268267curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/service_accounts/$SERVICE_ACCOUNT_ID \
8327 -H 'anthropic-version: 2023-06-01' \
8328 -H "X-Api-Key: $ANTHROPIC_API_KEY"
8268 -H 'anthropic-version: 2026-10-21' \
8269 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
83298270```
83308271 
83318272##### Response (200)
from line 8372
84318372```bash
84328373curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/service_accounts/$SERVICE_ACCOUNT_ID \
84338374 -H 'Content-Type: application/json' \
8434 -H 'anthropic-version: 2023-06-01' \
8435 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
8375 -H 'anthropic-version: 2026-10-21' \
8376 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
84368377 -d '{
84378378 "workspace_role": "workspace_admin"
84388379 }'
from line 8443
85028443```bash
85038444curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/service_accounts/$SERVICE_ACCOUNT_ID \
85048445 -X DELETE \
8505 -H 'anthropic-version: 2023-06-01' \
8506 -H "X-Api-Key: $ANTHROPIC_API_KEY"
8446 -H 'anthropic-version: 2026-10-21' \
8447 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
85078448```
85088449 
85098450##### Response (200)
from line 8533
85928533 
85938534 - `group: OrganizationRateLimitModelGroup or OrganizationRateLimitBatchGroup or OrganizationRateLimitTokenCountGroup or 3 more`
85948535 
8595 The rate-limit group this entry's limits apply to. Its `type` equals `group_type`.
8536 The rate-limit group this entry's limits apply to.
85968537 
85978538 - `OrganizationRateLimitModelGroup object`
85988539 
from line 8625
86848625 
86858626 - `models: array of string or null`
86868627 
8687 Model names this entry's limits apply to, including aliases. `null` when `group_type` is not `"model_group"`.
8628 Model names this entry's limits apply to, including aliases. `null` when `group.type` is not `"model_group"`.
86888629 
8689 - `group_type: "batch" or "files" or "model_group" or 3 more`
8690 
8691 **Deprecated**: Use `group.type` instead. `group_type` is still returned and always equals `group.type`.
8692 
8693 Deprecated: use `group.type` instead. The kind of rate-limit group this entry represents. `model_group` entries apply to a family of models (listed in `models`); other values apply to an API-surface category and have `models` set to `null`. Always equal to `group.type`.
8694 
8695 - `"batch"`
8696 
8697 - `"files"`
8698 
8699 - `"model_group"`
8700 
8701 - `"skills"`
8702 
8703 - `"token_count"`
8704 
8705 - `"web_search"`
8706 
87078630- `next_page: string or null`
87088631 
87098632 Opaque cursor for the next page of results, or `null` when no entries remain beyond this response.
from line 8635
87128635 
87138636```bash
87148637curl https://api.anthropic.com/v1/organizations/rate_limits \
8715 -H 'anthropic-version: 2023-06-01' \
8716 -H "X-Api-Key: $ANTHROPIC_API_KEY"
8638 -H 'anthropic-version: 2026-10-21' \
8639 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
87178640```
87188641 
87198642##### Response (200)
from line 8651
87288651 "display_name": "display_name",
87298652 "type": "model_group"
87308653 },
8731 "group_type": "batch",
87328654 "limits": [
87338655 {
87348656 "type": "type",
from line 8716
87948716 
87958717```bash
87968718curl https://api.anthropic.com/v1/organizations/compliance_settings \
8797 -H 'anthropic-version: 2023-06-01' \
8798 -H "X-Api-Key: $ANTHROPIC_API_KEY"
8719 -H 'anthropic-version: 2026-10-21' \
8720 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
87998721```
88008722 
88018723##### Response (200)
from line 8801
88798801```bash
88808802curl https://api.anthropic.com/v1/organizations/compliance_settings \
88818803 -H 'Content-Type: application/json' \
8882 -H 'anthropic-version: 2023-06-01' \
8883 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
8804 -H 'anthropic-version: 2026-10-21' \
8805 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
88848806 -d '{
88858807 "state": {
88868808 "type": "enabled"

api/organization/api_keys Changed · +14 / -41 lines

from line 161
161161 
162162 - `workspace_id: string`
163163 
164 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
164 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
165165 
166166 - `status: "active" or "archived" or "expired" or "inactive"`
167167 
from line 175
175175 
176176 - `"inactive"`
177177 
178 - `workspace_id: string or null`
179 
180 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
181 
182 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
183 
184178- `first_id: string or null`
185179 
186180 First ID in the `data` list. Can be used as the `before_id` for the previous page.
from line 191
197191 
198192```bash
199193curl https://api.anthropic.com/v1/organizations/api_keys \
200 -H 'anthropic-version: 2023-06-01' \
201 -H "X-Api-Key: $ANTHROPIC_API_KEY"
194 -H 'anthropic-version: 2026-10-21' \
195 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
202196```
203197 
204198#### Response (200)
from line 219
225219 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
226220 },
227221 "status": "active",
228 "type": "api_key",
229 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
222 "type": "api_key"
230223 }
231224 ],
232225 "first_id": "first_id",
from line 352
359352 
360353 - `workspace_id: string`
361354 
362 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
355 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
363356 
364357 - `status: "active" or "archived" or "expired" or "inactive"`
365358 
from line 366
373366 
374367 - `"inactive"`
375368 
376 - `workspace_id: string or null`
377 
378 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
379 
380 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
381 
382369### Example
383370 
384371```bash
385372curl https://api.anthropic.com/v1/organizations/api_keys/$API_KEY_ID \
386 -H 'anthropic-version: 2023-06-01' \
387 -H "X-Api-Key: $ANTHROPIC_API_KEY"
373 -H 'anthropic-version: 2026-10-21' \
374 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
388375```
389376 
390377#### Response (200)
from line 396
409396 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
410397 },
411398 "status": "active",
412 "type": "api_key",
413 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
399 "type": "api_key"
414400}
415401```
416402 
from line 542
556542 
557543 - `workspace_id: string`
558544 
559 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
545 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
560546 
561547 - `status: "active" or "archived" or "expired" or "inactive"`
562548 
from line 556
570556 
571557 - `"inactive"`
572558 
573 - `workspace_id: string or null`
574 
575 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
576 
577 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
578 
579559### Example
580560 
581561```bash
582562curl https://api.anthropic.com/v1/organizations/api_keys/$API_KEY_ID \
583563 -H 'Content-Type: application/json' \
584 -H 'anthropic-version: 2023-06-01' \
585 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
564 -H 'anthropic-version: 2026-10-21' \
565 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
586566 -d '{}'
587567```
588568 
from line 588
608588 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
609589 },
610590 "status": "active",
611 "type": "api_key",
612 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
591 "type": "api_key"
613592}
614593```
615594 
from line 698
719698 
720699 - `workspace_id: string`
721700 
722 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
701 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
723702 
724703 - `status: "active" or "archived" or "expired" or "inactive"`
725704 
from line 712
733712 
734713 - `"inactive"`
735714 
736 - `workspace_id: string or null`
737 
738 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
739 
740 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
741 
742715### API Key Created By
743716 
744717- `APIKeyCreatedBy object`
from line 778
805778 
806779 - `workspace_id: string`
807780 
808 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
781 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
809782 

api/organization/api_keys/list Changed · +4 / -11 lines

from line 159
159159 
160160 - `workspace_id: string`
161161 
162 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
162 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
163163 
164164 - `status: "active" or "archived" or "expired" or "inactive"`
165165 
from line 173
173173 
174174 - `"inactive"`
175175 
176 - `workspace_id: string or null`
177 
178 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
179 
180 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
181 
182176- `first_id: string or null`
183177 
184178 First ID in the `data` list. Can be used as the `before_id` for the previous page.
from line 189
195189 
196190```bash
197191curl https://api.anthropic.com/v1/organizations/api_keys \
198 -H 'anthropic-version: 2023-06-01' \
199 -H "X-Api-Key: $ANTHROPIC_API_KEY"
192 -H 'anthropic-version: 2026-10-21' \
193 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
200194```
201195 
202196### Response (200)
from line 217
223217 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
224218 },
225219 "status": "active",
226 "type": "api_key",
227 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
220 "type": "api_key"
228221 }
229222 ],
230223 "first_id": "first_id",

api/organization/api_keys/retrieve Changed · +4 / -11 lines

from line 127
127127 
128128 - `workspace_id: string`
129129 
130 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
130 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
131131 
132132 - `status: "active" or "archived" or "expired" or "inactive"`
133133 
from line 141
141141 
142142 - `"inactive"`
143143 
144 - `workspace_id: string or null`
145 
146 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
147 
148 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
149 
150144## Example
151145 
152146```bash
153147curl https://api.anthropic.com/v1/organizations/api_keys/$API_KEY_ID \
154 -H 'anthropic-version: 2023-06-01' \
155 -H "X-Api-Key: $ANTHROPIC_API_KEY"
148 -H 'anthropic-version: 2026-10-21' \
149 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
156150```
157151 
158152### Response (200)
from line 171
177171 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
178172 },
179173 "status": "active",
180 "type": "api_key",
181 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
174 "type": "api_key"
182175}
183176```
184177 

api/organization/api_keys/update Changed · +4 / -11 lines

from line 145
145145 
146146 - `workspace_id: string`
147147 
148 ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.
148 ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
149149 
150150 - `status: "active" or "archived" or "expired" or "inactive"`
151151 
from line 159
159159 
160160 - `"inactive"`
161161 
162 - `workspace_id: string or null`
163 
164 **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.
165 
166 Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.
167 
168162## Example
169163 
170164```bash
171165curl https://api.anthropic.com/v1/organizations/api_keys/$API_KEY_ID \
172166 -H 'Content-Type: application/json' \
173 -H 'anthropic-version: 2023-06-01' \
174 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
167 -H 'anthropic-version: 2026-10-21' \
168 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
175169 -d '{}'
176170```
177171 
from line 191
197191 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
198192 },
199193 "status": "active",
200 "type": "api_key",
201 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
194 "type": "api_key"
202195}
203196```
204197 

api/organization/compliance_settings Changed · +4 / -4 lines

from line 52
5252 
5353```bash
5454curl https://api.anthropic.com/v1/organizations/compliance_settings \
55 -H 'anthropic-version: 2023-06-01' \
56 -H "X-Api-Key: $ANTHROPIC_API_KEY"
55 -H 'anthropic-version: 2026-10-21' \
56 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
5757```
5858 
5959#### Response (200)
from line 137
137137```bash
138138curl https://api.anthropic.com/v1/organizations/compliance_settings \
139139 -H 'Content-Type: application/json' \
140 -H 'anthropic-version: 2023-06-01' \
141 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
140 -H 'anthropic-version: 2026-10-21' \
141 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
142142 -d '{
143143 "state": {
144144 "type": "enabled"

api/organization/external_keys Changed · +12 / -12 lines

from line 192
192192```bash
193193curl https://api.anthropic.com/v1/organizations/external_keys \
194194 -H 'Content-Type: application/json' \
195 -H 'anthropic-version: 2023-06-01' \
196 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
195 -H 'anthropic-version: 2026-10-21' \
196 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
197197 -d '{
198198 "provider_config": {
199199 "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
from line 357
357357 
358358```bash
359359curl https://api.anthropic.com/v1/organizations/external_keys \
360 -H 'anthropic-version: 2023-06-01' \
361 -H "X-Api-Key: $ANTHROPIC_API_KEY"
360 -H 'anthropic-version: 2026-10-21' \
361 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
362362```
363363 
364364#### Response (200)
from line 516
516516 
517517```bash
518518curl https://api.anthropic.com/v1/organizations/external_keys/$EXTERNAL_KEY_ID \
519 -H 'anthropic-version: 2023-06-01' \
520 -H "X-Api-Key: $ANTHROPIC_API_KEY"
519 -H 'anthropic-version: 2026-10-21' \
520 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
521521```
522522 
523523#### Response (200)
from line 741
741741```bash
742742curl https://api.anthropic.com/v1/organizations/external_keys/$EXTERNAL_KEY_ID \
743743 -H 'Content-Type: application/json' \
744 -H 'anthropic-version: 2023-06-01' \
745 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
744 -H 'anthropic-version: 2026-10-21' \
745 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
746746 -d '{}'
747747```
748748 
from line 807
807807```bash
808808curl https://api.anthropic.com/v1/organizations/external_keys/$EXTERNAL_KEY_ID \
809809 -X DELETE \
810 -H 'anthropic-version: 2023-06-01' \
811 -H "X-Api-Key: $ANTHROPIC_API_KEY"
810 -H 'anthropic-version: 2026-10-21' \
811 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
812812```
813813 
814814#### Response (200)
from line 870
870870```bash
871871curl https://api.anthropic.com/v1/organizations/external_keys/$EXTERNAL_KEY_ID/validate \
872872 -X POST \
873 -H 'anthropic-version: 2023-06-01' \
874 -H "X-Api-Key: $ANTHROPIC_API_KEY"
873 -H 'anthropic-version: 2026-10-21' \
874 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
875875```
876876 
877877#### Response (200)

api/organization/federation Changed · +26 / -26 lines

from line 251
251251```bash
252252curl https://api.anthropic.com/v1/organizations/federation_issuers \
253253 -H 'Content-Type: application/json' \
254 -H 'anthropic-version: 2023-06-01' \
255 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
254 -H 'anthropic-version: 2026-10-21' \
255 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
256256 -d '{
257257 "issuer_url": "x",
258258 "name": "x"
from line 467
467467 
468468```bash
469469curl https://api.anthropic.com/v1/organizations/federation_issuers \
470 -H 'anthropic-version: 2023-06-01' \
471 -H "X-Api-Key: $ANTHROPIC_API_KEY"
470 -H 'anthropic-version: 2026-10-21' \
471 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
472472```
473473 
474474##### Response (200)
from line 671
671671 
672672```bash
673673curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID \
674 -H 'anthropic-version: 2023-06-01' \
675 -H "X-Api-Key: $ANTHROPIC_API_KEY"
674 -H 'anthropic-version: 2026-10-21' \
675 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
676676```
677677 
678678##### Response (200)
from line 956
956956```bash
957957curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID \
958958 -H 'Content-Type: application/json' \
959 -H 'anthropic-version: 2023-06-01' \
960 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
959 -H 'anthropic-version: 2026-10-21' \
960 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
961961 -d '{}'
962962```
963963 
from line 1162
11621162```bash
11631163curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID/archive \
11641164 -X POST \
1165 -H 'anthropic-version: 2023-06-01' \
1166 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1165 -H 'anthropic-version: 2026-10-21' \
1166 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
11671167```
11681168 
11691169##### Response (200)
from line 1448
14481448```bash
14491449curl https://api.anthropic.com/v1/organizations/federation_rules \
14501450 -H 'Content-Type: application/json' \
1451 -H 'anthropic-version: 2023-06-01' \
1452 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
1451 -H 'anthropic-version: 2026-10-21' \
1452 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
14531453 -d '{
14541454 "issuer_id": "issuer_id",
14551455 "match": {},
from line 1675
16751675 
16761676```bash
16771677curl https://api.anthropic.com/v1/organizations/federation_rules \
1678 -H 'anthropic-version: 2023-06-01' \
1679 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1678 -H 'anthropic-version: 2026-10-21' \
1679 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
16801680```
16811681 
16821682##### Response (200)
from line 1885
18851885 
18861886```bash
18871887curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID \
1888 -H 'anthropic-version: 2023-06-01' \
1889 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1888 -H 'anthropic-version: 2026-10-21' \
1889 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
18901890```
18911891 
18921892##### Response (200)
from line 2185
21852185```bash
21862186curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID \
21872187 -H 'Content-Type: application/json' \
2188 -H 'anthropic-version: 2023-06-01' \
2189 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
2188 -H 'anthropic-version: 2026-10-21' \
2189 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
21902190 -d '{}'
21912191```
21922192 
from line 2400
24002400```bash
24012401curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/archive \
24022402 -X POST \
2403 -H 'anthropic-version: 2023-06-01' \
2404 -H "X-Api-Key: $ANTHROPIC_API_KEY"
2403 -H 'anthropic-version: 2026-10-21' \
2404 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
24052405```
24062406 
24072407##### Response (200)
from line 2520
25202520```bash
25212521curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces \
25222522 -H 'Content-Type: application/json' \
2523 -H 'anthropic-version: 2023-06-01' \
2524 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
2523 -H 'anthropic-version: 2026-10-21' \
2524 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
25252525 -d '{
25262526 "workspace_id": "workspace_id"
25272527 }'
from line 2618
26182618 
26192619```bash
26202620curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces \
2621 -H 'anthropic-version: 2023-06-01' \
2622 -H "X-Api-Key: $ANTHROPIC_API_KEY"
2621 -H 'anthropic-version: 2026-10-21' \
2622 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
26232623```
26242624 
26252625##### Response (200)
from line 2690
26902690```bash
26912691curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces/$WORKSPACE_ID \
26922692 -X DELETE \
2693 -H 'anthropic-version: 2023-06-01' \
2694 -H "X-Api-Key: $ANTHROPIC_API_KEY"
2693 -H 'anthropic-version: 2026-10-21' \
2694 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
26952695```
26962696 
26972697##### Response (200)

api/organization/federation/issuers Changed · +10 / -10 lines

from line 249
249249```bash
250250curl https://api.anthropic.com/v1/organizations/federation_issuers \
251251 -H 'Content-Type: application/json' \
252 -H 'anthropic-version: 2023-06-01' \
253 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
252 -H 'anthropic-version: 2026-10-21' \
253 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
254254 -d '{
255255 "issuer_url": "x",
256256 "name": "x"
from line 465
465465 
466466```bash
467467curl https://api.anthropic.com/v1/organizations/federation_issuers \
468 -H 'anthropic-version: 2023-06-01' \
469 -H "X-Api-Key: $ANTHROPIC_API_KEY"
468 -H 'anthropic-version: 2026-10-21' \
469 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
470470```
471471 
472472#### Response (200)
from line 669
669669 
670670```bash
671671curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID \
672 -H 'anthropic-version: 2023-06-01' \
673 -H "X-Api-Key: $ANTHROPIC_API_KEY"
672 -H 'anthropic-version: 2026-10-21' \
673 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
674674```
675675 
676676#### Response (200)
from line 954
954954```bash
955955curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID \
956956 -H 'Content-Type: application/json' \
957 -H 'anthropic-version: 2023-06-01' \
958 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
957 -H 'anthropic-version: 2026-10-21' \
958 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
959959 -d '{}'
960960```
961961 
from line 1160
11601160```bash
11611161curl https://api.anthropic.com/v1/organizations/federation_issuers/$FEDERATION_ISSUER_ID/archive \
11621162 -X POST \
1163 -H 'anthropic-version: 2023-06-01' \
1164 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1163 -H 'anthropic-version: 2026-10-21' \
1164 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
11651165```
11661166 
11671167#### Response (200)

api/organization/federation/rules Changed · +16 / -16 lines

from line 255
255255```bash
256256curl https://api.anthropic.com/v1/organizations/federation_rules \
257257 -H 'Content-Type: application/json' \
258 -H 'anthropic-version: 2023-06-01' \
259 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
258 -H 'anthropic-version: 2026-10-21' \
259 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
260260 -d '{
261261 "issuer_id": "issuer_id",
262262 "match": {},
from line 482
482482 
483483```bash
484484curl https://api.anthropic.com/v1/organizations/federation_rules \
485 -H 'anthropic-version: 2023-06-01' \
486 -H "X-Api-Key: $ANTHROPIC_API_KEY"
485 -H 'anthropic-version: 2026-10-21' \
486 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
487487```
488488 
489489#### Response (200)
from line 692
692692 
693693```bash
694694curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID \
695 -H 'anthropic-version: 2023-06-01' \
696 -H "X-Api-Key: $ANTHROPIC_API_KEY"
695 -H 'anthropic-version: 2026-10-21' \
696 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
697697```
698698 
699699#### Response (200)
from line 992
992992```bash
993993curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID \
994994 -H 'Content-Type: application/json' \
995 -H 'anthropic-version: 2023-06-01' \
996 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
995 -H 'anthropic-version: 2026-10-21' \
996 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
997997 -d '{}'
998998```
999999 
from line 1207
12071207```bash
12081208curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/archive \
12091209 -X POST \
1210 -H 'anthropic-version: 2023-06-01' \
1211 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1210 -H 'anthropic-version: 2026-10-21' \
1211 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
12121212```
12131213 
12141214#### Response (200)
from line 1540
15401540```bash
15411541curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces \
15421542 -H 'Content-Type: application/json' \
1543 -H 'anthropic-version: 2023-06-01' \
1544 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
1543 -H 'anthropic-version: 2026-10-21' \
1544 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
15451545 -d '{
15461546 "workspace_id": "workspace_id"
15471547 }'
from line 1638
16381638 
16391639```bash
16401640curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces \
1641 -H 'anthropic-version: 2023-06-01' \
1642 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1641 -H 'anthropic-version: 2026-10-21' \
1642 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
16431643```
16441644 
16451645##### Response (200)
from line 1710
17101710```bash
17111711curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces/$WORKSPACE_ID \
17121712 -X DELETE \
1713 -H 'anthropic-version: 2023-06-01' \
1714 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1713 -H 'anthropic-version: 2026-10-21' \
1714 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
17151715```
17161716 
17171717##### Response (200)

api/organization/federation/rules/workspaces Changed · +6 / -6 lines

from line 77
7777```bash
7878curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces \
7979 -H 'Content-Type: application/json' \
80 -H 'anthropic-version: 2023-06-01' \
81 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
80 -H 'anthropic-version: 2026-10-21' \
81 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
8282 -d '{
8383 "workspace_id": "workspace_id"
8484 }'
from line 175
175175 
176176```bash
177177curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces \
178 -H 'anthropic-version: 2023-06-01' \
179 -H "X-Api-Key: $ANTHROPIC_API_KEY"
178 -H 'anthropic-version: 2026-10-21' \
179 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
180180```
181181 
182182#### Response (200)
from line 247
247247```bash
248248curl https://api.anthropic.com/v1/organizations/federation_rules/$FEDERATION_RULE_ID/workspaces/$WORKSPACE_ID \
249249 -X DELETE \
250 -H 'anthropic-version: 2023-06-01' \
251 -H "X-Api-Key: $ANTHROPIC_API_KEY"
250 -H 'anthropic-version: 2026-10-21' \
251 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
252252```
253253 
254254#### Response (200)

api/organization/invites Changed · +8 / -8 lines

from line 132
132132```bash
133133curl https://api.anthropic.com/v1/organizations/invites \
134134 -H 'Content-Type: application/json' \
135 -H 'anthropic-version: 2023-06-01' \
136 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
135 -H 'anthropic-version: 2026-10-21' \
136 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
137137 -d '{
138138 "email": "[email protected]",
139139 "role": "user"
from line 304
304304 
305305```bash
306306curl https://api.anthropic.com/v1/organizations/invites \
307 -H 'anthropic-version: 2023-06-01' \
308 -H "X-Api-Key: $ANTHROPIC_API_KEY"
307 -H 'anthropic-version: 2026-10-21' \
308 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
309309```
310310 
311311#### Response (200)
from line 433
433433 
434434```bash
435435curl https://api.anthropic.com/v1/organizations/invites/$INVITE_ID \
436 -H 'anthropic-version: 2023-06-01' \
437 -H "X-Api-Key: $ANTHROPIC_API_KEY"
436 -H 'anthropic-version: 2026-10-21' \
437 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
438438```
439439 
440440#### Response (200)
from line 494
494494```bash
495495curl https://api.anthropic.com/v1/organizations/invites/$INVITE_ID \
496496 -X DELETE \
497 -H 'anthropic-version: 2023-06-01' \
498 -H "X-Api-Key: $ANTHROPIC_API_KEY"
497 -H 'anthropic-version: 2026-10-21' \
498 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
499499```
500500 
501501#### Response (200)

api/organization/rate_limits Changed · +6 / -43 lines

from line 79
7979 
8080 - `group: OrganizationRateLimitModelGroup or OrganizationRateLimitBatchGroup or OrganizationRateLimitTokenCountGroup or 3 more`
8181 
82 The rate-limit group this entry's limits apply to. Its `type` equals `group_type`.
82 The rate-limit group this entry's limits apply to.
8383 
8484 - `OrganizationRateLimitModelGroup object`
8585 
from line 171
171171 
172172 - `models: array of string or null`
173173 
174 Model names this entry's limits apply to, including aliases. `null` when `group_type` is not `"model_group"`.
174 Model names this entry's limits apply to, including aliases. `null` when `group.type` is not `"model_group"`.
175175 
176 - `group_type: "batch" or "files" or "model_group" or 3 more`
177 
178 **Deprecated**: Use `group.type` instead. `group_type` is still returned and always equals `group.type`.
179 
180 Deprecated: use `group.type` instead. The kind of rate-limit group this entry represents. `model_group` entries apply to a family of models (listed in `models`); other values apply to an API-surface category and have `models` set to `null`. Always equal to `group.type`.
181 
182 - `"batch"`
183 
184 - `"files"`
185 
186 - `"model_group"`
187 
188 - `"skills"`
189 
190 - `"token_count"`
191 
192 - `"web_search"`
193 
194176- `next_page: string or null`
195177 
196178 Opaque cursor for the next page of results, or `null` when no entries remain beyond this response.
from line 181
199181 
200182```bash
201183curl https://api.anthropic.com/v1/organizations/rate_limits \
202 -H 'anthropic-version: 2023-06-01' \
203 -H "X-Api-Key: $ANTHROPIC_API_KEY"
184 -H 'anthropic-version: 2026-10-21' \
185 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
204186```
205187 
206188#### Response (200)
from line 197
215197 "display_name": "display_name",
216198 "type": "model_group"
217199 },
218 "group_type": "batch",
219200 "limits": [
220201 {
221202 "type": "type",
from line 231
250231 
251232 - `group: OrganizationRateLimitModelGroup or OrganizationRateLimitBatchGroup or OrganizationRateLimitTokenCountGroup or 3 more`
252233 
253 The rate-limit group this entry's limits apply to. Its `type` equals `group_type`.
234 The rate-limit group this entry's limits apply to.
254235 
255236 - `OrganizationRateLimitModelGroup object`
256237 
from line 323
342323 
343324 - `models: array of string or null`
344325 
345 Model names this entry's limits apply to, including aliases. `null` when `group_type` is not `"model_group"`.
346 
347 - `group_type: "batch" or "files" or "model_group" or 3 more`
348 
349 **Deprecated**: Use `group.type` instead. `group_type` is still returned and always equals `group.type`.
350 
351 Deprecated: use `group.type` instead. The kind of rate-limit group this entry represents. `model_group` entries apply to a family of models (listed in `models`); other values apply to an API-surface category and have `models` set to `null`. Always equal to `group.type`.
352 
353 - `"batch"`
354 
355 - `"files"`
356 
357 - `"model_group"`
358 
359 - `"skills"`
360 
361 - `"token_count"`
362 
363 - `"web_search"`
326 Model names this entry's limits apply to, including aliases. `null` when `group.type` is not `"model_group"`.
364327 
365328### Organization Rate Limit Batch Group
366329 

api/organization/rate_limits/list Changed · +4 / -23 lines

from line 77
7777 
7878 - `group: OrganizationRateLimitModelGroup or OrganizationRateLimitBatchGroup or OrganizationRateLimitTokenCountGroup or 3 more`
7979 
80 The rate-limit group this entry's limits apply to. Its `type` equals `group_type`.
80 The rate-limit group this entry's limits apply to.
8181 
8282 - `OrganizationRateLimitModelGroup object`
8383 
from line 169
169169 
170170 - `models: array of string or null`
171171 
172 Model names this entry's limits apply to, including aliases. `null` when `group_type` is not `"model_group"`.
172 Model names this entry's limits apply to, including aliases. `null` when `group.type` is not `"model_group"`.
173173 
174 - `group_type: "batch" or "files" or "model_group" or 3 more`
175 
176 **Deprecated**: Use `group.type` instead. `group_type` is still returned and always equals `group.type`.
177 
178 Deprecated: use `group.type` instead. The kind of rate-limit group this entry represents. `model_group` entries apply to a family of models (listed in `models`); other values apply to an API-surface category and have `models` set to `null`. Always equal to `group.type`.
179 
180 - `"batch"`
181 
182 - `"files"`
183 
184 - `"model_group"`
185 
186 - `"skills"`
187 
188 - `"token_count"`
189 
190 - `"web_search"`
191 
192174- `next_page: string or null`
193175 
194176 Opaque cursor for the next page of results, or `null` when no entries remain beyond this response.
from line 179
197179 
198180```bash
199181curl https://api.anthropic.com/v1/organizations/rate_limits \
200 -H 'anthropic-version: 2023-06-01' \
201 -H "X-Api-Key: $ANTHROPIC_API_KEY"
182 -H 'anthropic-version: 2026-10-21' \
183 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
202184```
203185 
204186### Response (200)
from line 195
213195 "display_name": "display_name",
214196 "type": "model_group"
215197 },
216 "group_type": "batch",
217198 "limits": [
218199 {
219200 "type": "type",

api/organization/service_accounts Changed · +16 / -16 lines

from line 119
119119```bash
120120curl https://api.anthropic.com/v1/organizations/service_accounts \
121121 -H 'Content-Type: application/json' \
122 -H 'anthropic-version: 2023-06-01' \
123 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
122 -H 'anthropic-version: 2026-10-21' \
123 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
124124 -d '{
125125 "name": "ci-deploy-bot"
126126 }'
from line 248
248248 
249249```bash
250250curl https://api.anthropic.com/v1/organizations/service_accounts \
251 -H 'anthropic-version: 2023-06-01' \
252 -H "X-Api-Key: $ANTHROPIC_API_KEY"
251 -H 'anthropic-version: 2026-10-21' \
252 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
253253```
254254 
255255#### Response (200)
from line 364
364364 
365365```bash
366366curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID \
367 -H 'anthropic-version: 2023-06-01' \
368 -H "X-Api-Key: $ANTHROPIC_API_KEY"
367 -H 'anthropic-version: 2026-10-21' \
368 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
369369```
370370 
371371#### Response (200)
from line 497
497497```bash
498498curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID \
499499 -H 'Content-Type: application/json' \
500 -H 'anthropic-version: 2023-06-01' \
501 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
500 -H 'anthropic-version: 2026-10-21' \
501 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
502502 -d '{}'
503503```
504504 
from line 615
615615```bash
616616curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/archive \
617617 -X POST \
618 -H 'anthropic-version: 2023-06-01' \
619 -H "X-Api-Key: $ANTHROPIC_API_KEY"
618 -H 'anthropic-version: 2026-10-21' \
619 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
620620```
621621 
622622#### Response (200)
from line 832
832832```bash
833833curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces \
834834 -H 'Content-Type: application/json' \
835 -H 'anthropic-version: 2023-06-01' \
836 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
835 -H 'anthropic-version: 2026-10-21' \
836 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
837837 -d '{
838838 "workspace_id": "workspace_id",
839839 "workspace_role": "workspace_admin"
from line 947
947947 
948948```bash
949949curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces \
950 -H 'anthropic-version: 2023-06-01' \
951 -H "X-Api-Key: $ANTHROPIC_API_KEY"
950 -H 'anthropic-version: 2026-10-21' \
951 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
952952```
953953 
954954##### Response (200)
from line 1022
10221022```bash
10231023curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces/$WORKSPACE_ID \
10241024 -X DELETE \
1025 -H 'anthropic-version: 2023-06-01' \
1026 -H "X-Api-Key: $ANTHROPIC_API_KEY"
1025 -H 'anthropic-version: 2026-10-21' \
1026 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
10271027```
10281028 
10291029##### Response (200)

api/organization/service_accounts/workspaces Changed · +6 / -6 lines

from line 95
9595```bash
9696curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces \
9797 -H 'Content-Type: application/json' \
98 -H 'anthropic-version: 2023-06-01' \
99 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
98 -H 'anthropic-version: 2026-10-21' \
99 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
100100 -d '{
101101 "workspace_id": "workspace_id",
102102 "workspace_role": "workspace_admin"
from line 210
210210 
211211```bash
212212curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces \
213 -H 'anthropic-version: 2023-06-01' \
214 -H "X-Api-Key: $ANTHROPIC_API_KEY"
213 -H 'anthropic-version: 2026-10-21' \
214 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
215215```
216216 
217217#### Response (200)
from line 285
285285```bash
286286curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces/$WORKSPACE_ID \
287287 -X DELETE \
288 -H 'anthropic-version: 2023-06-01' \
289 -H "X-Api-Key: $ANTHROPIC_API_KEY"
288 -H 'anthropic-version: 2026-10-21' \
289 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
290290```
291291 
292292#### Response (200)

api/organization/users Changed · +8 / -8 lines

from line 117
117117 
118118```bash
119119curl https://api.anthropic.com/v1/organizations/users \
120 -H 'anthropic-version: 2023-06-01' \
121 -H "X-Api-Key: $ANTHROPIC_API_KEY"
120 -H 'anthropic-version: 2026-10-21' \
121 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
122122```
123123 
124124#### Response (200)
from line 217
217217 
218218```bash
219219curl https://api.anthropic.com/v1/organizations/users/$USER_ID \
220 -H 'anthropic-version: 2023-06-01' \
221 -H "X-Api-Key: $ANTHROPIC_API_KEY"
220 -H 'anthropic-version: 2026-10-21' \
221 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
222222```
223223 
224224#### Response (200)
from line 329
329329```bash
330330curl https://api.anthropic.com/v1/organizations/users/$USER_ID \
331331 -H 'Content-Type: application/json' \
332 -H 'anthropic-version: 2023-06-01' \
333 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
332 -H 'anthropic-version: 2026-10-21' \
333 -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
334334 -d '{
335335 "role": "user"
336336 }'
from line 388
388388```bash
389389curl https://api.anthropic.com/v1/organizations/users/$USER_ID \
390390 -X DELETE \
391 -H 'anthropic-version: 2023-06-01' \
392 -H "X-Api-Key: $ANTHROPIC_API_KEY"
391 -H 'anthropic-version: 2026-10-21' \
392 -H "Authorization: Bearer $ANTHROPIC_API_KEY"
393393```
394394 
395395#### Response (200)
Feedback