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-20260825T033708Z

377 pages moved out of 612 read.

Pages moved 377 significant first
Pages read 612 in this capture
Captured 03:37 UTC
Corpus hash 7d98cae5bb87 corpus-hash

What this read moved

351-375 of 377, page 15 of 16

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

api/files/upload Changed · +33 / -14 lines

# Upload File ## Body parameters (form-data) ## Returns ## Example ### Response (200) ## Upload File ### Returns ### Example #### Response

from line 1
1---
2title: Upload File
3url: https://platform.claude.com/docs/en/api/files/upload
4---
1# Upload File
52 
6## Upload File
3**POST** `/v1/files`
74 
8**post** `/v1/files`
9 
105Upload File
116 
12### Returns
7## Body parameters (form-data)
138 
14- `FileMetadata object { id, created_at, filename, 5 more }`
9- `file: string`
1510 
11 The file to upload
12 
13 format: binary
14 
15- `expires_in_seconds: optional number`
16 
17 Seconds from upload until the file expires and its bytes become permanently unavailable. Must be between 3600 (one hour) and 7776000 (ninety days).
18 
19 minimum: 3600, maximum: 7776000
20 
21## Returns
22 
23- `FileMetadata object`
24 
1625 - `id: string`
1726 
1827 Unique object identifier.
from line 32
2332 
2433 RFC 3339 datetime string representing when the file was created.
2534 
35 format: date-time
36 
2637 - `filename: string`
2738 
2839 Original filename of the uploaded file.
2940 
41 maxLength: 500, minLength: 1
42 
3043 - `mime_type: string`
3144 
3245 MIME type of the file.
3346 
47 maxLength: 255, minLength: 1
48 
3449 - `size_bytes: number`
3550 
3651 Size of the file in bytes.
3752 
53 minimum: 0
54 
3855 - `type: "file"`
3956 
4057 Object type.
from line 58
4158 
4259 For files, this is always `"file"`.
4360 
44 - `"file"`
45 
4661 - `downloadable: optional boolean`
4762 
4863 Whether the file can be downloaded.
4964 
65 default: false
66 
5067 - `expires_at: optional string or null`
5168 
5269 RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.
5370 
54### Example
71 format: date-time
5572 
56```http
73## Example
74 
75```bash
5776curl https://api.anthropic.com/v1/files \
5877 -H 'Content-Type: multipart/form-data' \
5978 -H 'anthropic-version: 2023-06-01' \
from line 80
6180 -F 'file=@/path/to/file'
6281```
6382 
64#### Response
83### Response (200)
6584 
6685```json
6786{

api/messages Changed · +4670 / -7513 lines

### Headers ### Body parameters #### Response (200) ### Headers ### Body parameters #### Response (200) ## Domain types ## Messages › Batches ### Create a Message Batch #### Headers #### Body parameters #### Returns #### Example ##### Response (200) ### Retrieve a Message Batch #### Path parameters #### Returns #### Example ##### Response (200) ### List Message Batches #### Query parameters #### Returns #### Example ##### Response (200) ### Cancel a Message Batch #### Path parameters #### Returns #### Example ##### Response (200) ### Delete a Message Batch #### Path parameters #### Returns #### Example ##### Response (200) ### Retrieve Message Batch results #### Path parameters #### Returns #### Example ### Header Parameters ### Body Parameters #### Response ### Header Parameters ### Body Parameters #### Response ## Domain Types # Batches ## Create a Message Batch ### Header Parameters ### Body Parameters #### Response ## Retrieve a Message Batch ### Path Parameters #### Response ## List Message Batches ### Query Parameters #### Response ## Cancel a Message Batch ### Path Parameters #### Response ## Delete a Message Batch ### Path Parameters #### Response ## Retrieve Message Batch results ### Path Parameters ## Domain Types ### Deleted Message Batch ### Message Batch ### Message Batch Canceled Result ### Message Batch Errored Result ### Message Batch Expired Result ### Message Batch Individual Response ### Message Batch Request Counts ### Message Batch Result ### Message Batch Succeeded Result

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

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

api/messages/batches Changed · +1459 / -1046 lines

### Headers ### Body parameters #### Response (200) ### Path parameters #### Response (200) ### Query parameters #### Response (200) ### Path parameters #### Response (200) ### Path parameters #### Response (200) ### Path parameters ## Domain types ### Header Parameters ### Body Parameters #### Response ### Path Parameters #### Response ### Query Parameters #### Response ### Path Parameters #### Response ### Path Parameters #### Response ### Path Parameters ## Domain Types

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

from line 1
1---
2title: Batches
3url: https://platform.claude.com/docs/en/api/messages/batches
4---
5 
61# Batches
72 
83## Create a Message Batch
94 
10**post** `/v1/messages/batches`
5**POST** `/v1/messages/batches`
116 
127Send a batch of Message creation requests.
138 
from line 10
1510 
1611Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
1712 
18### Header Parameters
13### Headers
1914 
2015- `"anthropic-user-profile-id": optional string`
2116 
2217 The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.
2318 
24### Body Parameters
25 
26- `requests: array of object { custom_id, params }`
19### Body parameters
20 
21- `requests: array of object`
2722 
2823 List of requests for prompt completion. Each is an individual request to create a Message.
2924 
25 maxItems: 100000, minItems: 1
26 
3027 - `custom_id: string`
3128 
3229 Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
3330 
3431 Must be unique for each request within the Message Batch.
3532 
36 - `params: object { max_tokens, messages, model, 15 more }`
33 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,64}$
34 
35 - `params: object`
3736 
3837 Messages API creation parameters for the individual request.
3938 
from line 47
4847 Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.
4948 
5049 Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
50 
51 minimum: 0
5152 
5253 - `messages: array of MessageParam`
5354 
from line 107
106107 
107108 - `array of ContentBlockParam`
108109 
109 - `TextBlockParam object { text, type, cache_control, citations }`
110 - `TextBlockParam object`
110111 
111112 - `text: string`
112113 
114 minLength: 1
115 
113116 - `type: "text"`
114117 
115 - `"text"`
116 
117118 - `cache_control: optional CacheControlEphemeral or null`
118119 
119120 Create a cache control breakpoint at this content block.
120121 
121122 - `type: "ephemeral"`
122 
123 - `"ephemeral"`
124123 
125124 - `ttl: optional "5m" or "1h"`
126125 
from line 138
139138 
140139 - `citations: optional array of TextCitationParam or null`
141140 
142 - `CitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
141 - `CitationCharLocationParam object`
143142 
144143 - `cited_text: string`
145144 
146145 - `document_index: number`
147146 
147 minimum: 0
148 
148149 - `document_title: string or null`
149150 
151 maxLength: 500, minLength: 1
152 
150153 - `end_char_index: number`
151154 
152155 - `start_char_index: number`
153156 
157 minimum: 0
158 
154159 - `type: "char_location"`
155160 
156 - `"char_location"`
157 
158 - `CitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
161 - `CitationPageLocationParam object`
159162 
160163 - `cited_text: string`
161164 
162165 - `document_index: number`
163166 
167 minimum: 0
168 
164169 - `document_title: string or null`
165170 
171 maxLength: 500, minLength: 1
172 
166173 - `end_page_number: number`
167174 
168175 - `start_page_number: number`
169176 
177 minimum: 1
178 
170179 - `type: "page_location"`
171180 
172 - `"page_location"`
173 
174 - `CitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
181 - `CitationContentBlockLocationParam object`
175182 
176183 - `cited_text: string`
177184 
from line 188
181188 
182189 - `document_index: number`
183190 
191 minimum: 0
192 
184193 - `document_title: string or null`
185194 
195 maxLength: 500, minLength: 1
196 
186197 - `end_block_index: number`
187198 
188199 Exclusive 0-based end index of the cited block range in the source's `content` array.
from line 204
193204 
194205 0-based index of the first cited block in the source's `content` array.
195206 
207 minimum: 0
208 
196209 - `type: "content_block_location"`
197210 
198 - `"content_block_location"`
199 
200 - `CitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
211 - `CitationWebSearchResultLocationParam object`
201212 
202213 - `cited_text: string`
203214 
from line 216
205216 
206217 - `title: string or null`
207218 
219 maxLength: 512, minLength: 1
220 
208221 - `type: "web_search_result_location"`
209222 
210 - `"web_search_result_location"`
211 
212223 - `url: string`
213224 
214 - `CitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
225 minLength: 1
226 
227 - `CitationSearchResultLocationParam object`
215228 
216229 - `cited_text: string`
217230 
from line 244
231244 
232245 Counted separately from `document_index`; server-side web search results are not included in this count.
233246 
247 minimum: 0
248 
234249 - `source: string`
235250 
236251 - `start_block_index: number`
237252 
238253 0-based index of the first cited block in the source's `content` array.
239254 
255 minimum: 0
256 
240257 - `title: string or null`
241258 
242259 - `type: "search_result_location"`
243260 
244 - `"search_result_location"`
245 
246 - `ImageBlockParam object { source, type, cache_control, transformations }`
261 - `ImageBlockParam object`
247262 
248263 - `source: Base64ImageSource or URLImageSource or FileImageSource`
249264 
250 - `Base64ImageSource object { data, media_type, type }`
265 - `Base64ImageSource object`
251266 
252267 - `data: string`
253268 
269 format: byte
270 
254271 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
255272 
256273 - `"image/jpeg"`
from line 280
263280 
264281 - `type: "base64"`
265282 
266 - `"base64"`
267 
268 - `URLImageSource object { type, url }`
283 - `URLImageSource object`
269284 
270285 - `type: "url"`
271286 
272 - `"url"`
273 
274287 - `url: string`
275288 
276 - `FileImageSource object { file_id, type }`
289 - `FileImageSource object`
277290 
278291 - `file_id: string`
279292 
280293 - `type: "file"`
281294 
282 - `"file"`
283 
284295 - `type: "image"`
285296 
286 - `"image"`
287 
288297 - `cache_control: optional CacheControlEphemeral or null`
289298 
290299 Create a cache control breakpoint at this content block.
from line 310
301310 
302311 - `"error"`
303312 
304 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
313 - `DocumentBlockParam object`
305314 
306315 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
307316 
308 - `Base64PDFSource object { data, media_type, type }`
317 - `Base64PDFSource object`
309318 
310319 - `data: string`
311320 
321 format: byte
322 
312323 - `media_type: "application/pdf"`
313324 
314 - `"application/pdf"`
315 
316325 - `type: "base64"`
317326 
318 - `"base64"`
319 
320 - `PlainTextSource object { data, media_type, type }`
327 - `PlainTextSource object`
321328 
322329 - `data: string`
323330 
324331 - `media_type: "text/plain"`
325332 
326 - `"text/plain"`
327 
328333 - `type: "text"`
329334 
330 - `"text"`
331 
332 - `ContentBlockSource object { content, type }`
335 - `ContentBlockSource object`
333336 
334337 - `content: string or array of ContentBlockSourceContent`
335338 
from line 340
337340 
338341 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
339342 
340 - `TextBlockParam object { text, type, cache_control, citations }`
341 
342 - `ImageBlockParam object { source, type, cache_control, transformations }`
343 - `TextBlockParam object`
344 
345 - `ImageBlockParam object`
343346 
344347 - `type: "content"`
345348 
346 - `"content"`
347 
348 - `URLPDFSource object { type, url }`
349 - `URLPDFSource object`
349350 
350351 - `type: "url"`
351352 
352 - `"url"`
353 
354353 - `url: string`
355354 
356 - `FileDocumentSource object { file_id, type }`
355 - `FileDocumentSource object`
357356 
358357 - `file_id: string`
359358 
360359 - `type: "file"`
361360 
362 - `"file"`
363 
364361 - `type: "document"`
365362 
366 - `"document"`
367 
368363 - `cache_control: optional CacheControlEphemeral or null`
369364 
370365 Create a cache control breakpoint at this content block.
from line 370
375370 
376371 - `context: optional string or null`
377372 
373 minLength: 1
374 
378375 - `title: optional string or null`
379376 
380 - `SearchResultBlockParam object { content, source, title, 3 more }`
377 maxLength: 500, minLength: 1
378 
379 - `SearchResultBlockParam object`
381380 
382381 - `content: array of TextBlockParam`
383382 
384383 - `text: string`
385384 
385 minLength: 1
386 
386387 - `type: "text"`
387388 
388389 - `cache_control: optional CacheControlEphemeral or null`
from line 398
397398 
398399 - `type: "search_result"`
399400 
400 - `"search_result"`
401 
402401 - `cache_control: optional CacheControlEphemeral or null`
403402 
404403 Create a cache control breakpoint at this content block.
405404 
406405 - `citations: optional CitationsConfigParam`
407406 
408 - `ThinkingBlockParam object { signature, thinking, type }`
407 - `ThinkingBlockParam object`
409408 
410409 - `signature: string`
411410 
from line 418
419418 
420419 - `type: "thinking"`
421420 
422 - `"thinking"`
423 
424 - `RedactedThinkingBlockParam object { data, type }`
421 - `RedactedThinkingBlockParam object`
425422 
426423 - `data: string`
427424 
from line 426
429426 
430427 - `type: "redacted_thinking"`
431428 
432 - `"redacted_thinking"`
433 
434 - `ToolUseBlockParam object { id, input, name, 4 more }`
429 - `ToolUseBlockParam object`
435430 
436431 - `id: string`
437432 
433 pattern: ^[a-zA-Z0-9_-]+$
434 
438435 - `input: map[unknown]`
439436 
440437 - `name: string`
441438 
439 maxLength: 200, minLength: 1
440 
442441 - `type: "tool_use"`
443442 
444 - `"tool_use"`
445 
446443 - `cache_control: optional CacheControlEphemeral or null`
447444 
448445 Create a cache control breakpoint at this content block.
from line 448
451448 
452449 Tool invocation directly from the model.
453450 
454 - `DirectCaller object { type }`
451 - `DirectCaller object`
455452 
456453 Tool invocation directly from the model.
457454 
458455 - `type: "direct"`
459456 
460 - `"direct"`
461 
462 - `ServerToolCaller object { tool_id, type }`
457 - `ServerToolCaller object`
463458 
464459 Tool invocation generated by a server-side tool.
465460 
466461 - `tool_id: string`
467462 
463 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
464 
468465 - `type: "code_execution_20250825"`
469466 
470 - `"code_execution_20250825"`
471 
472 - `ServerToolCaller20260120 object { tool_id, type }`
467 - `ServerToolCaller20260120 object`
473468 
474469 - `tool_id: string`
475470 
471 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
472 
476473 - `type: "code_execution_20260120"`
477474 
478 - `"code_execution_20260120"`
479 
480475 - `toolset_name: optional string or null`
481476 
482477 For a toolset member tool_use, the toolset family this member belongs to.
483478 
484 - `ToolResultBlockParam object { tool_use_id, type, cache_control, 3 more }`
479 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
480 
481 - `ToolResultBlockParam object`
485482 
486483 - `tool_use_id: string`
487484 
485 pattern: ^[a-zA-Z0-9_-]+$
486 
488487 - `type: "tool_result"`
489488 
490 - `"tool_result"`
491 
492489 - `cache_control: optional CacheControlEphemeral or null`
493490 
494491 Create a cache control breakpoint at this content block.
from line 496
499496 
500497 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
501498 
502 - `TextBlockParam object { text, type, cache_control, citations }`
503 
504 - `ImageBlockParam object { source, type, cache_control, transformations }`
505 
506 - `SearchResultBlockParam object { content, source, title, 3 more }`
507 
508 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
509 
510 - `ToolReferenceBlockParam object { tool_name, type, cache_control }`
499 - `TextBlockParam object`
500 
501 - `ImageBlockParam object`
502 
503 - `SearchResultBlockParam object`
504 
505 - `DocumentBlockParam object`
506 
507 - `ToolReferenceBlockParam object`
511508 
512509 Tool reference block that can be included in tool_result content.
513510 
514511 - `tool_name: string`
515512 
513 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
514 
516515 - `type: "tool_reference"`
517516 
518 - `"tool_reference"`
519 
520517 - `cache_control: optional CacheControlEphemeral or null`
521518 
522519 Create a cache control breakpoint at this content block.
523520 
524 - `BrowserStateBlockParam object { tabs, type, cache_control, state_changes }`
521 - `BrowserStateBlockParam object`
525522 
526523 The caller's browser state after a browser toolset member call —
527524 the full inventory of open tabs, which tab is active, and any side
from line 532
535532 
536533 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`.
537534 
535 maxItems: 100
536 
538537 - `tab_id: string`
539538 
540539 The caller-assigned identifier for this tab, unique within the inventory.
541540 
541 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
542 
542543 - `title: string`
543544 
544545 The title of the page the tab is showing. May be empty.
545546 
547 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
548 
546549 - `url: string`
547550 
548551 The URL of the page the tab is showing. May be empty.
549552 
553 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
554 
550555 - `active: optional boolean`
551556 
552557 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
553558 
554559 - `type: "browser_state"`
555560 
556 - `"browser_state"`
557 
558561 - `cache_control: optional CacheControlEphemeral or null`
559562 
560563 Create a cache control breakpoint at this content block.
from line 566
563566 
564567 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
565568 
566 - `BrowserStateChangeTabOpened object { tab_id, type }`
569 maxItems: 200, minItems: 1
570 
571 - `BrowserStateChangeTabOpened object`
567572 
568573 A tab this call's execution opened that remains open at its end —
569574 the creation delta of the `tabs` inventory, not an event log.
from line 582
577582 
578583 The `tab_id` of the opened tab, present in `tabs`.
579584 
585 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
586 
580587 - `type: "tab_opened"`
581588 
582 - `"tab_opened"`
583 
584 - `BrowserStateChangeDownloadStarted object { download_id, type, url }`
589 - `BrowserStateChangeDownloadStarted object`
585590 
586591 A file download that started during this call.
587592 
from line 594
589594 
590595 The caller-assigned identifier for this download, stable across the state changes reporting it.
591596 
597 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
598 
592599 - `type: "download_started"`
593600 
594 - `"download_started"`
595 
596601 - `url: string`
597602 
598603 The final post-redirect URL the download was served from.
599604 
600 - `BrowserStateChangeDownloadCompleted object { download_id, type, url, 2 more }`
605 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
606 
607 - `BrowserStateChangeDownloadCompleted object`
601608 
602609 A file download that finished during this call, reported with the
603610 same `download_id` as its `download_started` — or without a prior
from line 615
608615 
609616 The caller-assigned identifier for this download, stable across the state changes reporting it.
610617 
618 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
619 
611620 - `type: "download_completed"`
612621 
613 - `"download_completed"`
614 
615622 - `url: string`
616623 
617624 The final post-redirect URL the download was served from.
618625 
626 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
627 
619628 - `path: optional string or null`
620629 
621630 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.
622631 
632 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
633 
623634 - `size_bytes: optional number or null`
624635 
625636 The completed download's size.
626637 
627 - `BrowserStateChangeDownloadFailed object { download_id, type, url, error }`
638 minimum: 0
639 
640 - `BrowserStateChangeDownloadFailed object`
628641 
629642 A file download that failed — or was cancelled — during this call.
630643 
from line 645
632645 
633646 The caller-assigned identifier for this download, stable across the state changes reporting it.
634647 
648 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
649 
635650 - `type: "download_failed"`
636651 
637 - `"download_failed"`
638 
639652 - `url: string`
640653 
641654 The final post-redirect URL the download was served from.
642655 
656 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
657 
643658 - `error: optional string or null`
644659 
645660 The failure or cancellation detail, when known.
646661 
662 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
663 
647664 - `is_error: optional boolean`
648665 
649666 - `toolset_name: optional string or null`
650667 
651668 For a toolset member tool_result, the toolset family of the paired tool_use.
652669 
653 - `ServerToolUseBlockParam object { id, input, name, 3 more }`
670 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
671 
672 - `ServerToolUseBlockParam object`
654673 
655674 - `id: string`
656675 
676 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
677 
657678 - `input: map[unknown]`
658679 
659680 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
from line 695
674695 
675696 - `type: "server_tool_use"`
676697 
677 - `"server_tool_use"`
678 
679698 - `cache_control: optional CacheControlEphemeral or null`
680699 
681700 Create a cache control breakpoint at this content block.
from line 703
684703 
685704 Tool invocation directly from the model.
686705 
687 - `DirectCaller object { type }`
706 - `DirectCaller object`
688707 
689708 Tool invocation directly from the model.
690709 
691 - `ServerToolCaller object { tool_id, type }`
710 - `ServerToolCaller object`
692711 
693712 Tool invocation generated by a server-side tool.
694713 
695 - `ServerToolCaller20260120 object { tool_id, type }`
696 
697 - `WebSearchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
714 - `ServerToolCaller20260120 object`
715 
716 - `WebSearchToolResultBlockParam object`
698717 
699718 - `content: WebSearchToolResultBlockParamContent`
700719 
from line 725
706725 
707726 - `type: "web_search_result"`
708727 
709 - `"web_search_result"`
710 
711728 - `url: string`
712729 
713730 - `page_age: optional string or null`
714731 
715 - `WebSearchToolRequestError object { error_code, type }`
732 - `WebSearchToolRequestError object`
716733 
717734 - `error_code: WebSearchToolResultErrorCode`
718735 
from line 747
730747 
731748 - `type: "web_search_tool_result_error"`
732749 
733 - `"web_search_tool_result_error"`
734 
735750 - `tool_use_id: string`
736751 
752 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
753 
737754 - `type: "web_search_tool_result"`
738755 
739 - `"web_search_tool_result"`
740 
741756 - `cache_control: optional CacheControlEphemeral or null`
742757 
743758 Create a cache control breakpoint at this content block.
from line 761
746761 
747762 Tool invocation directly from the model.
748763 
749 - `DirectCaller object { type }`
764 - `DirectCaller object`
750765 
751766 Tool invocation directly from the model.
752767 
753 - `ServerToolCaller object { tool_id, type }`
768 - `ServerToolCaller object`
754769 
755770 Tool invocation generated by a server-side tool.
756771 
757 - `ServerToolCaller20260120 object { tool_id, type }`
758 
759 - `WebFetchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
772 - `ServerToolCaller20260120 object`
773 
774 - `WebFetchToolResultBlockParam object`
760775 
761776 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
762777 
763 - `WebFetchToolResultErrorBlockParam object { error_code, type }`
778 - `WebFetchToolResultErrorBlockParam object`
764779 
765780 - `error_code: WebFetchToolResultErrorCode`
766781 
from line 799
784799 
785800 - `type: "web_fetch_tool_result_error"`
786801 
787 - `"web_fetch_tool_result_error"`
788 
789 - `WebFetchBlockParam object { content, type, url, retrieved_at }`
802 - `WebFetchBlockParam object`
790803 
791804 - `content: DocumentBlockParam`
792805 
793806 - `type: "web_fetch_result"`
794807 
795 - `"web_fetch_result"`
796 
797808 - `url: string`
798809 
799810 Fetched content URL
from line 815
804815 
805816 - `tool_use_id: string`
806817 
818 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
819 
807820 - `type: "web_fetch_tool_result"`
808821 
809 - `"web_fetch_tool_result"`
810 
811822 - `cache_control: optional CacheControlEphemeral or null`
812823 
813824 Create a cache control breakpoint at this content block.
from line 827
816827 
817828 Tool invocation directly from the model.
818829 
819 - `DirectCaller object { type }`
830 - `DirectCaller object`
820831 
821832 Tool invocation directly from the model.
822833 
823 - `ServerToolCaller object { tool_id, type }`
834 - `ServerToolCaller object`
824835 
825836 Tool invocation generated by a server-side tool.
826837 
827 - `ServerToolCaller20260120 object { tool_id, type }`
828 
829 - `CodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
838 - `ServerToolCaller20260120 object`
839 
840 - `CodeExecutionToolResultBlockParam object`
830841 
831842 - `content: CodeExecutionToolResultBlockParamContent`
832843 
833844 Code execution result with encrypted stdout for PFC + web_search results.
834845 
835 - `CodeExecutionToolResultErrorParam object { error_code, type }`
846 - `CodeExecutionToolResultErrorParam object`
836847 
837848 - `error_code: CodeExecutionToolResultErrorCode`
838849 
from line 857
846857 
847858 - `type: "code_execution_tool_result_error"`
848859 
849 - `"code_execution_tool_result_error"`
850 
851 - `CodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
860 - `CodeExecutionResultBlockParam object`
852861 
853862 - `content: array of CodeExecutionOutputBlockParam`
854863 
from line 865
856865 
857866 - `type: "code_execution_output"`
858867 
859 - `"code_execution_output"`
860 
861868 - `return_code: number`
862869 
863870 - `stderr: string`
from line 873
866873 
867874 - `type: "code_execution_result"`
868875 
869 - `"code_execution_result"`
870 
871 - `EncryptedCodeExecutionResultBlockParam object { content, encrypted_stdout, return_code, 2 more }`
876 - `EncryptedCodeExecutionResultBlockParam object`
872877 
873878 Code execution result with encrypted stdout for PFC + web_search results.
874879 
from line 891
886891 
887892 - `type: "encrypted_code_execution_result"`
888893 
889 - `"encrypted_code_execution_result"`
890 
891894 - `tool_use_id: string`
892895 
896 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
897 
893898 - `type: "code_execution_tool_result"`
894899 
895 - `"code_execution_tool_result"`
896 
897900 - `cache_control: optional CacheControlEphemeral or null`
898901 
899902 Create a cache control breakpoint at this content block.
900903 
901 - `BashCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
904 - `BashCodeExecutionToolResultBlockParam object`
902905 
903906 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
904907 
905 - `BashCodeExecutionToolResultErrorParam object { error_code, type }`
908 - `BashCodeExecutionToolResultErrorParam object`
906909 
907910 - `error_code: BashCodeExecutionToolResultErrorCode`
908911 
from line 921
918921 
919922 - `type: "bash_code_execution_tool_result_error"`
920923 
921 - `"bash_code_execution_tool_result_error"`
922 
923 - `BashCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
924 - `BashCodeExecutionResultBlockParam object`
924925 
925926 - `content: array of BashCodeExecutionOutputBlockParam`
926927 
from line 929
928929 
929930 - `type: "bash_code_execution_output"`
930931 
931 - `"bash_code_execution_output"`
932 
933932 - `return_code: number`
934933 
935934 - `stderr: string`
from line 937
938937 
939938 - `type: "bash_code_execution_result"`
940939 
941 - `"bash_code_execution_result"`
942 
943940 - `tool_use_id: string`
944941 
942 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
943 
945944 - `type: "bash_code_execution_tool_result"`
946945 
947 - `"bash_code_execution_tool_result"`
948 
949946 - `cache_control: optional CacheControlEphemeral or null`
950947 
951948 Create a cache control breakpoint at this content block.
952949 
953 - `TextEditorCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
950 - `TextEditorCodeExecutionToolResultBlockParam object`
954951 
955952 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
956953 
957 - `TextEditorCodeExecutionToolResultErrorParam object { error_code, type, error_message }`
954 - `TextEditorCodeExecutionToolResultErrorParam object`
958955 
959956 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
960957 
from line 967
970967 
971968 - `type: "text_editor_code_execution_tool_result_error"`
972969 
973 - `"text_editor_code_execution_tool_result_error"`
974 
975970 - `error_message: optional string or null`
976971 
977 - `TextEditorCodeExecutionViewResultBlockParam object { content, file_type, type, 3 more }`
972 - `TextEditorCodeExecutionViewResultBlockParam object`
978973 
979974 - `content: string`
980975 
from line 983
988983 
989984 - `type: "text_editor_code_execution_view_result"`
990985 
991 - `"text_editor_code_execution_view_result"`
992 
993986 - `num_lines: optional number or null`
994987 
995988 - `start_line: optional number or null`
996989 
997990 - `total_lines: optional number or null`
998991 
999 - `TextEditorCodeExecutionCreateResultBlockParam object { is_file_update, type }`
992 - `TextEditorCodeExecutionCreateResultBlockParam object`
1000993 
1001994 - `is_file_update: boolean`
1002995 
1003996 - `type: "text_editor_code_execution_create_result"`
1004997 
1005 - `"text_editor_code_execution_create_result"`
1006 
1007 - `TextEditorCodeExecutionStrReplaceResultBlockParam object { type, lines, new_lines, 3 more }`
998 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1008999 
10091000 - `type: "text_editor_code_execution_str_replace_result"`
10101001 
1011 - `"text_editor_code_execution_str_replace_result"`
1012 
10131002 - `lines: optional array of string or null`
10141003 
10151004 - `new_lines: optional number or null`
from line 1011
10221011 
10231012 - `tool_use_id: string`
10241013 
1014 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1015 
10251016 - `type: "text_editor_code_execution_tool_result"`
10261017 
1027 - `"text_editor_code_execution_tool_result"`
1028 
10291018 - `cache_control: optional CacheControlEphemeral or null`
10301019 
10311020 Create a cache control breakpoint at this content block.
10321021 
1033 - `ToolSearchToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1022 - `ToolSearchToolResultBlockParam object`
10341023 
10351024 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
10361025 
1037 - `ToolSearchToolResultErrorParam object { error_code, type, error_message }`
1026 - `ToolSearchToolResultErrorParam object`
10381027 
10391028 - `error_code: ToolSearchToolResultErrorCode`
10401029 
from line 1037
10481037 
10491038 - `type: "tool_search_tool_result_error"`
10501039 
1051 - `"tool_search_tool_result_error"`
1052 
10531040 - `error_message: optional string or null`
10541041 
1055 - `ToolSearchToolSearchResultBlockParam object { tool_references, type }`
1042 - `ToolSearchToolSearchResultBlockParam object`
10561043 
10571044 - `tool_references: array of ToolReferenceBlockParam`
10581045 
10591046 - `tool_name: string`
10601047 
1048 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1049 
10611050 - `type: "tool_reference"`
10621051 
10631052 - `cache_control: optional CacheControlEphemeral or null`
from line 1055
10661055 
10671056 - `type: "tool_search_tool_search_result"`
10681057 
1069 - `"tool_search_tool_search_result"`
1070 
10711058 - `tool_use_id: string`
10721059 
1060 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1061 
10731062 - `type: "tool_search_tool_result"`
10741063 
1075 - `"tool_search_tool_result"`
1076 
10771064 - `cache_control: optional CacheControlEphemeral or null`
10781065 
10791066 Create a cache control breakpoint at this content block.
10801067 
1081 - `ContainerUploadBlockParam object { file_id, type, cache_control }`
1068 - `ContainerUploadBlockParam object`
10821069 
10831070 A content block that represents a file to be uploaded to the container
10841071 Files uploaded via this block will be available in the container's input directory.
from line 1074
10871074 
10881075 - `type: "container_upload"`
10891076 
1090 - `"container_upload"`
1091 
10921077 - `cache_control: optional CacheControlEphemeral or null`
10931078 
10941079 Create a cache control breakpoint at this content block.
from line 1168
11831168 
11841169 Container identifier for reuse across requests.
11851170 
1186 - `ContainerParams object { id, skills }`
1171 - `ContainerParams object`
11871172 
11881173 Container parameters with skills to be loaded.
11891174 
from line 1180
11951180 
11961181 List of skills to load in the container
11971182 
1183 maxItems: 20
1184 
11981185 - `skill_id: string`
11991186 
12001187 Skill ID
12011188 
1189 maxLength: 64, minLength: 1
1190 
12021191 - `type: "anthropic" or "custom"`
12031192 
12041193 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 1200
12111200 
12121201 Skill version or 'latest' for most recent version
12131202 
1203 maxLength: 64, minLength: 1
1204 
12141205 - `string`
12151206 
12161207 - `inference_geo: optional string or null`
from line 1218
12271218 
12281219 This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
12291220 
1221 maxLength: 512
1222 
12301223 - `output_config: optional OutputConfig`
12311224 
12321225 Configuration options for the model's output, such as the output format.
from line 1248
12551248 
12561249 - `type: "json_schema"`
12571250 
1258 - `"json_schema"`
1259 
12601251 - `service_tier: optional "auto" or "standard_only"`
12611252 
12621253 Determines whether to use priority capacity (if available) or standard capacity for this request.
from line 1284
12931284 
12941285 - `text: string`
12951286 
1287 minLength: 1
1288 
12961289 - `type: "text"`
12971290 
12981291 - `cache_control: optional CacheControlEphemeral or null`
from line 1294
13011294 
13021295 - `citations: optional array of TextCitationParam or null`
13031296 
1304 - `temperature: optional number`
1305 
1306 Amount of randomness injected into the response.
1307 
1308 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.
1309 
1310 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
1311 
13121297 - `thinking: optional ThinkingConfigParam`
13131298 
13141299 Configuration for enabling Claude's extended thinking.
from line 1302
13171302 
13181303 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
13191304 
1320 - `ThinkingConfigEnabled object { budget_tokens, type, display }`
1305 - `ThinkingConfigEnabled object`
13211306 
13221307 - `budget_tokens: number`
13231308 
from line 1312
13271312 
13281313 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
13291314 
1315 minimum: 1024
1316 
13301317 - `type: "enabled"`
13311318 
1332 - `"enabled"`
1333 
13341319 - `display: optional "summarized" or "omitted" or null`
13351320 
13361321 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1324
13391324 
13401325 - `"omitted"`
13411326 
1342 - `ThinkingConfigDisabled object { type }`
1327 - `ThinkingConfigDisabled object`
13431328 
13441329 - `type: "disabled"`
13451330 
1346 - `"disabled"`
1347 
1348 - `ThinkingConfigAdaptive object { type, display }`
1331 - `ThinkingConfigAdaptive object`
13491332 
13501333 - `type: "adaptive"`
13511334 
1352 - `"adaptive"`
1353 
13541335 - `display: optional "summarized" or "omitted" or null`
13551336 
13561337 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1344
13631344 
13641345 How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
13651346 
1366 - `ToolChoiceAuto object { type, disable_parallel_tool_use }`
1347 - `ToolChoiceAuto object`
13671348 
13681349 The model will automatically decide whether to use tools.
13691350 
13701351 - `type: "auto"`
13711352 
1372 - `"auto"`
1373 
13741353 - `disable_parallel_tool_use: optional boolean`
13751354 
13761355 Whether to disable parallel tool use.
13771356 
13781357 Defaults to `false`. If set to `true`, the model will output at most one tool use.
13791358 
1380 - `ToolChoiceAny object { type, disable_parallel_tool_use }`
1359 - `ToolChoiceAny object`
13811360 
13821361 The model will use any available tools.
13831362 
13841363 - `type: "any"`
13851364 
1386 - `"any"`
1387 
13881365 - `disable_parallel_tool_use: optional boolean`
13891366 
13901367 Whether to disable parallel tool use.
13911368 
13921369 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
13931370 
1394 - `ToolChoiceTool object { name, type, disable_parallel_tool_use }`
1371 - `ToolChoiceTool object`
13951372 
13961373 The model will use the specified tool with `tool_choice.name`.
13971374 
from line 1378
14011378 
14021379 - `type: "tool"`
14031380 
1404 - `"tool"`
1405 
14061381 - `disable_parallel_tool_use: optional boolean`
14071382 
14081383 Whether to disable parallel tool use.
14091384 
14101385 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
14111386 
1412 - `ToolChoiceNone object { type }`
1387 - `ToolChoiceNone object`
14131388 
14141389 The model will not be allowed to use tools.
14151390 
14161391 - `type: "none"`
1417 
1418 - `"none"`
14191392 
14201393 - `tools: optional array of ToolUnion`
14211394 
from line 1454
14811454 
14821455 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
14831456 
1484 - `Tool object { input_schema, name, allowed_callers, 7 more }`
1485 
1486 - `input_schema: object { type, properties, required }`
1457 - `Tool object`
1458 
1459 - `input_schema: object`
14871460 
14881461 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
14891462 
from line 1464
14911464 
14921465 - `type: "object"`
14931466 
1494 - `"object"`
1495 
14961467 - `properties: optional map[unknown] or null`
14971468 
14981469 - `required: optional array of string or null`
from line 1474
15031474 
15041475 This is how the tool will be called by the model and in `tool_use` blocks.
15051476 
1477 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$
1478 
15061479 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15071480 
15081481 - `"direct"`
from line 1512
15391512 
15401513 - `type: optional "custom" or null`
15411514 
1542 - `"custom"`
1543 
1544 - `ToolBash20250124 object { name, type, allowed_callers, 4 more }`
1515 - `ToolBash20250124 object`
15451516 
15461517 - `name: "bash"`
15471518 
from line 1520
15491520 
15501521 This is how the tool will be called by the model and in `tool_use` blocks.
15511522 
1552 - `"bash"`
1553 
15541523 - `type: "bash_20250124"`
15551524 
1556 - `"bash_20250124"`
1557 
15581525 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15591526 
15601527 - `"direct"`
from line 1546
15791546 
15801547 When true, guarantees schema validation on tool names and inputs
15811548 
1582 - `CodeExecutionTool20250522 object { name, type, allowed_callers, 3 more }`
1549 - `CodeExecutionTool20250522 object`
15831550 
15841551 - `name: "code_execution"`
15851552 
from line 1554
15871554 
15881555 This is how the tool will be called by the model and in `tool_use` blocks.
15891556 
1590 - `"code_execution"`
1591 
15921557 - `type: "code_execution_20250522"`
15931558 
1594 - `"code_execution_20250522"`
1595 
15961559 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15971560 
15981561 - `"direct"`
from line 1578
16151578 
16161579 When true, guarantees schema validation on tool names and inputs
16171580 
1618 - `CodeExecutionTool20250825 object { name, type, allowed_callers, 3 more }`
1581 - `CodeExecutionTool20250825 object`
16191582 
16201583 - `name: "code_execution"`
16211584 
from line 1586
16231586 
16241587 This is how the tool will be called by the model and in `tool_use` blocks.
16251588 
1626 - `"code_execution"`
1627 
16281589 - `type: "code_execution_20250825"`
16291590 
1591 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1592 
1593 - `"direct"`
1594 
16301595 - `"code_execution_20250825"`
16311596 
1597 - `"code_execution_20260120"`
1598 
1599 - `"code_execution_20260521"`
1600 
1601 - `cache_control: optional CacheControlEphemeral or null`
1602 
1603 Create a cache control breakpoint at this content block.
1604 
1605 - `defer_loading: optional boolean`
1606 
1607 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1608 
1609 - `strict: optional boolean`
1610 
1611 When true, guarantees schema validation on tool names and inputs
1612 
1613 - `CodeExecutionTool20260120 object`
1614 
1615 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1616 
1617 - `name: "code_execution"`
1618 
1619 Name of the tool.
1620 
1621 This is how the tool will be called by the model and in `tool_use` blocks.
1622 
1623 - `type: "code_execution_20260120"`
1624 
16321625 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16331626 
16341627 - `"direct"`
from line 1644
16511644 
16521645 When true, guarantees schema validation on tool names and inputs
16531646 
1654 - `CodeExecutionTool20260120 object { name, type, allowed_callers, 3 more }`
1655 
1656 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1647 - `CodeExecutionTool20260521 object`
1648 
1649 Code execution tool with REPL state persistence.
16571650 
16581651 - `name: "code_execution"`
16591652 
from line 1654
16611654 
16621655 This is how the tool will be called by the model and in `tool_use` blocks.
16631656 
1664 - `"code_execution"`
1665 
1666 - `type: "code_execution_20260120"`
1657 - `type: "code_execution_20260521"`
1658 
1659 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1660 
1661 - `"direct"`
1662 
1663 - `"code_execution_20250825"`
16671664 
16681665 - `"code_execution_20260120"`
16691666 
1670 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1671 
1672 - `"direct"`
1673 
1674 - `"code_execution_20250825"`
1675 
1676 - `"code_execution_20260120"`
1677 
16781667 - `"code_execution_20260521"`
16791668 
16801669 - `cache_control: optional CacheControlEphemeral or null`
from line 1678
16891678 
16901679 When true, guarantees schema validation on tool names and inputs
16911680 
1692 - `CodeExecutionTool20260521 object { name, type, allowed_callers, 3 more }`
1693 
1694 Code execution tool with REPL state persistence.
1695 
1696 - `name: "code_execution"`
1697 
1698 Name of the tool.
1699 
1700 This is how the tool will be called by the model and in `tool_use` blocks.
1701 
1702 - `"code_execution"`
1703 
1704 - `type: "code_execution_20260521"`
1705 
1706 - `"code_execution_20260521"`
1707 
1708 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1709 
1710 - `"direct"`
1711 
1712 - `"code_execution_20250825"`
1713 
1714 - `"code_execution_20260120"`
1715 
1716 - `"code_execution_20260521"`
1717 
1718 - `cache_control: optional CacheControlEphemeral or null`
1719 
1720 Create a cache control breakpoint at this content block.
1721 
1722 - `defer_loading: optional boolean`
1723 
1724 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1725 
1726 - `strict: optional boolean`
1727 
1728 When true, guarantees schema validation on tool names and inputs
1729 
1730 - `BrowserToolset20260801 object { type, allowed_callers, cache_control, configs }`
1681 - `BrowserToolset20260801 object`
17311682 
17321683 The browser toolset: a single `tools[]` entry (carrying no
17331684 `name`) that declares the browser tool family. The model is served
from line 1686
17351686 from its schema.
17361687 
17371688 - `type: "browser_toolset_20260801"`
1738 
1739 - `"browser_toolset_20260801"`
17401689 
17411690 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
17421691 
from line 2082
21332082 
21342083 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
21352084 
2136 - `MemoryTool20250818 object { name, type, allowed_callers, 4 more }`
2085 - `MemoryTool20250818 object`
21372086 
21382087 - `name: "memory"`
21392088 
from line 2090
21412090 
21422091 This is how the tool will be called by the model and in `tool_use` blocks.
21432092 
2144 - `"memory"`
2145 
21462093 - `type: "memory_20250818"`
21472094 
2148 - `"memory_20250818"`
2149 
21502095 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21512096 
21522097 - `"direct"`
from line 2116
21712116 
21722117 When true, guarantees schema validation on tool names and inputs
21732118 
2174 - `ComputerToolset20260801 object { type, allowed_callers, cache_control, configs }`
2119 - `ComputerToolset20260801 object`
21752120 
21762121 The computer toolset: a single `tools[]` entry (carrying no
21772122 `name`) that declares the computer tool family. The model is
from line 2129
21842129 
21852130 - `type: "computer_toolset_20260801"`
21862131 
2187 - `"computer_toolset_20260801"`
2188 
21892132 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21902133 
21912134 - `"direct"`
from line 2356
24132356 
24142357 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
24152358 
2416 - `ToolTextEditor20250124 object { name, type, allowed_callers, 4 more }`
2359 - `ToolTextEditor20250124 object`
24172360 
24182361 - `name: "str_replace_editor"`
24192362 
from line 2364
24212364 
24222365 This is how the tool will be called by the model and in `tool_use` blocks.
24232366 
2424 - `"str_replace_editor"`
2425 
24262367 - `type: "text_editor_20250124"`
24272368 
2428 - `"text_editor_20250124"`
2429 
24302369 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24312370 
24322371 - `"direct"`
from line 2390
24512390 
24522391 When true, guarantees schema validation on tool names and inputs
24532392 
2454 - `ToolTextEditor20250429 object { name, type, allowed_callers, 4 more }`
2393 - `ToolTextEditor20250429 object`
24552394 
24562395 - `name: "str_replace_based_edit_tool"`
24572396 
from line 2398
24592398 
24602399 This is how the tool will be called by the model and in `tool_use` blocks.
24612400 
2462 - `"str_replace_based_edit_tool"`
2463 
24642401 - `type: "text_editor_20250429"`
24652402 
2466 - `"text_editor_20250429"`
2467 
24682403 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24692404 
24702405 - `"direct"`
from line 2424
24892424 
24902425 When true, guarantees schema validation on tool names and inputs
24912426 
2492 - `ToolTextEditor20250728 object { name, type, allowed_callers, 5 more }`
2427 - `ToolTextEditor20250728 object`
24932428 
24942429 - `name: "str_replace_based_edit_tool"`
24952430 
from line 2432
24972432 
24982433 This is how the tool will be called by the model and in `tool_use` blocks.
24992434 
2500 - `"str_replace_based_edit_tool"`
2501 
25022435 - `type: "text_editor_20250728"`
25032436 
2504 - `"text_editor_20250728"`
2505 
25062437 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25072438 
25082439 - `"direct"`
from line 2458
25272458 
25282459 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
25292460 
2461 minimum: 1
2462 
25302463 - `strict: optional boolean`
25312464 
25322465 When true, guarantees schema validation on tool names and inputs
25332466 
2534 - `WebSearchTool20250305 object { name, type, allowed_callers, 7 more }`
2467 - `WebSearchTool20250305 object`
25352468 
25362469 - `name: "web_search"`
25372470 
from line 2472
25392472 
25402473 This is how the tool will be called by the model and in `tool_use` blocks.
25412474 
2542 - `"web_search"`
2543 
25442475 - `type: "web_search_20250305"`
25452476 
2546 - `"web_search_20250305"`
2547 
25482477 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25492478 
25502479 - `"direct"`
from line 2504
25752504 
25762505 Maximum number of times the tool can be used in the API request.
25772506 
2507 exclusiveMinimum: 0
2508 
25782509 - `strict: optional boolean`
25792510 
25802511 When true, guarantees schema validation on tool names and inputs
from line 2516
25852516 
25862517 - `type: "approximate"`
25872518 
2588 - `"approximate"`
2589 
25902519 - `city: optional string or null`
25912520 
25922521 The city of the user.
25932522 
2523 maxLength: 255, minLength: 1
2524 
25942525 - `country: optional string or null`
25952526 
25962527 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
25972528 
2529 maxLength: 2, minLength: 2
2530 
25982531 - `region: optional string or null`
25992532 
26002533 The region of the user.
26012534 
2535 maxLength: 255, minLength: 1
2536 
26022537 - `timezone: optional string or null`
26032538 
26042539 The [IANA timezone](https://nodatime.org/TimeZones) of the user.
26052540 
2606 - `WebFetchTool20250910 object { name, type, allowed_callers, 8 more }`
2541 maxLength: 255, minLength: 1
2542 
2543 - `WebFetchTool20250910 object`
26072544 
26082545 - `name: "web_fetch"`
26092546 
from line 2548
26112548 
26122549 This is how the tool will be called by the model and in `tool_use` blocks.
26132550 
2614 - `"web_fetch"`
2615 
26162551 - `type: "web_fetch_20250910"`
26172552 
2618 - `"web_fetch_20250910"`
2619 
26202553 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26212554 
26222555 - `"direct"`
from line 2584
26512584 
26522585 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
26532586 
2587 exclusiveMinimum: 0
2588 
26542589 - `max_uses: optional number or null`
26552590 
26562591 Maximum number of times the tool can be used in the API request.
26572592 
2593 exclusiveMinimum: 0
2594 
26582595 - `strict: optional boolean`
26592596 
26602597 When true, guarantees schema validation on tool names and inputs
26612598 
2662 - `WebSearchTool20260209 object { name, type, allowed_callers, 7 more }`
2599 - `WebSearchTool20260209 object`
26632600 
26642601 - `name: "web_search"`
26652602 
from line 2604
26672604 
26682605 This is how the tool will be called by the model and in `tool_use` blocks.
26692606 
2670 - `"web_search"`
2671 
26722607 - `type: "web_search_20260209"`
26732608 
2674 - `"web_search_20260209"`
2675 
26762609 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26772610 
26782611 - `"direct"`
from line 2636
27032636 
27042637 Maximum number of times the tool can be used in the API request.
27052638 
2639 exclusiveMinimum: 0
2640 
27062641 - `strict: optional boolean`
27072642 
27082643 When true, guarantees schema validation on tool names and inputs
from line 2646
27112646 
27122647 Parameters for the user's location. Used to provide more relevant search results.
27132648 
2714 - `WebFetchTool20260209 object { name, type, allowed_callers, 8 more }`
2649 - `WebFetchTool20260209 object`
27152650 
27162651 - `name: "web_fetch"`
27172652 
from line 2654
27192654 
27202655 This is how the tool will be called by the model and in `tool_use` blocks.
27212656 
2722 - `"web_fetch"`
2723 
27242657 - `type: "web_fetch_20260209"`
27252658 
2726 - `"web_fetch_20260209"`
2727 
27282659 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27292660 
27302661 - `"direct"`
from line 2690
27592690 
27602691 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
27612692 
2693 exclusiveMinimum: 0
2694 
27622695 - `max_uses: optional number or null`
27632696 
27642697 Maximum number of times the tool can be used in the API request.
27652698 
2699 exclusiveMinimum: 0
2700 
27662701 - `strict: optional boolean`
27672702 
27682703 When true, guarantees schema validation on tool names and inputs
27692704 
2770 - `WebFetchTool20260309 object { name, type, allowed_callers, 9 more }`
2705 - `WebFetchTool20260309 object`
27712706 
27722707 Web fetch tool with use_cache parameter for bypassing cached content.
27732708 
from line 2712
27772712 
27782713 This is how the tool will be called by the model and in `tool_use` blocks.
27792714 
2780 - `"web_fetch"`
2781 
27822715 - `type: "web_fetch_20260309"`
27832716 
2784 - `"web_fetch_20260309"`
2785 
27862717 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27872718 
27882719 - `"direct"`
from line 2748
28172748 
28182749 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
28192750 
2751 exclusiveMinimum: 0
2752 
28202753 - `max_uses: optional number or null`
28212754 
28222755 Maximum number of times the tool can be used in the API request.
28232756 
2757 exclusiveMinimum: 0
2758 
28242759 - `strict: optional boolean`
28252760 
28262761 When true, guarantees schema validation on tool names and inputs
from line 2764
28292764 
28302765 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
28312766 
2832 - `WebSearchTool20260318 object { name, type, allowed_callers, 8 more }`
2767 - `WebSearchTool20260318 object`
28332768 
28342769 - `name: "web_search"`
28352770 
from line 2772
28372772 
28382773 This is how the tool will be called by the model and in `tool_use` blocks.
28392774 
2840 - `"web_search"`
2841 
28422775 - `type: "web_search_20260318"`
28432776 
2844 - `"web_search_20260318"`
2845 
28462777 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28472778 
28482779 - `"direct"`
from line 2804
28732804 
28742805 Maximum number of times the tool can be used in the API request.
28752806 
2807 exclusiveMinimum: 0
2808 
28762809 - `response_inclusion: optional "full" or "excluded"`
28772810 
28782811 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 2822
28892822 
28902823 Parameters for the user's location. Used to provide more relevant search results.
28912824 
2892 - `WebFetchTool20260318 object { name, type, allowed_callers, 10 more }`
2825 - `WebFetchTool20260318 object`
28932826 
28942827 - `name: "web_fetch"`
28952828 
from line 2830
28972830 
28982831 This is how the tool will be called by the model and in `tool_use` blocks.
28992832 
2900 - `"web_fetch"`
2901 
29022833 - `type: "web_fetch_20260318"`
29032834 
2904 - `"web_fetch_20260318"`
2905 
29062835 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29072836 
29082837 - `"direct"`
from line 2866
29372866 
29382867 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
29392868 
2869 exclusiveMinimum: 0
2870 
29402871 - `max_uses: optional number or null`
29412872 
29422873 Maximum number of times the tool can be used in the API request.
29432874 
2875 exclusiveMinimum: 0
2876 
29442877 - `response_inclusion: optional "full" or "excluded"`
29452878 
29462879 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 2890
29572890 
29582891 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
29592892 
2960 - `ToolSearchToolBm25_20251119 object { name, type, allowed_callers, 3 more }`
2893 - `ToolSearchToolBm25_20251119 object`
29612894 
29622895 - `name: "tool_search_tool_bm25"`
29632896 
from line 2898
29652898 
29662899 This is how the tool will be called by the model and in `tool_use` blocks.
29672900 
2901 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2902 
2903 - `"tool_search_tool_bm25_20251119"`
2904 
29682905 - `"tool_search_tool_bm25"`
29692906 
2970 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2971 
2972 - `"tool_search_tool_bm25_20251119"`
2973 
2974 - `"tool_search_tool_bm25"`
2975 
29762907 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29772908 
29782909 - `"direct"`
from line 2926
29952926 
29962927 When true, guarantees schema validation on tool names and inputs
29972928 
2998 - `ToolSearchToolRegex20251119 object { name, type, allowed_callers, 3 more }`
2929 - `ToolSearchToolRegex20251119 object`
29992930 
30002931 - `name: "tool_search_tool_regex"`
30012932 
from line 2934
30032934 
30042935 This is how the tool will be called by the model and in `tool_use` blocks.
30052936 
2937 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2938 
2939 - `"tool_search_tool_regex_20251119"`
2940 
30062941 - `"tool_search_tool_regex"`
30072942 
3008 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3009 
3010 - `"tool_search_tool_regex_20251119"`
3011 
3012 - `"tool_search_tool_regex"`
3013 
30142943 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
30152944 
30162945 - `"direct"`
from line 2962
30332962 
30342963 When true, guarantees schema validation on tool names and inputs
30352964 
2965 - `temperature: optional number`
2966 
2967 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
2968 
2969 Amount of randomness injected into the response.
2970 
2971 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.
2972 
2973 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
2974 
2975 maximum: 1, minimum: 0
2976 
30362977 - `top_k: optional number`
30372978 
2979 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
2980 
30382981 Only sample from the top K options for each subsequent token.
30392982 
30402983 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
30412984 
30422985 Recommended for advanced use cases only.
30432986 
2987 minimum: 0
2988 
30442989 - `top_p: optional number`
30452990 
2991 **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.
2992 
30462993 Use nucleus sampling.
30472994 
30482995 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`.
30492996 
30502997 Recommended for advanced use cases only.
30512998 
2999 maximum: 1, minimum: 0
3000 
30523001### Returns
30533002 
3054- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
3003- `MessageBatch object`
30553004 
30563005 - `id: string`
30573006 
from line 3012
30633012 
30643013 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
30653014 
3015 format: date-time
3016 
30663017 - `cancel_initiated_at: string or null`
30673018 
30683019 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
30693020 
3021 format: date-time
3022 
30703023 - `created_at: string`
30713024 
30723025 RFC 3339 datetime string representing the time at which the Message Batch was created.
30733026 
3027 format: date-time
3028 
30743029 - `ended_at: string or null`
30753030 
30763031 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
30773032 
30783033 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
30793034 
3035 format: date-time
3036 
30803037 - `expires_at: string`
30813038 
30823039 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
30833040 
3041 format: date-time
3042 
30843043 - `processing_status: "in_progress" or "canceling" or "ended"`
30853044 
30863045 Processing status of the Message Batch.
from line 3062
31033062 
31043063 This is zero until processing of the entire Message Batch has ended.
31053064 
3065 default: 0
3066 
31063067 - `errored: number`
31073068 
31083069 Number of requests in the Message Batch that encountered an error.
31093070 
31103071 This is zero until processing of the entire Message Batch has ended.
31113072 
3073 default: 0
3074 
31123075 - `expired: number`
31133076 
31143077 Number of requests in the Message Batch that have expired.
31153078 
31163079 This is zero until processing of the entire Message Batch has ended.
31173080 
3081 default: 0
3082 
31183083 - `processing: number`
31193084 
31203085 Number of requests in the Message Batch that are processing.
31213086 
3087 default: 0
3088 
31223089 - `succeeded: number`
31233090 
31243091 Number of requests in the Message Batch that have completed successfully.
31253092 
31263093 This is zero until processing of the entire Message Batch has ended.
31273094 
3095 default: 0
3096 
31283097 - `results_url: string or null`
31293098 
31303099 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3106
31373106 
31383107 For Message Batches, this is always `"message_batch"`.
31393108 
3140 - `"message_batch"`
3109 default: message_batch
31413110 
31423111### Example
31433112 
3144```http
3113```bash
31453114curl https://api.anthropic.com/v1/messages/batches \
31463115 -H 'Content-Type: application/json' \
31473116 -H 'anthropic-version: 2023-06-01' \
from line 3134
31653134 }'
31663135```
31673136 
3168#### Response
3137#### Response (200)
31693138 
31703139```json
31713140{
from line 3159
31903159 
31913160## Retrieve a Message Batch
31923161 
3193**get** `/v1/messages/batches/{message_batch_id}`
3162**GET** `/v1/messages/batches/{message_batch_id}`
31943163 
31953164This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
31963165 
31973166Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
31983167 
3199### Path Parameters
3168### Path parameters
32003169 
32013170- `message_batch_id: string`
32023171 
from line 3173
32043173 
32053174### Returns
32063175 
3207- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
3176- `MessageBatch object`
32083177 
32093178 - `id: string`
32103179 
from line 3185
32163185 
32173186 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
32183187 
3188 format: date-time
3189 
32193190 - `cancel_initiated_at: string or null`
32203191 
32213192 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
32223193 
3194 format: date-time
3195 
32233196 - `created_at: string`
32243197 
32253198 RFC 3339 datetime string representing the time at which the Message Batch was created.
32263199 
3200 format: date-time
3201 
32273202 - `ended_at: string or null`
32283203 
32293204 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
32303205 
32313206 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
32323207 
3208 format: date-time
3209 
32333210 - `expires_at: string`
32343211 
32353212 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
32363213 
3214 format: date-time
3215 
32373216 - `processing_status: "in_progress" or "canceling" or "ended"`
32383217 
32393218 Processing status of the Message Batch.
from line 3235
32563235 
32573236 This is zero until processing of the entire Message Batch has ended.
32583237 
3238 default: 0
3239 
32593240 - `errored: number`
32603241 
32613242 Number of requests in the Message Batch that encountered an error.
32623243 
32633244 This is zero until processing of the entire Message Batch has ended.
32643245 
3246 default: 0
3247 
32653248 - `expired: number`
32663249 
32673250 Number of requests in the Message Batch that have expired.
32683251 
32693252 This is zero until processing of the entire Message Batch has ended.
32703253 
3254 default: 0
3255 
32713256 - `processing: number`
32723257 
32733258 Number of requests in the Message Batch that are processing.
32743259 
3260 default: 0
3261 
32753262 - `succeeded: number`
32763263 
32773264 Number of requests in the Message Batch that have completed successfully.
32783265 
32793266 This is zero until processing of the entire Message Batch has ended.
32803267 
3268 default: 0
3269 
32813270 - `results_url: string or null`
32823271 
32833272 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3279
32903279 
32913280 For Message Batches, this is always `"message_batch"`.
32923281 
3293 - `"message_batch"`
3282 default: message_batch
32943283 
32953284### Example
32963285 
3297```http
3286```bash
32983287curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
32993288 -H 'anthropic-version: 2023-06-01' \
33003289 -H "X-Api-Key: $ANTHROPIC_API_KEY"
33013290```
33023291 
3303#### Response
3292#### Response (200)
33043293 
33053294```json
33063295{
from line 3314
33253314 
33263315## List Message Batches
33273316 
3328**get** `/v1/messages/batches`
3317**GET** `/v1/messages/batches`
33293318 
33303319List all Message Batches within a Workspace. Most recently created batches are returned first.
33313320 
33323321Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
33333322 
3334### Query Parameters
3323### Query parameters
33353324 
33363325- `after_id: optional string`
33373326 
from line 3336
33473336 
33483337 Defaults to `20`. Ranges from `1` to `1000`.
33493338 
3339 default: 20, maximum: 1000, minimum: 1
3340 
33503341### Returns
33513342 
33523343- `data: array of MessageBatch`
from line 3352
33613352 
33623353 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
33633354 
3355 format: date-time
3356 
33643357 - `cancel_initiated_at: string or null`
33653358 
33663359 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
33673360 
3361 format: date-time
3362 
33683363 - `created_at: string`
33693364 
33703365 RFC 3339 datetime string representing the time at which the Message Batch was created.
33713366 
3367 format: date-time
3368 
33723369 - `ended_at: string or null`
33733370 
33743371 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
33753372 
33763373 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
33773374 
3375 format: date-time
3376 
33783377 - `expires_at: string`
33793378 
33803379 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
33813380 
3381 format: date-time
3382 
33823383 - `processing_status: "in_progress" or "canceling" or "ended"`
33833384 
33843385 Processing status of the Message Batch.
from line 3402
34013402 
34023403 This is zero until processing of the entire Message Batch has ended.
34033404 
3405 default: 0
3406 
34043407 - `errored: number`
34053408 
34063409 Number of requests in the Message Batch that encountered an error.
34073410 
34083411 This is zero until processing of the entire Message Batch has ended.
34093412 
3413 default: 0
3414 
34103415 - `expired: number`
34113416 
34123417 Number of requests in the Message Batch that have expired.
34133418 
34143419 This is zero until processing of the entire Message Batch has ended.
34153420 
3421 default: 0
3422 
34163423 - `processing: number`
34173424 
34183425 Number of requests in the Message Batch that are processing.
34193426 
3427 default: 0
3428 
34203429 - `succeeded: number`
34213430 
34223431 Number of requests in the Message Batch that have completed successfully.
34233432 
34243433 This is zero until processing of the entire Message Batch has ended.
34253434 
3435 default: 0
3436 
34263437 - `results_url: string or null`
34273438 
34283439 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3446
34353446 
34363447 For Message Batches, this is always `"message_batch"`.
34373448 
3438 - `"message_batch"`
3449 default: message_batch
34393450 
34403451- `first_id: string or null`
34413452 
from line 3462
34513462 
34523463### Example
34533464 
3454```http
3465```bash
34553466curl https://api.anthropic.com/v1/messages/batches \
34563467 -H 'anthropic-version: 2023-06-01' \
34573468 -H "X-Api-Key: $ANTHROPIC_API_KEY"
34583469```
34593470 
3460#### Response
3471#### Response (200)
34613472 
34623473```json
34633474{
from line 3500
34893500 
34903501## Cancel a Message Batch
34913502 
3492**post** `/v1/messages/batches/{message_batch_id}/cancel`
3503**POST** `/v1/messages/batches/{message_batch_id}/cancel`
34933504 
34943505Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
34953506 
from line 3508
34973508 
34983509Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
34993510 
3500### Path Parameters
3511### Path parameters
35013512 
35023513- `message_batch_id: string`
35033514 
from line 3516
35053516 
35063517### Returns
35073518 
3508- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
3519- `MessageBatch object`
35093520 
35103521 - `id: string`
35113522 
from line 3528
35173528 
35183529 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
35193530 
3531 format: date-time
3532 
35203533 - `cancel_initiated_at: string or null`
35213534 
35223535 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
35233536 
3537 format: date-time
3538 
35243539 - `created_at: string`
35253540 
35263541 RFC 3339 datetime string representing the time at which the Message Batch was created.
35273542 
3543 format: date-time
3544 
35283545 - `ended_at: string or null`
35293546 
35303547 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
35313548 
35323549 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
35333550 
3551 format: date-time
3552 
35343553 - `expires_at: string`
35353554 
35363555 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
35373556 
3557 format: date-time
3558 
35383559 - `processing_status: "in_progress" or "canceling" or "ended"`
35393560 
35403561 Processing status of the Message Batch.
from line 3578
35573578 
35583579 This is zero until processing of the entire Message Batch has ended.
35593580 
3581 default: 0
3582 
35603583 - `errored: number`
35613584 
35623585 Number of requests in the Message Batch that encountered an error.
35633586 
35643587 This is zero until processing of the entire Message Batch has ended.
35653588 
3589 default: 0
3590 
35663591 - `expired: number`
35673592 
35683593 Number of requests in the Message Batch that have expired.
35693594 
35703595 This is zero until processing of the entire Message Batch has ended.
35713596 
3597 default: 0
3598 
35723599 - `processing: number`
35733600 
35743601 Number of requests in the Message Batch that are processing.
35753602 
3603 default: 0
3604 
35763605 - `succeeded: number`
35773606 
35783607 Number of requests in the Message Batch that have completed successfully.
35793608 
35803609 This is zero until processing of the entire Message Batch has ended.
35813610 
3611 default: 0
3612 
35823613 - `results_url: string or null`
35833614 
35843615 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3622
35913622 
35923623 For Message Batches, this is always `"message_batch"`.
35933624 
3594 - `"message_batch"`
3625 default: message_batch
35953626 
35963627### Example
35973628 
3598```http
3629```bash
35993630curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \
36003631 -X POST \
36013632 -H 'anthropic-version: 2023-06-01' \
36023633 -H "X-Api-Key: $ANTHROPIC_API_KEY"
36033634```
36043635 
3605#### Response
3636#### Response (200)
36063637 
36073638```json
36083639{
from line 3658
36273658 
36283659## Delete a Message Batch
36293660 
3630**delete** `/v1/messages/batches/{message_batch_id}`
3661**DELETE** `/v1/messages/batches/{message_batch_id}`
36313662 
36323663Delete a Message Batch.
36333664 
from line 3666
36353666 
36363667Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
36373668 
3638### Path Parameters
3669### Path parameters
36393670 
36403671- `message_batch_id: string`
36413672 
from line 3674
36433674 
36443675### Returns
36453676 
3646- `DeletedMessageBatch object { id, type }`
3677- `DeletedMessageBatch object`
36473678 
36483679 - `id: string`
36493680 
from line 3686
36553686 
36563687 For Message Batches, this is always `"message_batch_deleted"`.
36573688 
3658 - `"message_batch_deleted"`
3689 default: message_batch_deleted
36593690 
36603691### Example
36613692 
3662```http
3693```bash
36633694curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
36643695 -X DELETE \
36653696 -H 'anthropic-version: 2023-06-01' \
36663697 -H "X-Api-Key: $ANTHROPIC_API_KEY"
36673698```
36683699 
3669#### Response
3700#### Response (200)
36703701 
36713702```json
36723703{
from line 3708
36773708 
36783709## Retrieve Message Batch results
36793710 
3680**get** `/v1/messages/batches/{message_batch_id}/results`
3711**GET** `/v1/messages/batches/{message_batch_id}/results`
36813712 
36823713Streams the results of a Message Batch as a `.jsonl` file.
36833714 
from line 3716
36853716 
36863717Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
36873718 
3688### Path Parameters
3719### Path parameters
36893720 
36903721- `message_batch_id: string`
36913722 
from line 3724
36933724 
36943725### Returns
36953726 
3696- `MessageBatchIndividualResponse object { custom_id, result }`
3727- `MessageBatchIndividualResponse object`
36973728 
36983729 This is a single line in the response `.jsonl` file and does not represent the response as a whole.
36993730 
from line 3740
37093740 
37103741 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
37113742 
3712 - `MessageBatchSucceededResult object { message, type }`
3743 - `MessageBatchSucceededResult object`
37133744 
37143745 - `message: Message`
37153746 
from line 3762
37313762 
37323763 The time at which the container will expire.
37333764 
3765 format: date-time
3766 
37343767 - `skills: array of ContainerSkill or null`
37353768 
37363769 Skills loaded in the container
from line 3772
37393772 
37403773 Skill ID
37413774 
3775 maxLength: 64, minLength: 1
3776 
37423777 - `type: "anthropic" or "custom"`
37433778 
37443779 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 3785
37503785 - `version: string`
37513786 
37523787 The resolved version: a skill version ID for custom skills.
3788 
3789 maxLength: 64, minLength: 1
37533790 
37543791 - `content: array of ContentBlock`
37553792 
from line 3817
37803817 [{"type": "text", "text": "B)"}]
37813818 ```
37823819 
3783 - `TextBlock object { citations, text, type }`
3820 - `TextBlock object`
37843821 
37853822 - `citations: array of TextCitation or null`
37863823 
from line 3825
37883825 
37893826 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
37903827 
3791 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
3828 - `CitationCharLocation object`
37923829 
37933830 - `cited_text: string`
37943831 
37953832 - `document_index: number`
37963833 
3834 minimum: 0
3835 
37973836 - `document_title: string or null`
37983837 
37993838 - `end_char_index: number`
from line 3841
38023841 
38033842 - `start_char_index: number`
38043843 
3844 minimum: 0
3845 
38053846 - `type: "char_location"`
38063847 
3807 - `"char_location"`
3808 
3809 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
3848 default: char_location
3849 
3850 - `CitationPageLocation object`
38103851 
38113852 - `cited_text: string`
38123853 
38133854 - `document_index: number`
38143855 
3856 minimum: 0
3857 
38153858 - `document_title: string or null`
38163859 
38173860 - `end_page_number: number`
from line 3863
38203863 
38213864 - `start_page_number: number`
38223865 
3866 minimum: 1
3867 
38233868 - `type: "page_location"`
38243869 
3825 - `"page_location"`
3826 
3827 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
3870 default: page_location
3871 
3872 - `CitationContentBlockLocation object`
38283873 
38293874 - `cited_text: string`
38303875 
from line 3879
38343879 
38353880 - `document_index: number`
38363881 
3882 minimum: 0
3883 
38373884 - `document_title: string or null`
38383885 
38393886 - `end_block_index: number`
from line 3895
38483895 
38493896 0-based index of the first cited block in the source's `content` array.
38503897 
3898 minimum: 0
3899 
38513900 - `type: "content_block_location"`
38523901 
3853 - `"content_block_location"`
3854 
3855 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
3902 default: content_block_location
3903 
3904 - `CitationsWebSearchResultLocation object`
38563905 
38573906 - `cited_text: string`
38583907 
from line 3909
38603909 
38613910 - `title: string or null`
38623911 
3912 maxLength: 512
3913 
38633914 - `type: "web_search_result_location"`
38643915 
3865 - `"web_search_result_location"`
3916 default: web_search_result_location
38663917 
38673918 - `url: string`
38683919 
3869 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
3920 - `CitationsSearchResultLocation object`
38703921 
38713922 - `cited_text: string`
38723923 
from line 3937
38863937 
38873938 Counted separately from `document_index`; server-side web search results are not included in this count.
38883939 
3940 minimum: 0
3941 
38893942 - `source: string`
38903943 
38913944 - `start_block_index: number`
38923945 
38933946 0-based index of the first cited block in the source's `content` array.
38943947 
3948 minimum: 0
3949 
38953950 - `title: string or null`
38963951 
38973952 - `type: "search_result_location"`
38983953 
3899 - `"search_result_location"`
3954 default: search_result_location
39003955 
39013956 - `text: string`
39023957 
3958 maxLength: 5000000, minLength: 0
3959 
39033960 - `type: "text"`
39043961 
3905 - `"text"`
3906 
3907 - `ThinkingBlock object { signature, thinking, type }`
3962 default: text
3963 
3964 - `ThinkingBlock object`
39083965 
39093966 - `signature: string`
39103967 
from line 3977
39203977 
39213978 - `type: "thinking"`
39223979 
3923 - `"thinking"`
3924 
3925 - `RedactedThinkingBlock object { data, type }`
3980 default: thinking
3981 
3982 - `RedactedThinkingBlock object`
39263983 
39273984 - `data: string`
39283985 
from line 3991
39343991 
39353992 - `type: "redacted_thinking"`
39363993 
3937 - `"redacted_thinking"`
3938 
3939 - `ToolUseBlock object { id, caller, input, 3 more }`
3994 default: redacted_thinking
3995 
3996 - `ToolUseBlock object`
39403997 
39413998 - `id: string`
39423999 
4000 pattern: ^[a-zA-Z0-9_-]+$
4001 
39434002 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
39444003 
39454004 Tool invocation directly from the model.
39464005 
3947 - `DirectCaller object { type }`
4006 default: {"type":"direct"}
4007 
4008 - `DirectCaller object`
39484009 
39494010 Tool invocation directly from the model.
39504011 
39514012 - `type: "direct"`
39524013 
3953 - `"direct"`
3954 
3955 - `ServerToolCaller object { tool_id, type }`
4014 - `ServerToolCaller object`
39564015 
39574016 Tool invocation generated by a server-side tool.
39584017 
39594018 - `tool_id: string`
39604019 
4020 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4021 
39614022 - `type: "code_execution_20250825"`
39624023 
3963 - `"code_execution_20250825"`
3964 
3965 - `ServerToolCaller20260120 object { tool_id, type }`
4024 - `ServerToolCaller20260120 object`
39664025 
39674026 - `tool_id: string`
39684027 
4028 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4029 
39694030 - `type: "code_execution_20260120"`
39704031 
3971 - `"code_execution_20260120"`
3972 
39734032 - `input: map[unknown]`
39744033 
39754034 - `name: string`
39764035 
4036 minLength: 1
4037 
39774038 - `type: "tool_use"`
39784039 
3979 - `"tool_use"`
4040 default: tool_use
39804041 
39814042 - `toolset_name: optional string or null`
39824043 
39834044 For a toolset member tool_use, the toolset family.
39844045 
3985 - `ServerToolUseBlock object { id, caller, input, 2 more }`
4046 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
4047 
4048 - `ServerToolUseBlock object`
39864049 
39874050 - `id: string`
39884051 
4052 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4053 
39894054 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
39904055 
39914056 Tool invocation directly from the model.
39924057 
3993 - `DirectCaller object { type }`
4058 default: {"type":"direct"}
4059 
4060 - `DirectCaller object`
39944061 
39954062 Tool invocation directly from the model.
39964063 
3997 - `ServerToolCaller object { tool_id, type }`
4064 - `ServerToolCaller object`
39984065 
39994066 Tool invocation generated by a server-side tool.
40004067 
4001 - `ServerToolCaller20260120 object { tool_id, type }`
4068 - `ServerToolCaller20260120 object`
40024069 
40034070 - `input: map[unknown]`
40044071 
from line 4087
40204087 
40214088 - `type: "server_tool_use"`
40224089 
4023 - `"server_tool_use"`
4024 
4025 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
4090 default: server_tool_use
4091 
4092 - `WebSearchToolResultBlock object`
40264093 
40274094 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
40284095 
40294096 Tool invocation directly from the model.
40304097 
4031 - `DirectCaller object { type }`
4098 default: {"type":"direct"}
4099 
4100 - `DirectCaller object`
40324101 
40334102 Tool invocation directly from the model.
40344103 
4035 - `ServerToolCaller object { tool_id, type }`
4104 - `ServerToolCaller object`
40364105 
40374106 Tool invocation generated by a server-side tool.
40384107 
4039 - `ServerToolCaller20260120 object { tool_id, type }`
4108 - `ServerToolCaller20260120 object`
40404109 
40414110 - `content: WebSearchToolResultBlockContent`
40424111 
4043 - `WebSearchToolResultError object { error_code, type }`
4112 - `WebSearchToolResultError object`
40444113 
40454114 - `error_code: WebSearchToolResultErrorCode`
40464115 
from line 4127
40584127 
40594128 - `type: "web_search_tool_result_error"`
40604129 
4061 - `"web_search_tool_result_error"`
4130 default: web_search_tool_result_error
40624131 
40634132 - `array of WebSearchResultBlock`
40644133 
from line 4139
40704139 
40714140 - `type: "web_search_result"`
40724141 
4073 - `"web_search_result"`
4142 default: web_search_result
40744143 
40754144 - `url: string`
40764145 
40774146 - `tool_use_id: string`
40784147 
4148 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4149 
40794150 - `type: "web_search_tool_result"`
40804151 
4081 - `"web_search_tool_result"`
4082 
4083 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
4152 default: web_search_tool_result
4153 
4154 - `WebFetchToolResultBlock object`
40844155 
40854156 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
40864157 
40874158 Tool invocation directly from the model.
40884159 
4089 - `DirectCaller object { type }`
4160 default: {"type":"direct"}
4161 
4162 - `DirectCaller object`
40904163 
40914164 Tool invocation directly from the model.
40924165 
4093 - `ServerToolCaller object { tool_id, type }`
4166 - `ServerToolCaller object`
40944167 
40954168 Tool invocation generated by a server-side tool.
40964169 
4097 - `ServerToolCaller20260120 object { tool_id, type }`
4170 - `ServerToolCaller20260120 object`
40984171 
40994172 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
41004173 
4101 - `WebFetchToolResultErrorBlock object { error_code, type }`
4174 - `WebFetchToolResultErrorBlock object`
41024175 
41034176 - `error_code: WebFetchToolResultErrorCode`
41044177 
from line 4195
41224195 
41234196 - `type: "web_fetch_tool_result_error"`
41244197 
4125 - `"web_fetch_tool_result_error"`
4126 
4127 - `WebFetchBlock object { content, retrieved_at, type, url }`
4198 default: web_fetch_tool_result_error
4199 
4200 - `WebFetchBlock object`
41284201 
41294202 - `content: DocumentBlock`
41304203 
from line 4207
41344207 
41354208 - `enabled: boolean`
41364209 
4210 default: false
4211 
41374212 - `source: Base64PDFSource or PlainTextSource`
41384213 
4139 - `Base64PDFSource object { data, media_type, type }`
4214 - `Base64PDFSource object`
41404215 
41414216 - `data: string`
41424217 
4218 format: byte
4219 
41434220 - `media_type: "application/pdf"`
41444221 
4145 - `"application/pdf"`
4146 
41474222 - `type: "base64"`
41484223 
4149 - `"base64"`
4150 
4151 - `PlainTextSource object { data, media_type, type }`
4224 - `PlainTextSource object`
41524225 
41534226 - `data: string`
41544227 
41554228 - `media_type: "text/plain"`
41564229 
4157 - `"text/plain"`
4158 
41594230 - `type: "text"`
41604231 
4161 - `"text"`
4162 
41634232 - `title: string or null`
41644233 
41654234 The title of the document
41664235 
41674236 - `type: "document"`
41684237 
4169 - `"document"`
4238 default: document
41704239 
41714240 - `retrieved_at: string or null`
41724241 
from line 4243
41744243 
41754244 - `type: "web_fetch_result"`
41764245 
4177 - `"web_fetch_result"`
4246 default: web_fetch_result
41784247 
41794248 - `url: string`
41804249 
from line 4251
41824251 
41834252 - `tool_use_id: string`
41844253 
4254 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4255 
41854256 - `type: "web_fetch_tool_result"`
41864257 
4187 - `"web_fetch_tool_result"`
4188 
4189 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
4258 default: web_fetch_tool_result
4259 
4260 - `CodeExecutionToolResultBlock object`
41904261 
41914262 - `content: CodeExecutionToolResultBlockContent`
41924263 
41934264 Code execution result with encrypted stdout for PFC + web_search results.
41944265 
4195 - `CodeExecutionToolResultError object { error_code, type }`
4266 - `CodeExecutionToolResultError object`
41964267 
41974268 - `error_code: CodeExecutionToolResultErrorCode`
41984269 
from line 4277
42064277 
42074278 - `type: "code_execution_tool_result_error"`
42084279 
4209 - `"code_execution_tool_result_error"`
4210 
4211 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
4280 default: code_execution_tool_result_error
4281 
4282 - `CodeExecutionResultBlock object`
42124283 
42134284 - `content: array of CodeExecutionOutputBlock`
42144285 
from line 4287
42164287 
42174288 - `type: "code_execution_output"`
42184289 
4219 - `"code_execution_output"`
4290 default: code_execution_output
42204291 
42214292 - `return_code: number`
42224293 
from line 4297
42264297 
42274298 - `type: "code_execution_result"`
42284299 
4229 - `"code_execution_result"`
4230 
4231 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
4300 default: code_execution_result
4301 
4302 - `EncryptedCodeExecutionResultBlock object`
42324303 
42334304 Code execution result with encrypted stdout for PFC + web_search results.
42344305 
from line 4309
42384309 
42394310 - `type: "code_execution_output"`
42404311 
4312 default: code_execution_output
4313 
42414314 - `encrypted_stdout: string`
42424315 
42434316 - `return_code: number`
from line 4319
42464319 
42474320 - `type: "encrypted_code_execution_result"`
42484321 
4249 - `"encrypted_code_execution_result"`
4322 default: encrypted_code_execution_result
42504323 
42514324 - `tool_use_id: string`
42524325 
4326 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4327 
42534328 - `type: "code_execution_tool_result"`
42544329 
4255 - `"code_execution_tool_result"`
4256 
4257 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
4330 default: code_execution_tool_result
4331 
4332 - `BashCodeExecutionToolResultBlock object`
42584333 
42594334 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
42604335 
4261 - `BashCodeExecutionToolResultError object { error_code, type }`
4336 - `BashCodeExecutionToolResultError object`
42624337 
42634338 - `error_code: BashCodeExecutionToolResultErrorCode`
42644339 
from line 4349
42744349 
42754350 - `type: "bash_code_execution_tool_result_error"`
42764351 
4277 - `"bash_code_execution_tool_result_error"`
4278 
4279 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
4352 default: bash_code_execution_tool_result_error
4353 
4354 - `BashCodeExecutionResultBlock object`
42804355 
42814356 - `content: array of BashCodeExecutionOutputBlock`
42824357 
from line 4359
42844359 
42854360 - `type: "bash_code_execution_output"`
42864361 
4287 - `"bash_code_execution_output"`
4362 default: bash_code_execution_output
42884363 
42894364 - `return_code: number`
42904365 
from line 4369
42944369 
42954370 - `type: "bash_code_execution_result"`
42964371 
4297 - `"bash_code_execution_result"`
4372 default: bash_code_execution_result
42984373 
42994374 - `tool_use_id: string`
43004375 
4376 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4377 
43014378 - `type: "bash_code_execution_tool_result"`
43024379 
4303 - `"bash_code_execution_tool_result"`
4304 
4305 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
4380 default: bash_code_execution_tool_result
4381 
4382 - `TextEditorCodeExecutionToolResultBlock object`
43064383 
43074384 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
43084385 
4309 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
4386 - `TextEditorCodeExecutionToolResultError object`
43104387 
43114388 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
43124389 
from line 4401
43244401 
43254402 - `type: "text_editor_code_execution_tool_result_error"`
43264403 
4327 - `"text_editor_code_execution_tool_result_error"`
4328 
4329 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
4404 default: text_editor_code_execution_tool_result_error
4405 
4406 - `TextEditorCodeExecutionViewResultBlock object`
43304407 
43314408 - `content: string`
43324409 
from line 4423
43464423 
43474424 - `type: "text_editor_code_execution_view_result"`
43484425 
4349 - `"text_editor_code_execution_view_result"`
4350 
4351 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
4426 default: text_editor_code_execution_view_result
4427 
4428 - `TextEditorCodeExecutionCreateResultBlock object`
43524429 
43534430 - `is_file_update: boolean`
43544431 
43554432 - `type: "text_editor_code_execution_create_result"`
43564433 
4357 - `"text_editor_code_execution_create_result"`
4358 
4359 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
4434 default: text_editor_code_execution_create_result
4435 
4436 - `TextEditorCodeExecutionStrReplaceResultBlock object`
43604437 
43614438 - `lines: array of string or null`
43624439 
from line 4447
43704447 
43714448 - `type: "text_editor_code_execution_str_replace_result"`
43724449 
4373 - `"text_editor_code_execution_str_replace_result"`
4450 default: text_editor_code_execution_str_replace_result
43744451 
43754452 - `tool_use_id: string`
43764453 
4454 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4455 
43774456 - `type: "text_editor_code_execution_tool_result"`
43784457 
4379 - `"text_editor_code_execution_tool_result"`
4380 
4381 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
4458 default: text_editor_code_execution_tool_result
4459 
4460 - `ToolSearchToolResultBlock object`
43824461 
43834462 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
43844463 
4385 - `ToolSearchToolResultError object { error_code, error_message, type }`
4464 - `ToolSearchToolResultError object`
43864465 
43874466 - `error_code: ToolSearchToolResultErrorCode`
43884467 
from line 4477
43984477 
43994478 - `type: "tool_search_tool_result_error"`
44004479 
4401 - `"tool_search_tool_result_error"`
4402 
4403 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
4480 default: tool_search_tool_result_error
4481 
4482 - `ToolSearchToolSearchResultBlock object`
44044483 
44054484 - `tool_references: array of ToolReferenceBlock`
44064485 
44074486 - `tool_name: string`
44084487 
4488 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
4489 
44094490 - `type: "tool_reference"`
44104491 
4411 - `"tool_reference"`
4492 default: tool_reference
44124493 
44134494 - `type: "tool_search_tool_search_result"`
44144495 
4415 - `"tool_search_tool_search_result"`
4496 default: tool_search_tool_search_result
44164497 
44174498 - `tool_use_id: string`
44184499 
4500 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
4501 
44194502 - `type: "tool_search_tool_result"`
44204503 
4421 - `"tool_search_tool_result"`
4422 
4423 - `ContainerUploadBlock object { file_id, type }`
4504 default: tool_search_tool_result
4505 
4506 - `ContainerUploadBlock object`
44244507 
44254508 Response model for a file uploaded to the container.
44264509 
from line 4511
44284511 
44294512 - `type: "container_upload"`
44304513 
4431 - `"container_upload"`
4514 default: container_upload
44324515 
44334516 - `model: Model`
44344517 
from line 4593
45104593 
45114594 This will always be `"assistant"`.
45124595 
4513 - `"assistant"`
4596 default: assistant
45144597 
45154598 - `stop_details: RefusalStopDetails or null`
45164599 
from line 4631
45484631 
45494632 - `type: "refusal"`
45504633 
4551 - `"refusal"`
4634 default: refusal
45524635 
45534636 - `stop_reason: StopReason or null`
45544637 
from line 4675
45924675 
45934676 For Messages, this is always `"message"`.
45944677 
4595 - `"message"`
4678 default: message
45964679 
45974680 - `usage: Usage`
45984681 
from line 4697
46144697 
46154698 The number of input tokens used to create the 1 hour cache entry.
46164699 
4700 default: 0, minimum: 0
4701 
46174702 - `ephemeral_5m_input_tokens: number`
46184703 
46194704 The number of input tokens used to create the 5 minute cache entry.
46204705 
4706 default: 0, minimum: 0
4707 
46214708 - `cache_creation_input_tokens: number or null`
46224709 
46234710 The number of input tokens used to create the cache entry.
46244711 
4712 minimum: 0
4713 
46254714 - `cache_read_input_tokens: number or null`
46264715 
46274716 The number of input tokens read from the cache.
46284717 
4718 minimum: 0
4719 
46294720 - `inference_geo: string or null`
46304721 
46314722 The geographic region where inference was performed for this request.
from line 4725
46344725 
46354726 The number of input tokens which were used.
46364727 
4728 minimum: 0
4729 
46374730 - `output_tokens: number`
46384731 
46394732 The number of output tokens which were used.
4733 
4734 minimum: 0
46404735 
46414736 - `output_tokens_details: OutputTokensDetails or null`
46424737 
from line 4753
46584753 generation count by a small number of tokens. Always ≤ `output_tokens`;
46594754 `output_tokens - thinking_tokens` approximates the non-reasoning output.
46604755 
4756 default: 0, minimum: 0
4757 
46614758 - `server_tool_use: ServerToolUsage or null`
46624759 
46634760 The number of server tool requests.
from line 4763
46664763 
46674764 The number of web fetch tool requests.
46684765 
4766 default: 0, minimum: 0
4767 
46694768 - `web_search_requests: number`
46704769 
46714770 The number of web search tool requests.
46724771 
4772 default: 0, minimum: 0
4773 
46734774 - `service_tier: "standard" or "priority" or "batch" or null`
46744775 
46754776 If the request used the priority, standard, or batch tier.
from line 4783
46824783 
46834784 - `type: "succeeded"`
46844785 
4685 - `"succeeded"`
4686 
4687 - `MessageBatchErroredResult object { error, type }`
4786 default: succeeded
4787 
4788 - `MessageBatchErroredResult object`
46884789 
46894790 - `error: ErrorResponse`
46904791 
46914792 - `error: ErrorObject`
46924793 
4693 - `InvalidRequestError object { message, type }`
4794 - `InvalidRequestError object`
46944795 
46954796 - `message: string`
46964797 
4798 default: Invalid request
4799 
46974800 - `type: "invalid_request_error"`
46984801 
4699 - `"invalid_request_error"`
4700 
4701 - `AuthenticationError object { message, type }`
4802 default: invalid_request_error
4803 
4804 - `AuthenticationError object`
47024805 
47034806 - `message: string`
47044807 
4808 default: Authentication error
4809 
47054810 - `type: "authentication_error"`
47064811 
4707 - `"authentication_error"`
4708 
4709 - `BillingError object { message, type }`
4812 default: authentication_error
4813 
4814 - `BillingError object`
47104815 
47114816 - `message: string`
47124817 
4818 default: Billing error
4819 
47134820 - `type: "billing_error"`
47144821 
4715 - `"billing_error"`
4716 
4717 - `PermissionError object { message, type }`
4822 default: billing_error
4823 
4824 - `PermissionError object`
47184825 
47194826 - `message: string`
47204827 
4828 default: Permission denied
4829 
47214830 - `type: "permission_error"`
47224831 
4723 - `"permission_error"`
4724 
4725 - `NotFoundError object { message, type }`
4832 default: permission_error
4833 
4834 - `NotFoundError object`
47264835 
47274836 - `message: string`
47284837 
4838 default: Not found
4839 
47294840 - `type: "not_found_error"`
47304841 
4731 - `"not_found_error"`
4732 
4733 - `RateLimitError object { message, type }`
4842 default: not_found_error
4843 
4844 - `RateLimitError object`
47344845 
47354846 - `message: string`
47364847 
4848 default: Rate limited
4849 
47374850 - `type: "rate_limit_error"`
47384851 
4739 - `"rate_limit_error"`
4740 
4741 - `GatewayTimeoutError object { message, type }`
4852 default: rate_limit_error
4853 
4854 - `GatewayTimeoutError object`
47424855 
47434856 - `message: string`
47444857 
4858 default: Request timeout
4859 
47454860 - `type: "timeout_error"`
47464861 
4747 - `"timeout_error"`
4748 
4749 - `APIErrorObject object { message, type }`
4862 default: timeout_error
4863 
4864 - `APIErrorObject object`
47504865 
47514866 - `message: string`
47524867 
4868 default: Internal server error
4869 
47534870 - `type: "api_error"`
47544871 
4755 - `"api_error"`
4756 
4757 - `OverloadedError object { message, type }`
4872 default: api_error
4873 
4874 - `OverloadedError object`
47584875 
47594876 - `message: string`
47604877 
4878 default: Overloaded
4879 
47614880 - `type: "overloaded_error"`
47624881 
4763 - `"overloaded_error"`
4882 default: overloaded_error
47644883 
47654884 - `request_id: string or null`
47664885 
47674886 - `type: "error"`
47684887 
4769 - `"error"`
4888 default: error
47704889 
47714890 - `type: "errored"`
47724891 
4773 - `"errored"`
4774 
4775 - `MessageBatchCanceledResult object { type }`
4892 default: errored
4893 
4894 - `MessageBatchCanceledResult object`
47764895 
47774896 - `type: "canceled"`
47784897 
4779 - `"canceled"`
4780 
4781 - `MessageBatchExpiredResult object { type }`
4898 default: canceled
4899 
4900 - `MessageBatchExpiredResult object`
47824901 
47834902 - `type: "expired"`
47844903 
4785 - `"expired"`
4904 default: expired
47864905 
47874906### Example
47884907 
4789```http
4908```bash
47904909curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/results \
47914910 -H 'anthropic-version: 2023-06-01' \
47924911 -H "X-Api-Key: $ANTHROPIC_API_KEY"
47934912```
47944913 
4795## Domain Types
4914## Domain types
47964915 
47974916### Deleted Message Batch
47984917 
4799- `DeletedMessageBatch object { id, type }`
4918- `DeletedMessageBatch object`
48004919 
48014920 - `id: string`
48024921 
from line 4927
48084927 
48094928 For Message Batches, this is always `"message_batch_deleted"`.
48104929 
4811 - `"message_batch_deleted"`
4930 default: message_batch_deleted
48124931 
48134932### Message Batch
48144933 
4815- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
4934- `MessageBatch object`
48164935 
48174936 - `id: string`
48184937 
from line 4943
48244943 
48254944 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
48264945 
4946 format: date-time
4947 
48274948 - `cancel_initiated_at: string or null`
48284949 
48294950 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
48304951 
4952 format: date-time
4953 
48314954 - `created_at: string`
48324955 
48334956 RFC 3339 datetime string representing the time at which the Message Batch was created.
48344957 
4958 format: date-time
4959 
48354960 - `ended_at: string or null`
48364961 
48374962 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
48384963 
48394964 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
48404965 
4966 format: date-time
4967 
48414968 - `expires_at: string`
48424969 
48434970 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
48444971 
4972 format: date-time
4973 
48454974 - `processing_status: "in_progress" or "canceling" or "ended"`
48464975 
48474976 Processing status of the Message Batch.
from line 4993
48644993 
48654994 This is zero until processing of the entire Message Batch has ended.
48664995 
4996 default: 0
4997 
48674998 - `errored: number`
48684999 
48695000 Number of requests in the Message Batch that encountered an error.
48705001 
48715002 This is zero until processing of the entire Message Batch has ended.
48725003 
5004 default: 0
5005 
48735006 - `expired: number`
48745007 
48755008 Number of requests in the Message Batch that have expired.
48765009 
48775010 This is zero until processing of the entire Message Batch has ended.
48785011 
5012 default: 0
5013 
48795014 - `processing: number`
48805015 
48815016 Number of requests in the Message Batch that are processing.
48825017 
5018 default: 0
5019 
48835020 - `succeeded: number`
48845021 
48855022 Number of requests in the Message Batch that have completed successfully.
48865023 
48875024 This is zero until processing of the entire Message Batch has ended.
48885025 
5026 default: 0
5027 
48895028 - `results_url: string or null`
48905029 
48915030 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 5037
48985037 
48995038 For Message Batches, this is always `"message_batch"`.
49005039 
4901 - `"message_batch"`
5040 default: message_batch
49025041 
49035042### Message Batch Canceled Result
49045043 
4905- `MessageBatchCanceledResult object { type }`
5044- `MessageBatchCanceledResult object`
49065045 
49075046 - `type: "canceled"`
49085047 
4909 - `"canceled"`
5048 default: canceled
49105049 
49115050### Message Batch Errored Result
49125051 
4913- `MessageBatchErroredResult object { error, type }`
5052- `MessageBatchErroredResult object`
49145053 
49155054 - `error: ErrorResponse`
49165055 
49175056 - `error: ErrorObject`
49185057 
4919 - `InvalidRequestError object { message, type }`
5058 - `InvalidRequestError object`
49205059 
49215060 - `message: string`
49225061 
5062 default: Invalid request
5063 
49235064 - `type: "invalid_request_error"`
49245065 
4925 - `"invalid_request_error"`
4926 
4927 - `AuthenticationError object { message, type }`
5066 default: invalid_request_error
5067 
5068 - `AuthenticationError object`
49285069 
49295070 - `message: string`
49305071 
5072 default: Authentication error
5073 
49315074 - `type: "authentication_error"`
49325075 
4933 - `"authentication_error"`
4934 
4935 - `BillingError object { message, type }`
5076 default: authentication_error
5077 
5078 - `BillingError object`
49365079 
49375080 - `message: string`
49385081 
5082 default: Billing error
5083 
49395084 - `type: "billing_error"`
49405085 
4941 - `"billing_error"`
4942 
4943 - `PermissionError object { message, type }`
5086 default: billing_error
5087 
5088 - `PermissionError object`
49445089 
49455090 - `message: string`
49465091 
5092 default: Permission denied
5093 
49475094 - `type: "permission_error"`
49485095 
4949 - `"permission_error"`
4950 
4951 - `NotFoundError object { message, type }`
5096 default: permission_error
5097 
5098 - `NotFoundError object`
49525099 
49535100 - `message: string`
49545101 
5102 default: Not found
5103 
49555104 - `type: "not_found_error"`
49565105 
4957 - `"not_found_error"`
4958 
4959 - `RateLimitError object { message, type }`
5106 default: not_found_error
5107 
5108 - `RateLimitError object`
49605109 
49615110 - `message: string`
49625111 
5112 default: Rate limited
5113 
49635114 - `type: "rate_limit_error"`
49645115 
4965 - `"rate_limit_error"`
4966 
4967 - `GatewayTimeoutError object { message, type }`
5116 default: rate_limit_error
5117 
5118 - `GatewayTimeoutError object`
49685119 
49695120 - `message: string`
49705121 
5122 default: Request timeout
5123 
49715124 - `type: "timeout_error"`
49725125 
4973 - `"timeout_error"`
4974 
4975 - `APIErrorObject object { message, type }`
5126 default: timeout_error
5127 
5128 - `APIErrorObject object`
49765129 
49775130 - `message: string`
49785131 
5132 default: Internal server error
5133 
49795134 - `type: "api_error"`
49805135 
4981 - `"api_error"`
4982 
4983 - `OverloadedError object { message, type }`
5136 default: api_error
5137 
5138 - `OverloadedError object`
49845139 
49855140 - `message: string`
49865141 
5142 default: Overloaded
5143 
49875144 - `type: "overloaded_error"`
49885145 
4989 - `"overloaded_error"`
5146 default: overloaded_error
49905147 
49915148 - `request_id: string or null`
49925149 
49935150 - `type: "error"`
49945151 
4995 - `"error"`
5152 default: error
49965153 
49975154 - `type: "errored"`
49985155 
4999 - `"errored"`
5156 default: errored
50005157 
50015158### Message Batch Expired Result
50025159 
5003- `MessageBatchExpiredResult object { type }`
5160- `MessageBatchExpiredResult object`
50045161 
50055162 - `type: "expired"`
50065163 
5007 - `"expired"`
5164 default: expired
50085165 
50095166### Message Batch Individual Response
50105167 
5011- `MessageBatchIndividualResponse object { custom_id, result }`
5168- `MessageBatchIndividualResponse object`
50125169 
50135170 This is a single line in the response `.jsonl` file and does not represent the response as a whole.
50145171 
from line 5181
50245181 
50255182 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
50265183 
5027 - `MessageBatchSucceededResult object { message, type }`
5184 - `MessageBatchSucceededResult object`
50285185 
50295186 - `message: Message`
50305187 
from line 5203
50465203 
50475204 The time at which the container will expire.
50485205 
5206 format: date-time
5207 
50495208 - `skills: array of ContainerSkill or null`
50505209 
50515210 Skills loaded in the container
from line 5213
50545213 
50555214 Skill ID
50565215 
5216 maxLength: 64, minLength: 1
5217 
50575218 - `type: "anthropic" or "custom"`
50585219 
50595220 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 5226
50655226 - `version: string`
50665227 
50675228 The resolved version: a skill version ID for custom skills.
5229 
5230 maxLength: 64, minLength: 1
50685231 
50695232 - `content: array of ContentBlock`
50705233 
from line 5258
50955258 [{"type": "text", "text": "B)"}]
50965259 ```
50975260 
5098 - `TextBlock object { citations, text, type }`
5261 - `TextBlock object`
50995262 
51005263 - `citations: array of TextCitation or null`
51015264 
from line 5266
51035266 
51045267 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
51055268 
5106 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
5269 - `CitationCharLocation object`
51075270 
51085271 - `cited_text: string`
51095272 
51105273 - `document_index: number`
51115274 
5275 minimum: 0
5276 
51125277 - `document_title: string or null`
51135278 
51145279 - `end_char_index: number`
from line 5282
51175282 
51185283 - `start_char_index: number`
51195284 
5285 minimum: 0
5286 
51205287 - `type: "char_location"`
51215288 
5122 - `"char_location"`
5123 
5124 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
5289 default: char_location
5290 
5291 - `CitationPageLocation object`
51255292 
51265293 - `cited_text: string`
51275294 
51285295 - `document_index: number`
51295296 
5297 minimum: 0
5298 
51305299 - `document_title: string or null`
51315300 
51325301 - `end_page_number: number`
from line 5304
51355304 
51365305 - `start_page_number: number`
51375306 
5307 minimum: 1
5308 
51385309 - `type: "page_location"`
51395310 
5140 - `"page_location"`
5141 
5142 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
5311 default: page_location
5312 
5313 - `CitationContentBlockLocation object`
51435314 
51445315 - `cited_text: string`
51455316 
from line 5320
51495320 
51505321 - `document_index: number`
51515322 
5323 minimum: 0
5324 
51525325 - `document_title: string or null`
51535326 
51545327 - `end_block_index: number`
from line 5336
51635336 
51645337 0-based index of the first cited block in the source's `content` array.
51655338 
5339 minimum: 0
5340 
51665341 - `type: "content_block_location"`
51675342 
5168 - `"content_block_location"`
5169 
5170 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
5343 default: content_block_location
5344 
5345 - `CitationsWebSearchResultLocation object`
51715346 
51725347 - `cited_text: string`
51735348 
from line 5350
51755350 
51765351 - `title: string or null`
51775352 
5353 maxLength: 512
5354 
51785355 - `type: "web_search_result_location"`
51795356 
5180 - `"web_search_result_location"`
5357 default: web_search_result_location
51815358 
51825359 - `url: string`
51835360 
5184 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
5361 - `CitationsSearchResultLocation object`
51855362 
51865363 - `cited_text: string`
51875364 
from line 5378
52015378 
52025379 Counted separately from `document_index`; server-side web search results are not included in this count.
52035380 
5381 minimum: 0
5382 
52045383 - `source: string`
52055384 
52065385 - `start_block_index: number`
52075386 
52085387 0-based index of the first cited block in the source's `content` array.
52095388 
5389 minimum: 0
5390 
52105391 - `title: string or null`
52115392 
52125393 - `type: "search_result_location"`
52135394 
5214 - `"search_result_location"`
5395 default: search_result_location
52155396 
52165397 - `text: string`
52175398 
5399 maxLength: 5000000, minLength: 0
5400 
52185401 - `type: "text"`
52195402 
5220 - `"text"`
5221 
5222 - `ThinkingBlock object { signature, thinking, type }`
5403 default: text
5404 
5405 - `ThinkingBlock object`
52235406 
52245407 - `signature: string`
52255408 
from line 5418
52355418 
52365419 - `type: "thinking"`
52375420 
5238 - `"thinking"`
5239 
5240 - `RedactedThinkingBlock object { data, type }`
5421 default: thinking
5422 
5423 - `RedactedThinkingBlock object`
52415424 
52425425 - `data: string`
52435426 
from line 5432
52495432 
52505433 - `type: "redacted_thinking"`
52515434 
5252 - `"redacted_thinking"`
5253 
5254 - `ToolUseBlock object { id, caller, input, 3 more }`
5435 default: redacted_thinking
5436 
5437 - `ToolUseBlock object`
52555438 
52565439 - `id: string`
52575440 
5441 pattern: ^[a-zA-Z0-9_-]+$
5442 
52585443 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
52595444 
52605445 Tool invocation directly from the model.
52615446 
5262 - `DirectCaller object { type }`
5447 default: {"type":"direct"}
5448 
5449 - `DirectCaller object`
52635450 
52645451 Tool invocation directly from the model.
52655452 
52665453 - `type: "direct"`
52675454 
5268 - `"direct"`
5269 
5270 - `ServerToolCaller object { tool_id, type }`
5455 - `ServerToolCaller object`
52715456 
52725457 Tool invocation generated by a server-side tool.
52735458 
52745459 - `tool_id: string`
52755460 
5461 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5462 
52765463 - `type: "code_execution_20250825"`
52775464 
5278 - `"code_execution_20250825"`
5279 
5280 - `ServerToolCaller20260120 object { tool_id, type }`
5465 - `ServerToolCaller20260120 object`
52815466 
52825467 - `tool_id: string`
52835468 
5469 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5470 
52845471 - `type: "code_execution_20260120"`
52855472 
5286 - `"code_execution_20260120"`
5287 
52885473 - `input: map[unknown]`
52895474 
52905475 - `name: string`
52915476 
5477 minLength: 1
5478 
52925479 - `type: "tool_use"`
52935480 
5294 - `"tool_use"`
5481 default: tool_use
52955482 
52965483 - `toolset_name: optional string or null`
52975484 
52985485 For a toolset member tool_use, the toolset family.
52995486 
5300 - `ServerToolUseBlock object { id, caller, input, 2 more }`
5487 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
5488 
5489 - `ServerToolUseBlock object`
53015490 
53025491 - `id: string`
53035492 
5493 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5494 
53045495 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
53055496 
53065497 Tool invocation directly from the model.
53075498 
5308 - `DirectCaller object { type }`
5499 default: {"type":"direct"}
5500 
5501 - `DirectCaller object`
53095502 
53105503 Tool invocation directly from the model.
53115504 
5312 - `ServerToolCaller object { tool_id, type }`
5505 - `ServerToolCaller object`
53135506 
53145507 Tool invocation generated by a server-side tool.
53155508 
5316 - `ServerToolCaller20260120 object { tool_id, type }`
5509 - `ServerToolCaller20260120 object`
53175510 
53185511 - `input: map[unknown]`
53195512 
from line 5528
53355528 
53365529 - `type: "server_tool_use"`
53375530 
5338 - `"server_tool_use"`
5339 
5340 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
5531 default: server_tool_use
5532 
5533 - `WebSearchToolResultBlock object`
53415534 
53425535 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
53435536 
53445537 Tool invocation directly from the model.
53455538 
5346 - `DirectCaller object { type }`
5539 default: {"type":"direct"}
5540 
5541 - `DirectCaller object`
53475542 
53485543 Tool invocation directly from the model.
53495544 
5350 - `ServerToolCaller object { tool_id, type }`
5545 - `ServerToolCaller object`
53515546 
53525547 Tool invocation generated by a server-side tool.
53535548 
5354 - `ServerToolCaller20260120 object { tool_id, type }`
5549 - `ServerToolCaller20260120 object`
53555550 
53565551 - `content: WebSearchToolResultBlockContent`
53575552 
5358 - `WebSearchToolResultError object { error_code, type }`
5553 - `WebSearchToolResultError object`
53595554 
53605555 - `error_code: WebSearchToolResultErrorCode`
53615556 
from line 5568
53735568 
53745569 - `type: "web_search_tool_result_error"`
53755570 
5376 - `"web_search_tool_result_error"`
5571 default: web_search_tool_result_error
53775572 
53785573 - `array of WebSearchResultBlock`
53795574 
from line 5580
53855580 
53865581 - `type: "web_search_result"`
53875582 
5388 - `"web_search_result"`
5583 default: web_search_result
53895584 
53905585 - `url: string`
53915586 
53925587 - `tool_use_id: string`
53935588 
5589 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5590 
53945591 - `type: "web_search_tool_result"`
53955592 
5396 - `"web_search_tool_result"`
5397 
5398 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
5593 default: web_search_tool_result
5594 
5595 - `WebFetchToolResultBlock object`
53995596 
54005597 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
54015598 
54025599 Tool invocation directly from the model.
54035600 
5404 - `DirectCaller object { type }`
5601 default: {"type":"direct"}
5602 
5603 - `DirectCaller object`
54055604 
54065605 Tool invocation directly from the model.
54075606 
5408 - `ServerToolCaller object { tool_id, type }`
5607 - `ServerToolCaller object`
54095608 
54105609 Tool invocation generated by a server-side tool.
54115610 
5412 - `ServerToolCaller20260120 object { tool_id, type }`
5611 - `ServerToolCaller20260120 object`
54135612 
54145613 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
54155614 
5416 - `WebFetchToolResultErrorBlock object { error_code, type }`
5615 - `WebFetchToolResultErrorBlock object`
54175616 
54185617 - `error_code: WebFetchToolResultErrorCode`
54195618 
from line 5636
54375636 
54385637 - `type: "web_fetch_tool_result_error"`
54395638 
5440 - `"web_fetch_tool_result_error"`
5441 
5442 - `WebFetchBlock object { content, retrieved_at, type, url }`
5639 default: web_fetch_tool_result_error
5640 
5641 - `WebFetchBlock object`
54435642 
54445643 - `content: DocumentBlock`
54455644 
from line 5648
54495648 
54505649 - `enabled: boolean`
54515650 
5651 default: false
5652 
54525653 - `source: Base64PDFSource or PlainTextSource`
54535654 
5454 - `Base64PDFSource object { data, media_type, type }`
5655 - `Base64PDFSource object`
54555656 
54565657 - `data: string`
54575658 
5659 format: byte
5660 
54585661 - `media_type: "application/pdf"`
54595662 
5460 - `"application/pdf"`
5461 
54625663 - `type: "base64"`
54635664 
5464 - `"base64"`
5465 
5466 - `PlainTextSource object { data, media_type, type }`
5665 - `PlainTextSource object`
54675666 
54685667 - `data: string`
54695668 
54705669 - `media_type: "text/plain"`
54715670 
5472 - `"text/plain"`
5473 
54745671 - `type: "text"`
54755672 
5476 - `"text"`
5477 
54785673 - `title: string or null`
54795674 
54805675 The title of the document
54815676 
54825677 - `type: "document"`
54835678 
5484 - `"document"`
5679 default: document
54855680 
54865681 - `retrieved_at: string or null`
54875682 
from line 5684
54895684 
54905685 - `type: "web_fetch_result"`
54915686 
5492 - `"web_fetch_result"`
5687 default: web_fetch_result
54935688 
54945689 - `url: string`
54955690 
from line 5692
54975692 
54985693 - `tool_use_id: string`
54995694 
5695 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5696 
55005697 - `type: "web_fetch_tool_result"`
55015698 
5502 - `"web_fetch_tool_result"`
5503 
5504 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
5699 default: web_fetch_tool_result
5700 
5701 - `CodeExecutionToolResultBlock object`
55055702 
55065703 - `content: CodeExecutionToolResultBlockContent`
55075704 
55085705 Code execution result with encrypted stdout for PFC + web_search results.
55095706 
5510 - `CodeExecutionToolResultError object { error_code, type }`
5707 - `CodeExecutionToolResultError object`
55115708 
55125709 - `error_code: CodeExecutionToolResultErrorCode`
55135710 
from line 5718
55215718 
55225719 - `type: "code_execution_tool_result_error"`
55235720 
5524 - `"code_execution_tool_result_error"`
5525 
5526 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
5721 default: code_execution_tool_result_error
5722 
5723 - `CodeExecutionResultBlock object`
55275724 
55285725 - `content: array of CodeExecutionOutputBlock`
55295726 
from line 5728
55315728 
55325729 - `type: "code_execution_output"`
55335730 
5534 - `"code_execution_output"`
5731 default: code_execution_output
55355732 
55365733 - `return_code: number`
55375734 
from line 5738
55415738 
55425739 - `type: "code_execution_result"`
55435740 
5544 - `"code_execution_result"`
5545 
5546 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
5741 default: code_execution_result
5742 
5743 - `EncryptedCodeExecutionResultBlock object`
55475744 
55485745 Code execution result with encrypted stdout for PFC + web_search results.
55495746 
from line 5750
55535750 
55545751 - `type: "code_execution_output"`
55555752 
5753 default: code_execution_output
5754 
55565755 - `encrypted_stdout: string`
55575756 
55585757 - `return_code: number`
from line 5760
55615760 
55625761 - `type: "encrypted_code_execution_result"`
55635762 
5564 - `"encrypted_code_execution_result"`
5763 default: encrypted_code_execution_result
55655764 
55665765 - `tool_use_id: string`
55675766 
5767 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5768 
55685769 - `type: "code_execution_tool_result"`
55695770 
5570 - `"code_execution_tool_result"`
5571 
5572 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
5771 default: code_execution_tool_result
5772 
5773 - `BashCodeExecutionToolResultBlock object`
55735774 
55745775 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
55755776 
5576 - `BashCodeExecutionToolResultError object { error_code, type }`
5777 - `BashCodeExecutionToolResultError object`
55775778 
55785779 - `error_code: BashCodeExecutionToolResultErrorCode`
55795780 
from line 5790
55895790 
55905791 - `type: "bash_code_execution_tool_result_error"`
55915792 
5592 - `"bash_code_execution_tool_result_error"`
5593 
5594 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
5793 default: bash_code_execution_tool_result_error
5794 
5795 - `BashCodeExecutionResultBlock object`
55955796 
55965797 - `content: array of BashCodeExecutionOutputBlock`
55975798 
from line 5800
55995800 
56005801 - `type: "bash_code_execution_output"`
56015802 
5602 - `"bash_code_execution_output"`
5803 default: bash_code_execution_output
56035804 
56045805 - `return_code: number`
56055806 
from line 5810
56095810 
56105811 - `type: "bash_code_execution_result"`
56115812 
5612 - `"bash_code_execution_result"`
5813 default: bash_code_execution_result
56135814 
56145815 - `tool_use_id: string`
56155816 
5817 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5818 
56165819 - `type: "bash_code_execution_tool_result"`
56175820 
5618 - `"bash_code_execution_tool_result"`
5619 
5620 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
5821 default: bash_code_execution_tool_result
5822 
5823 - `TextEditorCodeExecutionToolResultBlock object`
56215824 
56225825 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
56235826 
5624 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
5827 - `TextEditorCodeExecutionToolResultError object`
56255828 
56265829 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
56275830 
from line 5842
56395842 
56405843 - `type: "text_editor_code_execution_tool_result_error"`
56415844 
5642 - `"text_editor_code_execution_tool_result_error"`
5643 
5644 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
5845 default: text_editor_code_execution_tool_result_error
5846 
5847 - `TextEditorCodeExecutionViewResultBlock object`
56455848 
56465849 - `content: string`
56475850 
from line 5864
56615864 
56625865 - `type: "text_editor_code_execution_view_result"`
56635866 
5664 - `"text_editor_code_execution_view_result"`
5665 
5666 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
5867 default: text_editor_code_execution_view_result
5868 
5869 - `TextEditorCodeExecutionCreateResultBlock object`
56675870 
56685871 - `is_file_update: boolean`
56695872 
56705873 - `type: "text_editor_code_execution_create_result"`
56715874 
5672 - `"text_editor_code_execution_create_result"`
5673 
5674 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
5875 default: text_editor_code_execution_create_result
5876 
5877 - `TextEditorCodeExecutionStrReplaceResultBlock object`
56755878 
56765879 - `lines: array of string or null`
56775880 
from line 5888
56855888 
56865889 - `type: "text_editor_code_execution_str_replace_result"`
56875890 
5688 - `"text_editor_code_execution_str_replace_result"`
5891 default: text_editor_code_execution_str_replace_result
56895892 
56905893 - `tool_use_id: string`
56915894 
5895 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5896 
56925897 - `type: "text_editor_code_execution_tool_result"`
56935898 
5694 - `"text_editor_code_execution_tool_result"`
5695 
5696 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
5899 default: text_editor_code_execution_tool_result
5900 
5901 - `ToolSearchToolResultBlock object`
56975902 
56985903 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
56995904 
5700 - `ToolSearchToolResultError object { error_code, error_message, type }`
5905 - `ToolSearchToolResultError object`
57015906 
57025907 - `error_code: ToolSearchToolResultErrorCode`
57035908 
from line 5918
57135918 
57145919 - `type: "tool_search_tool_result_error"`
57155920 
5716 - `"tool_search_tool_result_error"`
5717 
5718 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
5921 default: tool_search_tool_result_error
5922 
5923 - `ToolSearchToolSearchResultBlock object`
57195924 
57205925 - `tool_references: array of ToolReferenceBlock`
57215926 
57225927 - `tool_name: string`
57235928 
5929 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
5930 
57245931 - `type: "tool_reference"`
57255932 
5726 - `"tool_reference"`
5933 default: tool_reference
57275934 
57285935 - `type: "tool_search_tool_search_result"`
57295936 
5730 - `"tool_search_tool_search_result"`
5937 default: tool_search_tool_search_result
57315938 
57325939 - `tool_use_id: string`
57335940 
5941 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
5942 
57345943 - `type: "tool_search_tool_result"`
57355944 
5736 - `"tool_search_tool_result"`
5737 
5738 - `ContainerUploadBlock object { file_id, type }`
5945 default: tool_search_tool_result
5946 
5947 - `ContainerUploadBlock object`
57395948 
57405949 Response model for a file uploaded to the container.
57415950 
from line 5952
57435952 
57445953 - `type: "container_upload"`
57455954 
5746 - `"container_upload"`
5955 default: container_upload
57475956 
57485957 - `model: Model`
57495958 
from line 6034
58256034 
58266035 This will always be `"assistant"`.
58276036 
5828 - `"assistant"`
6037 default: assistant
58296038 
58306039 - `stop_details: RefusalStopDetails or null`
58316040 
from line 6072
58636072 
58646073 - `type: "refusal"`
58656074 
5866 - `"refusal"`
6075 default: refusal
58676076 
58686077 - `stop_reason: StopReason or null`
58696078 
from line 6116
59076116 
59086117 For Messages, this is always `"message"`.
59096118 
5910 - `"message"`
6119 default: message
59116120 
59126121 - `usage: Usage`
59136122 
from line 6138
59296138 
59306139 The number of input tokens used to create the 1 hour cache entry.
59316140 
6141 default: 0, minimum: 0
6142 
59326143 - `ephemeral_5m_input_tokens: number`
59336144 
59346145 The number of input tokens used to create the 5 minute cache entry.
59356146 
6147 default: 0, minimum: 0
6148 
59366149 - `cache_creation_input_tokens: number or null`
59376150 
59386151 The number of input tokens used to create the cache entry.
59396152 
6153 minimum: 0
6154 
59406155 - `cache_read_input_tokens: number or null`
59416156 
59426157 The number of input tokens read from the cache.
59436158 
6159 minimum: 0
6160 
59446161 - `inference_geo: string or null`
59456162 
59466163 The geographic region where inference was performed for this request.
from line 6166
59496166 
59506167 The number of input tokens which were used.
59516168 
6169 minimum: 0
6170 
59526171 - `output_tokens: number`
59536172 
59546173 The number of output tokens which were used.
6174 
6175 minimum: 0
59556176 
59566177 - `output_tokens_details: OutputTokensDetails or null`
59576178 
from line 6194
59736194 generation count by a small number of tokens. Always ≤ `output_tokens`;
59746195 `output_tokens - thinking_tokens` approximates the non-reasoning output.
59756196 
6197 default: 0, minimum: 0
6198 
59766199 - `server_tool_use: ServerToolUsage or null`
59776200 
59786201 The number of server tool requests.
from line 6204
59816204 
59826205 The number of web fetch tool requests.
59836206 
6207 default: 0, minimum: 0
6208 
59846209 - `web_search_requests: number`
59856210 
59866211 The number of web search tool requests.
59876212 
6213 default: 0, minimum: 0
6214 
59886215 - `service_tier: "standard" or "priority" or "batch" or null`
59896216 
59906217 If the request used the priority, standard, or batch tier.
from line 6224
59976224 
59986225 - `type: "succeeded"`
59996226 
6000 - `"succeeded"`
6001 
6002 - `MessageBatchErroredResult object { error, type }`
6227 default: succeeded
6228 
6229 - `MessageBatchErroredResult object`
60036230 
60046231 - `error: ErrorResponse`
60056232 
60066233 - `error: ErrorObject`
60076234 
6008 - `InvalidRequestError object { message, type }`
6235 - `InvalidRequestError object`
60096236 
60106237 - `message: string`
60116238 
6239 default: Invalid request
6240 
60126241 - `type: "invalid_request_error"`
60136242 
6014 - `"invalid_request_error"`
6015 
6016 - `AuthenticationError object { message, type }`
6243 default: invalid_request_error
6244 
6245 - `AuthenticationError object`
60176246 
60186247 - `message: string`
60196248 
6249 default: Authentication error
6250 
60206251 - `type: "authentication_error"`
60216252 
6022 - `"authentication_error"`
6023 
6024 - `BillingError object { message, type }`
6253 default: authentication_error
6254 
6255 - `BillingError object`
60256256 
60266257 - `message: string`
60276258 
6259 default: Billing error
6260 
60286261 - `type: "billing_error"`
60296262 
6030 - `"billing_error"`
6031 
6032 - `PermissionError object { message, type }`
6263 default: billing_error
6264 
6265 - `PermissionError object`
60336266 
60346267 - `message: string`
60356268 
6269 default: Permission denied
6270 
60366271 - `type: "permission_error"`
60376272 
6038 - `"permission_error"`
6039 
6040 - `NotFoundError object { message, type }`
6273 default: permission_error
6274 
6275 - `NotFoundError object`
60416276 
60426277 - `message: string`
60436278 
6279 default: Not found
6280 
60446281 - `type: "not_found_error"`
60456282 
6046 - `"not_found_error"`
6047 
6048 - `RateLimitError object { message, type }`
6283 default: not_found_error
6284 
6285 - `RateLimitError object`
60496286 
60506287 - `message: string`
60516288 
6289 default: Rate limited
6290 
60526291 - `type: "rate_limit_error"`
60536292 
6054 - `"rate_limit_error"`
6055 
6056 - `GatewayTimeoutError object { message, type }`
6293 default: rate_limit_error
6294 
6295 - `GatewayTimeoutError object`
60576296 
60586297 - `message: string`
60596298 
6299 default: Request timeout
6300 
60606301 - `type: "timeout_error"`
60616302 
6062 - `"timeout_error"`
6063 
6064 - `APIErrorObject object { message, type }`
6303 default: timeout_error
6304 
6305 - `APIErrorObject object`
60656306 
60666307 - `message: string`
60676308 
6309 default: Internal server error
6310 
60686311 - `type: "api_error"`
60696312 
6070 - `"api_error"`
6071 
6072 - `OverloadedError object { message, type }`
6313 default: api_error
6314 
6315 - `OverloadedError object`
60736316 
60746317 - `message: string`
60756318 
6319 default: Overloaded
6320 
60766321 - `type: "overloaded_error"`
60776322 
6078 - `"overloaded_error"`
6323 default: overloaded_error
60796324 
60806325 - `request_id: string or null`
60816326 
60826327 - `type: "error"`
60836328 
6084 - `"error"`
6329 default: error
60856330 
60866331 - `type: "errored"`
60876332 
6088 - `"errored"`
6089 
6090 - `MessageBatchCanceledResult object { type }`
6333 default: errored
6334 
6335 - `MessageBatchCanceledResult object`
60916336 
60926337 - `type: "canceled"`
60936338 
6094 - `"canceled"`
6095 
6096 - `MessageBatchExpiredResult object { type }`
6339 default: canceled
6340 
6341 - `MessageBatchExpiredResult object`
60976342 
60986343 - `type: "expired"`
60996344 
6100 - `"expired"`
6345 default: expired
61016346 
61026347### Message Batch Request Counts
61036348 
6104- `MessageBatchRequestCounts object { canceled, errored, expired, 2 more }`
6349- `MessageBatchRequestCounts object`
61056350 
61066351 - `canceled: number`
61076352 
from line 6354
61096354 
61106355 This is zero until processing of the entire Message Batch has ended.
61116356 
6357 default: 0
6358 
61126359 - `errored: number`
61136360 
61146361 Number of requests in the Message Batch that encountered an error.
61156362 
61166363 This is zero until processing of the entire Message Batch has ended.
61176364 
6365 default: 0
6366 
61186367 - `expired: number`
61196368 
61206369 Number of requests in the Message Batch that have expired.
61216370 
61226371 This is zero until processing of the entire Message Batch has ended.
61236372 
6373 default: 0
6374 
61246375 - `processing: number`
61256376 
61266377 Number of requests in the Message Batch that are processing.
61276378 
6379 default: 0
6380 
61286381 - `succeeded: number`
61296382 
61306383 Number of requests in the Message Batch that have completed successfully.
61316384 
61326385 This is zero until processing of the entire Message Batch has ended.
61336386 
6387 default: 0
6388 
61346389### Message Batch Result
61356390 
61366391- `MessageBatchResult = MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
from line 6394
61396394 
61406395 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
61416396 
6142 - `MessageBatchSucceededResult object { message, type }`
6397 - `MessageBatchSucceededResult object`
61436398 
61446399 - `message: Message`
61456400 
from line 6416
61616416 
61626417 The time at which the container will expire.
61636418 
6419 format: date-time
6420 
61646421 - `skills: array of ContainerSkill or null`
61656422 
61666423 Skills loaded in the container
from line 6426
61696426 
61706427 Skill ID
61716428 
6429 maxLength: 64, minLength: 1
6430 
61726431 - `type: "anthropic" or "custom"`
61736432 
61746433 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 6439
61806439 - `version: string`
61816440 
61826441 The resolved version: a skill version ID for custom skills.
6442 
6443 maxLength: 64, minLength: 1
61836444 
61846445 - `content: array of ContentBlock`
61856446 
from line 6471
62106471 [{"type": "text", "text": "B)"}]
62116472 ```
62126473 
6213 - `TextBlock object { citations, text, type }`
6474 - `TextBlock object`
62146475 
62156476 - `citations: array of TextCitation or null`
62166477 
from line 6479
62186479 
62196480 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
62206481 
6221 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
6482 - `CitationCharLocation object`
62226483 
62236484 - `cited_text: string`
62246485 
62256486 - `document_index: number`
62266487 
6488 minimum: 0
6489 
62276490 - `document_title: string or null`
62286491 
62296492 - `end_char_index: number`
from line 6495
62326495 
62336496 - `start_char_index: number`
62346497 
6498 minimum: 0
6499 
62356500 - `type: "char_location"`
62366501 
6237 - `"char_location"`
6238 
6239 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
6502 default: char_location
6503 
6504 - `CitationPageLocation object`
62406505 
62416506 - `cited_text: string`
62426507 
62436508 - `document_index: number`
62446509 
6510 minimum: 0
6511 
62456512 - `document_title: string or null`
62466513 
62476514 - `end_page_number: number`
from line 6517
62506517 
62516518 - `start_page_number: number`
62526519 
6520 minimum: 1
6521 
62536522 - `type: "page_location"`
62546523 
6255 - `"page_location"`
6256 
6257 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
6524 default: page_location
6525 
6526 - `CitationContentBlockLocation object`
62586527 
62596528 - `cited_text: string`
62606529 
from line 6533
62646533 
62656534 - `document_index: number`
62666535 
6536 minimum: 0
6537 
62676538 - `document_title: string or null`
62686539 
62696540 - `end_block_index: number`
from line 6549
62786549 
62796550 0-based index of the first cited block in the source's `content` array.
62806551 
6552 minimum: 0
6553 
62816554 - `type: "content_block_location"`
62826555 
6283 - `"content_block_location"`
6284 
6285 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
6556 default: content_block_location
6557 
6558 - `CitationsWebSearchResultLocation object`
62866559 
62876560 - `cited_text: string`
62886561 
from line 6563
62906563 
62916564 - `title: string or null`
62926565 
6566 maxLength: 512
6567 
62936568 - `type: "web_search_result_location"`
62946569 
6295 - `"web_search_result_location"`
6570 default: web_search_result_location
62966571 
62976572 - `url: string`
62986573 
6299 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
6574 - `CitationsSearchResultLocation object`
63006575 
63016576 - `cited_text: string`
63026577 
from line 6591
63166591 
63176592 Counted separately from `document_index`; server-side web search results are not included in this count.
63186593 
6594 minimum: 0
6595 
63196596 - `source: string`
63206597 
63216598 - `start_block_index: number`
63226599 
63236600 0-based index of the first cited block in the source's `content` array.
63246601 
6602 minimum: 0
6603 
63256604 - `title: string or null`
63266605 
63276606 - `type: "search_result_location"`
63286607 
6329 - `"search_result_location"`
6608 default: search_result_location
63306609 
63316610 - `text: string`
63326611 
6612 maxLength: 5000000, minLength: 0
6613 
63336614 - `type: "text"`
63346615 
6335 - `"text"`
6336 
6337 - `ThinkingBlock object { signature, thinking, type }`
6616 default: text
6617 
6618 - `ThinkingBlock object`
63386619 
63396620 - `signature: string`
63406621 
from line 6631
63506631 
63516632 - `type: "thinking"`
63526633 
6353 - `"thinking"`
6354 
6355 - `RedactedThinkingBlock object { data, type }`
6634 default: thinking
6635 
6636 - `RedactedThinkingBlock object`
63566637 
63576638 - `data: string`
63586639 
from line 6645
63646645 
63656646 - `type: "redacted_thinking"`
63666647 
6367 - `"redacted_thinking"`
6368 
6369 - `ToolUseBlock object { id, caller, input, 3 more }`
6648 default: redacted_thinking
6649 
6650 - `ToolUseBlock object`
63706651 
63716652 - `id: string`
63726653 
6654 pattern: ^[a-zA-Z0-9_-]+$
6655 
63736656 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
63746657 
63756658 Tool invocation directly from the model.
63766659 
6377 - `DirectCaller object { type }`
6660 default: {"type":"direct"}
6661 
6662 - `DirectCaller object`
63786663 
63796664 Tool invocation directly from the model.
63806665 
63816666 - `type: "direct"`
63826667 
6383 - `"direct"`
6384 
6385 - `ServerToolCaller object { tool_id, type }`
6668 - `ServerToolCaller object`
63866669 
63876670 Tool invocation generated by a server-side tool.
63886671 
63896672 - `tool_id: string`
63906673 
6674 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6675 
63916676 - `type: "code_execution_20250825"`
63926677 
6393 - `"code_execution_20250825"`
6394 
6395 - `ServerToolCaller20260120 object { tool_id, type }`
6678 - `ServerToolCaller20260120 object`
63966679 
63976680 - `tool_id: string`
63986681 
6682 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6683 
63996684 - `type: "code_execution_20260120"`
64006685 
6401 - `"code_execution_20260120"`
6402 
64036686 - `input: map[unknown]`
64046687 
64056688 - `name: string`
64066689 
6690 minLength: 1
6691 
64076692 - `type: "tool_use"`
64086693 
6409 - `"tool_use"`
6694 default: tool_use
64106695 
64116696 - `toolset_name: optional string or null`
64126697 
64136698 For a toolset member tool_use, the toolset family.
64146699 
6415 - `ServerToolUseBlock object { id, caller, input, 2 more }`
6700 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
6701 
6702 - `ServerToolUseBlock object`
64166703 
64176704 - `id: string`
64186705 
6706 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6707 
64196708 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
64206709 
64216710 Tool invocation directly from the model.
64226711 
6423 - `DirectCaller object { type }`
6712 default: {"type":"direct"}
6713 
6714 - `DirectCaller object`
64246715 
64256716 Tool invocation directly from the model.
64266717 
6427 - `ServerToolCaller object { tool_id, type }`
6718 - `ServerToolCaller object`
64286719 
64296720 Tool invocation generated by a server-side tool.
64306721 
6431 - `ServerToolCaller20260120 object { tool_id, type }`
6722 - `ServerToolCaller20260120 object`
64326723 
64336724 - `input: map[unknown]`
64346725 
from line 6741
64506741 
64516742 - `type: "server_tool_use"`
64526743 
6453 - `"server_tool_use"`
6454 
6455 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
6744 default: server_tool_use
6745 
6746 - `WebSearchToolResultBlock object`
64566747 
64576748 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
64586749 
64596750 Tool invocation directly from the model.
64606751 
6461 - `DirectCaller object { type }`
6752 default: {"type":"direct"}
6753 
6754 - `DirectCaller object`
64626755 
64636756 Tool invocation directly from the model.
64646757 
6465 - `ServerToolCaller object { tool_id, type }`
6758 - `ServerToolCaller object`
64666759 
64676760 Tool invocation generated by a server-side tool.
64686761 
6469 - `ServerToolCaller20260120 object { tool_id, type }`
6762 - `ServerToolCaller20260120 object`
64706763 
64716764 - `content: WebSearchToolResultBlockContent`
64726765 
6473 - `WebSearchToolResultError object { error_code, type }`
6766 - `WebSearchToolResultError object`
64746767 
64756768 - `error_code: WebSearchToolResultErrorCode`
64766769 
from line 6781
64886781 
64896782 - `type: "web_search_tool_result_error"`
64906783 
6491 - `"web_search_tool_result_error"`
6784 default: web_search_tool_result_error
64926785 
64936786 - `array of WebSearchResultBlock`
64946787 
from line 6793
65006793 
65016794 - `type: "web_search_result"`
65026795 
6503 - `"web_search_result"`
6796 default: web_search_result
65046797 
65056798 - `url: string`
65066799 
65076800 - `tool_use_id: string`
65086801 
6802 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6803 
65096804 - `type: "web_search_tool_result"`
65106805 
6511 - `"web_search_tool_result"`
6512 
6513 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
6806 default: web_search_tool_result
6807 
6808 - `WebFetchToolResultBlock object`
65146809 
65156810 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
65166811 
65176812 Tool invocation directly from the model.
65186813 
6519 - `DirectCaller object { type }`
6814 default: {"type":"direct"}
6815 
6816 - `DirectCaller object`
65206817 
65216818 Tool invocation directly from the model.
65226819 
6523 - `ServerToolCaller object { tool_id, type }`
6820 - `ServerToolCaller object`
65246821 
65256822 Tool invocation generated by a server-side tool.
65266823 
6527 - `ServerToolCaller20260120 object { tool_id, type }`
6824 - `ServerToolCaller20260120 object`
65286825 
65296826 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
65306827 
6531 - `WebFetchToolResultErrorBlock object { error_code, type }`
6828 - `WebFetchToolResultErrorBlock object`
65326829 
65336830 - `error_code: WebFetchToolResultErrorCode`
65346831 
from line 6849
65526849 
65536850 - `type: "web_fetch_tool_result_error"`
65546851 
6555 - `"web_fetch_tool_result_error"`
6556 
6557 - `WebFetchBlock object { content, retrieved_at, type, url }`
6852 default: web_fetch_tool_result_error
6853 
6854 - `WebFetchBlock object`
65586855 
65596856 - `content: DocumentBlock`
65606857 
from line 6861
65646861 
65656862 - `enabled: boolean`
65666863 
6864 default: false
6865 
65676866 - `source: Base64PDFSource or PlainTextSource`
65686867 
6569 - `Base64PDFSource object { data, media_type, type }`
6868 - `Base64PDFSource object`
65706869 
65716870 - `data: string`
65726871 
6872 format: byte
6873 
65736874 - `media_type: "application/pdf"`
65746875 
6575 - `"application/pdf"`
6576 
65776876 - `type: "base64"`
65786877 
6579 - `"base64"`
6580 
6581 - `PlainTextSource object { data, media_type, type }`
6878 - `PlainTextSource object`
65826879 
65836880 - `data: string`
65846881 
65856882 - `media_type: "text/plain"`
65866883 
6587 - `"text/plain"`
6588 
65896884 - `type: "text"`
65906885 
6591 - `"text"`
6592 
65936886 - `title: string or null`
65946887 
65956888 The title of the document
65966889 
65976890 - `type: "document"`
65986891 
6599 - `"document"`
6892 default: document
66006893 
66016894 - `retrieved_at: string or null`
66026895 
from line 6897
66046897 
66056898 - `type: "web_fetch_result"`
66066899 
6607 - `"web_fetch_result"`
6900 default: web_fetch_result
66086901 
66096902 - `url: string`
66106903 
from line 6905
66126905 
66136906 - `tool_use_id: string`
66146907 
6908 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6909 
66156910 - `type: "web_fetch_tool_result"`
66166911 
6617 - `"web_fetch_tool_result"`
6618 
6619 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
6912 default: web_fetch_tool_result
6913 
6914 - `CodeExecutionToolResultBlock object`
66206915 
66216916 - `content: CodeExecutionToolResultBlockContent`
66226917 
66236918 Code execution result with encrypted stdout for PFC + web_search results.
66246919 
6625 - `CodeExecutionToolResultError object { error_code, type }`
6920 - `CodeExecutionToolResultError object`
66266921 
66276922 - `error_code: CodeExecutionToolResultErrorCode`
66286923 
from line 6931
66366931 
66376932 - `type: "code_execution_tool_result_error"`
66386933 
6639 - `"code_execution_tool_result_error"`
6640 
6641 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
6934 default: code_execution_tool_result_error
6935 
6936 - `CodeExecutionResultBlock object`
66426937 
66436938 - `content: array of CodeExecutionOutputBlock`
66446939 
from line 6941
66466941 
66476942 - `type: "code_execution_output"`
66486943 
6649 - `"code_execution_output"`
6944 default: code_execution_output
66506945 
66516946 - `return_code: number`
66526947 
from line 6951
66566951 
66576952 - `type: "code_execution_result"`
66586953 
6659 - `"code_execution_result"`
6660 
6661 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
6954 default: code_execution_result
6955 
6956 - `EncryptedCodeExecutionResultBlock object`
66626957 
66636958 Code execution result with encrypted stdout for PFC + web_search results.
66646959 
from line 6963
66686963 
66696964 - `type: "code_execution_output"`
66706965 
6966 default: code_execution_output
6967 
66716968 - `encrypted_stdout: string`
66726969 
66736970 - `return_code: number`
from line 6973
66766973 
66776974 - `type: "encrypted_code_execution_result"`
66786975 
6679 - `"encrypted_code_execution_result"`
6976 default: encrypted_code_execution_result
66806977 
66816978 - `tool_use_id: string`
66826979 
6980 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
6981 
66836982 - `type: "code_execution_tool_result"`
66846983 
6685 - `"code_execution_tool_result"`
6686 
6687 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
6984 default: code_execution_tool_result
6985 
6986 - `BashCodeExecutionToolResultBlock object`
66886987 
66896988 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
66906989 
6691 - `BashCodeExecutionToolResultError object { error_code, type }`
6990 - `BashCodeExecutionToolResultError object`
66926991 
66936992 - `error_code: BashCodeExecutionToolResultErrorCode`
66946993 
from line 7003
67047003 
67057004 - `type: "bash_code_execution_tool_result_error"`
67067005 
6707 - `"bash_code_execution_tool_result_error"`
6708 
6709 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
7006 default: bash_code_execution_tool_result_error
7007 
7008 - `BashCodeExecutionResultBlock object`
67107009 
67117010 - `content: array of BashCodeExecutionOutputBlock`
67127011 
from line 7013
67147013 
67157014 - `type: "bash_code_execution_output"`
67167015 
6717 - `"bash_code_execution_output"`
7016 default: bash_code_execution_output
67187017 
67197018 - `return_code: number`
67207019 
from line 7023
67247023 
67257024 - `type: "bash_code_execution_result"`
67267025 
6727 - `"bash_code_execution_result"`
7026 default: bash_code_execution_result
67287027 
67297028 - `tool_use_id: string`
67307029 
7030 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7031 
67317032 - `type: "bash_code_execution_tool_result"`
67327033 
6733 - `"bash_code_execution_tool_result"`
6734 
6735 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
7034 default: bash_code_execution_tool_result
7035 
7036 - `TextEditorCodeExecutionToolResultBlock object`
67367037 
67377038 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
67387039 
6739 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
7040 - `TextEditorCodeExecutionToolResultError object`
67407041 
67417042 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
67427043 
from line 7055
67547055 
67557056 - `type: "text_editor_code_execution_tool_result_error"`
67567057 
6757 - `"text_editor_code_execution_tool_result_error"`
6758 
6759 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
7058 default: text_editor_code_execution_tool_result_error
7059 
7060 - `TextEditorCodeExecutionViewResultBlock object`
67607061 
67617062 - `content: string`
67627063 
from line 7077
67767077 
67777078 - `type: "text_editor_code_execution_view_result"`
67787079 
6779 - `"text_editor_code_execution_view_result"`
6780 
6781 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
7080 default: text_editor_code_execution_view_result
7081 
7082 - `TextEditorCodeExecutionCreateResultBlock object`
67827083 
67837084 - `is_file_update: boolean`
67847085 
67857086 - `type: "text_editor_code_execution_create_result"`
67867087 
6787 - `"text_editor_code_execution_create_result"`
6788 
6789 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
7088 default: text_editor_code_execution_create_result
7089 
7090 - `TextEditorCodeExecutionStrReplaceResultBlock object`
67907091 
67917092 - `lines: array of string or null`
67927093 
from line 7101
68007101 
68017102 - `type: "text_editor_code_execution_str_replace_result"`
68027103 
6803 - `"text_editor_code_execution_str_replace_result"`
7104 default: text_editor_code_execution_str_replace_result
68047105 
68057106 - `tool_use_id: string`
68067107 
7108 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7109 
68077110 - `type: "text_editor_code_execution_tool_result"`
68087111 
6809 - `"text_editor_code_execution_tool_result"`
6810 
6811 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
7112 default: text_editor_code_execution_tool_result
7113 
7114 - `ToolSearchToolResultBlock object`
68127115 
68137116 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
68147117 
6815 - `ToolSearchToolResultError object { error_code, error_message, type }`
7118 - `ToolSearchToolResultError object`
68167119 
68177120 - `error_code: ToolSearchToolResultErrorCode`
68187121 
from line 7131
68287131 
68297132 - `type: "tool_search_tool_result_error"`
68307133 
6831 - `"tool_search_tool_result_error"`
6832 
6833 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
7134 default: tool_search_tool_result_error
7135 
7136 - `ToolSearchToolSearchResultBlock object`
68347137 
68357138 - `tool_references: array of ToolReferenceBlock`
68367139 
68377140 - `tool_name: string`
68387141 
7142 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
7143 
68397144 - `type: "tool_reference"`
68407145 
6841 - `"tool_reference"`
7146 default: tool_reference
68427147 
68437148 - `type: "tool_search_tool_search_result"`
68447149 
6845 - `"tool_search_tool_search_result"`
7150 default: tool_search_tool_search_result
68467151 
68477152 - `tool_use_id: string`
68487153 
7154 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7155 
68497156 - `type: "tool_search_tool_result"`
68507157 
6851 - `"tool_search_tool_result"`
6852 
6853 - `ContainerUploadBlock object { file_id, type }`
7158 default: tool_search_tool_result
7159 
7160 - `ContainerUploadBlock object`
68547161 
68557162 Response model for a file uploaded to the container.
68567163 
from line 7165
68587165 
68597166 - `type: "container_upload"`
68607167 
6861 - `"container_upload"`
7168 default: container_upload
68627169 
68637170 - `model: Model`
68647171 
from line 7247
69407247 
69417248 This will always be `"assistant"`.
69427249 
6943 - `"assistant"`
7250 default: assistant
69447251 
69457252 - `stop_details: RefusalStopDetails or null`
69467253 
from line 7285
69787285 
69797286 - `type: "refusal"`
69807287 
6981 - `"refusal"`
7288 default: refusal
69827289 
69837290 - `stop_reason: StopReason or null`
69847291 
from line 7329
70227329 
70237330 For Messages, this is always `"message"`.
70247331 
7025 - `"message"`
7332 default: message
70267333 
70277334 - `usage: Usage`
70287335 
from line 7351
70447351 
70457352 The number of input tokens used to create the 1 hour cache entry.
70467353 
7354 default: 0, minimum: 0
7355 
70477356 - `ephemeral_5m_input_tokens: number`
70487357 
70497358 The number of input tokens used to create the 5 minute cache entry.
70507359 
7360 default: 0, minimum: 0
7361 
70517362 - `cache_creation_input_tokens: number or null`
70527363 
70537364 The number of input tokens used to create the cache entry.
70547365 
7366 minimum: 0
7367 
70557368 - `cache_read_input_tokens: number or null`
70567369 
70577370 The number of input tokens read from the cache.
70587371 
7372 minimum: 0
7373 
70597374 - `inference_geo: string or null`
70607375 
70617376 The geographic region where inference was performed for this request.
from line 7379
70647379 
70657380 The number of input tokens which were used.
70667381 
7382 minimum: 0
7383 
70677384 - `output_tokens: number`
70687385 
70697386 The number of output tokens which were used.
7387 
7388 minimum: 0
70707389 
70717390 - `output_tokens_details: OutputTokensDetails or null`
70727391 
from line 7407
70887407 generation count by a small number of tokens. Always ≤ `output_tokens`;
70897408 `output_tokens - thinking_tokens` approximates the non-reasoning output.
70907409 
7410 default: 0, minimum: 0
7411 
70917412 - `server_tool_use: ServerToolUsage or null`
70927413 
70937414 The number of server tool requests.
from line 7417
70967417 
70977418 The number of web fetch tool requests.
70987419 
7420 default: 0, minimum: 0
7421 
70997422 - `web_search_requests: number`
71007423 
71017424 The number of web search tool requests.
71027425 
7426 default: 0, minimum: 0
7427 
71037428 - `service_tier: "standard" or "priority" or "batch" or null`
71047429 
71057430 If the request used the priority, standard, or batch tier.
from line 7437
71127437 
71137438 - `type: "succeeded"`
71147439 
7115 - `"succeeded"`
7116 
7117 - `MessageBatchErroredResult object { error, type }`
7440 default: succeeded
7441 
7442 - `MessageBatchErroredResult object`
71187443 
71197444 - `error: ErrorResponse`
71207445 
71217446 - `error: ErrorObject`
71227447 
7123 - `InvalidRequestError object { message, type }`
7448 - `InvalidRequestError object`
71247449 
71257450 - `message: string`
71267451 
7452 default: Invalid request
7453 
71277454 - `type: "invalid_request_error"`
71287455 
7129 - `"invalid_request_error"`
7130 
7131 - `AuthenticationError object { message, type }`
7456 default: invalid_request_error
7457 
7458 - `AuthenticationError object`
71327459 
71337460 - `message: string`
71347461 
7462 default: Authentication error
7463 
71357464 - `type: "authentication_error"`
71367465 
7137 - `"authentication_error"`
7138 
7139 - `BillingError object { message, type }`
7466 default: authentication_error
7467 
7468 - `BillingError object`
71407469 
71417470 - `message: string`
71427471 
7472 default: Billing error
7473 
71437474 - `type: "billing_error"`
71447475 
7145 - `"billing_error"`
7146 
7147 - `PermissionError object { message, type }`
7476 default: billing_error
7477 
7478 - `PermissionError object`
71487479 
71497480 - `message: string`
71507481 
7482 default: Permission denied
7483 
71517484 - `type: "permission_error"`
71527485 
7153 - `"permission_error"`
7154 
7155 - `NotFoundError object { message, type }`
7486 default: permission_error
7487 
7488 - `NotFoundError object`
71567489 
71577490 - `message: string`
71587491 
7492 default: Not found
7493 
71597494 - `type: "not_found_error"`
71607495 
7161 - `"not_found_error"`
7162 
7163 - `RateLimitError object { message, type }`
7496 default: not_found_error
7497 
7498 - `RateLimitError object`
71647499 
71657500 - `message: string`
71667501 
7502 default: Rate limited
7503 
71677504 - `type: "rate_limit_error"`
71687505 
7169 - `"rate_limit_error"`
7170 
7171 - `GatewayTimeoutError object { message, type }`
7506 default: rate_limit_error
7507 
7508 - `GatewayTimeoutError object`
71727509 
71737510 - `message: string`
71747511 
7512 default: Request timeout
7513 
71757514 - `type: "timeout_error"`
71767515 
7177 - `"timeout_error"`
7178 
7179 - `APIErrorObject object { message, type }`
7516 default: timeout_error
7517 
7518 - `APIErrorObject object`
71807519 
71817520 - `message: string`
71827521 
7522 default: Internal server error
7523 
71837524 - `type: "api_error"`
71847525 
7185 - `"api_error"`
7186 
7187 - `OverloadedError object { message, type }`
7526 default: api_error
7527 
7528 - `OverloadedError object`
71887529 
71897530 - `message: string`
71907531 
7532 default: Overloaded
7533 
71917534 - `type: "overloaded_error"`
71927535 
7193 - `"overloaded_error"`
7536 default: overloaded_error
71947537 
71957538 - `request_id: string or null`
71967539 
71977540 - `type: "error"`
71987541 
7199 - `"error"`
7542 default: error
72007543 
72017544 - `type: "errored"`
72027545 
7203 - `"errored"`
7204 
7205 - `MessageBatchCanceledResult object { type }`
7546 default: errored
7547 
7548 - `MessageBatchCanceledResult object`
72067549 
72077550 - `type: "canceled"`
72087551 
7209 - `"canceled"`
7210 
7211 - `MessageBatchExpiredResult object { type }`
7552 default: canceled
7553 
7554 - `MessageBatchExpiredResult object`
72127555 
72137556 - `type: "expired"`
72147557 
7215 - `"expired"`
7558 default: expired
72167559 
72177560### Message Batch Succeeded Result
72187561 
7219- `MessageBatchSucceededResult object { message, type }`
7562- `MessageBatchSucceededResult object`
72207563 
72217564 - `message: Message`
72227565 
from line 7581
72387581 
72397582 The time at which the container will expire.
72407583 
7584 format: date-time
7585 
72417586 - `skills: array of ContainerSkill or null`
72427587 
72437588 Skills loaded in the container
from line 7591
72467591 
72477592 Skill ID
72487593 
7594 maxLength: 64, minLength: 1
7595 
72497596 - `type: "anthropic" or "custom"`
72507597 
72517598 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 7604
72577604 - `version: string`
72587605 
72597606 The resolved version: a skill version ID for custom skills.
7607 
7608 maxLength: 64, minLength: 1
72607609 
72617610 - `content: array of ContentBlock`
72627611 
from line 7636
72877636 [{"type": "text", "text": "B)"}]
72887637 ```
72897638 
7290 - `TextBlock object { citations, text, type }`
7639 - `TextBlock object`
72917640 
72927641 - `citations: array of TextCitation or null`
72937642 
from line 7644
72957644 
72967645 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
72977646 
7298 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
7647 - `CitationCharLocation object`
72997648 
73007649 - `cited_text: string`
73017650 
73027651 - `document_index: number`
73037652 
7653 minimum: 0
7654 
73047655 - `document_title: string or null`
73057656 
73067657 - `end_char_index: number`
from line 7660
73097660 
73107661 - `start_char_index: number`
73117662 
7663 minimum: 0
7664 
73127665 - `type: "char_location"`
73137666 
7314 - `"char_location"`
7315 
7316 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
7667 default: char_location
7668 
7669 - `CitationPageLocation object`
73177670 
73187671 - `cited_text: string`
73197672 
73207673 - `document_index: number`
73217674 
7675 minimum: 0
7676 
73227677 - `document_title: string or null`
73237678 
73247679 - `end_page_number: number`
from line 7682
73277682 
73287683 - `start_page_number: number`
73297684 
7685 minimum: 1
7686 
73307687 - `type: "page_location"`
73317688 
7332 - `"page_location"`
7333 
7334 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
7689 default: page_location
7690 
7691 - `CitationContentBlockLocation object`
73357692 
73367693 - `cited_text: string`
73377694 
from line 7698
73417698 
73427699 - `document_index: number`
73437700 
7701 minimum: 0
7702 
73447703 - `document_title: string or null`
73457704 
73467705 - `end_block_index: number`
from line 7714
73557714 
73567715 0-based index of the first cited block in the source's `content` array.
73577716 
7717 minimum: 0
7718 
73587719 - `type: "content_block_location"`
73597720 
7360 - `"content_block_location"`
7361 
7362 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
7721 default: content_block_location
7722 
7723 - `CitationsWebSearchResultLocation object`
73637724 
73647725 - `cited_text: string`
73657726 
from line 7728
73677728 
73687729 - `title: string or null`
73697730 
7731 maxLength: 512
7732 
73707733 - `type: "web_search_result_location"`
73717734 
7372 - `"web_search_result_location"`
7735 default: web_search_result_location
73737736 
73747737 - `url: string`
73757738 
7376 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
7739 - `CitationsSearchResultLocation object`
73777740 
73787741 - `cited_text: string`
73797742 
from line 7756
73937756 
73947757 Counted separately from `document_index`; server-side web search results are not included in this count.
73957758 
7759 minimum: 0
7760 
73967761 - `source: string`
73977762 
73987763 - `start_block_index: number`
73997764 
74007765 0-based index of the first cited block in the source's `content` array.
74017766 
7767 minimum: 0
7768 
74027769 - `title: string or null`
74037770 
74047771 - `type: "search_result_location"`
74057772 
7406 - `"search_result_location"`
7773 default: search_result_location
74077774 
74087775 - `text: string`
74097776 
7777 maxLength: 5000000, minLength: 0
7778 
74107779 - `type: "text"`
74117780 
7412 - `"text"`
7413 
7414 - `ThinkingBlock object { signature, thinking, type }`
7781 default: text
7782 
7783 - `ThinkingBlock object`
74157784 
74167785 - `signature: string`
74177786 
from line 7796
74277796 
74287797 - `type: "thinking"`
74297798 
7430 - `"thinking"`
7431 
7432 - `RedactedThinkingBlock object { data, type }`
7799 default: thinking
7800 
7801 - `RedactedThinkingBlock object`
74337802 
74347803 - `data: string`
74357804 
from line 7810
74417810 
74427811 - `type: "redacted_thinking"`
74437812 
7444 - `"redacted_thinking"`
7445 
7446 - `ToolUseBlock object { id, caller, input, 3 more }`
7813 default: redacted_thinking
7814 
7815 - `ToolUseBlock object`
74477816 
74487817 - `id: string`
74497818 
7819 pattern: ^[a-zA-Z0-9_-]+$
7820 
74507821 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
74517822 
74527823 Tool invocation directly from the model.
74537824 
7454 - `DirectCaller object { type }`
7825 default: {"type":"direct"}
7826 
7827 - `DirectCaller object`
74557828 
74567829 Tool invocation directly from the model.
74577830 
74587831 - `type: "direct"`
74597832 
7460 - `"direct"`
7461 
7462 - `ServerToolCaller object { tool_id, type }`
7833 - `ServerToolCaller object`
74637834 
74647835 Tool invocation generated by a server-side tool.
74657836 
74667837 - `tool_id: string`
74677838 
7839 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7840 
74687841 - `type: "code_execution_20250825"`
74697842 
7470 - `"code_execution_20250825"`
7471 
7472 - `ServerToolCaller20260120 object { tool_id, type }`
7843 - `ServerToolCaller20260120 object`
74737844 
74747845 - `tool_id: string`
74757846 
7847 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7848 
74767849 - `type: "code_execution_20260120"`
74777850 
7478 - `"code_execution_20260120"`
7479 
74807851 - `input: map[unknown]`
74817852 
74827853 - `name: string`
74837854 
7855 minLength: 1
7856 
74847857 - `type: "tool_use"`
74857858 
7486 - `"tool_use"`
7859 default: tool_use
74877860 
74887861 - `toolset_name: optional string or null`
74897862 
74907863 For a toolset member tool_use, the toolset family.
74917864 
7492 - `ServerToolUseBlock object { id, caller, input, 2 more }`
7865 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
7866 
7867 - `ServerToolUseBlock object`
74937868 
74947869 - `id: string`
74957870 
7871 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7872 
74967873 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
74977874 
74987875 Tool invocation directly from the model.
74997876 
7500 - `DirectCaller object { type }`
7877 default: {"type":"direct"}
7878 
7879 - `DirectCaller object`
75017880 
75027881 Tool invocation directly from the model.
75037882 
7504 - `ServerToolCaller object { tool_id, type }`
7883 - `ServerToolCaller object`
75057884 
75067885 Tool invocation generated by a server-side tool.
75077886 
7508 - `ServerToolCaller20260120 object { tool_id, type }`
7887 - `ServerToolCaller20260120 object`
75097888 
75107889 - `input: map[unknown]`
75117890 
from line 7906
75277906 
75287907 - `type: "server_tool_use"`
75297908 
7530 - `"server_tool_use"`
7531 
7532 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
7909 default: server_tool_use
7910 
7911 - `WebSearchToolResultBlock object`
75337912 
75347913 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
75357914 
75367915 Tool invocation directly from the model.
75377916 
7538 - `DirectCaller object { type }`
7917 default: {"type":"direct"}
7918 
7919 - `DirectCaller object`
75397920 
75407921 Tool invocation directly from the model.
75417922 
7542 - `ServerToolCaller object { tool_id, type }`
7923 - `ServerToolCaller object`
75437924 
75447925 Tool invocation generated by a server-side tool.
75457926 
7546 - `ServerToolCaller20260120 object { tool_id, type }`
7927 - `ServerToolCaller20260120 object`
75477928 
75487929 - `content: WebSearchToolResultBlockContent`
75497930 
7550 - `WebSearchToolResultError object { error_code, type }`
7931 - `WebSearchToolResultError object`
75517932 
75527933 - `error_code: WebSearchToolResultErrorCode`
75537934 
from line 7946
75657946 
75667947 - `type: "web_search_tool_result_error"`
75677948 
7568 - `"web_search_tool_result_error"`
7949 default: web_search_tool_result_error
75697950 
75707951 - `array of WebSearchResultBlock`
75717952 
from line 7958
75777958 
75787959 - `type: "web_search_result"`
75797960 
7580 - `"web_search_result"`
7961 default: web_search_result
75817962 
75827963 - `url: string`
75837964 
75847965 - `tool_use_id: string`
75857966 
7967 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
7968 
75867969 - `type: "web_search_tool_result"`
75877970 
7588 - `"web_search_tool_result"`
7589 
7590 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
7971 default: web_search_tool_result
7972 
7973 - `WebFetchToolResultBlock object`
75917974 
75927975 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
75937976 
75947977 Tool invocation directly from the model.
75957978 
7596 - `DirectCaller object { type }`
7979 default: {"type":"direct"}
7980 
7981 - `DirectCaller object`
75977982 
75987983 Tool invocation directly from the model.
75997984 
7600 - `ServerToolCaller object { tool_id, type }`
7985 - `ServerToolCaller object`
76017986 
76027987 Tool invocation generated by a server-side tool.
76037988 
7604 - `ServerToolCaller20260120 object { tool_id, type }`
7989 - `ServerToolCaller20260120 object`
76057990 
76067991 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
76077992 
7608 - `WebFetchToolResultErrorBlock object { error_code, type }`
7993 - `WebFetchToolResultErrorBlock object`
76097994 
76107995 - `error_code: WebFetchToolResultErrorCode`
76117996 
from line 8014
76298014 
76308015 - `type: "web_fetch_tool_result_error"`
76318016 
7632 - `"web_fetch_tool_result_error"`
7633 
7634 - `WebFetchBlock object { content, retrieved_at, type, url }`
8017 default: web_fetch_tool_result_error
8018 
8019 - `WebFetchBlock object`
76358020 
76368021 - `content: DocumentBlock`
76378022 
from line 8026
76418026 
76428027 - `enabled: boolean`
76438028 
8029 default: false
8030 
76448031 - `source: Base64PDFSource or PlainTextSource`
76458032 
7646 - `Base64PDFSource object { data, media_type, type }`
8033 - `Base64PDFSource object`
76478034 
76488035 - `data: string`
76498036 
8037 format: byte
8038 
76508039 - `media_type: "application/pdf"`
76518040 
7652 - `"application/pdf"`
7653 
76548041 - `type: "base64"`
76558042 
7656 - `"base64"`
7657 
7658 - `PlainTextSource object { data, media_type, type }`
8043 - `PlainTextSource object`
76598044 
76608045 - `data: string`
76618046 
76628047 - `media_type: "text/plain"`
76638048 
7664 - `"text/plain"`
7665 
76668049 - `type: "text"`
76678050 
7668 - `"text"`
7669 
76708051 - `title: string or null`
76718052 
76728053 The title of the document
76738054 
76748055 - `type: "document"`
76758056 
7676 - `"document"`
8057 default: document
76778058 
76788059 - `retrieved_at: string or null`
76798060 
from line 8062
76818062 
76828063 - `type: "web_fetch_result"`
76838064 
7684 - `"web_fetch_result"`
8065 default: web_fetch_result
76858066 
76868067 - `url: string`
76878068 
from line 8070
76898070 
76908071 - `tool_use_id: string`
76918072 
8073 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8074 
76928075 - `type: "web_fetch_tool_result"`
76938076 
7694 - `"web_fetch_tool_result"`
7695 
7696 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
8077 default: web_fetch_tool_result
8078 
8079 - `CodeExecutionToolResultBlock object`
76978080 
76988081 - `content: CodeExecutionToolResultBlockContent`
76998082 
77008083 Code execution result with encrypted stdout for PFC + web_search results.
77018084 
7702 - `CodeExecutionToolResultError object { error_code, type }`
8085 - `CodeExecutionToolResultError object`
77038086 
77048087 - `error_code: CodeExecutionToolResultErrorCode`
77058088 
from line 8096
77138096 
77148097 - `type: "code_execution_tool_result_error"`
77158098 
7716 - `"code_execution_tool_result_error"`
7717 
7718 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
8099 default: code_execution_tool_result_error
8100 
8101 - `CodeExecutionResultBlock object`
77198102 
77208103 - `content: array of CodeExecutionOutputBlock`
77218104 
from line 8106
77238106 
77248107 - `type: "code_execution_output"`
77258108 
7726 - `"code_execution_output"`
8109 default: code_execution_output
77278110 
77288111 - `return_code: number`
77298112 
from line 8116
77338116 
77348117 - `type: "code_execution_result"`
77358118 
7736 - `"code_execution_result"`
7737 
7738 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
8119 default: code_execution_result
8120 
8121 - `EncryptedCodeExecutionResultBlock object`
77398122 
77408123 Code execution result with encrypted stdout for PFC + web_search results.
77418124 
from line 8128
77458128 
77468129 - `type: "code_execution_output"`
77478130 
8131 default: code_execution_output
8132 
77488133 - `encrypted_stdout: string`
77498134 
77508135 - `return_code: number`
from line 8138
77538138 
77548139 - `type: "encrypted_code_execution_result"`
77558140 
7756 - `"encrypted_code_execution_result"`
8141 default: encrypted_code_execution_result
77578142 
77588143 - `tool_use_id: string`
77598144 
8145 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8146 
77608147 - `type: "code_execution_tool_result"`
77618148 
7762 - `"code_execution_tool_result"`
7763 
7764 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
8149 default: code_execution_tool_result
8150 
8151 - `BashCodeExecutionToolResultBlock object`
77658152 
77668153 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
77678154 
7768 - `BashCodeExecutionToolResultError object { error_code, type }`
8155 - `BashCodeExecutionToolResultError object`
77698156 
77708157 - `error_code: BashCodeExecutionToolResultErrorCode`
77718158 
from line 8168
77818168 
77828169 - `type: "bash_code_execution_tool_result_error"`
77838170 
7784 - `"bash_code_execution_tool_result_error"`
7785 
7786 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
8171 default: bash_code_execution_tool_result_error
8172 
8173 - `BashCodeExecutionResultBlock object`
77878174 
77888175 - `content: array of BashCodeExecutionOutputBlock`
77898176 
from line 8178
77918178 
77928179 - `type: "bash_code_execution_output"`
77938180 
7794 - `"bash_code_execution_output"`
8181 default: bash_code_execution_output
77958182 
77968183 - `return_code: number`
77978184 
from line 8188
78018188 
78028189 - `type: "bash_code_execution_result"`
78038190 
7804 - `"bash_code_execution_result"`
8191 default: bash_code_execution_result
78058192 
78068193 - `tool_use_id: string`
78078194 
8195 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8196 
78088197 - `type: "bash_code_execution_tool_result"`
78098198 
7810 - `"bash_code_execution_tool_result"`
7811 
7812 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
8199 default: bash_code_execution_tool_result
8200 
8201 - `TextEditorCodeExecutionToolResultBlock object`
78138202 
78148203 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
78158204 
7816 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
8205 - `TextEditorCodeExecutionToolResultError object`
78178206 
78188207 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
78198208 
from line 8220
78318220 
78328221 - `type: "text_editor_code_execution_tool_result_error"`
78338222 
7834 - `"text_editor_code_execution_tool_result_error"`
7835 
7836 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
8223 default: text_editor_code_execution_tool_result_error
8224 
8225 - `TextEditorCodeExecutionViewResultBlock object`
78378226 
78388227 - `content: string`
78398228 
from line 8242
78538242 
78548243 - `type: "text_editor_code_execution_view_result"`
78558244 
7856 - `"text_editor_code_execution_view_result"`
7857 
7858 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
8245 default: text_editor_code_execution_view_result
8246 
8247 - `TextEditorCodeExecutionCreateResultBlock object`
78598248 
78608249 - `is_file_update: boolean`
78618250 
78628251 - `type: "text_editor_code_execution_create_result"`
78638252 
7864 - `"text_editor_code_execution_create_result"`
7865 
7866 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
8253 default: text_editor_code_execution_create_result
8254 
8255 - `TextEditorCodeExecutionStrReplaceResultBlock object`
78678256 
78688257 - `lines: array of string or null`
78698258 
from line 8266
78778266 
78788267 - `type: "text_editor_code_execution_str_replace_result"`
78798268 
7880 - `"text_editor_code_execution_str_replace_result"`
8269 default: text_editor_code_execution_str_replace_result
78818270 
78828271 - `tool_use_id: string`
78838272 
8273 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8274 
78848275 - `type: "text_editor_code_execution_tool_result"`
78858276 
7886 - `"text_editor_code_execution_tool_result"`
7887 
7888 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
8277 default: text_editor_code_execution_tool_result
8278 
8279 - `ToolSearchToolResultBlock object`
78898280 
78908281 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
78918282 
7892 - `ToolSearchToolResultError object { error_code, error_message, type }`
8283 - `ToolSearchToolResultError object`
78938284 
78948285 - `error_code: ToolSearchToolResultErrorCode`
78958286 
from line 8296
79058296 
79068297 - `type: "tool_search_tool_result_error"`
79078298 
7908 - `"tool_search_tool_result_error"`
7909 
7910 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
8299 default: tool_search_tool_result_error
8300 
8301 - `ToolSearchToolSearchResultBlock object`
79118302 
79128303 - `tool_references: array of ToolReferenceBlock`
79138304 
79148305 - `tool_name: string`
79158306 
8307 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
8308 
79168309 - `type: "tool_reference"`
79178310 
7918 - `"tool_reference"`
8311 default: tool_reference
79198312 
79208313 - `type: "tool_search_tool_search_result"`
79218314 
7922 - `"tool_search_tool_search_result"`
8315 default: tool_search_tool_search_result
79238316 
79248317 - `tool_use_id: string`
79258318 
8319 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
8320 
79268321 - `type: "tool_search_tool_result"`
79278322 
7928 - `"tool_search_tool_result"`
7929 
7930 - `ContainerUploadBlock object { file_id, type }`
8323 default: tool_search_tool_result
8324 
8325 - `ContainerUploadBlock object`
79318326 
79328327 Response model for a file uploaded to the container.
79338328 
from line 8330
79358330 
79368331 - `type: "container_upload"`
79378332 
7938 - `"container_upload"`
8333 default: container_upload
79398334 
79408335 - `model: Model`
79418336 
from line 8412
80178412 
80188413 This will always be `"assistant"`.
80198414 
8020 - `"assistant"`
8415 default: assistant
80218416 
80228417 - `stop_details: RefusalStopDetails or null`
80238418 
from line 8450
80558450 
80568451 - `type: "refusal"`
80578452 
8058 - `"refusal"`
8453 default: refusal
80598454 
80608455 - `stop_reason: StopReason or null`
80618456 
from line 8494
80998494 
81008495 For Messages, this is always `"message"`.
81018496 
8102 - `"message"`
8497 default: message
81038498 
81048499 - `usage: Usage`
81058500 
from line 8516
81218516 
81228517 The number of input tokens used to create the 1 hour cache entry.
81238518 
8519 default: 0, minimum: 0
8520 
81248521 - `ephemeral_5m_input_tokens: number`
81258522 
81268523 The number of input tokens used to create the 5 minute cache entry.
81278524 
8525 default: 0, minimum: 0
8526 
81288527 - `cache_creation_input_tokens: number or null`
81298528 
81308529 The number of input tokens used to create the cache entry.
81318530 
8531 minimum: 0
8532 
81328533 - `cache_read_input_tokens: number or null`
81338534 
81348535 The number of input tokens read from the cache.
81358536 
8537 minimum: 0
8538 
81368539 - `inference_geo: string or null`
81378540 
81388541 The geographic region where inference was performed for this request.
from line 8544
81418544 
81428545 The number of input tokens which were used.
81438546 
8547 minimum: 0
8548 
81448549 - `output_tokens: number`
81458550 
81468551 The number of output tokens which were used.
8552 
8553 minimum: 0
81478554 
81488555 - `output_tokens_details: OutputTokensDetails or null`
81498556 
from line 8572
81658572 generation count by a small number of tokens. Always ≤ `output_tokens`;
81668573 `output_tokens - thinking_tokens` approximates the non-reasoning output.
81678574 
8575 default: 0, minimum: 0
8576 
81688577 - `server_tool_use: ServerToolUsage or null`
81698578 
81708579 The number of server tool requests.
from line 8582
81738582 
81748583 The number of web fetch tool requests.
81758584 
8585 default: 0, minimum: 0
8586 
81768587 - `web_search_requests: number`
81778588 
81788589 The number of web search tool requests.
81798590 
8591 default: 0, minimum: 0
8592 
81808593 - `service_tier: "standard" or "priority" or "batch" or null`
81818594 
81828595 If the request used the priority, standard, or batch tier.
from line 8602
81898602 
81908603 - `type: "succeeded"`
81918604 
8192 - `"succeeded"`
8605 default: succeeded
81938606 

api/messages/batches/cancel Changed · +29 / -14 lines

# Cancel a Message Batch ## Path parameters ## Returns ## Example ### Response (200) ## Cancel a Message Batch ### Path Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Cancel a Message Batch
3url: https://platform.claude.com/docs/en/api/messages/batches/cancel
4---
1# Cancel a Message Batch
52 
6## Cancel a Message Batch
3**POST** `/v1/messages/batches/{message_batch_id}/cancel`
74 
8**post** `/v1/messages/batches/{message_batch_id}/cancel`
9 
105Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
116 
127The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
from line 8
138 
149Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
1510 
16### Path Parameters
11## Path parameters
1712 
1813- `message_batch_id: string`
1914 
2015 ID of the Message Batch.
2116 
22### Returns
17## Returns
2318 
24- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
19- `MessageBatch object`
2520 
2621 - `id: string`
2722 
from line 28
3328 
3429 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
3530 
31 format: date-time
32 
3633 - `cancel_initiated_at: string or null`
3734 
3835 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
3936 
37 format: date-time
38 
4039 - `created_at: string`
4140 
4241 RFC 3339 datetime string representing the time at which the Message Batch was created.
4342 
43 format: date-time
44 
4445 - `ended_at: string or null`
4546 
4647 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
from line 48
4748 
4849 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
4950 
51 format: date-time
52 
5053 - `expires_at: string`
5154 
5255 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
5356 
57 format: date-time
58 
5459 - `processing_status: "in_progress" or "canceling" or "ended"`
5560 
5661 Processing status of the Message Batch.
from line 78
7378 
7479 This is zero until processing of the entire Message Batch has ended.
7580 
81 default: 0
82 
7683 - `errored: number`
7784 
7885 Number of requests in the Message Batch that encountered an error.
from line 86
7986 
8087 This is zero until processing of the entire Message Batch has ended.
8188 
89 default: 0
90 
8291 - `expired: number`
8392 
8493 Number of requests in the Message Batch that have expired.
from line 94
8594 
8695 This is zero until processing of the entire Message Batch has ended.
8796 
97 default: 0
98 
8899 - `processing: number`
89100 
90101 Number of requests in the Message Batch that are processing.
91102 
103 default: 0
104 
92105 - `succeeded: number`
93106 
94107 Number of requests in the Message Batch that have completed successfully.
from line 108
95108 
96109 This is zero until processing of the entire Message Batch has ended.
97110 
111 default: 0
112 
98113 - `results_url: string or null`
99114 
100115 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 122
107122 
108123 For Message Batches, this is always `"message_batch"`.
109124 
110 - `"message_batch"`
125 default: message_batch
111126 
112### Example
127## Example
113128 
114```http
129```bash
115130curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \
116131 -X POST \
117132 -H 'anthropic-version: 2023-06-01' \
from line 133
118133 -H "X-Api-Key: $ANTHROPIC_API_KEY"
119134```
120135 
121#### Response
136### Response (200)
122137 
123138```json
124139{

api/messages/batches/create Changed · +363 / -394 lines

# Create a Message Batch ## Headers ## Body parameters ## Returns ## Example ### Response (200) ## Create a Message Batch ### Header Parameters ### Body Parameters ### Returns ### Example #### Response

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

from line 1
1---
2title: Create a Message Batch
3url: https://platform.claude.com/docs/en/api/messages/batches/create
4---
5 
6## Create a Message Batch
7 
8**post** `/v1/messages/batches`
1# Create a Message Batch
2 
3**POST** `/v1/messages/batches`
94 
105Send a batch of Message creation requests.
116 
from line 8
138 
149Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
1510 
16### Header Parameters
11## Headers
1712 
1813- `"anthropic-user-profile-id": optional string`
1914 
2015 The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.
2116 
22### Body Parameters
23 
24- `requests: array of object { custom_id, params }`
17## Body parameters
18 
19- `requests: array of object`
2520 
2621 List of requests for prompt completion. Each is an individual request to create a Message.
2722 
23 maxItems: 100000, minItems: 1
24 
2825 - `custom_id: string`
2926 
3027 Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
3128 
3229 Must be unique for each request within the Message Batch.
3330 
34 - `params: object { max_tokens, messages, model, 15 more }`
31 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,64}$
32 
33 - `params: object`
3534 
3635 Messages API creation parameters for the individual request.
3736 
from line 45
4645 Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.
4746 
4847 Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
48 
49 minimum: 0
4950 
5051 - `messages: array of MessageParam`
5152 
from line 105
104105 
105106 - `array of ContentBlockParam`
106107 
107 - `TextBlockParam object { text, type, cache_control, citations }`
108 - `TextBlockParam object`
108109 
109110 - `text: string`
110111 
112 minLength: 1
113 
111114 - `type: "text"`
112115 
113 - `"text"`
114 
115116 - `cache_control: optional CacheControlEphemeral or null`
116117 
117118 Create a cache control breakpoint at this content block.
118119 
119120 - `type: "ephemeral"`
120 
121 - `"ephemeral"`
122121 
123122 - `ttl: optional "5m" or "1h"`
124123 
from line 136
137136 
138137 - `citations: optional array of TextCitationParam or null`
139138 
140 - `CitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
139 - `CitationCharLocationParam object`
141140 
142141 - `cited_text: string`
143142 
144143 - `document_index: number`
145144 
145 minimum: 0
146 
146147 - `document_title: string or null`
147148 
149 maxLength: 500, minLength: 1
150 
148151 - `end_char_index: number`
149152 
150153 - `start_char_index: number`
151154 
155 minimum: 0
156 
152157 - `type: "char_location"`
153158 
154 - `"char_location"`
155 
156 - `CitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
159 - `CitationPageLocationParam object`
157160 
158161 - `cited_text: string`
159162 
160163 - `document_index: number`
161164 
165 minimum: 0
166 
162167 - `document_title: string or null`
163168 
169 maxLength: 500, minLength: 1
170 
164171 - `end_page_number: number`
165172 
166173 - `start_page_number: number`
167174 
175 minimum: 1
176 
168177 - `type: "page_location"`
169178 
170 - `"page_location"`
171 
172 - `CitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
179 - `CitationContentBlockLocationParam object`
173180 
174181 - `cited_text: string`
175182 
from line 186
179186 
180187 - `document_index: number`
181188 
189 minimum: 0
190 
182191 - `document_title: string or null`
183192 
193 maxLength: 500, minLength: 1
194 
184195 - `end_block_index: number`
185196 
186197 Exclusive 0-based end index of the cited block range in the source's `content` array.
from line 202
191202 
192203 0-based index of the first cited block in the source's `content` array.
193204 
205 minimum: 0
206 
194207 - `type: "content_block_location"`
195208 
196 - `"content_block_location"`
197 
198 - `CitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
209 - `CitationWebSearchResultLocationParam object`
199210 
200211 - `cited_text: string`
201212 
from line 214
203214 
204215 - `title: string or null`
205216 
217 maxLength: 512, minLength: 1
218 
206219 - `type: "web_search_result_location"`
207220 
208 - `"web_search_result_location"`
209 
210221 - `url: string`
211222 
212 - `CitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
223 minLength: 1
224 
225 - `CitationSearchResultLocationParam object`
213226 
214227 - `cited_text: string`
215228 
from line 242
229242 
230243 Counted separately from `document_index`; server-side web search results are not included in this count.
231244 
245 minimum: 0
246 
232247 - `source: string`
233248 
234249 - `start_block_index: number`
235250 
236251 0-based index of the first cited block in the source's `content` array.
237252 
253 minimum: 0
254 
238255 - `title: string or null`
239256 
240257 - `type: "search_result_location"`
241258 
242 - `"search_result_location"`
243 
244 - `ImageBlockParam object { source, type, cache_control, transformations }`
259 - `ImageBlockParam object`
245260 
246261 - `source: Base64ImageSource or URLImageSource or FileImageSource`
247262 
248 - `Base64ImageSource object { data, media_type, type }`
263 - `Base64ImageSource object`
249264 
250265 - `data: string`
251266 
267 format: byte
268 
252269 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
253270 
254271 - `"image/jpeg"`
from line 278
261278 
262279 - `type: "base64"`
263280 
264 - `"base64"`
265 
266 - `URLImageSource object { type, url }`
281 - `URLImageSource object`
267282 
268283 - `type: "url"`
269284 
270 - `"url"`
271 
272285 - `url: string`
273286 
274 - `FileImageSource object { file_id, type }`
287 - `FileImageSource object`
275288 
276289 - `file_id: string`
277290 
278291 - `type: "file"`
279292 
280 - `"file"`
281 
282293 - `type: "image"`
283294 
284 - `"image"`
285 
286295 - `cache_control: optional CacheControlEphemeral or null`
287296 
288297 Create a cache control breakpoint at this content block.
from line 308
299308 
300309 - `"error"`
301310 
302 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
311 - `DocumentBlockParam object`
303312 
304313 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
305314 
306 - `Base64PDFSource object { data, media_type, type }`
315 - `Base64PDFSource object`
307316 
308317 - `data: string`
309318 
319 format: byte
320 
310321 - `media_type: "application/pdf"`
311322 
312 - `"application/pdf"`
313 
314323 - `type: "base64"`
315324 
316 - `"base64"`
317 
318 - `PlainTextSource object { data, media_type, type }`
325 - `PlainTextSource object`
319326 
320327 - `data: string`
321328 
322329 - `media_type: "text/plain"`
323330 
324 - `"text/plain"`
325 
326331 - `type: "text"`
327332 
328 - `"text"`
329 
330 - `ContentBlockSource object { content, type }`
333 - `ContentBlockSource object`
331334 
332335 - `content: string or array of ContentBlockSourceContent`
333336 
from line 338
335338 
336339 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
337340 
338 - `TextBlockParam object { text, type, cache_control, citations }`
339 
340 - `ImageBlockParam object { source, type, cache_control, transformations }`
341 - `TextBlockParam object`
342 
343 - `ImageBlockParam object`
341344 
342345 - `type: "content"`
343346 
344 - `"content"`
345 
346 - `URLPDFSource object { type, url }`
347 - `URLPDFSource object`
347348 
348349 - `type: "url"`
349350 
350 - `"url"`
351 
352351 - `url: string`
353352 
354 - `FileDocumentSource object { file_id, type }`
353 - `FileDocumentSource object`
355354 
356355 - `file_id: string`
357356 
358357 - `type: "file"`
359358 
360 - `"file"`
361 
362359 - `type: "document"`
363360 
364 - `"document"`
365 
366361 - `cache_control: optional CacheControlEphemeral or null`
367362 
368363 Create a cache control breakpoint at this content block.
from line 368
373368 
374369 - `context: optional string or null`
375370 
371 minLength: 1
372 
376373 - `title: optional string or null`
377374 
378 - `SearchResultBlockParam object { content, source, title, 3 more }`
375 maxLength: 500, minLength: 1
376 
377 - `SearchResultBlockParam object`
379378 
380379 - `content: array of TextBlockParam`
381380 
382381 - `text: string`
383382 
383 minLength: 1
384 
384385 - `type: "text"`
385386 
386387 - `cache_control: optional CacheControlEphemeral or null`
from line 396
395396 
396397 - `type: "search_result"`
397398 
398 - `"search_result"`
399 
400399 - `cache_control: optional CacheControlEphemeral or null`
401400 
402401 Create a cache control breakpoint at this content block.
403402 
404403 - `citations: optional CitationsConfigParam`
405404 
406 - `ThinkingBlockParam object { signature, thinking, type }`
405 - `ThinkingBlockParam object`
407406 
408407 - `signature: string`
409408 
from line 416
417416 
418417 - `type: "thinking"`
419418 
420 - `"thinking"`
421 
422 - `RedactedThinkingBlockParam object { data, type }`
419 - `RedactedThinkingBlockParam object`
423420 
424421 - `data: string`
425422 
from line 424
427424 
428425 - `type: "redacted_thinking"`
429426 
430 - `"redacted_thinking"`
431 
432 - `ToolUseBlockParam object { id, input, name, 4 more }`
427 - `ToolUseBlockParam object`
433428 
434429 - `id: string`
435430 
431 pattern: ^[a-zA-Z0-9_-]+$
432 
436433 - `input: map[unknown]`
437434 
438435 - `name: string`
439436 
437 maxLength: 200, minLength: 1
438 
440439 - `type: "tool_use"`
441440 
442 - `"tool_use"`
443 
444441 - `cache_control: optional CacheControlEphemeral or null`
445442 
446443 Create a cache control breakpoint at this content block.
from line 446
449446 
450447 Tool invocation directly from the model.
451448 
452 - `DirectCaller object { type }`
449 - `DirectCaller object`
453450 
454451 Tool invocation directly from the model.
455452 
456453 - `type: "direct"`
457454 
458 - `"direct"`
459 
460 - `ServerToolCaller object { tool_id, type }`
455 - `ServerToolCaller object`
461456 
462457 Tool invocation generated by a server-side tool.
463458 
464459 - `tool_id: string`
465460 
461 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
462 
466463 - `type: "code_execution_20250825"`
467464 
468 - `"code_execution_20250825"`
469 
470 - `ServerToolCaller20260120 object { tool_id, type }`
465 - `ServerToolCaller20260120 object`
471466 
472467 - `tool_id: string`
473468 
469 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
470 
474471 - `type: "code_execution_20260120"`
475472 
476 - `"code_execution_20260120"`
477 
478473 - `toolset_name: optional string or null`
479474 
480475 For a toolset member tool_use, the toolset family this member belongs to.
481476 
482 - `ToolResultBlockParam object { tool_use_id, type, cache_control, 3 more }`
477 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
478 
479 - `ToolResultBlockParam object`
483480 
484481 - `tool_use_id: string`
485482 
483 pattern: ^[a-zA-Z0-9_-]+$
484 
486485 - `type: "tool_result"`
487486 
488 - `"tool_result"`
489 
490487 - `cache_control: optional CacheControlEphemeral or null`
491488 
492489 Create a cache control breakpoint at this content block.
from line 494
497494 
498495 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
499496 
500 - `TextBlockParam object { text, type, cache_control, citations }`
501 
502 - `ImageBlockParam object { source, type, cache_control, transformations }`
503 
504 - `SearchResultBlockParam object { content, source, title, 3 more }`
505 
506 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
507 
508 - `ToolReferenceBlockParam object { tool_name, type, cache_control }`
497 - `TextBlockParam object`
498 
499 - `ImageBlockParam object`
500 
501 - `SearchResultBlockParam object`
502 
503 - `DocumentBlockParam object`
504 
505 - `ToolReferenceBlockParam object`
509506 
510507 Tool reference block that can be included in tool_result content.
511508 
512509 - `tool_name: string`
513510 
511 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
512 
514513 - `type: "tool_reference"`
515514 
516 - `"tool_reference"`
517 
518515 - `cache_control: optional CacheControlEphemeral or null`
519516 
520517 Create a cache control breakpoint at this content block.
521518 
522 - `BrowserStateBlockParam object { tabs, type, cache_control, state_changes }`
519 - `BrowserStateBlockParam object`
523520 
524521 The caller's browser state after a browser toolset member call —
525522 the full inventory of open tabs, which tab is active, and any side
from line 530
533530 
534531 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`.
535532 
533 maxItems: 100
534 
536535 - `tab_id: string`
537536 
538537 The caller-assigned identifier for this tab, unique within the inventory.
539538 
539 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
540 
540541 - `title: string`
541542 
542543 The title of the page the tab is showing. May be empty.
543544 
545 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
546 
544547 - `url: string`
545548 
546549 The URL of the page the tab is showing. May be empty.
547550 
551 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
552 
548553 - `active: optional boolean`
549554 
550555 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
551556 
552557 - `type: "browser_state"`
553558 
554 - `"browser_state"`
555 
556559 - `cache_control: optional CacheControlEphemeral or null`
557560 
558561 Create a cache control breakpoint at this content block.
from line 564
561564 
562565 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
563566 
564 - `BrowserStateChangeTabOpened object { tab_id, type }`
567 maxItems: 200, minItems: 1
568 
569 - `BrowserStateChangeTabOpened object`
565570 
566571 A tab this call's execution opened that remains open at its end —
567572 the creation delta of the `tabs` inventory, not an event log.
from line 580
575580 
576581 The `tab_id` of the opened tab, present in `tabs`.
577582 
583 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
584 
578585 - `type: "tab_opened"`
579586 
580 - `"tab_opened"`
581 
582 - `BrowserStateChangeDownloadStarted object { download_id, type, url }`
587 - `BrowserStateChangeDownloadStarted object`
583588 
584589 A file download that started during this call.
585590 
from line 592
587592 
588593 The caller-assigned identifier for this download, stable across the state changes reporting it.
589594 
595 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
596 
590597 - `type: "download_started"`
591598 
592 - `"download_started"`
593 
594599 - `url: string`
595600 
596601 The final post-redirect URL the download was served from.
597602 
598 - `BrowserStateChangeDownloadCompleted object { download_id, type, url, 2 more }`
603 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
604 
605 - `BrowserStateChangeDownloadCompleted object`
599606 
600607 A file download that finished during this call, reported with the
601608 same `download_id` as its `download_started` — or without a prior
from line 613
606613 
607614 The caller-assigned identifier for this download, stable across the state changes reporting it.
608615 
616 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
617 
609618 - `type: "download_completed"`
610619 
611 - `"download_completed"`
612 
613620 - `url: string`
614621 
615622 The final post-redirect URL the download was served from.
616623 
624 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
625 
617626 - `path: optional string or null`
618627 
619628 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.
620629 
630 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
631 
621632 - `size_bytes: optional number or null`
622633 
623634 The completed download's size.
624635 
625 - `BrowserStateChangeDownloadFailed object { download_id, type, url, error }`
636 minimum: 0
637 
638 - `BrowserStateChangeDownloadFailed object`
626639 
627640 A file download that failed — or was cancelled — during this call.
628641 
from line 643
630643 
631644 The caller-assigned identifier for this download, stable across the state changes reporting it.
632645 
646 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
647 
633648 - `type: "download_failed"`
634649 
635 - `"download_failed"`
636 
637650 - `url: string`
638651 
639652 The final post-redirect URL the download was served from.
640653 
654 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
655 
641656 - `error: optional string or null`
642657 
643658 The failure or cancellation detail, when known.
644659 
660 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
661 
645662 - `is_error: optional boolean`
646663 
647664 - `toolset_name: optional string or null`
648665 
649666 For a toolset member tool_result, the toolset family of the paired tool_use.
650667 
651 - `ServerToolUseBlockParam object { id, input, name, 3 more }`
668 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
669 
670 - `ServerToolUseBlockParam object`
652671 
653672 - `id: string`
654673 
674 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
675 
655676 - `input: map[unknown]`
656677 
657678 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
from line 693
672693 
673694 - `type: "server_tool_use"`
674695 
675 - `"server_tool_use"`
676 
677696 - `cache_control: optional CacheControlEphemeral or null`
678697 
679698 Create a cache control breakpoint at this content block.
from line 701
682701 
683702 Tool invocation directly from the model.
684703 
685 - `DirectCaller object { type }`
704 - `DirectCaller object`
686705 
687706 Tool invocation directly from the model.
688707 
689 - `ServerToolCaller object { tool_id, type }`
708 - `ServerToolCaller object`
690709 
691710 Tool invocation generated by a server-side tool.
692711 
693 - `ServerToolCaller20260120 object { tool_id, type }`
694 
695 - `WebSearchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
712 - `ServerToolCaller20260120 object`
713 
714 - `WebSearchToolResultBlockParam object`
696715 
697716 - `content: WebSearchToolResultBlockParamContent`
698717 
from line 723
704723 
705724 - `type: "web_search_result"`
706725 
707 - `"web_search_result"`
708 
709726 - `url: string`
710727 
711728 - `page_age: optional string or null`
712729 
713 - `WebSearchToolRequestError object { error_code, type }`
730 - `WebSearchToolRequestError object`
714731 
715732 - `error_code: WebSearchToolResultErrorCode`
716733 
from line 745
728745 
729746 - `type: "web_search_tool_result_error"`
730747 
731 - `"web_search_tool_result_error"`
732 
733748 - `tool_use_id: string`
734749 
750 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
751 
735752 - `type: "web_search_tool_result"`
736753 
737 - `"web_search_tool_result"`
738 
739754 - `cache_control: optional CacheControlEphemeral or null`
740755 
741756 Create a cache control breakpoint at this content block.
from line 759
744759 
745760 Tool invocation directly from the model.
746761 
747 - `DirectCaller object { type }`
762 - `DirectCaller object`
748763 
749764 Tool invocation directly from the model.
750765 
751 - `ServerToolCaller object { tool_id, type }`
766 - `ServerToolCaller object`
752767 
753768 Tool invocation generated by a server-side tool.
754769 
755 - `ServerToolCaller20260120 object { tool_id, type }`
756 
757 - `WebFetchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
770 - `ServerToolCaller20260120 object`
771 
772 - `WebFetchToolResultBlockParam object`
758773 
759774 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
760775 
761 - `WebFetchToolResultErrorBlockParam object { error_code, type }`
776 - `WebFetchToolResultErrorBlockParam object`
762777 
763778 - `error_code: WebFetchToolResultErrorCode`
764779 
from line 797
782797 
783798 - `type: "web_fetch_tool_result_error"`
784799 
785 - `"web_fetch_tool_result_error"`
786 
787 - `WebFetchBlockParam object { content, type, url, retrieved_at }`
800 - `WebFetchBlockParam object`
788801 
789802 - `content: DocumentBlockParam`
790803 
791804 - `type: "web_fetch_result"`
792805 
793 - `"web_fetch_result"`
794 
795806 - `url: string`
796807 
797808 Fetched content URL
from line 813
802813 
803814 - `tool_use_id: string`
804815 
816 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
817 
805818 - `type: "web_fetch_tool_result"`
806819 
807 - `"web_fetch_tool_result"`
808 
809820 - `cache_control: optional CacheControlEphemeral or null`
810821 
811822 Create a cache control breakpoint at this content block.
from line 825
814825 
815826 Tool invocation directly from the model.
816827 
817 - `DirectCaller object { type }`
828 - `DirectCaller object`
818829 
819830 Tool invocation directly from the model.
820831 
821 - `ServerToolCaller object { tool_id, type }`
832 - `ServerToolCaller object`
822833 
823834 Tool invocation generated by a server-side tool.
824835 
825 - `ServerToolCaller20260120 object { tool_id, type }`
826 
827 - `CodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
836 - `ServerToolCaller20260120 object`
837 
838 - `CodeExecutionToolResultBlockParam object`
828839 
829840 - `content: CodeExecutionToolResultBlockParamContent`
830841 
831842 Code execution result with encrypted stdout for PFC + web_search results.
832843 
833 - `CodeExecutionToolResultErrorParam object { error_code, type }`
844 - `CodeExecutionToolResultErrorParam object`
834845 
835846 - `error_code: CodeExecutionToolResultErrorCode`
836847 
from line 855
844855 
845856 - `type: "code_execution_tool_result_error"`
846857 
847 - `"code_execution_tool_result_error"`
848 
849 - `CodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
858 - `CodeExecutionResultBlockParam object`
850859 
851860 - `content: array of CodeExecutionOutputBlockParam`
852861 
from line 863
854863 
855864 - `type: "code_execution_output"`
856865 
857 - `"code_execution_output"`
858 
859866 - `return_code: number`
860867 
861868 - `stderr: string`
from line 871
864871 
865872 - `type: "code_execution_result"`
866873 
867 - `"code_execution_result"`
868 
869 - `EncryptedCodeExecutionResultBlockParam object { content, encrypted_stdout, return_code, 2 more }`
874 - `EncryptedCodeExecutionResultBlockParam object`
870875 
871876 Code execution result with encrypted stdout for PFC + web_search results.
872877 
from line 889
884889 
885890 - `type: "encrypted_code_execution_result"`
886891 
887 - `"encrypted_code_execution_result"`
888 
889892 - `tool_use_id: string`
890893 
894 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
895 
891896 - `type: "code_execution_tool_result"`
892897 
893 - `"code_execution_tool_result"`
894 
895898 - `cache_control: optional CacheControlEphemeral or null`
896899 
897900 Create a cache control breakpoint at this content block.
898901 
899 - `BashCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
902 - `BashCodeExecutionToolResultBlockParam object`
900903 
901904 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
902905 
903 - `BashCodeExecutionToolResultErrorParam object { error_code, type }`
906 - `BashCodeExecutionToolResultErrorParam object`
904907 
905908 - `error_code: BashCodeExecutionToolResultErrorCode`
906909 
from line 919
916919 
917920 - `type: "bash_code_execution_tool_result_error"`
918921 
919 - `"bash_code_execution_tool_result_error"`
920 
921 - `BashCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
922 - `BashCodeExecutionResultBlockParam object`
922923 
923924 - `content: array of BashCodeExecutionOutputBlockParam`
924925 
from line 927
926927 
927928 - `type: "bash_code_execution_output"`
928929 
929 - `"bash_code_execution_output"`
930 
931930 - `return_code: number`
932931 
933932 - `stderr: string`
from line 935
936935 
937936 - `type: "bash_code_execution_result"`
938937 
939 - `"bash_code_execution_result"`
940 
941938 - `tool_use_id: string`
942939 
940 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
941 
943942 - `type: "bash_code_execution_tool_result"`
944943 
945 - `"bash_code_execution_tool_result"`
946 
947944 - `cache_control: optional CacheControlEphemeral or null`
948945 
949946 Create a cache control breakpoint at this content block.
950947 
951 - `TextEditorCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
948 - `TextEditorCodeExecutionToolResultBlockParam object`
952949 
953950 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
954951 
955 - `TextEditorCodeExecutionToolResultErrorParam object { error_code, type, error_message }`
952 - `TextEditorCodeExecutionToolResultErrorParam object`
956953 
957954 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
958955 
from line 965
968965 
969966 - `type: "text_editor_code_execution_tool_result_error"`
970967 
971 - `"text_editor_code_execution_tool_result_error"`
972 
973968 - `error_message: optional string or null`
974969 
975 - `TextEditorCodeExecutionViewResultBlockParam object { content, file_type, type, 3 more }`
970 - `TextEditorCodeExecutionViewResultBlockParam object`
976971 
977972 - `content: string`
978973 
from line 981
986981 
987982 - `type: "text_editor_code_execution_view_result"`
988983 
989 - `"text_editor_code_execution_view_result"`
990 
991984 - `num_lines: optional number or null`
992985 
993986 - `start_line: optional number or null`
994987 
995988 - `total_lines: optional number or null`
996989 
997 - `TextEditorCodeExecutionCreateResultBlockParam object { is_file_update, type }`
990 - `TextEditorCodeExecutionCreateResultBlockParam object`
998991 
999992 - `is_file_update: boolean`
1000993 
1001994 - `type: "text_editor_code_execution_create_result"`
1002995 
1003 - `"text_editor_code_execution_create_result"`
1004 
1005 - `TextEditorCodeExecutionStrReplaceResultBlockParam object { type, lines, new_lines, 3 more }`
996 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
1006997 
1007998 - `type: "text_editor_code_execution_str_replace_result"`
1008999 
1009 - `"text_editor_code_execution_str_replace_result"`
1010 
10111000 - `lines: optional array of string or null`
10121001 
10131002 - `new_lines: optional number or null`
from line 1009
10201009 
10211010 - `tool_use_id: string`
10221011 
1012 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1013 
10231014 - `type: "text_editor_code_execution_tool_result"`
10241015 
1025 - `"text_editor_code_execution_tool_result"`
1026 
10271016 - `cache_control: optional CacheControlEphemeral or null`
10281017 
10291018 Create a cache control breakpoint at this content block.
10301019 
1031 - `ToolSearchToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1020 - `ToolSearchToolResultBlockParam object`
10321021 
10331022 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
10341023 
1035 - `ToolSearchToolResultErrorParam object { error_code, type, error_message }`
1024 - `ToolSearchToolResultErrorParam object`
10361025 
10371026 - `error_code: ToolSearchToolResultErrorCode`
10381027 
from line 1035
10461035 
10471036 - `type: "tool_search_tool_result_error"`
10481037 
1049 - `"tool_search_tool_result_error"`
1050 
10511038 - `error_message: optional string or null`
10521039 
1053 - `ToolSearchToolSearchResultBlockParam object { tool_references, type }`
1040 - `ToolSearchToolSearchResultBlockParam object`
10541041 
10551042 - `tool_references: array of ToolReferenceBlockParam`
10561043 
10571044 - `tool_name: string`
10581045 
1046 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1047 
10591048 - `type: "tool_reference"`
10601049 
10611050 - `cache_control: optional CacheControlEphemeral or null`
from line 1053
10641053 
10651054 - `type: "tool_search_tool_search_result"`
10661055 
1067 - `"tool_search_tool_search_result"`
1068 
10691056 - `tool_use_id: string`
10701057 
1058 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1059 
10711060 - `type: "tool_search_tool_result"`
10721061 
1073 - `"tool_search_tool_result"`
1074 
10751062 - `cache_control: optional CacheControlEphemeral or null`
10761063 
10771064 Create a cache control breakpoint at this content block.
10781065 
1079 - `ContainerUploadBlockParam object { file_id, type, cache_control }`
1066 - `ContainerUploadBlockParam object`
10801067 
10811068 A content block that represents a file to be uploaded to the container
10821069 Files uploaded via this block will be available in the container's input directory.
from line 1072
10851072 
10861073 - `type: "container_upload"`
10871074 
1088 - `"container_upload"`
1089 
10901075 - `cache_control: optional CacheControlEphemeral or null`
10911076 
10921077 Create a cache control breakpoint at this content block.
from line 1166
11811166 
11821167 Container identifier for reuse across requests.
11831168 
1184 - `ContainerParams object { id, skills }`
1169 - `ContainerParams object`
11851170 
11861171 Container parameters with skills to be loaded.
11871172 
from line 1178
11931178 
11941179 List of skills to load in the container
11951180 
1181 maxItems: 20
1182 
11961183 - `skill_id: string`
11971184 
11981185 Skill ID
11991186 
1187 maxLength: 64, minLength: 1
1188 
12001189 - `type: "anthropic" or "custom"`
12011190 
12021191 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 1198
12091198 
12101199 Skill version or 'latest' for most recent version
12111200 
1201 maxLength: 64, minLength: 1
1202 
12121203 - `string`
12131204 
12141205 - `inference_geo: optional string or null`
from line 1216
12251216 
12261217 This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
12271218 
1219 maxLength: 512
1220 
12281221 - `output_config: optional OutputConfig`
12291222 
12301223 Configuration options for the model's output, such as the output format.
from line 1246
12531246 
12541247 - `type: "json_schema"`
12551248 
1256 - `"json_schema"`
1257 
12581249 - `service_tier: optional "auto" or "standard_only"`
12591250 
12601251 Determines whether to use priority capacity (if available) or standard capacity for this request.
from line 1282
12911282 
12921283 - `text: string`
12931284 
1285 minLength: 1
1286 
12941287 - `type: "text"`
12951288 
12961289 - `cache_control: optional CacheControlEphemeral or null`
from line 1292
12991292 
13001293 - `citations: optional array of TextCitationParam or null`
13011294 
1302 - `temperature: optional number`
1303 
1304 Amount of randomness injected into the response.
1305 
1306 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.
1307 
1308 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
1309 
13101295 - `thinking: optional ThinkingConfigParam`
13111296 
13121297 Configuration for enabling Claude's extended thinking.
from line 1300
13151300 
13161301 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
13171302 
1318 - `ThinkingConfigEnabled object { budget_tokens, type, display }`
1303 - `ThinkingConfigEnabled object`
13191304 
13201305 - `budget_tokens: number`
13211306 
from line 1310
13251310 
13261311 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
13271312 
1313 minimum: 1024
1314 
13281315 - `type: "enabled"`
13291316 
1330 - `"enabled"`
1331 
13321317 - `display: optional "summarized" or "omitted" or null`
13331318 
13341319 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1322
13371322 
13381323 - `"omitted"`
13391324 
1340 - `ThinkingConfigDisabled object { type }`
1325 - `ThinkingConfigDisabled object`
13411326 
13421327 - `type: "disabled"`
13431328 
1344 - `"disabled"`
1345 
1346 - `ThinkingConfigAdaptive object { type, display }`
1329 - `ThinkingConfigAdaptive object`
13471330 
13481331 - `type: "adaptive"`
13491332 
1350 - `"adaptive"`
1351 
13521333 - `display: optional "summarized" or "omitted" or null`
13531334 
13541335 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1342
13611342 
13621343 How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
13631344 
1364 - `ToolChoiceAuto object { type, disable_parallel_tool_use }`
1345 - `ToolChoiceAuto object`
13651346 
13661347 The model will automatically decide whether to use tools.
13671348 
13681349 - `type: "auto"`
13691350 
1370 - `"auto"`
1371 
13721351 - `disable_parallel_tool_use: optional boolean`
13731352 
13741353 Whether to disable parallel tool use.
13751354 
13761355 Defaults to `false`. If set to `true`, the model will output at most one tool use.
13771356 
1378 - `ToolChoiceAny object { type, disable_parallel_tool_use }`
1357 - `ToolChoiceAny object`
13791358 
13801359 The model will use any available tools.
13811360 
13821361 - `type: "any"`
13831362 
1384 - `"any"`
1385 
13861363 - `disable_parallel_tool_use: optional boolean`
13871364 
13881365 Whether to disable parallel tool use.
13891366 
13901367 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
13911368 
1392 - `ToolChoiceTool object { name, type, disable_parallel_tool_use }`
1369 - `ToolChoiceTool object`
13931370 
13941371 The model will use the specified tool with `tool_choice.name`.
13951372 
from line 1376
13991376 
14001377 - `type: "tool"`
14011378 
1402 - `"tool"`
1403 
14041379 - `disable_parallel_tool_use: optional boolean`
14051380 
14061381 Whether to disable parallel tool use.
14071382 
14081383 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
14091384 
1410 - `ToolChoiceNone object { type }`
1385 - `ToolChoiceNone object`
14111386 
14121387 The model will not be allowed to use tools.
14131388 
14141389 - `type: "none"`
1415 
1416 - `"none"`
14171390 
14181391 - `tools: optional array of ToolUnion`
14191392 
from line 1452
14791452 
14801453 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
14811454 
1482 - `Tool object { input_schema, name, allowed_callers, 7 more }`
1483 
1484 - `input_schema: object { type, properties, required }`
1455 - `Tool object`
1456 
1457 - `input_schema: object`
14851458 
14861459 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
14871460 
from line 1462
14891462 
14901463 - `type: "object"`
14911464 
1492 - `"object"`
1493 
14941465 - `properties: optional map[unknown] or null`
14951466 
14961467 - `required: optional array of string or null`
from line 1472
15011472 
15021473 This is how the tool will be called by the model and in `tool_use` blocks.
15031474 
1475 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$
1476 
15041477 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15051478 
15061479 - `"direct"`
from line 1510
15371510 
15381511 - `type: optional "custom" or null`
15391512 
1540 - `"custom"`
1541 
1542 - `ToolBash20250124 object { name, type, allowed_callers, 4 more }`
1513 - `ToolBash20250124 object`
15431514 
15441515 - `name: "bash"`
15451516 
from line 1518
15471518 
15481519 This is how the tool will be called by the model and in `tool_use` blocks.
15491520 
1550 - `"bash"`
1551 
15521521 - `type: "bash_20250124"`
15531522 
1554 - `"bash_20250124"`
1555 
15561523 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15571524 
15581525 - `"direct"`
from line 1544
15771544 
15781545 When true, guarantees schema validation on tool names and inputs
15791546 
1580 - `CodeExecutionTool20250522 object { name, type, allowed_callers, 3 more }`
1547 - `CodeExecutionTool20250522 object`
15811548 
15821549 - `name: "code_execution"`
15831550 
from line 1552
15851552 
15861553 This is how the tool will be called by the model and in `tool_use` blocks.
15871554 
1588 - `"code_execution"`
1589 
15901555 - `type: "code_execution_20250522"`
15911556 
1592 - `"code_execution_20250522"`
1593 
15941557 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15951558 
15961559 - `"direct"`
from line 1576
16131576 
16141577 When true, guarantees schema validation on tool names and inputs
16151578 
1616 - `CodeExecutionTool20250825 object { name, type, allowed_callers, 3 more }`
1579 - `CodeExecutionTool20250825 object`
16171580 
16181581 - `name: "code_execution"`
16191582 
from line 1584
16211584 
16221585 This is how the tool will be called by the model and in `tool_use` blocks.
16231586 
1624 - `"code_execution"`
1625 
16261587 - `type: "code_execution_20250825"`
16271588 
1589 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1590 
1591 - `"direct"`
1592 
16281593 - `"code_execution_20250825"`
16291594 
1595 - `"code_execution_20260120"`
1596 
1597 - `"code_execution_20260521"`
1598 
1599 - `cache_control: optional CacheControlEphemeral or null`
1600 
1601 Create a cache control breakpoint at this content block.
1602 
1603 - `defer_loading: optional boolean`
1604 
1605 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1606 
1607 - `strict: optional boolean`
1608 
1609 When true, guarantees schema validation on tool names and inputs
1610 
1611 - `CodeExecutionTool20260120 object`
1612 
1613 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1614 
1615 - `name: "code_execution"`
1616 
1617 Name of the tool.
1618 
1619 This is how the tool will be called by the model and in `tool_use` blocks.
1620 
1621 - `type: "code_execution_20260120"`
1622 
16301623 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16311624 
16321625 - `"direct"`
from line 1642
16491642 
16501643 When true, guarantees schema validation on tool names and inputs
16511644 
1652 - `CodeExecutionTool20260120 object { name, type, allowed_callers, 3 more }`
1653 
1654 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1645 - `CodeExecutionTool20260521 object`
1646 
1647 Code execution tool with REPL state persistence.
16551648 
16561649 - `name: "code_execution"`
16571650 
from line 1652
16591652 
16601653 This is how the tool will be called by the model and in `tool_use` blocks.
16611654 
1662 - `"code_execution"`
1663 
1664 - `type: "code_execution_20260120"`
1655 - `type: "code_execution_20260521"`
1656 
1657 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1658 
1659 - `"direct"`
1660 
1661 - `"code_execution_20250825"`
16651662 
16661663 - `"code_execution_20260120"`
16671664 
1668 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1669 
1670 - `"direct"`
1671 
1672 - `"code_execution_20250825"`
1673 
1674 - `"code_execution_20260120"`
1675 
16761665 - `"code_execution_20260521"`
16771666 
16781667 - `cache_control: optional CacheControlEphemeral or null`
from line 1676
16871676 
16881677 When true, guarantees schema validation on tool names and inputs
16891678 
1690 - `CodeExecutionTool20260521 object { name, type, allowed_callers, 3 more }`
1691 
1692 Code execution tool with REPL state persistence.
1693 
1694 - `name: "code_execution"`
1695 
1696 Name of the tool.
1697 
1698 This is how the tool will be called by the model and in `tool_use` blocks.
1699 
1700 - `"code_execution"`
1701 
1702 - `type: "code_execution_20260521"`
1703 
1704 - `"code_execution_20260521"`
1705 
1706 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1707 
1708 - `"direct"`
1709 
1710 - `"code_execution_20250825"`
1711 
1712 - `"code_execution_20260120"`
1713 
1714 - `"code_execution_20260521"`
1715 
1716 - `cache_control: optional CacheControlEphemeral or null`
1717 
1718 Create a cache control breakpoint at this content block.
1719 
1720 - `defer_loading: optional boolean`
1721 
1722 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1723 
1724 - `strict: optional boolean`
1725 
1726 When true, guarantees schema validation on tool names and inputs
1727 
1728 - `BrowserToolset20260801 object { type, allowed_callers, cache_control, configs }`
1679 - `BrowserToolset20260801 object`
17291680 
17301681 The browser toolset: a single `tools[]` entry (carrying no
17311682 `name`) that declares the browser tool family. The model is served
from line 1684
17331684 from its schema.
17341685 
17351686 - `type: "browser_toolset_20260801"`
1736 
1737 - `"browser_toolset_20260801"`
17381687 
17391688 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
17401689 
from line 2080
21312080 
21322081 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
21332082 
2134 - `MemoryTool20250818 object { name, type, allowed_callers, 4 more }`
2083 - `MemoryTool20250818 object`
21352084 
21362085 - `name: "memory"`
21372086 
from line 2088
21392088 
21402089 This is how the tool will be called by the model and in `tool_use` blocks.
21412090 
2142 - `"memory"`
2143 
21442091 - `type: "memory_20250818"`
21452092 
2146 - `"memory_20250818"`
2147 
21482093 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21492094 
21502095 - `"direct"`
from line 2114
21692114 
21702115 When true, guarantees schema validation on tool names and inputs
21712116 
2172 - `ComputerToolset20260801 object { type, allowed_callers, cache_control, configs }`
2117 - `ComputerToolset20260801 object`
21732118 
21742119 The computer toolset: a single `tools[]` entry (carrying no
21752120 `name`) that declares the computer tool family. The model is
from line 2127
21822127 
21832128 - `type: "computer_toolset_20260801"`
21842129 
2185 - `"computer_toolset_20260801"`
2186 
21872130 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21882131 
21892132 - `"direct"`
from line 2354
24112354 
24122355 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
24132356 
2414 - `ToolTextEditor20250124 object { name, type, allowed_callers, 4 more }`
2357 - `ToolTextEditor20250124 object`
24152358 
24162359 - `name: "str_replace_editor"`
24172360 
from line 2362
24192362 
24202363 This is how the tool will be called by the model and in `tool_use` blocks.
24212364 
2422 - `"str_replace_editor"`
2423 
24242365 - `type: "text_editor_20250124"`
24252366 
2426 - `"text_editor_20250124"`
2427 
24282367 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24292368 
24302369 - `"direct"`
from line 2388
24492388 
24502389 When true, guarantees schema validation on tool names and inputs
24512390 
2452 - `ToolTextEditor20250429 object { name, type, allowed_callers, 4 more }`
2391 - `ToolTextEditor20250429 object`
24532392 
24542393 - `name: "str_replace_based_edit_tool"`
24552394 
from line 2396
24572396 
24582397 This is how the tool will be called by the model and in `tool_use` blocks.
24592398 
2460 - `"str_replace_based_edit_tool"`
2461 
24622399 - `type: "text_editor_20250429"`
24632400 
2464 - `"text_editor_20250429"`
2465 
24662401 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24672402 
24682403 - `"direct"`
from line 2422
24872422 
24882423 When true, guarantees schema validation on tool names and inputs
24892424 
2490 - `ToolTextEditor20250728 object { name, type, allowed_callers, 5 more }`
2425 - `ToolTextEditor20250728 object`
24912426 
24922427 - `name: "str_replace_based_edit_tool"`
24932428 
from line 2430
24952430 
24962431 This is how the tool will be called by the model and in `tool_use` blocks.
24972432 
2498 - `"str_replace_based_edit_tool"`
2499 
25002433 - `type: "text_editor_20250728"`
25012434 
2502 - `"text_editor_20250728"`
2503 
25042435 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25052436 
25062437 - `"direct"`
from line 2456
25252456 
25262457 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
25272458 
2459 minimum: 1
2460 
25282461 - `strict: optional boolean`
25292462 
25302463 When true, guarantees schema validation on tool names and inputs
25312464 
2532 - `WebSearchTool20250305 object { name, type, allowed_callers, 7 more }`
2465 - `WebSearchTool20250305 object`
25332466 
25342467 - `name: "web_search"`
25352468 
from line 2470
25372470 
25382471 This is how the tool will be called by the model and in `tool_use` blocks.
25392472 
2540 - `"web_search"`
2541 
25422473 - `type: "web_search_20250305"`
25432474 
2544 - `"web_search_20250305"`
2545 
25462475 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25472476 
25482477 - `"direct"`
from line 2502
25732502 
25742503 Maximum number of times the tool can be used in the API request.
25752504 
2505 exclusiveMinimum: 0
2506 
25762507 - `strict: optional boolean`
25772508 
25782509 When true, guarantees schema validation on tool names and inputs
from line 2514
25832514 
25842515 - `type: "approximate"`
25852516 
2586 - `"approximate"`
2587 
25882517 - `city: optional string or null`
25892518 
25902519 The city of the user.
25912520 
2521 maxLength: 255, minLength: 1
2522 
25922523 - `country: optional string or null`
25932524 
25942525 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
25952526 
2527 maxLength: 2, minLength: 2
2528 
25962529 - `region: optional string or null`
25972530 
25982531 The region of the user.
25992532 
2533 maxLength: 255, minLength: 1
2534 
26002535 - `timezone: optional string or null`
26012536 
26022537 The [IANA timezone](https://nodatime.org/TimeZones) of the user.
26032538 
2604 - `WebFetchTool20250910 object { name, type, allowed_callers, 8 more }`
2539 maxLength: 255, minLength: 1
2540 
2541 - `WebFetchTool20250910 object`
26052542 
26062543 - `name: "web_fetch"`
26072544 
from line 2546
26092546 
26102547 This is how the tool will be called by the model and in `tool_use` blocks.
26112548 
2612 - `"web_fetch"`
2613 
26142549 - `type: "web_fetch_20250910"`
26152550 
2616 - `"web_fetch_20250910"`
2617 
26182551 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26192552 
26202553 - `"direct"`
from line 2582
26492582 
26502583 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
26512584 
2585 exclusiveMinimum: 0
2586 
26522587 - `max_uses: optional number or null`
26532588 
26542589 Maximum number of times the tool can be used in the API request.
26552590 
2591 exclusiveMinimum: 0
2592 
26562593 - `strict: optional boolean`
26572594 
26582595 When true, guarantees schema validation on tool names and inputs
26592596 
2660 - `WebSearchTool20260209 object { name, type, allowed_callers, 7 more }`
2597 - `WebSearchTool20260209 object`
26612598 
26622599 - `name: "web_search"`
26632600 
from line 2602
26652602 
26662603 This is how the tool will be called by the model and in `tool_use` blocks.
26672604 
2668 - `"web_search"`
2669 
26702605 - `type: "web_search_20260209"`
26712606 
2672 - `"web_search_20260209"`
2673 
26742607 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26752608 
26762609 - `"direct"`
from line 2634
27012634 
27022635 Maximum number of times the tool can be used in the API request.
27032636 
2637 exclusiveMinimum: 0
2638 
27042639 - `strict: optional boolean`
27052640 
27062641 When true, guarantees schema validation on tool names and inputs
from line 2644
27092644 
27102645 Parameters for the user's location. Used to provide more relevant search results.
27112646 
2712 - `WebFetchTool20260209 object { name, type, allowed_callers, 8 more }`
2647 - `WebFetchTool20260209 object`
27132648 
27142649 - `name: "web_fetch"`
27152650 
from line 2652
27172652 
27182653 This is how the tool will be called by the model and in `tool_use` blocks.
27192654 
2720 - `"web_fetch"`
2721 
27222655 - `type: "web_fetch_20260209"`
27232656 
2724 - `"web_fetch_20260209"`
2725 
27262657 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27272658 
27282659 - `"direct"`
from line 2688
27572688 
27582689 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
27592690 
2691 exclusiveMinimum: 0
2692 
27602693 - `max_uses: optional number or null`
27612694 
27622695 Maximum number of times the tool can be used in the API request.
27632696 
2697 exclusiveMinimum: 0
2698 
27642699 - `strict: optional boolean`
27652700 
27662701 When true, guarantees schema validation on tool names and inputs
27672702 
2768 - `WebFetchTool20260309 object { name, type, allowed_callers, 9 more }`
2703 - `WebFetchTool20260309 object`
27692704 
27702705 Web fetch tool with use_cache parameter for bypassing cached content.
27712706 
from line 2710
27752710 
27762711 This is how the tool will be called by the model and in `tool_use` blocks.
27772712 
2778 - `"web_fetch"`
2779 
27802713 - `type: "web_fetch_20260309"`
27812714 
2782 - `"web_fetch_20260309"`
2783 
27842715 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27852716 
27862717 - `"direct"`
from line 2746
28152746 
28162747 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
28172748 
2749 exclusiveMinimum: 0
2750 
28182751 - `max_uses: optional number or null`
28192752 
28202753 Maximum number of times the tool can be used in the API request.
28212754 
2755 exclusiveMinimum: 0
2756 
28222757 - `strict: optional boolean`
28232758 
28242759 When true, guarantees schema validation on tool names and inputs
from line 2762
28272762 
28282763 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
28292764 
2830 - `WebSearchTool20260318 object { name, type, allowed_callers, 8 more }`
2765 - `WebSearchTool20260318 object`
28312766 
28322767 - `name: "web_search"`
28332768 
from line 2770
28352770 
28362771 This is how the tool will be called by the model and in `tool_use` blocks.
28372772 
2838 - `"web_search"`
2839 
28402773 - `type: "web_search_20260318"`
28412774 
2842 - `"web_search_20260318"`
2843 
28442775 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28452776 
28462777 - `"direct"`
from line 2802
28712802 
28722803 Maximum number of times the tool can be used in the API request.
28732804 
2805 exclusiveMinimum: 0
2806 
28742807 - `response_inclusion: optional "full" or "excluded"`
28752808 
28762809 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 2820
28872820 
28882821 Parameters for the user's location. Used to provide more relevant search results.
28892822 
2890 - `WebFetchTool20260318 object { name, type, allowed_callers, 10 more }`
2823 - `WebFetchTool20260318 object`
28912824 
28922825 - `name: "web_fetch"`
28932826 
from line 2828
28952828 
28962829 This is how the tool will be called by the model and in `tool_use` blocks.
28972830 
2898 - `"web_fetch"`
2899 
29002831 - `type: "web_fetch_20260318"`
29012832 
2902 - `"web_fetch_20260318"`
2903 
29042833 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29052834 
29062835 - `"direct"`
from line 2864
29352864 
29362865 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
29372866 
2867 exclusiveMinimum: 0
2868 
29382869 - `max_uses: optional number or null`
29392870 
29402871 Maximum number of times the tool can be used in the API request.
29412872 
2873 exclusiveMinimum: 0
2874 
29422875 - `response_inclusion: optional "full" or "excluded"`
29432876 
29442877 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 2888
29552888 
29562889 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
29572890 
2958 - `ToolSearchToolBm25_20251119 object { name, type, allowed_callers, 3 more }`
2891 - `ToolSearchToolBm25_20251119 object`
29592892 
29602893 - `name: "tool_search_tool_bm25"`
29612894 
from line 2896
29632896 
29642897 This is how the tool will be called by the model and in `tool_use` blocks.
29652898 
2899 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2900 
2901 - `"tool_search_tool_bm25_20251119"`
2902 
29662903 - `"tool_search_tool_bm25"`
29672904 
2968 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2969 
2970 - `"tool_search_tool_bm25_20251119"`
2971 
2972 - `"tool_search_tool_bm25"`
2973 
29742905 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29752906 
29762907 - `"direct"`
from line 2924
29932924 
29942925 When true, guarantees schema validation on tool names and inputs
29952926 
2996 - `ToolSearchToolRegex20251119 object { name, type, allowed_callers, 3 more }`
2927 - `ToolSearchToolRegex20251119 object`
29972928 
29982929 - `name: "tool_search_tool_regex"`
29992930 
from line 2932
30012932 
30022933 This is how the tool will be called by the model and in `tool_use` blocks.
30032934 
2935 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2936 
2937 - `"tool_search_tool_regex_20251119"`
2938 
30042939 - `"tool_search_tool_regex"`
30052940 
3006 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
3007 
3008 - `"tool_search_tool_regex_20251119"`
3009 
3010 - `"tool_search_tool_regex"`
3011 
30122941 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
30132942 
30142943 - `"direct"`
from line 2960
30312960 
30322961 When true, guarantees schema validation on tool names and inputs
30332962 
2963 - `temperature: optional number`
2964 
2965 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
2966 
2967 Amount of randomness injected into the response.
2968 
2969 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.
2970 
2971 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
2972 
2973 maximum: 1, minimum: 0
2974 
30342975 - `top_k: optional number`
30352976 
2977 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
2978 
30362979 Only sample from the top K options for each subsequent token.
30372980 
30382981 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
30392982 
30402983 Recommended for advanced use cases only.
30412984 
2985 minimum: 0
2986 
30422987 - `top_p: optional number`
30432988 
2989 **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.
2990 
30442991 Use nucleus sampling.
30452992 
30462993 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`.
30472994 
30482995 Recommended for advanced use cases only.
30492996 
3050### Returns
3051 
3052- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
2997 maximum: 1, minimum: 0
2998 
2999## Returns
3000 
3001- `MessageBatch object`
30533002 
30543003 - `id: string`
30553004 
from line 3010
30613010 
30623011 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
30633012 
3013 format: date-time
3014 
30643015 - `cancel_initiated_at: string or null`
30653016 
30663017 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
30673018 
3019 format: date-time
3020 
30683021 - `created_at: string`
30693022 
30703023 RFC 3339 datetime string representing the time at which the Message Batch was created.
30713024 
3025 format: date-time
3026 
30723027 - `ended_at: string or null`
30733028 
30743029 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
30753030 
30763031 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
30773032 
3033 format: date-time
3034 
30783035 - `expires_at: string`
30793036 
30803037 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
30813038 
3039 format: date-time
3040 
30823041 - `processing_status: "in_progress" or "canceling" or "ended"`
30833042 
30843043 Processing status of the Message Batch.
from line 3060
31013060 
31023061 This is zero until processing of the entire Message Batch has ended.
31033062 
3063 default: 0
3064 
31043065 - `errored: number`
31053066 
31063067 Number of requests in the Message Batch that encountered an error.
31073068 
31083069 This is zero until processing of the entire Message Batch has ended.
31093070 
3071 default: 0
3072 
31103073 - `expired: number`
31113074 
31123075 Number of requests in the Message Batch that have expired.
31133076 
31143077 This is zero until processing of the entire Message Batch has ended.
31153078 
3079 default: 0
3080 
31163081 - `processing: number`
31173082 
31183083 Number of requests in the Message Batch that are processing.
31193084 
3085 default: 0
3086 
31203087 - `succeeded: number`
31213088 
31223089 Number of requests in the Message Batch that have completed successfully.
31233090 
31243091 This is zero until processing of the entire Message Batch has ended.
31253092 
3093 default: 0
3094 
31263095 - `results_url: string or null`
31273096 
31283097 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 3104
31353104 
31363105 For Message Batches, this is always `"message_batch"`.
31373106 
3138 - `"message_batch"`
3139 
3140### Example
3141 
3142```http
3107 default: message_batch
3108 
3109## Example
3110 
3111```bash
31433112curl https://api.anthropic.com/v1/messages/batches \
31443113 -H 'Content-Type: application/json' \
31453114 -H 'anthropic-version: 2023-06-01' \
from line 3132
31633132 }'
31643133```
31653134 
3166#### Response
3135### Response (200)
31673136 
31683137```json
31693138{
31703139 

api/messages/batches/delete Changed · +9 / -14 lines

# Delete a Message Batch ## Path parameters ## Returns ## Example ### Response (200) ## Delete a Message Batch ### Path Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Delete a Message Batch
3url: https://platform.claude.com/docs/en/api/messages/batches/delete
4---
1# Delete a Message Batch
52 
6## Delete a Message Batch
3**DELETE** `/v1/messages/batches/{message_batch_id}`
74 
8**delete** `/v1/messages/batches/{message_batch_id}`
9 
105Delete a Message Batch.
116 
127Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
from line 8
138 
149Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
1510 
16### Path Parameters
11## Path parameters
1712 
1813- `message_batch_id: string`
1914 
2015 ID of the Message Batch.
2116 
22### Returns
17## Returns
2318 
24- `DeletedMessageBatch object { id, type }`
19- `DeletedMessageBatch object`
2520 
2621 - `id: string`
2722 
from line 28
3328 
3429 For Message Batches, this is always `"message_batch_deleted"`.
3530 
36 - `"message_batch_deleted"`
31 default: message_batch_deleted
3732 
38### Example
33## Example
3934 
40```http
35```bash
4136curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
4237 -X DELETE \
4338 -H 'anthropic-version: 2023-06-01' \
from line 39
4439 -H "X-Api-Key: $ANTHROPIC_API_KEY"
4540```
4641 
47#### Response
42### Response (200)
4843 
4944```json
5045{

api/messages/batches/list Changed · +30 / -13 lines

# List Message Batches ## Query parameters ## Returns ## Example ### Response (200) ## List Message Batches ### Query Parameters ### Returns ### Example #### Response

from line 1
1---
2title: List Message Batches
3url: https://platform.claude.com/docs/en/api/messages/batches/list
4---
1# List Message Batches
52 
6## List Message Batches
3**GET** `/v1/messages/batches`
74 
8**get** `/v1/messages/batches`
9 
105List all Message Batches within a Workspace. Most recently created batches are returned first.
116 
127Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
138 
14### Query Parameters
9## Query parameters
1510 
1611- `after_id: optional string`
1712 
from line 22
2722 
2823 Defaults to `20`. Ranges from `1` to `1000`.
2924 
30### Returns
25 default: 20, maximum: 1000, minimum: 1
3126 
27## Returns
28 
3229- `data: array of MessageBatch`
3330 
3431 - `id: string`
from line 38
4138 
4239 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
4340 
41 format: date-time
42 
4443 - `cancel_initiated_at: string or null`
4544 
4645 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
4746 
47 format: date-time
48 
4849 - `created_at: string`
4950 
5051 RFC 3339 datetime string representing the time at which the Message Batch was created.
5152 
53 format: date-time
54 
5255 - `ended_at: string or null`
5356 
5457 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
from line 58
5558 
5659 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
5760 
61 format: date-time
62 
5863 - `expires_at: string`
5964 
6065 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
6166 
67 format: date-time
68 
6269 - `processing_status: "in_progress" or "canceling" or "ended"`
6370 
6471 Processing status of the Message Batch.
from line 88
8188 
8289 This is zero until processing of the entire Message Batch has ended.
8390 
91 default: 0
92 
8493 - `errored: number`
8594 
8695 Number of requests in the Message Batch that encountered an error.
from line 96
8796 
8897 This is zero until processing of the entire Message Batch has ended.
8998 
99 default: 0
100 
90101 - `expired: number`
91102 
92103 Number of requests in the Message Batch that have expired.
from line 104
93104 
94105 This is zero until processing of the entire Message Batch has ended.
95106 
107 default: 0
108 
96109 - `processing: number`
97110 
98111 Number of requests in the Message Batch that are processing.
99112 
113 default: 0
114 
100115 - `succeeded: number`
101116 
102117 Number of requests in the Message Batch that have completed successfully.
from line 118
103118 
104119 This is zero until processing of the entire Message Batch has ended.
105120 
121 default: 0
122 
106123 - `results_url: string or null`
107124 
108125 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 132
115132 
116133 For Message Batches, this is always `"message_batch"`.
117134 
118 - `"message_batch"`
135 default: message_batch
119136 
120137- `first_id: string or null`
121138 
from line 146
129146 
130147 Last ID in the `data` list. Can be used as the `after_id` for the next page.
131148 
132### Example
149## Example
133150 
134```http
151```bash
135152curl https://api.anthropic.com/v1/messages/batches \
136153 -H 'anthropic-version: 2023-06-01' \
137154 -H "X-Api-Key: $ANTHROPIC_API_KEY"
138155```
139156 
140#### Response
157### Response (200)
141158 
142159```json
143160{

api/messages/batches/results Changed · +256 / -173 lines

# Retrieve Message Batch results ## Path parameters ## Returns ## Example ## Retrieve Message Batch results ### Path Parameters ### Returns ### Example

from line 1
1---
2title: Retrieve Message Batch results
3url: https://platform.claude.com/docs/en/api/messages/batches/results
4---
1# Retrieve Message Batch results
52 
6## Retrieve Message Batch results
3**GET** `/v1/messages/batches/{message_batch_id}/results`
74 
8**get** `/v1/messages/batches/{message_batch_id}/results`
9 
105Streams the results of a Message Batch as a `.jsonl` file.
116 
127Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
from line 8
138 
149Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
1510 
16### Path Parameters
11## Path parameters
1712 
1813- `message_batch_id: string`
1914 
2015 ID of the Message Batch.
2116 
22### Returns
17## Returns
2318 
24- `MessageBatchIndividualResponse object { custom_id, result }`
19- `MessageBatchIndividualResponse object`
2520 
2621 This is a single line in the response `.jsonl` file and does not represent the response as a whole.
2722 
from line 32
3732 
3833 Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
3934 
40 - `MessageBatchSucceededResult object { message, type }`
35 - `MessageBatchSucceededResult object`
4136 
4237 - `message: Message`
4338 
from line 54
5954 
6055 The time at which the container will expire.
6156 
57 format: date-time
58 
6259 - `skills: array of ContainerSkill or null`
6360 
6461 Skills loaded in the container
from line 64
6764 
6865 Skill ID
6966 
67 maxLength: 64, minLength: 1
68 
7069 - `type: "anthropic" or "custom"`
7170 
7271 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 78
7978 
8079 The resolved version: a skill version ID for custom skills.
8180 
81 maxLength: 64, minLength: 1
82 
8283 - `content: array of ContentBlock`
8384 
8485 Content generated by the model.
from line 109
108109 [{"type": "text", "text": "B)"}]
109110 ```
110111 
111 - `TextBlock object { citations, text, type }`
112 - `TextBlock object`
112113 
113114 - `citations: array of TextCitation or null`
114115 
from line 117
116117 
117118 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
118119 
119 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
120 - `CitationCharLocation object`
120121 
121122 - `cited_text: string`
122123 
123124 - `document_index: number`
124125 
126 minimum: 0
127 
125128 - `document_title: string or null`
126129 
127130 - `end_char_index: number`
from line 133
130133 
131134 - `start_char_index: number`
132135 
136 minimum: 0
137 
133138 - `type: "char_location"`
134139 
135 - `"char_location"`
140 default: char_location
136141 
137 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
142 - `CitationPageLocation object`
138143 
139144 - `cited_text: string`
140145 
141146 - `document_index: number`
142147 
148 minimum: 0
149 
143150 - `document_title: string or null`
144151 
145152 - `end_page_number: number`
from line 155
148155 
149156 - `start_page_number: number`
150157 
158 minimum: 1
159 
151160 - `type: "page_location"`
152161 
153 - `"page_location"`
162 default: page_location
154163 
155 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
164 - `CitationContentBlockLocation object`
156165 
157166 - `cited_text: string`
158167 
from line 171
162171 
163172 - `document_index: number`
164173 
174 minimum: 0
175 
165176 - `document_title: string or null`
166177 
167178 - `end_block_index: number`
from line 187
176187 
177188 0-based index of the first cited block in the source's `content` array.
178189 
190 minimum: 0
191 
179192 - `type: "content_block_location"`
180193 
181 - `"content_block_location"`
194 default: content_block_location
182195 
183 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
196 - `CitationsWebSearchResultLocation object`
184197 
185198 - `cited_text: string`
186199 
from line 201
188201 
189202 - `title: string or null`
190203 
204 maxLength: 512
205 
191206 - `type: "web_search_result_location"`
192207 
193 - `"web_search_result_location"`
208 default: web_search_result_location
194209 
195210 - `url: string`
196211 
197 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
212 - `CitationsSearchResultLocation object`
198213 
199214 - `cited_text: string`
200215 
from line 229
214229 
215230 Counted separately from `document_index`; server-side web search results are not included in this count.
216231 
232 minimum: 0
233 
217234 - `source: string`
218235 
219236 - `start_block_index: number`
from line 237
220237 
221238 0-based index of the first cited block in the source's `content` array.
222239 
240 minimum: 0
241 
223242 - `title: string or null`
224243 
225244 - `type: "search_result_location"`
226245 
227 - `"search_result_location"`
246 default: search_result_location
228247 
229248 - `text: string`
230249 
250 maxLength: 5000000, minLength: 0
251 
231252 - `type: "text"`
232253 
233 - `"text"`
254 default: text
234255 
235 - `ThinkingBlock object { signature, thinking, type }`
256 - `ThinkingBlock object`
236257 
237258 - `signature: string`
238259 
from line 269
248269 
249270 - `type: "thinking"`
250271 
251 - `"thinking"`
272 default: thinking
252273 
253 - `RedactedThinkingBlock object { data, type }`
274 - `RedactedThinkingBlock object`
254275 
255276 - `data: string`
256277 
from line 283
262283 
263284 - `type: "redacted_thinking"`
264285 
265 - `"redacted_thinking"`
286 default: redacted_thinking
266287 
267 - `ToolUseBlock object { id, caller, input, 3 more }`
288 - `ToolUseBlock object`
268289 
269290 - `id: string`
270291 
292 pattern: ^[a-zA-Z0-9_-]+$
293 
271294 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
272295 
273296 Tool invocation directly from the model.
274297 
275 - `DirectCaller object { type }`
298 default: {"type":"direct"}
276299 
300 - `DirectCaller object`
301 
277302 Tool invocation directly from the model.
278303 
279304 - `type: "direct"`
280305 
281 - `"direct"`
306 - `ServerToolCaller object`
282307 
283 - `ServerToolCaller object { tool_id, type }`
284 
285308 Tool invocation generated by a server-side tool.
286309 
287310 - `tool_id: string`
288311 
312 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
313 
289314 - `type: "code_execution_20250825"`
290315 
291 - `"code_execution_20250825"`
316 - `ServerToolCaller20260120 object`
292317 
293 - `ServerToolCaller20260120 object { tool_id, type }`
294 
295318 - `tool_id: string`
296319 
320 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
321 
297322 - `type: "code_execution_20260120"`
298323 
299 - `"code_execution_20260120"`
300 
301324 - `input: map[unknown]`
302325 
303326 - `name: string`
304327 
328 minLength: 1
329 
305330 - `type: "tool_use"`
306331 
307 - `"tool_use"`
332 default: tool_use
308333 
309334 - `toolset_name: optional string or null`
310335 
311336 For a toolset member tool_use, the toolset family.
312337 
313 - `ServerToolUseBlock object { id, caller, input, 2 more }`
338 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
314339 
340 - `ServerToolUseBlock object`
341 
315342 - `id: string`
316343 
344 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
345 
317346 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
318347 
319348 Tool invocation directly from the model.
320349 
321 - `DirectCaller object { type }`
350 default: {"type":"direct"}
322351 
352 - `DirectCaller object`
353 
323354 Tool invocation directly from the model.
324355 
325 - `ServerToolCaller object { tool_id, type }`
356 - `ServerToolCaller object`
326357 
327358 Tool invocation generated by a server-side tool.
328359 
329 - `ServerToolCaller20260120 object { tool_id, type }`
360 - `ServerToolCaller20260120 object`
330361 
331362 - `input: map[unknown]`
332363 
from line 379
348379 
349380 - `type: "server_tool_use"`
350381 
351 - `"server_tool_use"`
382 default: server_tool_use
352383 
353 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
384 - `WebSearchToolResultBlock object`
354385 
355386 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
356387 
357388 Tool invocation directly from the model.
358389 
359 - `DirectCaller object { type }`
390 default: {"type":"direct"}
360391 
392 - `DirectCaller object`
393 
361394 Tool invocation directly from the model.
362395 
363 - `ServerToolCaller object { tool_id, type }`
396 - `ServerToolCaller object`
364397 
365398 Tool invocation generated by a server-side tool.
366399 
367 - `ServerToolCaller20260120 object { tool_id, type }`
400 - `ServerToolCaller20260120 object`
368401 
369402 - `content: WebSearchToolResultBlockContent`
370403 
371 - `WebSearchToolResultError object { error_code, type }`
404 - `WebSearchToolResultError object`
372405 
373406 - `error_code: WebSearchToolResultErrorCode`
374407 
from line 419
386419 
387420 - `type: "web_search_tool_result_error"`
388421 
389 - `"web_search_tool_result_error"`
422 default: web_search_tool_result_error
390423 
391424 - `array of WebSearchResultBlock`
392425 
from line 431
398431 
399432 - `type: "web_search_result"`
400433 
401 - `"web_search_result"`
434 default: web_search_result
402435 
403436 - `url: string`
404437 
405438 - `tool_use_id: string`
406439 
440 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
441 
407442 - `type: "web_search_tool_result"`
408443 
409 - `"web_search_tool_result"`
444 default: web_search_tool_result
410445 
411 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
446 - `WebFetchToolResultBlock object`
412447 
413448 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
414449 
415450 Tool invocation directly from the model.
416451 
417 - `DirectCaller object { type }`
452 default: {"type":"direct"}
418453 
454 - `DirectCaller object`
455 
419456 Tool invocation directly from the model.
420457 
421 - `ServerToolCaller object { tool_id, type }`
458 - `ServerToolCaller object`
422459 
423460 Tool invocation generated by a server-side tool.
424461 
425 - `ServerToolCaller20260120 object { tool_id, type }`
462 - `ServerToolCaller20260120 object`
426463 
427464 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
428465 
429 - `WebFetchToolResultErrorBlock object { error_code, type }`
466 - `WebFetchToolResultErrorBlock object`
430467 
431468 - `error_code: WebFetchToolResultErrorCode`
432469 
from line 487
450487 
451488 - `type: "web_fetch_tool_result_error"`
452489 
453 - `"web_fetch_tool_result_error"`
490 default: web_fetch_tool_result_error
454491 
455 - `WebFetchBlock object { content, retrieved_at, type, url }`
492 - `WebFetchBlock object`
456493 
457494 - `content: DocumentBlock`
458495 
from line 499
462499 
463500 - `enabled: boolean`
464501 
502 default: false
503 
465504 - `source: Base64PDFSource or PlainTextSource`
466505 
467 - `Base64PDFSource object { data, media_type, type }`
506 - `Base64PDFSource object`
468507 
469508 - `data: string`
470509 
510 format: byte
511 
471512 - `media_type: "application/pdf"`
472513 
473 - `"application/pdf"`
474 
475514 - `type: "base64"`
476515 
477 - `"base64"`
516 - `PlainTextSource object`
478517 
479 - `PlainTextSource object { data, media_type, type }`
480 
481518 - `data: string`
482519 
483520 - `media_type: "text/plain"`
484521 
485 - `"text/plain"`
486 
487522 - `type: "text"`
488523 
489 - `"text"`
490 
491524 - `title: string or null`
492525 
493526 The title of the document
from line 527
494527 
495528 - `type: "document"`
496529 
497 - `"document"`
530 default: document
498531 
499532 - `retrieved_at: string or null`
500533 
from line 535
502535 
503536 - `type: "web_fetch_result"`
504537 
505 - `"web_fetch_result"`
538 default: web_fetch_result
506539 
507540 - `url: string`
508541 
from line 543
510543 
511544 - `tool_use_id: string`
512545 
546 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
547 
513548 - `type: "web_fetch_tool_result"`
514549 
515 - `"web_fetch_tool_result"`
550 default: web_fetch_tool_result
516551 
517 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
552 - `CodeExecutionToolResultBlock object`
518553 
519554 - `content: CodeExecutionToolResultBlockContent`
520555 
521556 Code execution result with encrypted stdout for PFC + web_search results.
522557 
523 - `CodeExecutionToolResultError object { error_code, type }`
558 - `CodeExecutionToolResultError object`
524559 
525560 - `error_code: CodeExecutionToolResultErrorCode`
526561 
from line 569
534569 
535570 - `type: "code_execution_tool_result_error"`
536571 
537 - `"code_execution_tool_result_error"`
572 default: code_execution_tool_result_error
538573 
539 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
574 - `CodeExecutionResultBlock object`
540575 
541576 - `content: array of CodeExecutionOutputBlock`
542577 
from line 579
544579 
545580 - `type: "code_execution_output"`
546581 
547 - `"code_execution_output"`
582 default: code_execution_output
548583 
549584 - `return_code: number`
550585 
from line 589
554589 
555590 - `type: "code_execution_result"`
556591 
557 - `"code_execution_result"`
592 default: code_execution_result
558593 
559 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
594 - `EncryptedCodeExecutionResultBlock object`
560595 
561596 Code execution result with encrypted stdout for PFC + web_search results.
562597 
from line 601
566601 
567602 - `type: "code_execution_output"`
568603 
604 default: code_execution_output
605 
569606 - `encrypted_stdout: string`
570607 
571608 - `return_code: number`
from line 611
574611 
575612 - `type: "encrypted_code_execution_result"`
576613 
577 - `"encrypted_code_execution_result"`
614 default: encrypted_code_execution_result
578615 
579616 - `tool_use_id: string`
580617 
618 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
619 
581620 - `type: "code_execution_tool_result"`
582621 
583 - `"code_execution_tool_result"`
622 default: code_execution_tool_result
584623 
585 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
624 - `BashCodeExecutionToolResultBlock object`
586625 
587626 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
588627 
589 - `BashCodeExecutionToolResultError object { error_code, type }`
628 - `BashCodeExecutionToolResultError object`
590629 
591630 - `error_code: BashCodeExecutionToolResultErrorCode`
592631 
from line 641
602641 
603642 - `type: "bash_code_execution_tool_result_error"`
604643 
605 - `"bash_code_execution_tool_result_error"`
644 default: bash_code_execution_tool_result_error
606645 
607 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
646 - `BashCodeExecutionResultBlock object`
608647 
609648 - `content: array of BashCodeExecutionOutputBlock`
610649 
from line 651
612651 
613652 - `type: "bash_code_execution_output"`
614653 
615 - `"bash_code_execution_output"`
654 default: bash_code_execution_output
616655 
617656 - `return_code: number`
618657 
from line 661
622661 
623662 - `type: "bash_code_execution_result"`
624663 
625 - `"bash_code_execution_result"`
664 default: bash_code_execution_result
626665 
627666 - `tool_use_id: string`
628667 
668 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
669 
629670 - `type: "bash_code_execution_tool_result"`
630671 
631 - `"bash_code_execution_tool_result"`
672 default: bash_code_execution_tool_result
632673 
633 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
674 - `TextEditorCodeExecutionToolResultBlock object`
634675 
635676 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
636677 
637 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
678 - `TextEditorCodeExecutionToolResultError object`
638679 
639680 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
640681 
from line 693
652693 
653694 - `type: "text_editor_code_execution_tool_result_error"`
654695 
655 - `"text_editor_code_execution_tool_result_error"`
696 default: text_editor_code_execution_tool_result_error
656697 
657 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
698 - `TextEditorCodeExecutionViewResultBlock object`
658699 
659700 - `content: string`
660701 
from line 715
674715 
675716 - `type: "text_editor_code_execution_view_result"`
676717 
677 - `"text_editor_code_execution_view_result"`
718 default: text_editor_code_execution_view_result
678719 
679 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
720 - `TextEditorCodeExecutionCreateResultBlock object`
680721 
681722 - `is_file_update: boolean`
682723 
683724 - `type: "text_editor_code_execution_create_result"`
684725 
685 - `"text_editor_code_execution_create_result"`
726 default: text_editor_code_execution_create_result
686727 
687 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
728 - `TextEditorCodeExecutionStrReplaceResultBlock object`
688729 
689730 - `lines: array of string or null`
690731 
from line 739
698739 
699740 - `type: "text_editor_code_execution_str_replace_result"`
700741 
701 - `"text_editor_code_execution_str_replace_result"`
742 default: text_editor_code_execution_str_replace_result
702743 
703744 - `tool_use_id: string`
704745 
746 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
747 
705748 - `type: "text_editor_code_execution_tool_result"`
706749 
707 - `"text_editor_code_execution_tool_result"`
750 default: text_editor_code_execution_tool_result
708751 
709 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
752 - `ToolSearchToolResultBlock object`
710753 
711754 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
712755 
713 - `ToolSearchToolResultError object { error_code, error_message, type }`
756 - `ToolSearchToolResultError object`
714757 
715758 - `error_code: ToolSearchToolResultErrorCode`
716759 
from line 769
726769 
727770 - `type: "tool_search_tool_result_error"`
728771 
729 - `"tool_search_tool_result_error"`
772 default: tool_search_tool_result_error
730773 
731 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
774 - `ToolSearchToolSearchResultBlock object`
732775 
733776 - `tool_references: array of ToolReferenceBlock`
734777 
735778 - `tool_name: string`
736779 
780 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
781 
737782 - `type: "tool_reference"`
738783 
739 - `"tool_reference"`
784 default: tool_reference
740785 
741786 - `type: "tool_search_tool_search_result"`
742787 
743 - `"tool_search_tool_search_result"`
788 default: tool_search_tool_search_result
744789 
745790 - `tool_use_id: string`
746791 
792 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
793 
747794 - `type: "tool_search_tool_result"`
748795 
749 - `"tool_search_tool_result"`
796 default: tool_search_tool_result
750797 
751 - `ContainerUploadBlock object { file_id, type }`
798 - `ContainerUploadBlock object`
752799 
753800 Response model for a file uploaded to the container.
754801 
from line 803
756803 
757804 - `type: "container_upload"`
758805 
759 - `"container_upload"`
806 default: container_upload
760807 
761808 - `model: Model`
762809 
from line 885
838885 
839886 This will always be `"assistant"`.
840887 
841 - `"assistant"`
888 default: assistant
842889 
843890 - `stop_details: RefusalStopDetails or null`
844891 
from line 923
876923 
877924 - `type: "refusal"`
878925 
879 - `"refusal"`
926 default: refusal
880927 
881928 - `stop_reason: StopReason or null`
882929 
from line 967
920967 
921968 For Messages, this is always `"message"`.
922969 
923 - `"message"`
970 default: message
924971 
925972 - `usage: Usage`
926973 
from line 989
942989 
943990 The number of input tokens used to create the 1 hour cache entry.
944991 
992 default: 0, minimum: 0
993 
945994 - `ephemeral_5m_input_tokens: number`
946995 
947996 The number of input tokens used to create the 5 minute cache entry.
948997 
998 default: 0, minimum: 0
999 
9491000 - `cache_creation_input_tokens: number or null`
9501001 
9511002 The number of input tokens used to create the cache entry.
9521003 
1004 minimum: 0
1005 
9531006 - `cache_read_input_tokens: number or null`
9541007 
9551008 The number of input tokens read from the cache.
9561009 
1010 minimum: 0
1011 
9571012 - `inference_geo: string or null`
9581013 
9591014 The geographic region where inference was performed for this request.
from line 1017
9621017 
9631018 The number of input tokens which were used.
9641019 
1020 minimum: 0
1021 
9651022 - `output_tokens: number`
9661023 
9671024 The number of output tokens which were used.
9681025 
1026 minimum: 0
1027 
9691028 - `output_tokens_details: OutputTokensDetails or null`
9701029 
9711030 Breakdown of output tokens by category.
from line 1045
9861045 generation count by a small number of tokens. Always ≤ `output_tokens`;
9871046 `output_tokens - thinking_tokens` approximates the non-reasoning output.
9881047 
1048 default: 0, minimum: 0
1049 
9891050 - `server_tool_use: ServerToolUsage or null`
9901051 
9911052 The number of server tool requests.
from line 1055
9941055 
9951056 The number of web fetch tool requests.
9961057 
1058 default: 0, minimum: 0
1059 
9971060 - `web_search_requests: number`
9981061 
9991062 The number of web search tool requests.
10001063 
1064 default: 0, minimum: 0
1065 
10011066 - `service_tier: "standard" or "priority" or "batch" or null`
10021067 
10031068 If the request used the priority, standard, or batch tier.
from line 1075
10101075 
10111076 - `type: "succeeded"`
10121077 
1013 - `"succeeded"`
1078 default: succeeded
10141079 
1015 - `MessageBatchErroredResult object { error, type }`
1080 - `MessageBatchErroredResult object`
10161081 
10171082 - `error: ErrorResponse`
10181083 
10191084 - `error: ErrorObject`
10201085 
1021 - `InvalidRequestError object { message, type }`
1086 - `InvalidRequestError object`
10221087 
10231088 - `message: string`
10241089 
1090 default: Invalid request
1091 
10251092 - `type: "invalid_request_error"`
10261093 
1027 - `"invalid_request_error"`
1094 default: invalid_request_error
10281095 
1029 - `AuthenticationError object { message, type }`
1096 - `AuthenticationError object`
10301097 
10311098 - `message: string`
10321099 
1100 default: Authentication error
1101 
10331102 - `type: "authentication_error"`
10341103 
1035 - `"authentication_error"`
1104 default: authentication_error
10361105 
1037 - `BillingError object { message, type }`
1106 - `BillingError object`
10381107 
10391108 - `message: string`
10401109 
1110 default: Billing error
1111 
10411112 - `type: "billing_error"`
10421113 
1043 - `"billing_error"`
1114 default: billing_error
10441115 
1045 - `PermissionError object { message, type }`
1116 - `PermissionError object`
10461117 
10471118 - `message: string`
10481119 
1120 default: Permission denied
1121 
10491122 - `type: "permission_error"`
10501123 
1051 - `"permission_error"`
1124 default: permission_error
10521125 
1053 - `NotFoundError object { message, type }`
1126 - `NotFoundError object`
10541127 
10551128 - `message: string`
10561129 
1130 default: Not found
1131 
10571132 - `type: "not_found_error"`
10581133 
1059 - `"not_found_error"`
1134 default: not_found_error
10601135 
1061 - `RateLimitError object { message, type }`
1136 - `RateLimitError object`
10621137 
10631138 - `message: string`
10641139 
1140 default: Rate limited
1141 
10651142 - `type: "rate_limit_error"`
10661143 
1067 - `"rate_limit_error"`
1144 default: rate_limit_error
10681145 
1069 - `GatewayTimeoutError object { message, type }`
1146 - `GatewayTimeoutError object`
10701147 
10711148 - `message: string`
10721149 
1150 default: Request timeout
1151 
10731152 - `type: "timeout_error"`
10741153 
1075 - `"timeout_error"`
1154 default: timeout_error
10761155 
1077 - `APIErrorObject object { message, type }`
1156 - `APIErrorObject object`
10781157 
10791158 - `message: string`
10801159 
1160 default: Internal server error
1161 
10811162 - `type: "api_error"`
10821163 
1083 - `"api_error"`
1164 default: api_error
10841165 
1085 - `OverloadedError object { message, type }`
1166 - `OverloadedError object`
10861167 
10871168 - `message: string`
10881169 
1170 default: Overloaded
1171 
10891172 - `type: "overloaded_error"`
10901173 
1091 - `"overloaded_error"`
1174 default: overloaded_error
10921175 
10931176 - `request_id: string or null`
10941177 
10951178 - `type: "error"`
10961179 
1097 - `"error"`
1180 default: error
10981181 
10991182 - `type: "errored"`
11001183 
1101 - `"errored"`
1184 default: errored
11021185 
1103 - `MessageBatchCanceledResult object { type }`
1186 - `MessageBatchCanceledResult object`
11041187 
11051188 - `type: "canceled"`
11061189 
1107 - `"canceled"`
1190 default: canceled
11081191 
1109 - `MessageBatchExpiredResult object { type }`
1192 - `MessageBatchExpiredResult object`
11101193 
11111194 - `type: "expired"`
11121195 
1113 - `"expired"`
1196 default: expired
11141197 
1115### Example
1198## Example
11161199 
1117```http
1200```bash
11181201curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/results \
11191202 -H 'anthropic-version: 2023-06-01' \
11201203 -H "X-Api-Key: $ANTHROPIC_API_KEY"

api/messages/batches/retrieve Changed · +29 / -14 lines

# Retrieve a Message Batch ## Path parameters ## Returns ## Example ### Response (200) ## Retrieve a Message Batch ### Path Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Retrieve a Message Batch
3url: https://platform.claude.com/docs/en/api/messages/batches/retrieve
4---
1# Retrieve a Message Batch
52 
6## Retrieve a Message Batch
3**GET** `/v1/messages/batches/{message_batch_id}`
74 
8**get** `/v1/messages/batches/{message_batch_id}`
9 
105This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
116 
127Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
138 
14### Path Parameters
9## Path parameters
1510 
1611- `message_batch_id: string`
1712 
1813 ID of the Message Batch.
1914 
20### Returns
15## Returns
2116 
22- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
17- `MessageBatch object`
2318 
2419 - `id: string`
2520 
from line 26
3126 
3227 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
3328 
29 format: date-time
30 
3431 - `cancel_initiated_at: string or null`
3532 
3633 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
3734 
35 format: date-time
36 
3837 - `created_at: string`
3938 
4039 RFC 3339 datetime string representing the time at which the Message Batch was created.
4140 
41 format: date-time
42 
4243 - `ended_at: string or null`
4344 
4445 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
from line 46
4546 
4647 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
4748 
49 format: date-time
50 
4851 - `expires_at: string`
4952 
5053 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
5154 
55 format: date-time
56 
5257 - `processing_status: "in_progress" or "canceling" or "ended"`
5358 
5459 Processing status of the Message Batch.
from line 76
7176 
7277 This is zero until processing of the entire Message Batch has ended.
7378 
79 default: 0
80 
7481 - `errored: number`
7582 
7683 Number of requests in the Message Batch that encountered an error.
from line 84
7784 
7885 This is zero until processing of the entire Message Batch has ended.
7986 
87 default: 0
88 
8089 - `expired: number`
8190 
8291 Number of requests in the Message Batch that have expired.
from line 92
8392 
8493 This is zero until processing of the entire Message Batch has ended.
8594 
95 default: 0
96 
8697 - `processing: number`
8798 
8899 Number of requests in the Message Batch that are processing.
89100 
101 default: 0
102 
90103 - `succeeded: number`
91104 
92105 Number of requests in the Message Batch that have completed successfully.
from line 106
93106 
94107 This is zero until processing of the entire Message Batch has ended.
95108 
109 default: 0
110 
96111 - `results_url: string or null`
97112 
98113 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 120
105120 
106121 For Message Batches, this is always `"message_batch"`.
107122 
108 - `"message_batch"`
123 default: message_batch
109124 
110### Example
125## Example
111126 
112```http
127```bash
113128curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
114129 -H 'anthropic-version: 2023-06-01' \
115130 -H "X-Api-Key: $ANTHROPIC_API_KEY"
116131```
117132 
118#### Response
133### Response (200)
119134 
120135```json
121136{

api/messages/count_tokens Changed · +303 / -380 lines

# Count tokens in a Message ## Headers ## Body parameters ## Returns ## Example ### Response (200) ## Count tokens in a Message ### Header Parameters ### Body Parameters ### Returns ### Example #### Response

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

from line 1
1---
2title: Count tokens in a Message
3url: https://platform.claude.com/docs/en/api/messages/count_tokens
4---
5 
6## Count tokens in a Message
7 
8**post** `/v1/messages/count_tokens`
1# Count tokens in a Message
2 
3**POST** `/v1/messages/count_tokens`
94 
105Count the number of tokens in a Message.
116 
from line 8
138 
149Learn more about token counting in our [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting)
1510 
16### Header Parameters
11## Headers
1712 
1813- `"anthropic-user-profile-id": optional string`
1914 
2015 The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.
2116 
22### Body Parameters
17## Body parameters
2318 
2419- `messages: array of MessageParam`
2520 
from line 73
7873 
7974 - `array of ContentBlockParam`
8075 
81 - `TextBlockParam object { text, type, cache_control, citations }`
76 - `TextBlockParam object`
8277 
8378 - `text: string`
8479 
80 minLength: 1
81 
8582 - `type: "text"`
8683 
87 - `"text"`
88 
8984 - `cache_control: optional CacheControlEphemeral or null`
9085 
9186 Create a cache control breakpoint at this content block.
9287 
9388 - `type: "ephemeral"`
94 
95 - `"ephemeral"`
9689 
9790 - `ttl: optional "5m" or "1h"`
9891 
from line 104
111104 
112105 - `citations: optional array of TextCitationParam or null`
113106 
114 - `CitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
107 - `CitationCharLocationParam object`
115108 
116109 - `cited_text: string`
117110 
118111 - `document_index: number`
119112 
113 minimum: 0
114 
120115 - `document_title: string or null`
121116 
117 maxLength: 500, minLength: 1
118 
122119 - `end_char_index: number`
123120 
124121 - `start_char_index: number`
125122 
123 minimum: 0
124 
126125 - `type: "char_location"`
127126 
128 - `"char_location"`
129 
130 - `CitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
127 - `CitationPageLocationParam object`
131128 
132129 - `cited_text: string`
133130 
134131 - `document_index: number`
135132 
133 minimum: 0
134 
136135 - `document_title: string or null`
137136 
137 maxLength: 500, minLength: 1
138 
138139 - `end_page_number: number`
139140 
140141 - `start_page_number: number`
141142 
143 minimum: 1
144 
142145 - `type: "page_location"`
143146 
144 - `"page_location"`
145 
146 - `CitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
147 - `CitationContentBlockLocationParam object`
147148 
148149 - `cited_text: string`
149150 
from line 154
153154 
154155 - `document_index: number`
155156 
157 minimum: 0
158 
156159 - `document_title: string or null`
157160 
161 maxLength: 500, minLength: 1
162 
158163 - `end_block_index: number`
159164 
160165 Exclusive 0-based end index of the cited block range in the source's `content` array.
from line 170
165170 
166171 0-based index of the first cited block in the source's `content` array.
167172 
173 minimum: 0
174 
168175 - `type: "content_block_location"`
169176 
170 - `"content_block_location"`
171 
172 - `CitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
177 - `CitationWebSearchResultLocationParam object`
173178 
174179 - `cited_text: string`
175180 
from line 182
177182 
178183 - `title: string or null`
179184 
185 maxLength: 512, minLength: 1
186 
180187 - `type: "web_search_result_location"`
181188 
182 - `"web_search_result_location"`
183 
184189 - `url: string`
185190 
186 - `CitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
191 minLength: 1
192 
193 - `CitationSearchResultLocationParam object`
187194 
188195 - `cited_text: string`
189196 
from line 210
203210 
204211 Counted separately from `document_index`; server-side web search results are not included in this count.
205212 
213 minimum: 0
214 
206215 - `source: string`
207216 
208217 - `start_block_index: number`
209218 
210219 0-based index of the first cited block in the source's `content` array.
211220 
221 minimum: 0
222 
212223 - `title: string or null`
213224 
214225 - `type: "search_result_location"`
215226 
216 - `"search_result_location"`
217 
218 - `ImageBlockParam object { source, type, cache_control, transformations }`
227 - `ImageBlockParam object`
219228 
220229 - `source: Base64ImageSource or URLImageSource or FileImageSource`
221230 
222 - `Base64ImageSource object { data, media_type, type }`
231 - `Base64ImageSource object`
223232 
224233 - `data: string`
225234 
235 format: byte
236 
226237 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
227238 
228239 - `"image/jpeg"`
from line 246
235246 
236247 - `type: "base64"`
237248 
238 - `"base64"`
239 
240 - `URLImageSource object { type, url }`
249 - `URLImageSource object`
241250 
242251 - `type: "url"`
243252 
244 - `"url"`
245 
246253 - `url: string`
247254 
248 - `FileImageSource object { file_id, type }`
255 - `FileImageSource object`
249256 
250257 - `file_id: string`
251258 
252259 - `type: "file"`
253260 
254 - `"file"`
255 
256261 - `type: "image"`
257262 
258 - `"image"`
259 
260263 - `cache_control: optional CacheControlEphemeral or null`
261264 
262265 Create a cache control breakpoint at this content block.
from line 276
273276 
274277 - `"error"`
275278 
276 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
279 - `DocumentBlockParam object`
277280 
278281 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
279282 
280 - `Base64PDFSource object { data, media_type, type }`
283 - `Base64PDFSource object`
281284 
282285 - `data: string`
283286 
287 format: byte
288 
284289 - `media_type: "application/pdf"`
285290 
286 - `"application/pdf"`
287 
288291 - `type: "base64"`
289292 
290 - `"base64"`
291 
292 - `PlainTextSource object { data, media_type, type }`
293 - `PlainTextSource object`
293294 
294295 - `data: string`
295296 
296297 - `media_type: "text/plain"`
297298 
298 - `"text/plain"`
299 
300299 - `type: "text"`
301300 
302 - `"text"`
303 
304 - `ContentBlockSource object { content, type }`
301 - `ContentBlockSource object`
305302 
306303 - `content: string or array of ContentBlockSourceContent`
307304 
from line 306
309306 
310307 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
311308 
312 - `TextBlockParam object { text, type, cache_control, citations }`
313 
314 - `ImageBlockParam object { source, type, cache_control, transformations }`
309 - `TextBlockParam object`
310 
311 - `ImageBlockParam object`
315312 
316313 - `type: "content"`
317314 
318 - `"content"`
319 
320 - `URLPDFSource object { type, url }`
315 - `URLPDFSource object`
321316 
322317 - `type: "url"`
323318 
324 - `"url"`
325 
326319 - `url: string`
327320 
328 - `FileDocumentSource object { file_id, type }`
321 - `FileDocumentSource object`
329322 
330323 - `file_id: string`
331324 
332325 - `type: "file"`
333326 
334 - `"file"`
335 
336327 - `type: "document"`
337328 
338 - `"document"`
339 
340329 - `cache_control: optional CacheControlEphemeral or null`
341330 
342331 Create a cache control breakpoint at this content block.
from line 336
347336 
348337 - `context: optional string or null`
349338 
339 minLength: 1
340 
350341 - `title: optional string or null`
351342 
352 - `SearchResultBlockParam object { content, source, title, 3 more }`
343 maxLength: 500, minLength: 1
344 
345 - `SearchResultBlockParam object`
353346 
354347 - `content: array of TextBlockParam`
355348 
356349 - `text: string`
357350 
351 minLength: 1
352 
358353 - `type: "text"`
359354 
360355 - `cache_control: optional CacheControlEphemeral or null`
from line 364
369364 
370365 - `type: "search_result"`
371366 
372 - `"search_result"`
373 
374367 - `cache_control: optional CacheControlEphemeral or null`
375368 
376369 Create a cache control breakpoint at this content block.
377370 
378371 - `citations: optional CitationsConfigParam`
379372 
380 - `ThinkingBlockParam object { signature, thinking, type }`
373 - `ThinkingBlockParam object`
381374 
382375 - `signature: string`
383376 
from line 384
391384 
392385 - `type: "thinking"`
393386 
394 - `"thinking"`
395 
396 - `RedactedThinkingBlockParam object { data, type }`
387 - `RedactedThinkingBlockParam object`
397388 
398389 - `data: string`
399390 
from line 392
401392 
402393 - `type: "redacted_thinking"`
403394 
404 - `"redacted_thinking"`
405 
406 - `ToolUseBlockParam object { id, input, name, 4 more }`
395 - `ToolUseBlockParam object`
407396 
408397 - `id: string`
409398 
399 pattern: ^[a-zA-Z0-9_-]+$
400 
410401 - `input: map[unknown]`
411402 
412403 - `name: string`
413404 
405 maxLength: 200, minLength: 1
406 
414407 - `type: "tool_use"`
415408 
416 - `"tool_use"`
417 
418409 - `cache_control: optional CacheControlEphemeral or null`
419410 
420411 Create a cache control breakpoint at this content block.
from line 414
423414 
424415 Tool invocation directly from the model.
425416 
426 - `DirectCaller object { type }`
417 - `DirectCaller object`
427418 
428419 Tool invocation directly from the model.
429420 
430421 - `type: "direct"`
431422 
432 - `"direct"`
433 
434 - `ServerToolCaller object { tool_id, type }`
423 - `ServerToolCaller object`
435424 
436425 Tool invocation generated by a server-side tool.
437426 
438427 - `tool_id: string`
439428 
429 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
430 
440431 - `type: "code_execution_20250825"`
441432 
442 - `"code_execution_20250825"`
443 
444 - `ServerToolCaller20260120 object { tool_id, type }`
433 - `ServerToolCaller20260120 object`
445434 
446435 - `tool_id: string`
447436 
437 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
438 
448439 - `type: "code_execution_20260120"`
449440 
450 - `"code_execution_20260120"`
451 
452441 - `toolset_name: optional string or null`
453442 
454443 For a toolset member tool_use, the toolset family this member belongs to.
455444 
456 - `ToolResultBlockParam object { tool_use_id, type, cache_control, 3 more }`
445 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
446 
447 - `ToolResultBlockParam object`
457448 
458449 - `tool_use_id: string`
459450 
451 pattern: ^[a-zA-Z0-9_-]+$
452 
460453 - `type: "tool_result"`
461454 
462 - `"tool_result"`
463 
464455 - `cache_control: optional CacheControlEphemeral or null`
465456 
466457 Create a cache control breakpoint at this content block.
from line 462
471462 
472463 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
473464 
474 - `TextBlockParam object { text, type, cache_control, citations }`
475 
476 - `ImageBlockParam object { source, type, cache_control, transformations }`
477 
478 - `SearchResultBlockParam object { content, source, title, 3 more }`
479 
480 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
481 
482 - `ToolReferenceBlockParam object { tool_name, type, cache_control }`
465 - `TextBlockParam object`
466 
467 - `ImageBlockParam object`
468 
469 - `SearchResultBlockParam object`
470 
471 - `DocumentBlockParam object`
472 
473 - `ToolReferenceBlockParam object`
483474 
484475 Tool reference block that can be included in tool_result content.
485476 
486477 - `tool_name: string`
487478 
479 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
480 
488481 - `type: "tool_reference"`
489482 
490 - `"tool_reference"`
491 
492483 - `cache_control: optional CacheControlEphemeral or null`
493484 
494485 Create a cache control breakpoint at this content block.
495486 
496 - `BrowserStateBlockParam object { tabs, type, cache_control, state_changes }`
487 - `BrowserStateBlockParam object`
497488 
498489 The caller's browser state after a browser toolset member call —
499490 the full inventory of open tabs, which tab is active, and any side
from line 498
507498 
508499 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`.
509500 
501 maxItems: 100
502 
510503 - `tab_id: string`
511504 
512505 The caller-assigned identifier for this tab, unique within the inventory.
513506 
507 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
508 
514509 - `title: string`
515510 
516511 The title of the page the tab is showing. May be empty.
517512 
513 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
514 
518515 - `url: string`
519516 
520517 The URL of the page the tab is showing. May be empty.
521518 
519 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
520 
522521 - `active: optional boolean`
523522 
524523 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
525524 
526525 - `type: "browser_state"`
527526 
528 - `"browser_state"`
529 
530527 - `cache_control: optional CacheControlEphemeral or null`
531528 
532529 Create a cache control breakpoint at this content block.
from line 532
535532 
536533 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
537534 
538 - `BrowserStateChangeTabOpened object { tab_id, type }`
535 maxItems: 200, minItems: 1
536 
537 - `BrowserStateChangeTabOpened object`
539538 
540539 A tab this call's execution opened that remains open at its end —
541540 the creation delta of the `tabs` inventory, not an event log.
from line 548
549548 
550549 The `tab_id` of the opened tab, present in `tabs`.
551550 
551 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
552 
552553 - `type: "tab_opened"`
553554 
554 - `"tab_opened"`
555 
556 - `BrowserStateChangeDownloadStarted object { download_id, type, url }`
555 - `BrowserStateChangeDownloadStarted object`
557556 
558557 A file download that started during this call.
559558 
from line 560
561560 
562561 The caller-assigned identifier for this download, stable across the state changes reporting it.
563562 
563 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
564 
564565 - `type: "download_started"`
565566 
566 - `"download_started"`
567 
568567 - `url: string`
569568 
570569 The final post-redirect URL the download was served from.
571570 
572 - `BrowserStateChangeDownloadCompleted object { download_id, type, url, 2 more }`
571 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
572 
573 - `BrowserStateChangeDownloadCompleted object`
573574 
574575 A file download that finished during this call, reported with the
575576 same `download_id` as its `download_started` — or without a prior
from line 581
580581 
581582 The caller-assigned identifier for this download, stable across the state changes reporting it.
582583 
584 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
585 
583586 - `type: "download_completed"`
584587 
585 - `"download_completed"`
586 
587588 - `url: string`
588589 
589590 The final post-redirect URL the download was served from.
590591 
592 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
593 
591594 - `path: optional string or null`
592595 
593596 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.
594597 
598 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
599 
595600 - `size_bytes: optional number or null`
596601 
597602 The completed download's size.
598603 
599 - `BrowserStateChangeDownloadFailed object { download_id, type, url, error }`
604 minimum: 0
605 
606 - `BrowserStateChangeDownloadFailed object`
600607 
601608 A file download that failed — or was cancelled — during this call.
602609 
from line 611
604611 
605612 The caller-assigned identifier for this download, stable across the state changes reporting it.
606613 
614 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
615 
607616 - `type: "download_failed"`
608617 
609 - `"download_failed"`
610 
611618 - `url: string`
612619 
613620 The final post-redirect URL the download was served from.
614621 
622 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
623 
615624 - `error: optional string or null`
616625 
617626 The failure or cancellation detail, when known.
618627 
628 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
629 
619630 - `is_error: optional boolean`
620631 
621632 - `toolset_name: optional string or null`
622633 
623634 For a toolset member tool_result, the toolset family of the paired tool_use.
624635 
625 - `ServerToolUseBlockParam object { id, input, name, 3 more }`
636 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
637 
638 - `ServerToolUseBlockParam object`
626639 
627640 - `id: string`
628641 
642 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
643 
629644 - `input: map[unknown]`
630645 
631646 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
from line 661
646661 
647662 - `type: "server_tool_use"`
648663 
649 - `"server_tool_use"`
650 
651664 - `cache_control: optional CacheControlEphemeral or null`
652665 
653666 Create a cache control breakpoint at this content block.
from line 669
656669 
657670 Tool invocation directly from the model.
658671 
659 - `DirectCaller object { type }`
672 - `DirectCaller object`
660673 
661674 Tool invocation directly from the model.
662675 
663 - `ServerToolCaller object { tool_id, type }`
676 - `ServerToolCaller object`
664677 
665678 Tool invocation generated by a server-side tool.
666679 
667 - `ServerToolCaller20260120 object { tool_id, type }`
668 
669 - `WebSearchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
680 - `ServerToolCaller20260120 object`
681 
682 - `WebSearchToolResultBlockParam object`
670683 
671684 - `content: WebSearchToolResultBlockParamContent`
672685 
from line 691
678691 
679692 - `type: "web_search_result"`
680693 
681 - `"web_search_result"`
682 
683694 - `url: string`
684695 
685696 - `page_age: optional string or null`
686697 
687 - `WebSearchToolRequestError object { error_code, type }`
698 - `WebSearchToolRequestError object`
688699 
689700 - `error_code: WebSearchToolResultErrorCode`
690701 
from line 713
702713 
703714 - `type: "web_search_tool_result_error"`
704715 
705 - `"web_search_tool_result_error"`
706 
707716 - `tool_use_id: string`
708717 
718 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
719 
709720 - `type: "web_search_tool_result"`
710721 
711 - `"web_search_tool_result"`
712 
713722 - `cache_control: optional CacheControlEphemeral or null`
714723 
715724 Create a cache control breakpoint at this content block.
from line 727
718727 
719728 Tool invocation directly from the model.
720729 
721 - `DirectCaller object { type }`
730 - `DirectCaller object`
722731 
723732 Tool invocation directly from the model.
724733 
725 - `ServerToolCaller object { tool_id, type }`
734 - `ServerToolCaller object`
726735 
727736 Tool invocation generated by a server-side tool.
728737 
729 - `ServerToolCaller20260120 object { tool_id, type }`
730 
731 - `WebFetchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
738 - `ServerToolCaller20260120 object`
739 
740 - `WebFetchToolResultBlockParam object`
732741 
733742 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
734743 
735 - `WebFetchToolResultErrorBlockParam object { error_code, type }`
744 - `WebFetchToolResultErrorBlockParam object`
736745 
737746 - `error_code: WebFetchToolResultErrorCode`
738747 
from line 765
756765 
757766 - `type: "web_fetch_tool_result_error"`
758767 
759 - `"web_fetch_tool_result_error"`
760 
761 - `WebFetchBlockParam object { content, type, url, retrieved_at }`
768 - `WebFetchBlockParam object`
762769 
763770 - `content: DocumentBlockParam`
764771 
765772 - `type: "web_fetch_result"`
766773 
767 - `"web_fetch_result"`
768 
769774 - `url: string`
770775 
771776 Fetched content URL
from line 781
776781 
777782 - `tool_use_id: string`
778783 
784 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
785 
779786 - `type: "web_fetch_tool_result"`
780787 
781 - `"web_fetch_tool_result"`
782 
783788 - `cache_control: optional CacheControlEphemeral or null`
784789 
785790 Create a cache control breakpoint at this content block.
from line 793
788793 
789794 Tool invocation directly from the model.
790795 
791 - `DirectCaller object { type }`
796 - `DirectCaller object`
792797 
793798 Tool invocation directly from the model.
794799 
795 - `ServerToolCaller object { tool_id, type }`
800 - `ServerToolCaller object`
796801 
797802 Tool invocation generated by a server-side tool.
798803 
799 - `ServerToolCaller20260120 object { tool_id, type }`
800 
801 - `CodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
804 - `ServerToolCaller20260120 object`
805 
806 - `CodeExecutionToolResultBlockParam object`
802807 
803808 - `content: CodeExecutionToolResultBlockParamContent`
804809 
805810 Code execution result with encrypted stdout for PFC + web_search results.
806811 
807 - `CodeExecutionToolResultErrorParam object { error_code, type }`
812 - `CodeExecutionToolResultErrorParam object`
808813 
809814 - `error_code: CodeExecutionToolResultErrorCode`
810815 
from line 823
818823 
819824 - `type: "code_execution_tool_result_error"`
820825 
821 - `"code_execution_tool_result_error"`
822 
823 - `CodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
826 - `CodeExecutionResultBlockParam object`
824827 
825828 - `content: array of CodeExecutionOutputBlockParam`
826829 
from line 831
828831 
829832 - `type: "code_execution_output"`
830833 
831 - `"code_execution_output"`
832 
833834 - `return_code: number`
834835 
835836 - `stderr: string`
from line 839
838839 
839840 - `type: "code_execution_result"`
840841 
841 - `"code_execution_result"`
842 
843 - `EncryptedCodeExecutionResultBlockParam object { content, encrypted_stdout, return_code, 2 more }`
842 - `EncryptedCodeExecutionResultBlockParam object`
844843 
845844 Code execution result with encrypted stdout for PFC + web_search results.
846845 
from line 857
858857 
859858 - `type: "encrypted_code_execution_result"`
860859 
861 - `"encrypted_code_execution_result"`
862 
863860 - `tool_use_id: string`
864861 
862 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
863 
865864 - `type: "code_execution_tool_result"`
866865 
867 - `"code_execution_tool_result"`
868 
869866 - `cache_control: optional CacheControlEphemeral or null`
870867 
871868 Create a cache control breakpoint at this content block.
872869 
873 - `BashCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
870 - `BashCodeExecutionToolResultBlockParam object`
874871 
875872 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
876873 
877 - `BashCodeExecutionToolResultErrorParam object { error_code, type }`
874 - `BashCodeExecutionToolResultErrorParam object`
878875 
879876 - `error_code: BashCodeExecutionToolResultErrorCode`
880877 
from line 887
890887 
891888 - `type: "bash_code_execution_tool_result_error"`
892889 
893 - `"bash_code_execution_tool_result_error"`
894 
895 - `BashCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
890 - `BashCodeExecutionResultBlockParam object`
896891 
897892 - `content: array of BashCodeExecutionOutputBlockParam`
898893 
from line 895
900895 
901896 - `type: "bash_code_execution_output"`
902897 
903 - `"bash_code_execution_output"`
904 
905898 - `return_code: number`
906899 
907900 - `stderr: string`
from line 903
910903 
911904 - `type: "bash_code_execution_result"`
912905 
913 - `"bash_code_execution_result"`
914 
915906 - `tool_use_id: string`
916907 
908 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
909 
917910 - `type: "bash_code_execution_tool_result"`
918911 
919 - `"bash_code_execution_tool_result"`
920 
921912 - `cache_control: optional CacheControlEphemeral or null`
922913 
923914 Create a cache control breakpoint at this content block.
924915 
925 - `TextEditorCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
916 - `TextEditorCodeExecutionToolResultBlockParam object`
926917 
927918 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
928919 
929 - `TextEditorCodeExecutionToolResultErrorParam object { error_code, type, error_message }`
920 - `TextEditorCodeExecutionToolResultErrorParam object`
930921 
931922 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
932923 
from line 933
942933 
943934 - `type: "text_editor_code_execution_tool_result_error"`
944935 
945 - `"text_editor_code_execution_tool_result_error"`
946 
947936 - `error_message: optional string or null`
948937 
949 - `TextEditorCodeExecutionViewResultBlockParam object { content, file_type, type, 3 more }`
938 - `TextEditorCodeExecutionViewResultBlockParam object`
950939 
951940 - `content: string`
952941 
from line 949
960949 
961950 - `type: "text_editor_code_execution_view_result"`
962951 
963 - `"text_editor_code_execution_view_result"`
964 
965952 - `num_lines: optional number or null`
966953 
967954 - `start_line: optional number or null`
968955 
969956 - `total_lines: optional number or null`
970957 
971 - `TextEditorCodeExecutionCreateResultBlockParam object { is_file_update, type }`
958 - `TextEditorCodeExecutionCreateResultBlockParam object`
972959 
973960 - `is_file_update: boolean`
974961 
975962 - `type: "text_editor_code_execution_create_result"`
976963 
977 - `"text_editor_code_execution_create_result"`
978 
979 - `TextEditorCodeExecutionStrReplaceResultBlockParam object { type, lines, new_lines, 3 more }`
964 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
980965 
981966 - `type: "text_editor_code_execution_str_replace_result"`
982967 
983 - `"text_editor_code_execution_str_replace_result"`
984 
985968 - `lines: optional array of string or null`
986969 
987970 - `new_lines: optional number or null`
from line 977
994977 
995978 - `tool_use_id: string`
996979 
980 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
981 
997982 - `type: "text_editor_code_execution_tool_result"`
998983 
999 - `"text_editor_code_execution_tool_result"`
1000 
1001984 - `cache_control: optional CacheControlEphemeral or null`
1002985 
1003986 Create a cache control breakpoint at this content block.
1004987 
1005 - `ToolSearchToolResultBlockParam object { content, tool_use_id, type, cache_control }`
988 - `ToolSearchToolResultBlockParam object`
1006989 
1007990 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1008991 
1009 - `ToolSearchToolResultErrorParam object { error_code, type, error_message }`
992 - `ToolSearchToolResultErrorParam object`
1010993 
1011994 - `error_code: ToolSearchToolResultErrorCode`
1012995 
from line 1003
10201003 
10211004 - `type: "tool_search_tool_result_error"`
10221005 
1023 - `"tool_search_tool_result_error"`
1024 
10251006 - `error_message: optional string or null`
10261007 
1027 - `ToolSearchToolSearchResultBlockParam object { tool_references, type }`
1008 - `ToolSearchToolSearchResultBlockParam object`
10281009 
10291010 - `tool_references: array of ToolReferenceBlockParam`
10301011 
10311012 - `tool_name: string`
10321013 
1014 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1015 
10331016 - `type: "tool_reference"`
10341017 
10351018 - `cache_control: optional CacheControlEphemeral or null`
from line 1021
10381021 
10391022 - `type: "tool_search_tool_search_result"`
10401023 
1041 - `"tool_search_tool_search_result"`
1042 
10431024 - `tool_use_id: string`
10441025 
1026 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1027 
10451028 - `type: "tool_search_tool_result"`
10461029 
1047 - `"tool_search_tool_result"`
1048 
10491030 - `cache_control: optional CacheControlEphemeral or null`
10501031 
10511032 Create a cache control breakpoint at this content block.
10521033 
1053 - `ContainerUploadBlockParam object { file_id, type, cache_control }`
1034 - `ContainerUploadBlockParam object`
10541035 
10551036 A content block that represents a file to be uploaded to the container
10561037 Files uploaded via this block will be available in the container's input directory.
from line 1040
10591040 
10601041 - `type: "container_upload"`
10611042 
1062 - `"container_upload"`
1063 
10641043 - `cache_control: optional CacheControlEphemeral or null`
10651044 
10661045 Create a cache control breakpoint at this content block.
from line 1158
11791158 
11801159 - `type: "json_schema"`
11811160 
1182 - `"json_schema"`
1183 
11841161- `system: optional string or array of TextBlockParam`
11851162 
11861163 System prompt.
from line 1170
11931170 
11941171 - `text: string`
11951172 
1173 minLength: 1
1174 
11961175 - `type: "text"`
11971176 
11981177 - `cache_control: optional CacheControlEphemeral or null`
from line 1188
12091188 
12101189 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
12111190 
1212 - `ThinkingConfigEnabled object { budget_tokens, type, display }`
1191 - `ThinkingConfigEnabled object`
12131192 
12141193 - `budget_tokens: number`
12151194 
from line 1198
12191198 
12201199 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
12211200 
1201 minimum: 1024
1202 
12221203 - `type: "enabled"`
12231204 
1224 - `"enabled"`
1225 
12261205 - `display: optional "summarized" or "omitted" or null`
12271206 
12281207 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1210
12311210 
12321211 - `"omitted"`
12331212 
1234 - `ThinkingConfigDisabled object { type }`
1213 - `ThinkingConfigDisabled object`
12351214 
12361215 - `type: "disabled"`
12371216 
1238 - `"disabled"`
1239 
1240 - `ThinkingConfigAdaptive object { type, display }`
1217 - `ThinkingConfigAdaptive object`
12411218 
12421219 - `type: "adaptive"`
12431220 
1244 - `"adaptive"`
1245 
12461221 - `display: optional "summarized" or "omitted" or null`
12471222 
12481223 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1230
12551230 
12561231 How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
12571232 
1258 - `ToolChoiceAuto object { type, disable_parallel_tool_use }`
1233 - `ToolChoiceAuto object`
12591234 
12601235 The model will automatically decide whether to use tools.
12611236 
12621237 - `type: "auto"`
12631238 
1264 - `"auto"`
1265 
12661239 - `disable_parallel_tool_use: optional boolean`
12671240 
12681241 Whether to disable parallel tool use.
12691242 
12701243 Defaults to `false`. If set to `true`, the model will output at most one tool use.
12711244 
1272 - `ToolChoiceAny object { type, disable_parallel_tool_use }`
1245 - `ToolChoiceAny object`
12731246 
12741247 The model will use any available tools.
12751248 
12761249 - `type: "any"`
12771250 
1278 - `"any"`
1279 
12801251 - `disable_parallel_tool_use: optional boolean`
12811252 
12821253 Whether to disable parallel tool use.
12831254 
12841255 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
12851256 
1286 - `ToolChoiceTool object { name, type, disable_parallel_tool_use }`
1257 - `ToolChoiceTool object`
12871258 
12881259 The model will use the specified tool with `tool_choice.name`.
12891260 
from line 1264
12931264 
12941265 - `type: "tool"`
12951266 
1296 - `"tool"`
1297 
12981267 - `disable_parallel_tool_use: optional boolean`
12991268 
13001269 Whether to disable parallel tool use.
13011270 
13021271 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
13031272 
1304 - `ToolChoiceNone object { type }`
1273 - `ToolChoiceNone object`
13051274 
13061275 The model will not be allowed to use tools.
13071276 
13081277 - `type: "none"`
1309 
1310 - `"none"`
13111278 
13121279- `tools: optional array of MessageCountTokensTool`
13131280 
from line 1340
13731340 
13741341 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
13751342 
1376 - `Tool object { input_schema, name, allowed_callers, 7 more }`
1377 
1378 - `input_schema: object { type, properties, required }`
1343 - `Tool object`
1344 
1345 - `input_schema: object`
13791346 
13801347 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
13811348 
from line 1350
13831350 
13841351 - `type: "object"`
13851352 
1386 - `"object"`
1387 
13881353 - `properties: optional map[unknown] or null`
13891354 
13901355 - `required: optional array of string or null`
from line 1360
13951360 
13961361 This is how the tool will be called by the model and in `tool_use` blocks.
13971362 
1363 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$
1364 
13981365 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
13991366 
14001367 - `"direct"`
from line 1398
14311398 
14321399 - `type: optional "custom" or null`
14331400 
1434 - `"custom"`
1435 
1436 - `ToolBash20250124 object { name, type, allowed_callers, 4 more }`
1401 - `ToolBash20250124 object`
14371402 
14381403 - `name: "bash"`
14391404 
from line 1406
14411406 
14421407 This is how the tool will be called by the model and in `tool_use` blocks.
14431408 
1444 - `"bash"`
1445 
14461409 - `type: "bash_20250124"`
14471410 
1448 - `"bash_20250124"`
1449 
14501411 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
14511412 
14521413 - `"direct"`
from line 1432
14711432 
14721433 When true, guarantees schema validation on tool names and inputs
14731434 
1474 - `CodeExecutionTool20250522 object { name, type, allowed_callers, 3 more }`
1435 - `CodeExecutionTool20250522 object`
14751436 
14761437 - `name: "code_execution"`
14771438 
from line 1440
14791440 
14801441 This is how the tool will be called by the model and in `tool_use` blocks.
14811442 
1482 - `"code_execution"`
1483 
14841443 - `type: "code_execution_20250522"`
14851444 
1486 - `"code_execution_20250522"`
1487 
14881445 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
14891446 
14901447 - `"direct"`
from line 1464
15071464 
15081465 When true, guarantees schema validation on tool names and inputs
15091466 
1510 - `CodeExecutionTool20250825 object { name, type, allowed_callers, 3 more }`
1467 - `CodeExecutionTool20250825 object`
15111468 
15121469 - `name: "code_execution"`
15131470 
from line 1472
15151472 
15161473 This is how the tool will be called by the model and in `tool_use` blocks.
15171474 
1518 - `"code_execution"`
1519 
15201475 - `type: "code_execution_20250825"`
15211476 
1477 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1478 
1479 - `"direct"`
1480 
15221481 - `"code_execution_20250825"`
15231482 
1483 - `"code_execution_20260120"`
1484 
1485 - `"code_execution_20260521"`
1486 
1487 - `cache_control: optional CacheControlEphemeral or null`
1488 
1489 Create a cache control breakpoint at this content block.
1490 
1491 - `defer_loading: optional boolean`
1492 
1493 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1494 
1495 - `strict: optional boolean`
1496 
1497 When true, guarantees schema validation on tool names and inputs
1498 
1499 - `CodeExecutionTool20260120 object`
1500 
1501 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1502 
1503 - `name: "code_execution"`
1504 
1505 Name of the tool.
1506 
1507 This is how the tool will be called by the model and in `tool_use` blocks.
1508 
1509 - `type: "code_execution_20260120"`
1510 
15241511 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15251512 
15261513 - `"direct"`
from line 1530
15431530 
15441531 When true, guarantees schema validation on tool names and inputs
15451532 
1546 - `CodeExecutionTool20260120 object { name, type, allowed_callers, 3 more }`
1547 
1548 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1533 - `CodeExecutionTool20260521 object`
1534 
1535 Code execution tool with REPL state persistence.
15491536 
15501537 - `name: "code_execution"`
15511538 
from line 1540
15531540 
15541541 This is how the tool will be called by the model and in `tool_use` blocks.
15551542 
1556 - `"code_execution"`
1557 
1558 - `type: "code_execution_20260120"`
1543 - `type: "code_execution_20260521"`
1544 
1545 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1546 
1547 - `"direct"`
1548 
1549 - `"code_execution_20250825"`
15591550 
15601551 - `"code_execution_20260120"`
15611552 
1562 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1563 
1564 - `"direct"`
1565 
1566 - `"code_execution_20250825"`
1567 
1568 - `"code_execution_20260120"`
1569 
15701553 - `"code_execution_20260521"`
15711554 
15721555 - `cache_control: optional CacheControlEphemeral or null`
from line 1564
15811564 
15821565 When true, guarantees schema validation on tool names and inputs
15831566 
1584 - `CodeExecutionTool20260521 object { name, type, allowed_callers, 3 more }`
1585 
1586 Code execution tool with REPL state persistence.
1587 
1588 - `name: "code_execution"`
1589 
1590 Name of the tool.
1591 
1592 This is how the tool will be called by the model and in `tool_use` blocks.
1593 
1594 - `"code_execution"`
1595 
1596 - `type: "code_execution_20260521"`
1597 
1598 - `"code_execution_20260521"`
1599 
1600 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1601 
1602 - `"direct"`
1603 
1604 - `"code_execution_20250825"`
1605 
1606 - `"code_execution_20260120"`
1607 
1608 - `"code_execution_20260521"`
1609 
1610 - `cache_control: optional CacheControlEphemeral or null`
1611 
1612 Create a cache control breakpoint at this content block.
1613 
1614 - `defer_loading: optional boolean`
1615 
1616 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1617 
1618 - `strict: optional boolean`
1619 
1620 When true, guarantees schema validation on tool names and inputs
1621 
1622 - `BrowserToolset20260801 object { type, allowed_callers, cache_control, configs }`
1567 - `BrowserToolset20260801 object`
16231568 
16241569 The browser toolset: a single `tools[]` entry (carrying no
16251570 `name`) that declares the browser tool family. The model is served
from line 1572
16271572 from its schema.
16281573 
16291574 - `type: "browser_toolset_20260801"`
1630 
1631 - `"browser_toolset_20260801"`
16321575 
16331576 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16341577 
from line 1968
20251968 
20261969 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
20271970 
2028 - `MemoryTool20250818 object { name, type, allowed_callers, 4 more }`
1971 - `MemoryTool20250818 object`
20291972 
20301973 - `name: "memory"`
20311974 
from line 1976
20331976 
20341977 This is how the tool will be called by the model and in `tool_use` blocks.
20351978 
2036 - `"memory"`
2037 
20381979 - `type: "memory_20250818"`
20391980 
2040 - `"memory_20250818"`
2041 
20421981 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
20431982 
20441983 - `"direct"`
from line 2002
20632002 
20642003 When true, guarantees schema validation on tool names and inputs
20652004 
2066 - `ComputerToolset20260801 object { type, allowed_callers, cache_control, configs }`
2005 - `ComputerToolset20260801 object`
20672006 
20682007 The computer toolset: a single `tools[]` entry (carrying no
20692008 `name`) that declares the computer tool family. The model is
from line 2015
20762015 
20772016 - `type: "computer_toolset_20260801"`
20782017 
2079 - `"computer_toolset_20260801"`
2080 
20812018 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
20822019 
20832020 - `"direct"`
from line 2242
23052242 
23062243 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
23072244 
2308 - `ToolTextEditor20250124 object { name, type, allowed_callers, 4 more }`
2245 - `ToolTextEditor20250124 object`
23092246 
23102247 - `name: "str_replace_editor"`
23112248 
from line 2250
23132250 
23142251 This is how the tool will be called by the model and in `tool_use` blocks.
23152252 
2316 - `"str_replace_editor"`
2317 
23182253 - `type: "text_editor_20250124"`
23192254 
2320 - `"text_editor_20250124"`
2321 
23222255 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23232256 
23242257 - `"direct"`
from line 2276
23432276 
23442277 When true, guarantees schema validation on tool names and inputs
23452278 
2346 - `ToolTextEditor20250429 object { name, type, allowed_callers, 4 more }`
2279 - `ToolTextEditor20250429 object`
23472280 
23482281 - `name: "str_replace_based_edit_tool"`
23492282 
from line 2284
23512284 
23522285 This is how the tool will be called by the model and in `tool_use` blocks.
23532286 
2354 - `"str_replace_based_edit_tool"`
2355 
23562287 - `type: "text_editor_20250429"`
23572288 
2358 - `"text_editor_20250429"`
2359 
23602289 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23612290 
23622291 - `"direct"`
from line 2310
23812310 
23822311 When true, guarantees schema validation on tool names and inputs
23832312 
2384 - `ToolTextEditor20250728 object { name, type, allowed_callers, 5 more }`
2313 - `ToolTextEditor20250728 object`
23852314 
23862315 - `name: "str_replace_based_edit_tool"`
23872316 
from line 2318
23892318 
23902319 This is how the tool will be called by the model and in `tool_use` blocks.
23912320 
2392 - `"str_replace_based_edit_tool"`
2393 
23942321 - `type: "text_editor_20250728"`
23952322 
2396 - `"text_editor_20250728"`
2397 
23982323 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23992324 
24002325 - `"direct"`
from line 2344
24192344 
24202345 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
24212346 
2347 minimum: 1
2348 
24222349 - `strict: optional boolean`
24232350 
24242351 When true, guarantees schema validation on tool names and inputs
24252352 
2426 - `WebSearchTool20250305 object { name, type, allowed_callers, 7 more }`
2353 - `WebSearchTool20250305 object`
24272354 
24282355 - `name: "web_search"`
24292356 
from line 2358
24312358 
24322359 This is how the tool will be called by the model and in `tool_use` blocks.
24332360 
2434 - `"web_search"`
2435 
24362361 - `type: "web_search_20250305"`
24372362 
2438 - `"web_search_20250305"`
2439 
24402363 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24412364 
24422365 - `"direct"`
from line 2390
24672390 
24682391 Maximum number of times the tool can be used in the API request.
24692392 
2393 exclusiveMinimum: 0
2394 
24702395 - `strict: optional boolean`
24712396 
24722397 When true, guarantees schema validation on tool names and inputs
from line 2402
24772402 
24782403 - `type: "approximate"`
24792404 
2480 - `"approximate"`
2481 
24822405 - `city: optional string or null`
24832406 
24842407 The city of the user.
24852408 
2409 maxLength: 255, minLength: 1
2410 
24862411 - `country: optional string or null`
24872412 
24882413 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
24892414 
2415 maxLength: 2, minLength: 2
2416 
24902417 - `region: optional string or null`
24912418 
24922419 The region of the user.
24932420 
2421 maxLength: 255, minLength: 1
2422 
24942423 - `timezone: optional string or null`
24952424 
24962425 The [IANA timezone](https://nodatime.org/TimeZones) of the user.
24972426 
2498 - `WebFetchTool20250910 object { name, type, allowed_callers, 8 more }`
2427 maxLength: 255, minLength: 1
2428 
2429 - `WebFetchTool20250910 object`
24992430 
25002431 - `name: "web_fetch"`
25012432 
from line 2434
25032434 
25042435 This is how the tool will be called by the model and in `tool_use` blocks.
25052436 
2506 - `"web_fetch"`
2507 
25082437 - `type: "web_fetch_20250910"`
25092438 
2510 - `"web_fetch_20250910"`
2511 
25122439 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25132440 
25142441 - `"direct"`
from line 2470
25432470 
25442471 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
25452472 
2473 exclusiveMinimum: 0
2474 
25462475 - `max_uses: optional number or null`
25472476 
25482477 Maximum number of times the tool can be used in the API request.
25492478 
2479 exclusiveMinimum: 0
2480 
25502481 - `strict: optional boolean`
25512482 
25522483 When true, guarantees schema validation on tool names and inputs
25532484 
2554 - `WebSearchTool20260209 object { name, type, allowed_callers, 7 more }`
2485 - `WebSearchTool20260209 object`
25552486 
25562487 - `name: "web_search"`
25572488 
from line 2490
25592490 
25602491 This is how the tool will be called by the model and in `tool_use` blocks.
25612492 
2562 - `"web_search"`
2563 
25642493 - `type: "web_search_20260209"`
25652494 
2566 - `"web_search_20260209"`
2567 
25682495 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25692496 
25702497 - `"direct"`
from line 2522
25952522 
25962523 Maximum number of times the tool can be used in the API request.
25972524 
2525 exclusiveMinimum: 0
2526 
25982527 - `strict: optional boolean`
25992528 
26002529 When true, guarantees schema validation on tool names and inputs
from line 2532
26032532 
26042533 Parameters for the user's location. Used to provide more relevant search results.
26052534 
2606 - `WebFetchTool20260209 object { name, type, allowed_callers, 8 more }`
2535 - `WebFetchTool20260209 object`
26072536 
26082537 - `name: "web_fetch"`
26092538 
from line 2540
26112540 
26122541 This is how the tool will be called by the model and in `tool_use` blocks.
26132542 
2614 - `"web_fetch"`
2615 
26162543 - `type: "web_fetch_20260209"`
26172544 
2618 - `"web_fetch_20260209"`
2619 
26202545 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26212546 
26222547 - `"direct"`
from line 2576
26512576 
26522577 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
26532578 
2579 exclusiveMinimum: 0
2580 
26542581 - `max_uses: optional number or null`
26552582 
26562583 Maximum number of times the tool can be used in the API request.
26572584 
2585 exclusiveMinimum: 0
2586 
26582587 - `strict: optional boolean`
26592588 
26602589 When true, guarantees schema validation on tool names and inputs
26612590 
2662 - `WebFetchTool20260309 object { name, type, allowed_callers, 9 more }`
2591 - `WebFetchTool20260309 object`
26632592 
26642593 Web fetch tool with use_cache parameter for bypassing cached content.
26652594 
from line 2598
26692598 
26702599 This is how the tool will be called by the model and in `tool_use` blocks.
26712600 
2672 - `"web_fetch"`
2673 
26742601 - `type: "web_fetch_20260309"`
26752602 
2676 - `"web_fetch_20260309"`
2677 
26782603 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26792604 
26802605 - `"direct"`
from line 2634
27092634 
27102635 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
27112636 
2637 exclusiveMinimum: 0
2638 
27122639 - `max_uses: optional number or null`
27132640 
27142641 Maximum number of times the tool can be used in the API request.
27152642 
2643 exclusiveMinimum: 0
2644 
27162645 - `strict: optional boolean`
27172646 
27182647 When true, guarantees schema validation on tool names and inputs
from line 2650
27212650 
27222651 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
27232652 
2724 - `WebSearchTool20260318 object { name, type, allowed_callers, 8 more }`
2653 - `WebSearchTool20260318 object`
27252654 
27262655 - `name: "web_search"`
27272656 
from line 2658
27292658 
27302659 This is how the tool will be called by the model and in `tool_use` blocks.
27312660 
2732 - `"web_search"`
2733 
27342661 - `type: "web_search_20260318"`
27352662 
2736 - `"web_search_20260318"`
2737 
27382663 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27392664 
27402665 - `"direct"`
from line 2690
27652690 
27662691 Maximum number of times the tool can be used in the API request.
27672692 
2693 exclusiveMinimum: 0
2694 
27682695 - `response_inclusion: optional "full" or "excluded"`
27692696 
27702697 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 2708
27812708 
27822709 Parameters for the user's location. Used to provide more relevant search results.
27832710 
2784 - `WebFetchTool20260318 object { name, type, allowed_callers, 10 more }`
2711 - `WebFetchTool20260318 object`
27852712 
27862713 - `name: "web_fetch"`
27872714 
from line 2716
27892716 
27902717 This is how the tool will be called by the model and in `tool_use` blocks.
27912718 
2792 - `"web_fetch"`
2793 
27942719 - `type: "web_fetch_20260318"`
27952720 
2796 - `"web_fetch_20260318"`
2797 
27982721 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27992722 
28002723 - `"direct"`
from line 2752
28292752 
28302753 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
28312754 
2755 exclusiveMinimum: 0
2756 
28322757 - `max_uses: optional number or null`
28332758 
28342759 Maximum number of times the tool can be used in the API request.
28352760 
2761 exclusiveMinimum: 0
2762 
28362763 - `response_inclusion: optional "full" or "excluded"`
28372764 
28382765 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 2776
28492776 
28502777 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
28512778 
2852 - `ToolSearchToolBm25_20251119 object { name, type, allowed_callers, 3 more }`
2779 - `ToolSearchToolBm25_20251119 object`
28532780 
28542781 - `name: "tool_search_tool_bm25"`
28552782 
from line 2784
28572784 
28582785 This is how the tool will be called by the model and in `tool_use` blocks.
28592786 
2787 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2788 
2789 - `"tool_search_tool_bm25_20251119"`
2790 
28602791 - `"tool_search_tool_bm25"`
28612792 
2862 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2863 
2864 - `"tool_search_tool_bm25_20251119"`
2865 
2866 - `"tool_search_tool_bm25"`
2867 
28682793 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28692794 
28702795 - `"direct"`
from line 2812
28872812 
28882813 When true, guarantees schema validation on tool names and inputs
28892814 
2890 - `ToolSearchToolRegex20251119 object { name, type, allowed_callers, 3 more }`
2815 - `ToolSearchToolRegex20251119 object`
28912816 
28922817 - `name: "tool_search_tool_regex"`
28932818 
from line 2820
28952820 
28962821 This is how the tool will be called by the model and in `tool_use` blocks.
28972822 
2823 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2824 
2825 - `"tool_search_tool_regex_20251119"`
2826 
28982827 - `"tool_search_tool_regex"`
28992828 
2900 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2901 
2902 - `"tool_search_tool_regex_20251119"`
2903 
2904 - `"tool_search_tool_regex"`
2905 
29062829 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29072830 
29082831 - `"direct"`
from line 2848
29252848 
29262849 When true, guarantees schema validation on tool names and inputs
29272850 
2928### Returns
2929 
2930- `MessageTokensCount object { input_tokens }`
2851## Returns
2852 
2853- `MessageTokensCount object`
29312854 
29322855 - `input_tokens: number`
29332856 
29342857 The total number of tokens across the provided list of messages, system prompt, and tools.
29352858 
2936### Example
2937 
2938```http
2859## Example
2860 
2861```bash
29392862curl https://api.anthropic.com/v1/messages/count_tokens \
29402863 -H 'Content-Type: application/json' \
29412864 -H 'anthropic-version: 2023-06-01' \
from line 2898
29752898 }'
29762899```
29772900 
2978#### Response
2901### Response (200)
29792902 
29802903```json
29812904{
29822905 

api/messages/create Changed · +716 / -508 lines

# Create a Message ## Headers ## Body parameters ## Returns ## Example ### Response (200) ## Create a Message ### Header Parameters ### Body Parameters ### Returns ### Example #### Response

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

from line 1
1---
2title: Create a Message
3url: https://platform.claude.com/docs/en/api/messages/create
4---
5 
6## Create a Message
7 
8**post** `/v1/messages`
1# Create a Message
2 
3**POST** `/v1/messages`
94 
105Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
116 
from line 8
138 
149Learn more about the Messages API in our [user guide](https://platform.claude.com/docs/en/get-started)
1510 
16### Header Parameters
11## Headers
1712 
1813- `"anthropic-user-profile-id": optional string`
1914 
2015 The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.
2116 
22### Body Parameters
17## Body parameters
2318 
2419- `max_tokens: number`
2520 
from line 25
3025 Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.
3126 
3227 Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
28 
29 minimum: 0
3330 
3431- `messages: array of MessageParam`
3532 
from line 85
8885 
8986 - `array of ContentBlockParam`
9087 
91 - `TextBlockParam object { text, type, cache_control, citations }`
88 - `TextBlockParam object`
9289 
9390 - `text: string`
9491 
92 minLength: 1
93 
9594 - `type: "text"`
9695 
97 - `"text"`
98 
9996 - `cache_control: optional CacheControlEphemeral or null`
10097 
10198 Create a cache control breakpoint at this content block.
10299 
103100 - `type: "ephemeral"`
104 
105 - `"ephemeral"`
106101 
107102 - `ttl: optional "5m" or "1h"`
108103 
from line 116
121116 
122117 - `citations: optional array of TextCitationParam or null`
123118 
124 - `CitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
119 - `CitationCharLocationParam object`
125120 
126121 - `cited_text: string`
127122 
128123 - `document_index: number`
129124 
125 minimum: 0
126 
130127 - `document_title: string or null`
131128 
129 maxLength: 500, minLength: 1
130 
132131 - `end_char_index: number`
133132 
134133 - `start_char_index: number`
135134 
135 minimum: 0
136 
136137 - `type: "char_location"`
137138 
138 - `"char_location"`
139 
140 - `CitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
139 - `CitationPageLocationParam object`
141140 
142141 - `cited_text: string`
143142 
144143 - `document_index: number`
145144 
145 minimum: 0
146 
146147 - `document_title: string or null`
147148 
149 maxLength: 500, minLength: 1
150 
148151 - `end_page_number: number`
149152 
150153 - `start_page_number: number`
151154 
155 minimum: 1
156 
152157 - `type: "page_location"`
153158 
154 - `"page_location"`
155 
156 - `CitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
159 - `CitationContentBlockLocationParam object`
157160 
158161 - `cited_text: string`
159162 
from line 166
163166 
164167 - `document_index: number`
165168 
169 minimum: 0
170 
166171 - `document_title: string or null`
167172 
173 maxLength: 500, minLength: 1
174 
168175 - `end_block_index: number`
169176 
170177 Exclusive 0-based end index of the cited block range in the source's `content` array.
from line 182
175182 
176183 0-based index of the first cited block in the source's `content` array.
177184 
185 minimum: 0
186 
178187 - `type: "content_block_location"`
179188 
180 - `"content_block_location"`
181 
182 - `CitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
189 - `CitationWebSearchResultLocationParam object`
183190 
184191 - `cited_text: string`
185192 
from line 194
187194 
188195 - `title: string or null`
189196 
197 maxLength: 512, minLength: 1
198 
190199 - `type: "web_search_result_location"`
191200 
192 - `"web_search_result_location"`
193 
194201 - `url: string`
195202 
196 - `CitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
203 minLength: 1
204 
205 - `CitationSearchResultLocationParam object`
197206 
198207 - `cited_text: string`
199208 
from line 222
213222 
214223 Counted separately from `document_index`; server-side web search results are not included in this count.
215224 
225 minimum: 0
226 
216227 - `source: string`
217228 
218229 - `start_block_index: number`
219230 
220231 0-based index of the first cited block in the source's `content` array.
221232 
233 minimum: 0
234 
222235 - `title: string or null`
223236 
224237 - `type: "search_result_location"`
225238 
226 - `"search_result_location"`
227 
228 - `ImageBlockParam object { source, type, cache_control, transformations }`
239 - `ImageBlockParam object`
229240 
230241 - `source: Base64ImageSource or URLImageSource or FileImageSource`
231242 
232 - `Base64ImageSource object { data, media_type, type }`
243 - `Base64ImageSource object`
233244 
234245 - `data: string`
235246 
247 format: byte
248 
236249 - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
237250 
238251 - `"image/jpeg"`
from line 258
245258 
246259 - `type: "base64"`
247260 
248 - `"base64"`
249 
250 - `URLImageSource object { type, url }`
261 - `URLImageSource object`
251262 
252263 - `type: "url"`
253264 
254 - `"url"`
255 
256265 - `url: string`
257266 
258 - `FileImageSource object { file_id, type }`
267 - `FileImageSource object`
259268 
260269 - `file_id: string`
261270 
262271 - `type: "file"`
263272 
264 - `"file"`
265 
266273 - `type: "image"`
267274 
268 - `"image"`
269 
270275 - `cache_control: optional CacheControlEphemeral or null`
271276 
272277 Create a cache control breakpoint at this content block.
from line 288
283288 
284289 - `"error"`
285290 
286 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
291 - `DocumentBlockParam object`
287292 
288293 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
289294 
290 - `Base64PDFSource object { data, media_type, type }`
295 - `Base64PDFSource object`
291296 
292297 - `data: string`
293298 
299 format: byte
300 
294301 - `media_type: "application/pdf"`
295302 
296 - `"application/pdf"`
297 
298303 - `type: "base64"`
299304 
300 - `"base64"`
301 
302 - `PlainTextSource object { data, media_type, type }`
305 - `PlainTextSource object`
303306 
304307 - `data: string`
305308 
306309 - `media_type: "text/plain"`
307310 
308 - `"text/plain"`
309 
310311 - `type: "text"`
311312 
312 - `"text"`
313 
314 - `ContentBlockSource object { content, type }`
313 - `ContentBlockSource object`
315314 
316315 - `content: string or array of ContentBlockSourceContent`
317316 
from line 318
319318 
320319 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
321320 
322 - `TextBlockParam object { text, type, cache_control, citations }`
323 
324 - `ImageBlockParam object { source, type, cache_control, transformations }`
321 - `TextBlockParam object`
322 
323 - `ImageBlockParam object`
325324 
326325 - `type: "content"`
327326 
328 - `"content"`
329 
330 - `URLPDFSource object { type, url }`
327 - `URLPDFSource object`
331328 
332329 - `type: "url"`
333330 
334 - `"url"`
335 
336331 - `url: string`
337332 
338 - `FileDocumentSource object { file_id, type }`
333 - `FileDocumentSource object`
339334 
340335 - `file_id: string`
341336 
342337 - `type: "file"`
343338 
344 - `"file"`
345 
346339 - `type: "document"`
347340 
348 - `"document"`
349 
350341 - `cache_control: optional CacheControlEphemeral or null`
351342 
352343 Create a cache control breakpoint at this content block.
from line 348
357348 
358349 - `context: optional string or null`
359350 
351 minLength: 1
352 
360353 - `title: optional string or null`
361354 
362 - `SearchResultBlockParam object { content, source, title, 3 more }`
355 maxLength: 500, minLength: 1
356 
357 - `SearchResultBlockParam object`
363358 
364359 - `content: array of TextBlockParam`
365360 
366361 - `text: string`
367362 
363 minLength: 1
364 
368365 - `type: "text"`
369366 
370367 - `cache_control: optional CacheControlEphemeral or null`
from line 376
379376 
380377 - `type: "search_result"`
381378 
382 - `"search_result"`
383 
384379 - `cache_control: optional CacheControlEphemeral or null`
385380 
386381 Create a cache control breakpoint at this content block.
387382 
388383 - `citations: optional CitationsConfigParam`
389384 
390 - `ThinkingBlockParam object { signature, thinking, type }`
385 - `ThinkingBlockParam object`
391386 
392387 - `signature: string`
393388 
from line 396
401396 
402397 - `type: "thinking"`
403398 
404 - `"thinking"`
405 
406 - `RedactedThinkingBlockParam object { data, type }`
399 - `RedactedThinkingBlockParam object`
407400 
408401 - `data: string`
409402 
from line 404
411404 
412405 - `type: "redacted_thinking"`
413406 
414 - `"redacted_thinking"`
415 
416 - `ToolUseBlockParam object { id, input, name, 4 more }`
407 - `ToolUseBlockParam object`
417408 
418409 - `id: string`
419410 
411 pattern: ^[a-zA-Z0-9_-]+$
412 
420413 - `input: map[unknown]`
421414 
422415 - `name: string`
423416 
417 maxLength: 200, minLength: 1
418 
424419 - `type: "tool_use"`
425420 
426 - `"tool_use"`
427 
428421 - `cache_control: optional CacheControlEphemeral or null`
429422 
430423 Create a cache control breakpoint at this content block.
from line 426
433426 
434427 Tool invocation directly from the model.
435428 
436 - `DirectCaller object { type }`
429 - `DirectCaller object`
437430 
438431 Tool invocation directly from the model.
439432 
440433 - `type: "direct"`
441434 
442 - `"direct"`
443 
444 - `ServerToolCaller object { tool_id, type }`
435 - `ServerToolCaller object`
445436 
446437 Tool invocation generated by a server-side tool.
447438 
448439 - `tool_id: string`
449440 
441 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
442 
450443 - `type: "code_execution_20250825"`
451444 
452 - `"code_execution_20250825"`
453 
454 - `ServerToolCaller20260120 object { tool_id, type }`
445 - `ServerToolCaller20260120 object`
455446 
456447 - `tool_id: string`
457448 
449 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
450 
458451 - `type: "code_execution_20260120"`
459452 
460 - `"code_execution_20260120"`
461 
462453 - `toolset_name: optional string or null`
463454 
464455 For a toolset member tool_use, the toolset family this member belongs to.
465456 
466 - `ToolResultBlockParam object { tool_use_id, type, cache_control, 3 more }`
457 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
458 
459 - `ToolResultBlockParam object`
467460 
468461 - `tool_use_id: string`
469462 
463 pattern: ^[a-zA-Z0-9_-]+$
464 
470465 - `type: "tool_result"`
471466 
472 - `"tool_result"`
473 
474467 - `cache_control: optional CacheControlEphemeral or null`
475468 
476469 Create a cache control breakpoint at this content block.
from line 474
481474 
482475 - `array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
483476 
484 - `TextBlockParam object { text, type, cache_control, citations }`
485 
486 - `ImageBlockParam object { source, type, cache_control, transformations }`
487 
488 - `SearchResultBlockParam object { content, source, title, 3 more }`
489 
490 - `DocumentBlockParam object { source, type, cache_control, 3 more }`
491 
492 - `ToolReferenceBlockParam object { tool_name, type, cache_control }`
477 - `TextBlockParam object`
478 
479 - `ImageBlockParam object`
480 
481 - `SearchResultBlockParam object`
482 
483 - `DocumentBlockParam object`
484 
485 - `ToolReferenceBlockParam object`
493486 
494487 Tool reference block that can be included in tool_result content.
495488 
496489 - `tool_name: string`
497490 
491 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
492 
498493 - `type: "tool_reference"`
499494 
500 - `"tool_reference"`
501 
502495 - `cache_control: optional CacheControlEphemeral or null`
503496 
504497 Create a cache control breakpoint at this content block.
505498 
506 - `BrowserStateBlockParam object { tabs, type, cache_control, state_changes }`
499 - `BrowserStateBlockParam object`
507500 
508501 The caller's browser state after a browser toolset member call —
509502 the full inventory of open tabs, which tab is active, and any side
from line 510
517510 
518511 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`.
519512 
513 maxItems: 100
514 
520515 - `tab_id: string`
521516 
522517 The caller-assigned identifier for this tab, unique within the inventory.
523518 
519 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
520 
524521 - `title: string`
525522 
526523 The title of the page the tab is showing. May be empty.
527524 
525 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
526 
528527 - `url: string`
529528 
530529 The URL of the page the tab is showing. May be empty.
531530 
531 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
532 
532533 - `active: optional boolean`
533534 
534535 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
535536 
536537 - `type: "browser_state"`
537538 
538 - `"browser_state"`
539 
540539 - `cache_control: optional CacheControlEphemeral or null`
541540 
542541 Create a cache control breakpoint at this content block.
from line 544
545544 
546545 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
547546 
548 - `BrowserStateChangeTabOpened object { tab_id, type }`
547 maxItems: 200, minItems: 1
548 
549 - `BrowserStateChangeTabOpened object`
549550 
550551 A tab this call's execution opened that remains open at its end —
551552 the creation delta of the `tabs` inventory, not an event log.
from line 560
559560 
560561 The `tab_id` of the opened tab, present in `tabs`.
561562 
563 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
564 
562565 - `type: "tab_opened"`
563566 
564 - `"tab_opened"`
565 
566 - `BrowserStateChangeDownloadStarted object { download_id, type, url }`
567 - `BrowserStateChangeDownloadStarted object`
567568 
568569 A file download that started during this call.
569570 
from line 572
571572 
572573 The caller-assigned identifier for this download, stable across the state changes reporting it.
573574 
575 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
576 
574577 - `type: "download_started"`
575578 
576 - `"download_started"`
577 
578579 - `url: string`
579580 
580581 The final post-redirect URL the download was served from.
581582 
582 - `BrowserStateChangeDownloadCompleted object { download_id, type, url, 2 more }`
583 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
584 
585 - `BrowserStateChangeDownloadCompleted object`
583586 
584587 A file download that finished during this call, reported with the
585588 same `download_id` as its `download_started` — or without a prior
from line 593
590593 
591594 The caller-assigned identifier for this download, stable across the state changes reporting it.
592595 
596 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
597 
593598 - `type: "download_completed"`
594599 
595 - `"download_completed"`
596 
597600 - `url: string`
598601 
599602 The final post-redirect URL the download was served from.
600603 
604 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
605 
601606 - `path: optional string or null`
602607 
603608 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.
604609 
610 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
611 
605612 - `size_bytes: optional number or null`
606613 
607614 The completed download's size.
608615 
609 - `BrowserStateChangeDownloadFailed object { download_id, type, url, error }`
616 minimum: 0
617 
618 - `BrowserStateChangeDownloadFailed object`
610619 
611620 A file download that failed — or was cancelled — during this call.
612621 
from line 623
614623 
615624 The caller-assigned identifier for this download, stable across the state changes reporting it.
616625 
626 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
627 
617628 - `type: "download_failed"`
618629 
619 - `"download_failed"`
620 
621630 - `url: string`
622631 
623632 The final post-redirect URL the download was served from.
624633 
634 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
635 
625636 - `error: optional string or null`
626637 
627638 The failure or cancellation detail, when known.
628639 
640 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
641 
629642 - `is_error: optional boolean`
630643 
631644 - `toolset_name: optional string or null`
632645 
633646 For a toolset member tool_result, the toolset family of the paired tool_use.
634647 
635 - `ServerToolUseBlockParam object { id, input, name, 3 more }`
648 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
649 
650 - `ServerToolUseBlockParam object`
636651 
637652 - `id: string`
638653 
654 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
655 
639656 - `input: map[unknown]`
640657 
641658 - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
from line 673
656673 
657674 - `type: "server_tool_use"`
658675 
659 - `"server_tool_use"`
660 
661676 - `cache_control: optional CacheControlEphemeral or null`
662677 
663678 Create a cache control breakpoint at this content block.
from line 681
666681 
667682 Tool invocation directly from the model.
668683 
669 - `DirectCaller object { type }`
684 - `DirectCaller object`
670685 
671686 Tool invocation directly from the model.
672687 
673 - `ServerToolCaller object { tool_id, type }`
688 - `ServerToolCaller object`
674689 
675690 Tool invocation generated by a server-side tool.
676691 
677 - `ServerToolCaller20260120 object { tool_id, type }`
678 
679 - `WebSearchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
692 - `ServerToolCaller20260120 object`
693 
694 - `WebSearchToolResultBlockParam object`
680695 
681696 - `content: WebSearchToolResultBlockParamContent`
682697 
from line 703
688703 
689704 - `type: "web_search_result"`
690705 
691 - `"web_search_result"`
692 
693706 - `url: string`
694707 
695708 - `page_age: optional string or null`
696709 
697 - `WebSearchToolRequestError object { error_code, type }`
710 - `WebSearchToolRequestError object`
698711 
699712 - `error_code: WebSearchToolResultErrorCode`
700713 
from line 725
712725 
713726 - `type: "web_search_tool_result_error"`
714727 
715 - `"web_search_tool_result_error"`
716 
717728 - `tool_use_id: string`
718729 
730 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
731 
719732 - `type: "web_search_tool_result"`
720733 
721 - `"web_search_tool_result"`
722 
723734 - `cache_control: optional CacheControlEphemeral or null`
724735 
725736 Create a cache control breakpoint at this content block.
from line 739
728739 
729740 Tool invocation directly from the model.
730741 
731 - `DirectCaller object { type }`
742 - `DirectCaller object`
732743 
733744 Tool invocation directly from the model.
734745 
735 - `ServerToolCaller object { tool_id, type }`
746 - `ServerToolCaller object`
736747 
737748 Tool invocation generated by a server-side tool.
738749 
739 - `ServerToolCaller20260120 object { tool_id, type }`
740 
741 - `WebFetchToolResultBlockParam object { content, tool_use_id, type, 2 more }`
750 - `ServerToolCaller20260120 object`
751 
752 - `WebFetchToolResultBlockParam object`
742753 
743754 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
744755 
745 - `WebFetchToolResultErrorBlockParam object { error_code, type }`
756 - `WebFetchToolResultErrorBlockParam object`
746757 
747758 - `error_code: WebFetchToolResultErrorCode`
748759 
from line 777
766777 
767778 - `type: "web_fetch_tool_result_error"`
768779 
769 - `"web_fetch_tool_result_error"`
770 
771 - `WebFetchBlockParam object { content, type, url, retrieved_at }`
780 - `WebFetchBlockParam object`
772781 
773782 - `content: DocumentBlockParam`
774783 
775784 - `type: "web_fetch_result"`
776785 
777 - `"web_fetch_result"`
778 
779786 - `url: string`
780787 
781788 Fetched content URL
from line 793
786793 
787794 - `tool_use_id: string`
788795 
796 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
797 
789798 - `type: "web_fetch_tool_result"`
790799 
791 - `"web_fetch_tool_result"`
792 
793800 - `cache_control: optional CacheControlEphemeral or null`
794801 
795802 Create a cache control breakpoint at this content block.
from line 805
798805 
799806 Tool invocation directly from the model.
800807 
801 - `DirectCaller object { type }`
808 - `DirectCaller object`
802809 
803810 Tool invocation directly from the model.
804811 
805 - `ServerToolCaller object { tool_id, type }`
812 - `ServerToolCaller object`
806813 
807814 Tool invocation generated by a server-side tool.
808815 
809 - `ServerToolCaller20260120 object { tool_id, type }`
810 
811 - `CodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
816 - `ServerToolCaller20260120 object`
817 
818 - `CodeExecutionToolResultBlockParam object`
812819 
813820 - `content: CodeExecutionToolResultBlockParamContent`
814821 
815822 Code execution result with encrypted stdout for PFC + web_search results.
816823 
817 - `CodeExecutionToolResultErrorParam object { error_code, type }`
824 - `CodeExecutionToolResultErrorParam object`
818825 
819826 - `error_code: CodeExecutionToolResultErrorCode`
820827 
from line 835
828835 
829836 - `type: "code_execution_tool_result_error"`
830837 
831 - `"code_execution_tool_result_error"`
832 
833 - `CodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
838 - `CodeExecutionResultBlockParam object`
834839 
835840 - `content: array of CodeExecutionOutputBlockParam`
836841 
from line 843
838843 
839844 - `type: "code_execution_output"`
840845 
841 - `"code_execution_output"`
842 
843846 - `return_code: number`
844847 
845848 - `stderr: string`
from line 851
848851 
849852 - `type: "code_execution_result"`
850853 
851 - `"code_execution_result"`
852 
853 - `EncryptedCodeExecutionResultBlockParam object { content, encrypted_stdout, return_code, 2 more }`
854 - `EncryptedCodeExecutionResultBlockParam object`
854855 
855856 Code execution result with encrypted stdout for PFC + web_search results.
856857 
from line 869
868869 
869870 - `type: "encrypted_code_execution_result"`
870871 
871 - `"encrypted_code_execution_result"`
872 
873872 - `tool_use_id: string`
874873 
874 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
875 
875876 - `type: "code_execution_tool_result"`
876877 
877 - `"code_execution_tool_result"`
878 
879878 - `cache_control: optional CacheControlEphemeral or null`
880879 
881880 Create a cache control breakpoint at this content block.
882881 
883 - `BashCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
882 - `BashCodeExecutionToolResultBlockParam object`
884883 
885884 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
886885 
887 - `BashCodeExecutionToolResultErrorParam object { error_code, type }`
886 - `BashCodeExecutionToolResultErrorParam object`
888887 
889888 - `error_code: BashCodeExecutionToolResultErrorCode`
890889 
from line 899
900899 
901900 - `type: "bash_code_execution_tool_result_error"`
902901 
903 - `"bash_code_execution_tool_result_error"`
904 
905 - `BashCodeExecutionResultBlockParam object { content, return_code, stderr, 2 more }`
902 - `BashCodeExecutionResultBlockParam object`
906903 
907904 - `content: array of BashCodeExecutionOutputBlockParam`
908905 
from line 907
910907 
911908 - `type: "bash_code_execution_output"`
912909 
913 - `"bash_code_execution_output"`
914 
915910 - `return_code: number`
916911 
917912 - `stderr: string`
from line 915
920915 
921916 - `type: "bash_code_execution_result"`
922917 
923 - `"bash_code_execution_result"`
924 
925918 - `tool_use_id: string`
926919 
920 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
921 
927922 - `type: "bash_code_execution_tool_result"`
928923 
929 - `"bash_code_execution_tool_result"`
930 
931924 - `cache_control: optional CacheControlEphemeral or null`
932925 
933926 Create a cache control breakpoint at this content block.
934927 
935 - `TextEditorCodeExecutionToolResultBlockParam object { content, tool_use_id, type, cache_control }`
928 - `TextEditorCodeExecutionToolResultBlockParam object`
936929 
937930 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
938931 
939 - `TextEditorCodeExecutionToolResultErrorParam object { error_code, type, error_message }`
932 - `TextEditorCodeExecutionToolResultErrorParam object`
940933 
941934 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
942935 
from line 945
952945 
953946 - `type: "text_editor_code_execution_tool_result_error"`
954947 
955 - `"text_editor_code_execution_tool_result_error"`
956 
957948 - `error_message: optional string or null`
958949 
959 - `TextEditorCodeExecutionViewResultBlockParam object { content, file_type, type, 3 more }`
950 - `TextEditorCodeExecutionViewResultBlockParam object`
960951 
961952 - `content: string`
962953 
from line 961
970961 
971962 - `type: "text_editor_code_execution_view_result"`
972963 
973 - `"text_editor_code_execution_view_result"`
974 
975964 - `num_lines: optional number or null`
976965 
977966 - `start_line: optional number or null`
978967 
979968 - `total_lines: optional number or null`
980969 
981 - `TextEditorCodeExecutionCreateResultBlockParam object { is_file_update, type }`
970 - `TextEditorCodeExecutionCreateResultBlockParam object`
982971 
983972 - `is_file_update: boolean`
984973 
985974 - `type: "text_editor_code_execution_create_result"`
986975 
987 - `"text_editor_code_execution_create_result"`
988 
989 - `TextEditorCodeExecutionStrReplaceResultBlockParam object { type, lines, new_lines, 3 more }`
976 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
990977 
991978 - `type: "text_editor_code_execution_str_replace_result"`
992979 
993 - `"text_editor_code_execution_str_replace_result"`
994 
995980 - `lines: optional array of string or null`
996981 
997982 - `new_lines: optional number or null`
from line 989
1004989 
1005990 - `tool_use_id: string`
1006991 
992 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
993 
1007994 - `type: "text_editor_code_execution_tool_result"`
1008995 
1009 - `"text_editor_code_execution_tool_result"`
1010 
1011996 - `cache_control: optional CacheControlEphemeral or null`
1012997 
1013998 Create a cache control breakpoint at this content block.
1014999 
1015 - `ToolSearchToolResultBlockParam object { content, tool_use_id, type, cache_control }`
1000 - `ToolSearchToolResultBlockParam object`
10161001 
10171002 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
10181003 
1019 - `ToolSearchToolResultErrorParam object { error_code, type, error_message }`
1004 - `ToolSearchToolResultErrorParam object`
10201005 
10211006 - `error_code: ToolSearchToolResultErrorCode`
10221007 
from line 1015
10301015 
10311016 - `type: "tool_search_tool_result_error"`
10321017 
1033 - `"tool_search_tool_result_error"`
1034 
10351018 - `error_message: optional string or null`
10361019 
1037 - `ToolSearchToolSearchResultBlockParam object { tool_references, type }`
1020 - `ToolSearchToolSearchResultBlockParam object`
10381021 
10391022 - `tool_references: array of ToolReferenceBlockParam`
10401023 
10411024 - `tool_name: string`
10421025 
1026 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1027 
10431028 - `type: "tool_reference"`
10441029 
10451030 - `cache_control: optional CacheControlEphemeral or null`
from line 1033
10481033 
10491034 - `type: "tool_search_tool_search_result"`
10501035 
1051 - `"tool_search_tool_search_result"`
1052 
10531036 - `tool_use_id: string`
10541037 
1038 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1039 
10551040 - `type: "tool_search_tool_result"`
10561041 
1057 - `"tool_search_tool_result"`
1058 
10591042 - `cache_control: optional CacheControlEphemeral or null`
10601043 
10611044 Create a cache control breakpoint at this content block.
10621045 
1063 - `ContainerUploadBlockParam object { file_id, type, cache_control }`
1046 - `ContainerUploadBlockParam object`
10641047 
10651048 A content block that represents a file to be uploaded to the container
10661049 Files uploaded via this block will be available in the container's input directory.
from line 1052
10691052 
10701053 - `type: "container_upload"`
10711054 
1072 - `"container_upload"`
1073 
10741055 - `cache_control: optional CacheControlEphemeral or null`
10751056 
10761057 Create a cache control breakpoint at this content block.
from line 1146
11651146 
11661147 Container identifier for reuse across requests.
11671148 
1168 - `ContainerParams object { id, skills }`
1149 - `ContainerParams object`
11691150 
11701151 Container parameters with skills to be loaded.
11711152 
from line 1158
11771158 
11781159 List of skills to load in the container
11791160 
1161 maxItems: 20
1162 
11801163 - `skill_id: string`
11811164 
11821165 Skill ID
11831166 
1167 maxLength: 64, minLength: 1
1168 
11841169 - `type: "anthropic" or "custom"`
11851170 
11861171 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 1178
11931178 
11941179 Skill version or 'latest' for most recent version
11951180 
1181 maxLength: 64, minLength: 1
1182 
11961183 - `string`
11971184 
11981185- `inference_geo: optional string or null`
from line 1196
12091196 
12101197 This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
12111198 
1199 maxLength: 512
1200 
12121201- `output_config: optional OutputConfig`
12131202 
12141203 Configuration options for the model's output, such as the output format.
from line 1226
12371226 
12381227 - `type: "json_schema"`
12391228 
1240 - `"json_schema"`
1241 
12421229- `service_tier: optional "auto" or "standard_only"`
12431230 
12441231 Determines whether to use priority capacity (if available) or standard capacity for this request.
from line 1262
12751262 
12761263 - `text: string`
12771264 
1265 minLength: 1
1266 
12781267 - `type: "text"`
12791268 
12801269 - `cache_control: optional CacheControlEphemeral or null`
from line 1272
12831272 
12841273 - `citations: optional array of TextCitationParam or null`
12851274 
1286- `temperature: optional number`
1287 
1288 Amount of randomness injected into the response.
1289 
1290 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.
1291 
1292 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
1293 
12941275- `thinking: optional ThinkingConfigParam`
12951276 
12961277 Configuration for enabling Claude's extended thinking.
from line 1280
12991280 
13001281 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
13011282 
1302 - `ThinkingConfigEnabled object { budget_tokens, type, display }`
1283 - `ThinkingConfigEnabled object`
13031284 
13041285 - `budget_tokens: number`
13051286 
from line 1290
13091290 
13101291 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
13111292 
1293 minimum: 1024
1294 
13121295 - `type: "enabled"`
13131296 
1314 - `"enabled"`
1315 
13161297 - `display: optional "summarized" or "omitted" or null`
13171298 
13181299 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1302
13211302 
13221303 - `"omitted"`
13231304 
1324 - `ThinkingConfigDisabled object { type }`
1305 - `ThinkingConfigDisabled object`
13251306 
13261307 - `type: "disabled"`
13271308 
1328 - `"disabled"`
1329 
1330 - `ThinkingConfigAdaptive object { type, display }`
1309 - `ThinkingConfigAdaptive object`
13311310 
13321311 - `type: "adaptive"`
13331312 
1334 - `"adaptive"`
1335 
13361313 - `display: optional "summarized" or "omitted" or null`
13371314 
13381315 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1322
13451322 
13461323 How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
13471324 
1348 - `ToolChoiceAuto object { type, disable_parallel_tool_use }`
1325 - `ToolChoiceAuto object`
13491326 
13501327 The model will automatically decide whether to use tools.
13511328 
13521329 - `type: "auto"`
13531330 
1354 - `"auto"`
1355 
13561331 - `disable_parallel_tool_use: optional boolean`
13571332 
13581333 Whether to disable parallel tool use.
13591334 
13601335 Defaults to `false`. If set to `true`, the model will output at most one tool use.
13611336 
1362 - `ToolChoiceAny object { type, disable_parallel_tool_use }`
1337 - `ToolChoiceAny object`
13631338 
13641339 The model will use any available tools.
13651340 
13661341 - `type: "any"`
13671342 
1368 - `"any"`
1369 
13701343 - `disable_parallel_tool_use: optional boolean`
13711344 
13721345 Whether to disable parallel tool use.
13731346 
13741347 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
13751348 
1376 - `ToolChoiceTool object { name, type, disable_parallel_tool_use }`
1349 - `ToolChoiceTool object`
13771350 
13781351 The model will use the specified tool with `tool_choice.name`.
13791352 
from line 1356
13831356 
13841357 - `type: "tool"`
13851358 
1386 - `"tool"`
1387 
13881359 - `disable_parallel_tool_use: optional boolean`
13891360 
13901361 Whether to disable parallel tool use.
13911362 
13921363 Defaults to `false`. If set to `true`, the model will output exactly one tool use.
13931364 
1394 - `ToolChoiceNone object { type }`
1365 - `ToolChoiceNone object`
13951366 
13961367 The model will not be allowed to use tools.
13971368 
13981369 - `type: "none"`
1399 
1400 - `"none"`
14011370 
14021371- `tools: optional array of ToolUnion`
14031372 
from line 1432
14631432 
14641433 See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
14651434 
1466 - `Tool object { input_schema, name, allowed_callers, 7 more }`
1467 
1468 - `input_schema: object { type, properties, required }`
1435 - `Tool object`
1436 
1437 - `input_schema: object`
14691438 
14701439 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
14711440 
from line 1442
14731442 
14741443 - `type: "object"`
14751444 
1476 - `"object"`
1477 
14781445 - `properties: optional map[unknown] or null`
14791446 
14801447 - `required: optional array of string or null`
from line 1452
14851452 
14861453 This is how the tool will be called by the model and in `tool_use` blocks.
14871454 
1455 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$
1456 
14881457 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
14891458 
14901459 - `"direct"`
from line 1490
15211490 
15221491 - `type: optional "custom" or null`
15231492 
1524 - `"custom"`
1525 
1526 - `ToolBash20250124 object { name, type, allowed_callers, 4 more }`
1493 - `ToolBash20250124 object`
15271494 
15281495 - `name: "bash"`
15291496 
from line 1498
15311498 
15321499 This is how the tool will be called by the model and in `tool_use` blocks.
15331500 
1534 - `"bash"`
1535 
15361501 - `type: "bash_20250124"`
15371502 
1538 - `"bash_20250124"`
1539 
15401503 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15411504 
15421505 - `"direct"`
from line 1524
15611524 
15621525 When true, guarantees schema validation on tool names and inputs
15631526 
1564 - `CodeExecutionTool20250522 object { name, type, allowed_callers, 3 more }`
1527 - `CodeExecutionTool20250522 object`
15651528 
15661529 - `name: "code_execution"`
15671530 
from line 1532
15691532 
15701533 This is how the tool will be called by the model and in `tool_use` blocks.
15711534 
1572 - `"code_execution"`
1573 
15741535 - `type: "code_execution_20250522"`
15751536 
1576 - `"code_execution_20250522"`
1577 
15781537 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15791538 
15801539 - `"direct"`
from line 1556
15971556 
15981557 When true, guarantees schema validation on tool names and inputs
15991558 
1600 - `CodeExecutionTool20250825 object { name, type, allowed_callers, 3 more }`
1559 - `CodeExecutionTool20250825 object`
16011560 
16021561 - `name: "code_execution"`
16031562 
from line 1564
16051564 
16061565 This is how the tool will be called by the model and in `tool_use` blocks.
16071566 
1608 - `"code_execution"`
1609 
16101567 - `type: "code_execution_20250825"`
16111568 
1569 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1570 
1571 - `"direct"`
1572 
16121573 - `"code_execution_20250825"`
16131574 
1575 - `"code_execution_20260120"`
1576 
1577 - `"code_execution_20260521"`
1578 
1579 - `cache_control: optional CacheControlEphemeral or null`
1580 
1581 Create a cache control breakpoint at this content block.
1582 
1583 - `defer_loading: optional boolean`
1584 
1585 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1586 
1587 - `strict: optional boolean`
1588 
1589 When true, guarantees schema validation on tool names and inputs
1590 
1591 - `CodeExecutionTool20260120 object`
1592 
1593 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1594 
1595 - `name: "code_execution"`
1596 
1597 Name of the tool.
1598 
1599 This is how the tool will be called by the model and in `tool_use` blocks.
1600 
1601 - `type: "code_execution_20260120"`
1602 
16141603 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16151604 
16161605 - `"direct"`
from line 1622
16331622 
16341623 When true, guarantees schema validation on tool names and inputs
16351624 
1636 - `CodeExecutionTool20260120 object { name, type, allowed_callers, 3 more }`
1637 
1638 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
1625 - `CodeExecutionTool20260521 object`
1626 
1627 Code execution tool with REPL state persistence.
16391628 
16401629 - `name: "code_execution"`
16411630 
from line 1632
16431632 
16441633 This is how the tool will be called by the model and in `tool_use` blocks.
16451634 
1646 - `"code_execution"`
1647 
1648 - `type: "code_execution_20260120"`
1635 - `type: "code_execution_20260521"`
1636 
1637 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1638 
1639 - `"direct"`
1640 
1641 - `"code_execution_20250825"`
16491642 
16501643 - `"code_execution_20260120"`
16511644 
1652 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1653 
1654 - `"direct"`
1655 
1656 - `"code_execution_20250825"`
1657 
1658 - `"code_execution_20260120"`
1659 
16601645 - `"code_execution_20260521"`
16611646 
16621647 - `cache_control: optional CacheControlEphemeral or null`
from line 1656
16711656 
16721657 When true, guarantees schema validation on tool names and inputs
16731658 
1674 - `CodeExecutionTool20260521 object { name, type, allowed_callers, 3 more }`
1675 
1676 Code execution tool with REPL state persistence.
1677 
1678 - `name: "code_execution"`
1679 
1680 Name of the tool.
1681 
1682 This is how the tool will be called by the model and in `tool_use` blocks.
1683 
1684 - `"code_execution"`
1685 
1686 - `type: "code_execution_20260521"`
1687 
1688 - `"code_execution_20260521"`
1689 
1690 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
1691 
1692 - `"direct"`
1693 
1694 - `"code_execution_20250825"`
1695 
1696 - `"code_execution_20260120"`
1697 
1698 - `"code_execution_20260521"`
1699 
1700 - `cache_control: optional CacheControlEphemeral or null`
1701 
1702 Create a cache control breakpoint at this content block.
1703 
1704 - `defer_loading: optional boolean`
1705 
1706 If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
1707 
1708 - `strict: optional boolean`
1709 
1710 When true, guarantees schema validation on tool names and inputs
1711 
1712 - `BrowserToolset20260801 object { type, allowed_callers, cache_control, configs }`
1659 - `BrowserToolset20260801 object`
17131660 
17141661 The browser toolset: a single `tools[]` entry (carrying no
17151662 `name`) that declares the browser tool family. The model is served
from line 1664
17171664 from its schema.
17181665 
17191666 - `type: "browser_toolset_20260801"`
1720 
1721 - `"browser_toolset_20260801"`
17221667 
17231668 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
17241669 
from line 2060
21152060 
21162061 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
21172062 
2118 - `MemoryTool20250818 object { name, type, allowed_callers, 4 more }`
2063 - `MemoryTool20250818 object`
21192064 
21202065 - `name: "memory"`
21212066 
from line 2068
21232068 
21242069 This is how the tool will be called by the model and in `tool_use` blocks.
21252070 
2126 - `"memory"`
2127 
21282071 - `type: "memory_20250818"`
21292072 
2130 - `"memory_20250818"`
2131 
21322073 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21332074 
21342075 - `"direct"`
from line 2094
21532094 
21542095 When true, guarantees schema validation on tool names and inputs
21552096 
2156 - `ComputerToolset20260801 object { type, allowed_callers, cache_control, configs }`
2097 - `ComputerToolset20260801 object`
21572098 
21582099 The computer toolset: a single `tools[]` entry (carrying no
21592100 `name`) that declares the computer tool family. The model is
from line 2107
21662107 
21672108 - `type: "computer_toolset_20260801"`
21682109 
2169 - `"computer_toolset_20260801"`
2170 
21712110 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
21722111 
21732112 - `"direct"`
from line 2334
23952334 
23962335 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
23972336 
2398 - `ToolTextEditor20250124 object { name, type, allowed_callers, 4 more }`
2337 - `ToolTextEditor20250124 object`
23992338 
24002339 - `name: "str_replace_editor"`
24012340 
from line 2342
24032342 
24042343 This is how the tool will be called by the model and in `tool_use` blocks.
24052344 
2406 - `"str_replace_editor"`
2407 
24082345 - `type: "text_editor_20250124"`
24092346 
2410 - `"text_editor_20250124"`
2411 
24122347 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24132348 
24142349 - `"direct"`
from line 2368
24332368 
24342369 When true, guarantees schema validation on tool names and inputs
24352370 
2436 - `ToolTextEditor20250429 object { name, type, allowed_callers, 4 more }`
2371 - `ToolTextEditor20250429 object`
24372372 
24382373 - `name: "str_replace_based_edit_tool"`
24392374 
from line 2376
24412376 
24422377 This is how the tool will be called by the model and in `tool_use` blocks.
24432378 
2444 - `"str_replace_based_edit_tool"`
2445 
24462379 - `type: "text_editor_20250429"`
24472380 
2448 - `"text_editor_20250429"`
2449 
24502381 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24512382 
24522383 - `"direct"`
from line 2402
24712402 
24722403 When true, guarantees schema validation on tool names and inputs
24732404 
2474 - `ToolTextEditor20250728 object { name, type, allowed_callers, 5 more }`
2405 - `ToolTextEditor20250728 object`
24752406 
24762407 - `name: "str_replace_based_edit_tool"`
24772408 
from line 2410
24792410 
24802411 This is how the tool will be called by the model and in `tool_use` blocks.
24812412 
2482 - `"str_replace_based_edit_tool"`
2483 
24842413 - `type: "text_editor_20250728"`
24852414 
2486 - `"text_editor_20250728"`
2487 
24882415 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24892416 
24902417 - `"direct"`
from line 2436
25092436 
25102437 Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
25112438 
2439 minimum: 1
2440 
25122441 - `strict: optional boolean`
25132442 
25142443 When true, guarantees schema validation on tool names and inputs
25152444 
2516 - `WebSearchTool20250305 object { name, type, allowed_callers, 7 more }`
2445 - `WebSearchTool20250305 object`
25172446 
25182447 - `name: "web_search"`
25192448 
from line 2450
25212450 
25222451 This is how the tool will be called by the model and in `tool_use` blocks.
25232452 
2524 - `"web_search"`
2525 
25262453 - `type: "web_search_20250305"`
25272454 
2528 - `"web_search_20250305"`
2529 
25302455 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25312456 
25322457 - `"direct"`
from line 2482
25572482 
25582483 Maximum number of times the tool can be used in the API request.
25592484 
2485 exclusiveMinimum: 0
2486 
25602487 - `strict: optional boolean`
25612488 
25622489 When true, guarantees schema validation on tool names and inputs
from line 2494
25672494 
25682495 - `type: "approximate"`
25692496 
2570 - `"approximate"`
2571 
25722497 - `city: optional string or null`
25732498 
25742499 The city of the user.
25752500 
2501 maxLength: 255, minLength: 1
2502 
25762503 - `country: optional string or null`
25772504 
25782505 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
25792506 
2507 maxLength: 2, minLength: 2
2508 
25802509 - `region: optional string or null`
25812510 
25822511 The region of the user.
25832512 
2513 maxLength: 255, minLength: 1
2514 
25842515 - `timezone: optional string or null`
25852516 
25862517 The [IANA timezone](https://nodatime.org/TimeZones) of the user.
25872518 
2588 - `WebFetchTool20250910 object { name, type, allowed_callers, 8 more }`
2519 maxLength: 255, minLength: 1
2520 
2521 - `WebFetchTool20250910 object`
25892522 
25902523 - `name: "web_fetch"`
25912524 
from line 2526
25932526 
25942527 This is how the tool will be called by the model and in `tool_use` blocks.
25952528 
2596 - `"web_fetch"`
2597 
25982529 - `type: "web_fetch_20250910"`
25992530 
2600 - `"web_fetch_20250910"`
2601 
26022531 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26032532 
26042533 - `"direct"`
from line 2562
26332562 
26342563 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
26352564 
2565 exclusiveMinimum: 0
2566 
26362567 - `max_uses: optional number or null`
26372568 
26382569 Maximum number of times the tool can be used in the API request.
26392570 
2571 exclusiveMinimum: 0
2572 
26402573 - `strict: optional boolean`
26412574 
26422575 When true, guarantees schema validation on tool names and inputs
26432576 
2644 - `WebSearchTool20260209 object { name, type, allowed_callers, 7 more }`
2577 - `WebSearchTool20260209 object`
26452578 
26462579 - `name: "web_search"`
26472580 
from line 2582
26492582 
26502583 This is how the tool will be called by the model and in `tool_use` blocks.
26512584 
2652 - `"web_search"`
2653 
26542585 - `type: "web_search_20260209"`
26552586 
2656 - `"web_search_20260209"`
2657 
26582587 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26592588 
26602589 - `"direct"`
from line 2614
26852614 
26862615 Maximum number of times the tool can be used in the API request.
26872616 
2617 exclusiveMinimum: 0
2618 
26882619 - `strict: optional boolean`
26892620 
26902621 When true, guarantees schema validation on tool names and inputs
from line 2624
26932624 
26942625 Parameters for the user's location. Used to provide more relevant search results.
26952626 
2696 - `WebFetchTool20260209 object { name, type, allowed_callers, 8 more }`
2627 - `WebFetchTool20260209 object`
26972628 
26982629 - `name: "web_fetch"`
26992630 
from line 2632
27012632 
27022633 This is how the tool will be called by the model and in `tool_use` blocks.
27032634 
2704 - `"web_fetch"`
2705 
27062635 - `type: "web_fetch_20260209"`
27072636 
2708 - `"web_fetch_20260209"`
2709 
27102637 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27112638 
27122639 - `"direct"`
from line 2668
27412668 
27422669 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
27432670 
2671 exclusiveMinimum: 0
2672 
27442673 - `max_uses: optional number or null`
27452674 
27462675 Maximum number of times the tool can be used in the API request.
27472676 
2677 exclusiveMinimum: 0
2678 
27482679 - `strict: optional boolean`
27492680 
27502681 When true, guarantees schema validation on tool names and inputs
27512682 
2752 - `WebFetchTool20260309 object { name, type, allowed_callers, 9 more }`
2683 - `WebFetchTool20260309 object`
27532684 
27542685 Web fetch tool with use_cache parameter for bypassing cached content.
27552686 
from line 2690
27592690 
27602691 This is how the tool will be called by the model and in `tool_use` blocks.
27612692 
2762 - `"web_fetch"`
2763 
27642693 - `type: "web_fetch_20260309"`
27652694 
2766 - `"web_fetch_20260309"`
2767 
27682695 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27692696 
27702697 - `"direct"`
from line 2726
27992726 
28002727 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
28012728 
2729 exclusiveMinimum: 0
2730 
28022731 - `max_uses: optional number or null`
28032732 
28042733 Maximum number of times the tool can be used in the API request.
28052734 
2735 exclusiveMinimum: 0
2736 
28062737 - `strict: optional boolean`
28072738 
28082739 When true, guarantees schema validation on tool names and inputs
from line 2742
28112742 
28122743 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
28132744 
2814 - `WebSearchTool20260318 object { name, type, allowed_callers, 8 more }`
2745 - `WebSearchTool20260318 object`
28152746 
28162747 - `name: "web_search"`
28172748 
from line 2750
28192750 
28202751 This is how the tool will be called by the model and in `tool_use` blocks.
28212752 
2822 - `"web_search"`
2823 
28242753 - `type: "web_search_20260318"`
28252754 
2826 - `"web_search_20260318"`
2827 
28282755 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28292756 
28302757 - `"direct"`
from line 2782
28552782 
28562783 Maximum number of times the tool can be used in the API request.
28572784 
2785 exclusiveMinimum: 0
2786 
28582787 - `response_inclusion: optional "full" or "excluded"`
28592788 
28602789 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 2800
28712800 
28722801 Parameters for the user's location. Used to provide more relevant search results.
28732802 
2874 - `WebFetchTool20260318 object { name, type, allowed_callers, 10 more }`
2803 - `WebFetchTool20260318 object`
28752804 
28762805 - `name: "web_fetch"`
28772806 
from line 2808
28792808 
28802809 This is how the tool will be called by the model and in `tool_use` blocks.
28812810 
2882 - `"web_fetch"`
2883 
28842811 - `type: "web_fetch_20260318"`
28852812 
2886 - `"web_fetch_20260318"`
2887 
28882813 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28892814 
28902815 - `"direct"`
from line 2844
29192844 
29202845 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
29212846 
2847 exclusiveMinimum: 0
2848 
29222849 - `max_uses: optional number or null`
29232850 
29242851 Maximum number of times the tool can be used in the API request.
29252852 
2853 exclusiveMinimum: 0
2854 
29262855 - `response_inclusion: optional "full" or "excluded"`
29272856 
29282857 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
from line 2868
29392868 
29402869 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
29412870 
2942 - `ToolSearchToolBm25_20251119 object { name, type, allowed_callers, 3 more }`
2871 - `ToolSearchToolBm25_20251119 object`
29432872 
29442873 - `name: "tool_search_tool_bm25"`
29452874 
from line 2876
29472876 
29482877 This is how the tool will be called by the model and in `tool_use` blocks.
29492878 
2879 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2880 
2881 - `"tool_search_tool_bm25_20251119"`
2882 
29502883 - `"tool_search_tool_bm25"`
29512884 
2952 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2953 
2954 - `"tool_search_tool_bm25_20251119"`
2955 
2956 - `"tool_search_tool_bm25"`
2957 
29582885 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29592886 
29602887 - `"direct"`
from line 2904
29772904 
29782905 When true, guarantees schema validation on tool names and inputs
29792906 
2980 - `ToolSearchToolRegex20251119 object { name, type, allowed_callers, 3 more }`
2907 - `ToolSearchToolRegex20251119 object`
29812908 
29822909 - `name: "tool_search_tool_regex"`
29832910 
from line 2912
29852912 
29862913 This is how the tool will be called by the model and in `tool_use` blocks.
29872914 
2915 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2916 
2917 - `"tool_search_tool_regex_20251119"`
2918 
29882919 - `"tool_search_tool_regex"`
29892920 
2990 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2991 
2992 - `"tool_search_tool_regex_20251119"`
2993 
2994 - `"tool_search_tool_regex"`
2995 
29962921 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29972922 
29982923 - `"direct"`
from line 2940
30152940 
30162941 When true, guarantees schema validation on tool names and inputs
30172942 
2943- `temperature: optional number`
2944 
2945 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
2946 
2947 Amount of randomness injected into the response.
2948 
2949 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.
2950 
2951 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
2952 
2953 maximum: 1, minimum: 0
2954 
30182955- `top_k: optional number`
30192956 
2957 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
2958 
30202959 Only sample from the top K options for each subsequent token.
30212960 
30222961 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
30232962 
30242963 Recommended for advanced use cases only.
30252964 
2965 minimum: 0
2966 
30262967- `top_p: optional number`
30272968 
2969 **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.
2970 
30282971 Use nucleus sampling.
30292972 
30302973 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`.
30312974 
30322975 Recommended for advanced use cases only.
30332976 
3034### Returns
3035 
3036- `Message object { id, container, content, 7 more }`
2977 maximum: 1, minimum: 0
2978 
2979## Returns
2980 
2981- `Message object`
30372982 
30382983 - `id: string`
30392984 
from line 2998
30532998 
30542999 The time at which the container will expire.
30553000 
3001 format: date-time
3002 
30563003 - `skills: array of ContainerSkill or null`
30573004 
30583005 Skills loaded in the container
from line 3008
30613008 
30623009 Skill ID
30633010 
3011 maxLength: 64, minLength: 1
3012 
30643013 - `type: "anthropic" or "custom"`
30653014 
30663015 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 3021
30723021 - `version: string`
30733022 
30743023 The resolved version: a skill version ID for custom skills.
3024 
3025 maxLength: 64, minLength: 1
30753026 
30763027 - `content: array of ContentBlock`
30773028 
from line 3053
31023053 [{"type": "text", "text": "B)"}]
31033054 ```
31043055 
3105 - `TextBlock object { citations, text, type }`
3056 - `TextBlock object`
31063057 
31073058 - `citations: array of TextCitation or null`
31083059 
from line 3061
31103061 
31113062 The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
31123063 
3113 - `CitationCharLocation object { cited_text, document_index, document_title, 4 more }`
3064 - `CitationCharLocation object`
31143065 
31153066 - `cited_text: string`
31163067 
31173068 - `document_index: number`
31183069 
3070 minimum: 0
3071 
31193072 - `document_title: string or null`
31203073 
31213074 - `end_char_index: number`
from line 3077
31243077 
31253078 - `start_char_index: number`
31263079 
3080 minimum: 0
3081 
31273082 - `type: "char_location"`
31283083 
3129 - `"char_location"`
3130 
3131 - `CitationPageLocation object { cited_text, document_index, document_title, 4 more }`
3084 default: char_location
3085 
3086 - `CitationPageLocation object`
31323087 
31333088 - `cited_text: string`
31343089 
31353090 - `document_index: number`
31363091 
3092 minimum: 0
3093 
31373094 - `document_title: string or null`
31383095 
31393096 - `end_page_number: number`
from line 3099
31423099 
31433100 - `start_page_number: number`
31443101 
3102 minimum: 1
3103 
31453104 - `type: "page_location"`
31463105 
3147 - `"page_location"`
3148 
3149 - `CitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
3106 default: page_location
3107 
3108 - `CitationContentBlockLocation object`
31503109 
31513110 - `cited_text: string`
31523111 
from line 3115
31563115 
31573116 - `document_index: number`
31583117 
3118 minimum: 0
3119 
31593120 - `document_title: string or null`
31603121 
31613122 - `end_block_index: number`
from line 3131
31703131 
31713132 0-based index of the first cited block in the source's `content` array.
31723133 
3134 minimum: 0
3135 
31733136 - `type: "content_block_location"`
31743137 
3175 - `"content_block_location"`
3176 
3177 - `CitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
3138 default: content_block_location
3139 
3140 - `CitationsWebSearchResultLocation object`
31783141 
31793142 - `cited_text: string`
31803143 
from line 3145
31823145 
31833146 - `title: string or null`
31843147 
3148 maxLength: 512
3149 
31853150 - `type: "web_search_result_location"`
31863151 
3187 - `"web_search_result_location"`
3152 default: web_search_result_location
31883153 
31893154 - `url: string`
31903155 
3191 - `CitationsSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
3156 - `CitationsSearchResultLocation object`
31923157 
31933158 - `cited_text: string`
31943159 
from line 3173
32083173 
32093174 Counted separately from `document_index`; server-side web search results are not included in this count.
32103175 
3176 minimum: 0
3177 
32113178 - `source: string`
32123179 
32133180 - `start_block_index: number`
32143181 
32153182 0-based index of the first cited block in the source's `content` array.
32163183 
3184 minimum: 0
3185 
32173186 - `title: string or null`
32183187 
32193188 - `type: "search_result_location"`
32203189 
3221 - `"search_result_location"`
3190 default: search_result_location
32223191 
32233192 - `text: string`
32243193 
3194 maxLength: 5000000, minLength: 0
3195 
32253196 - `type: "text"`
32263197 
3227 - `"text"`
3228 
3229 - `ThinkingBlock object { signature, thinking, type }`
3198 default: text
3199 
3200 - `ThinkingBlock object`
32303201 
32313202 - `signature: string`
32323203 
from line 3213
32423213 
32433214 - `type: "thinking"`
32443215 
3245 - `"thinking"`
3246 
3247 - `RedactedThinkingBlock object { data, type }`
3216 default: thinking
3217 
3218 - `RedactedThinkingBlock object`
32483219 
32493220 - `data: string`
32503221 
from line 3227
32563227 
32573228 - `type: "redacted_thinking"`
32583229 
3259 - `"redacted_thinking"`
3260 
3261 - `ToolUseBlock object { id, caller, input, 3 more }`
3230 default: redacted_thinking
3231 
3232 - `ToolUseBlock object`
32623233 
32633234 - `id: string`
32643235 
3236 pattern: ^[a-zA-Z0-9_-]+$
3237 
32653238 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
32663239 
32673240 Tool invocation directly from the model.
32683241 
3269 - `DirectCaller object { type }`
3242 default: {"type":"direct"}
3243 
3244 - `DirectCaller object`
32703245 
32713246 Tool invocation directly from the model.
32723247 
32733248 - `type: "direct"`
32743249 
3275 - `"direct"`
3276 
3277 - `ServerToolCaller object { tool_id, type }`
3250 - `ServerToolCaller object`
32783251 
32793252 Tool invocation generated by a server-side tool.
32803253 
32813254 - `tool_id: string`
32823255 
3256 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3257 
32833258 - `type: "code_execution_20250825"`
32843259 
3285 - `"code_execution_20250825"`
3286 
3287 - `ServerToolCaller20260120 object { tool_id, type }`
3260 - `ServerToolCaller20260120 object`
32883261 
32893262 - `tool_id: string`
32903263 
3264 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3265 
32913266 - `type: "code_execution_20260120"`
32923267 
3293 - `"code_execution_20260120"`
3294 
32953268 - `input: map[unknown]`
32963269 
32973270 - `name: string`
32983271 
3272 minLength: 1
3273 
32993274 - `type: "tool_use"`
33003275 
3301 - `"tool_use"`
3276 default: tool_use
33023277 
33033278 - `toolset_name: optional string or null`
33043279 
33053280 For a toolset member tool_use, the toolset family.
33063281 
3307 - `ServerToolUseBlock object { id, caller, input, 2 more }`
3282 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
3283 
3284 - `ServerToolUseBlock object`
33083285 
33093286 - `id: string`
33103287 
3288 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3289 
33113290 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
33123291 
33133292 Tool invocation directly from the model.
33143293 
3315 - `DirectCaller object { type }`
3294 default: {"type":"direct"}
3295 
3296 - `DirectCaller object`
33163297 
33173298 Tool invocation directly from the model.
33183299 
3319 - `ServerToolCaller object { tool_id, type }`
3300 - `ServerToolCaller object`
33203301 
33213302 Tool invocation generated by a server-side tool.
33223303 
3323 - `ServerToolCaller20260120 object { tool_id, type }`
3304 - `ServerToolCaller20260120 object`
33243305 
33253306 - `input: map[unknown]`
33263307 
from line 3323
33423323 
33433324 - `type: "server_tool_use"`
33443325 
3345 - `"server_tool_use"`
3346 
3347 - `WebSearchToolResultBlock object { caller, content, tool_use_id, type }`
3326 default: server_tool_use
3327 
3328 - `WebSearchToolResultBlock object`
33483329 
33493330 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
33503331 
33513332 Tool invocation directly from the model.
33523333 
3353 - `DirectCaller object { type }`
3334 default: {"type":"direct"}
3335 
3336 - `DirectCaller object`
33543337 
33553338 Tool invocation directly from the model.
33563339 
3357 - `ServerToolCaller object { tool_id, type }`
3340 - `ServerToolCaller object`
33583341 
33593342 Tool invocation generated by a server-side tool.
33603343 
3361 - `ServerToolCaller20260120 object { tool_id, type }`
3344 - `ServerToolCaller20260120 object`
33623345 
33633346 - `content: WebSearchToolResultBlockContent`
33643347 
3365 - `WebSearchToolResultError object { error_code, type }`
3348 - `WebSearchToolResultError object`
33663349 
33673350 - `error_code: WebSearchToolResultErrorCode`
33683351 
from line 3363
33803363 
33813364 - `type: "web_search_tool_result_error"`
33823365 
3383 - `"web_search_tool_result_error"`
3366 default: web_search_tool_result_error
33843367 
33853368 - `array of WebSearchResultBlock`
33863369 
from line 3375
33923375 
33933376 - `type: "web_search_result"`
33943377 
3395 - `"web_search_result"`
3378 default: web_search_result
33963379 
33973380 - `url: string`
33983381 
33993382 - `tool_use_id: string`
34003383 
3384 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3385 
34013386 - `type: "web_search_tool_result"`
34023387 
3403 - `"web_search_tool_result"`
3404 
3405 - `WebFetchToolResultBlock object { caller, content, tool_use_id, type }`
3388 default: web_search_tool_result
3389 
3390 - `WebFetchToolResultBlock object`
34063391 
34073392 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
34083393 
34093394 Tool invocation directly from the model.
34103395 
3411 - `DirectCaller object { type }`
3396 default: {"type":"direct"}
3397 
3398 - `DirectCaller object`
34123399 
34133400 Tool invocation directly from the model.
34143401 
3415 - `ServerToolCaller object { tool_id, type }`
3402 - `ServerToolCaller object`
34163403 
34173404 Tool invocation generated by a server-side tool.
34183405 
3419 - `ServerToolCaller20260120 object { tool_id, type }`
3406 - `ServerToolCaller20260120 object`
34203407 
34213408 - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
34223409 
3423 - `WebFetchToolResultErrorBlock object { error_code, type }`
3410 - `WebFetchToolResultErrorBlock object`
34243411 
34253412 - `error_code: WebFetchToolResultErrorCode`
34263413 
from line 3431
34443431 
34453432 - `type: "web_fetch_tool_result_error"`
34463433 
3447 - `"web_fetch_tool_result_error"`
3448 
3449 - `WebFetchBlock object { content, retrieved_at, type, url }`
3434 default: web_fetch_tool_result_error
3435 
3436 - `WebFetchBlock object`
34503437 
34513438 - `content: DocumentBlock`
34523439 
from line 3443
34563443 
34573444 - `enabled: boolean`
34583445 
3446 default: false
3447 
34593448 - `source: Base64PDFSource or PlainTextSource`
34603449 
3461 - `Base64PDFSource object { data, media_type, type }`
3450 - `Base64PDFSource object`
34623451 
34633452 - `data: string`
34643453 
3454 format: byte
3455 
34653456 - `media_type: "application/pdf"`
34663457 
3467 - `"application/pdf"`
3468 
34693458 - `type: "base64"`
34703459 
3471 - `"base64"`
3472 
3473 - `PlainTextSource object { data, media_type, type }`
3460 - `PlainTextSource object`
34743461 
34753462 - `data: string`
34763463 
34773464 - `media_type: "text/plain"`
34783465 
3479 - `"text/plain"`
3480 
34813466 - `type: "text"`
34823467 
3483 - `"text"`
3484 
34853468 - `title: string or null`
34863469 
34873470 The title of the document
34883471 
34893472 - `type: "document"`
34903473 
3491 - `"document"`
3474 default: document
34923475 
34933476 - `retrieved_at: string or null`
34943477 
from line 3479
34963479 
34973480 - `type: "web_fetch_result"`
34983481 
3499 - `"web_fetch_result"`
3482 default: web_fetch_result
35003483 
35013484 - `url: string`
35023485 
from line 3487
35043487 
35053488 - `tool_use_id: string`
35063489 
3490 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3491 
35073492 - `type: "web_fetch_tool_result"`
35083493 
3509 - `"web_fetch_tool_result"`
3510 
3511 - `CodeExecutionToolResultBlock object { content, tool_use_id, type }`
3494 default: web_fetch_tool_result
3495 
3496 - `CodeExecutionToolResultBlock object`
35123497 
35133498 - `content: CodeExecutionToolResultBlockContent`
35143499 
35153500 Code execution result with encrypted stdout for PFC + web_search results.
35163501 
3517 - `CodeExecutionToolResultError object { error_code, type }`
3502 - `CodeExecutionToolResultError object`
35183503 
35193504 - `error_code: CodeExecutionToolResultErrorCode`
35203505 
from line 3513
35283513 
35293514 - `type: "code_execution_tool_result_error"`
35303515 
3531 - `"code_execution_tool_result_error"`
3532 
3533 - `CodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
3516 default: code_execution_tool_result_error
3517 
3518 - `CodeExecutionResultBlock object`
35343519 
35353520 - `content: array of CodeExecutionOutputBlock`
35363521 
from line 3523
35383523 
35393524 - `type: "code_execution_output"`
35403525 
3541 - `"code_execution_output"`
3526 default: code_execution_output
35423527 
35433528 - `return_code: number`
35443529 
from line 3533
35483533 
35493534 - `type: "code_execution_result"`
35503535 
3551 - `"code_execution_result"`
3552 
3553 - `EncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
3536 default: code_execution_result
3537 
3538 - `EncryptedCodeExecutionResultBlock object`
35543539 
35553540 Code execution result with encrypted stdout for PFC + web_search results.
35563541 
from line 3545
35603545 
35613546 - `type: "code_execution_output"`
35623547 
3548 default: code_execution_output
3549 
35633550 - `encrypted_stdout: string`
35643551 
35653552 - `return_code: number`
from line 3555
35683555 
35693556 - `type: "encrypted_code_execution_result"`
35703557 
3571 - `"encrypted_code_execution_result"`
3558 default: encrypted_code_execution_result
35723559 
35733560 - `tool_use_id: string`
35743561 
3562 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3563 
35753564 - `type: "code_execution_tool_result"`
35763565 
3577 - `"code_execution_tool_result"`
3578 
3579 - `BashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
3566 default: code_execution_tool_result
3567 
3568 - `BashCodeExecutionToolResultBlock object`
35803569 
35813570 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
35823571 
3583 - `BashCodeExecutionToolResultError object { error_code, type }`
3572 - `BashCodeExecutionToolResultError object`
35843573 
35853574 - `error_code: BashCodeExecutionToolResultErrorCode`
35863575 
from line 3585
35963585 
35973586 - `type: "bash_code_execution_tool_result_error"`
35983587 
3599 - `"bash_code_execution_tool_result_error"`
3600 
3601 - `BashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
3588 default: bash_code_execution_tool_result_error
3589 
3590 - `BashCodeExecutionResultBlock object`
36023591 
36033592 - `content: array of BashCodeExecutionOutputBlock`
36043593 
from line 3595
36063595 
36073596 - `type: "bash_code_execution_output"`
36083597 
3609 - `"bash_code_execution_output"`
3598 default: bash_code_execution_output
36103599 
36113600 - `return_code: number`
36123601 
from line 3605
36163605 
36173606 - `type: "bash_code_execution_result"`
36183607 
3619 - `"bash_code_execution_result"`
3608 default: bash_code_execution_result
36203609 
36213610 - `tool_use_id: string`
36223611 
3612 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3613 
36233614 - `type: "bash_code_execution_tool_result"`
36243615 
3625 - `"bash_code_execution_tool_result"`
3626 
3627 - `TextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
3616 default: bash_code_execution_tool_result
3617 
3618 - `TextEditorCodeExecutionToolResultBlock object`
36283619 
36293620 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
36303621 
3631 - `TextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
3622 - `TextEditorCodeExecutionToolResultError object`
36323623 
36333624 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
36343625 
from line 3637
36463637 
36473638 - `type: "text_editor_code_execution_tool_result_error"`
36483639 
3649 - `"text_editor_code_execution_tool_result_error"`
3650 
3651 - `TextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
3640 default: text_editor_code_execution_tool_result_error
3641 
3642 - `TextEditorCodeExecutionViewResultBlock object`
36523643 
36533644 - `content: string`
36543645 
from line 3659
36683659 
36693660 - `type: "text_editor_code_execution_view_result"`
36703661 
3671 - `"text_editor_code_execution_view_result"`
3672 
3673 - `TextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
3662 default: text_editor_code_execution_view_result
3663 
3664 - `TextEditorCodeExecutionCreateResultBlock object`
36743665 
36753666 - `is_file_update: boolean`
36763667 
36773668 - `type: "text_editor_code_execution_create_result"`
36783669 
3679 - `"text_editor_code_execution_create_result"`
3680 
3681 - `TextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
3670 default: text_editor_code_execution_create_result
3671 
3672 - `TextEditorCodeExecutionStrReplaceResultBlock object`
36823673 
36833674 - `lines: array of string or null`
36843675 
from line 3683
36923683 
36933684 - `type: "text_editor_code_execution_str_replace_result"`
36943685 
3695 - `"text_editor_code_execution_str_replace_result"`
3686 default: text_editor_code_execution_str_replace_result
36963687 
36973688 - `tool_use_id: string`
36983689 
3690 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3691 
36993692 - `type: "text_editor_code_execution_tool_result"`
37003693 
3701 - `"text_editor_code_execution_tool_result"`
3702 
3703 - `ToolSearchToolResultBlock object { content, tool_use_id, type }`
3694 default: text_editor_code_execution_tool_result
3695 
3696 - `ToolSearchToolResultBlock object`
37043697 
37053698 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
37063699 
3707 - `ToolSearchToolResultError object { error_code, error_message, type }`
3700 - `ToolSearchToolResultError object`
37083701 
37093702 - `error_code: ToolSearchToolResultErrorCode`
37103703 
from line 3713
37203713 
37213714 - `type: "tool_search_tool_result_error"`
37223715 
3723 - `"tool_search_tool_result_error"`
3724 
3725 - `ToolSearchToolSearchResultBlock object { tool_references, type }`
3716 default: tool_search_tool_result_error
3717 
3718 - `ToolSearchToolSearchResultBlock object`
37263719 
37273720 - `tool_references: array of ToolReferenceBlock`
37283721 
37293722 - `tool_name: string`
37303723 
3724 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
3725 
37313726 - `type: "tool_reference"`
37323727 
3733 - `"tool_reference"`
3728 default: tool_reference
37343729 
37353730 - `type: "tool_search_tool_search_result"`
37363731 
3737 - `"tool_search_tool_search_result"`
3732 default: tool_search_tool_search_result
37383733 
37393734 - `tool_use_id: string`
37403735 
3736 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3737 
37413738 - `type: "tool_search_tool_result"`
37423739 
3743 - `"tool_search_tool_result"`
3744 
3745 - `ContainerUploadBlock object { file_id, type }`
3740 default: tool_search_tool_result
3741 
3742 - `ContainerUploadBlock object`
37463743 
37473744 Response model for a file uploaded to the container.
37483745 
from line 3747
37503747 
37513748 - `type: "container_upload"`
37523749 
3753 - `"container_upload"`
3750 default: container_upload
37543751 
37553752 - `model: Model`
37563753 
from line 3829
38323829 
38333830 This will always be `"assistant"`.
38343831 
3835 - `"assistant"`
3832 default: assistant
38363833 
38373834 - `stop_details: RefusalStopDetails or null`
38383835 
from line 3867
38703867 
38713868 - `type: "refusal"`
38723869 
3873 - `"refusal"`
3870 default: refusal
38743871 
38753872 - `stop_reason: StopReason or null`
38763873 
from line 3911
39143911 
39153912 For Messages, this is always `"message"`.
39163913 
3917 - `"message"`
3914 default: message
39183915 
39193916 - `usage: Usage`
39203917 
from line 3933
39363933 
39373934 The number of input tokens used to create the 1 hour cache entry.
39383935 
3936 default: 0, minimum: 0
3937 
39393938 - `ephemeral_5m_input_tokens: number`
39403939 
39413940 The number of input tokens used to create the 5 minute cache entry.
39423941 
3942 default: 0, minimum: 0
3943 
39433944 - `cache_creation_input_tokens: number or null`
39443945 
39453946 The number of input tokens used to create the cache entry.
39463947 
3948 minimum: 0
3949 
39473950 - `cache_read_input_tokens: number or null`
39483951 
39493952 The number of input tokens read from the cache.
39503953 
3954 minimum: 0
3955 
39513956 - `inference_geo: string or null`
39523957 
39533958 The geographic region where inference was performed for this request.
from line 3961
39563961 
39573962 The number of input tokens which were used.
39583963 
3964 minimum: 0
3965 
39593966 - `output_tokens: number`
39603967 
39613968 The number of output tokens which were used.
3969 
3970 minimum: 0
39623971 
39633972 - `output_tokens_details: OutputTokensDetails or null`
39643973 
from line 3989
39803989 generation count by a small number of tokens. Always ≤ `output_tokens`;
39813990 `output_tokens - thinking_tokens` approximates the non-reasoning output.
39823991 
3992 default: 0, minimum: 0
3993 
39833994 - `server_tool_use: ServerToolUsage or null`
39843995 
39853996 The number of server tool requests.
from line 3999
39883999 
39894000 The number of web fetch tool requests.
39904001 
4002 default: 0, minimum: 0
4003 
39914004 - `web_search_requests: number`
39924005 
39934006 The number of web search tool requests.
39944007 
4008 default: 0, minimum: 0
4009 
39954010 - `service_tier: "standard" or "priority" or "batch" or null`
39964011 
39974012 If the request used the priority, standard, or batch tier.
from line 4017
40024017 
40034018 - `"batch"`
40044019 
4005### Example
4006 
4007```http
4020- `RawMessageStreamEvent = RawMessageStartEvent or RawMessageDeltaEvent or RawMessageStopEvent or 3 more`
4021 
4022 - `RawMessageStartEvent object`
4023 
4024 - `message: Message`
4025 
4026 - `type: "message_start"`
4027 
4028 default: message_start
4029 
4030 - `RawMessageDeltaEvent object`
4031 
4032 - `delta: object`
4033 
4034 - `container: Container or null`
4035 
4036 Information about the container used in the request (for the code execution tool)
4037 
4038 - `stop_details: RefusalStopDetails or null`
4039 
4040 Structured information about a refusal.
4041 
4042 - `stop_reason: StopReason or null`
4043 
4044 - `stop_sequence: string or null`
4045 
4046 - `type: "message_delta"`
4047 
4048 default: message_delta
4049 
4050 - `usage: MessageDeltaUsage`
4051 
4052 Billing and rate-limit usage.
4053 
4054 Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
4055 
4056 Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
4057 
4058 For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
4059 
4060 Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
4061 
4062 - `cache_creation_input_tokens: number or null`
4063 
4064 The cumulative number of input tokens used to create the cache entry.
4065 
4066 minimum: 0
4067 
4068 - `cache_read_input_tokens: number or null`
4069 
4070 The cumulative number of input tokens read from the cache.
4071 
4072 minimum: 0
4073 
4074 - `input_tokens: number or null`
4075 
4076 The cumulative number of input tokens which were used.
4077 
4078 minimum: 0
4079 
4080 - `output_tokens: number`
4081 
4082 The cumulative number of output tokens which were used.
4083 
4084 - `output_tokens_details: OutputTokensDetails or null`
4085 
4086 Breakdown of output tokens by category.
4087 
4088 `output_tokens` remains the inclusive, authoritative total used for billing.
4089 This object provides a read-only decomposition for observability — for example,
4090 how many of the billed output tokens were spent on internal reasoning that may
4091 have been summarized before being returned to you.
4092 
4093 - `server_tool_use: ServerToolUsage or null`
4094 
4095 The number of server tool requests.
4096 
4097 - `RawMessageStopEvent object`
4098 
4099 - `type: "message_stop"`
4100 
4101 default: message_stop
4102 
4103 - `RawContentBlockStartEvent object`
4104 
4105 - `content_block: TextBlock or ThinkingBlock or RedactedThinkingBlock or 9 more`
4106 
4107 Response model for a file uploaded to the container.
4108 
4109 - `TextBlock object`
4110 
4111 - `ThinkingBlock object`
4112 
4113 - `RedactedThinkingBlock object`
4114 
4115 - `ToolUseBlock object`
4116 
4117 - `ServerToolUseBlock object`
4118 
4119 - `WebSearchToolResultBlock object`
4120 
4121 - `WebFetchToolResultBlock object`
4122 
4123 - `CodeExecutionToolResultBlock object`
4124 
4125 - `BashCodeExecutionToolResultBlock object`
4126 
4127 - `TextEditorCodeExecutionToolResultBlock object`
4128 
4129 - `ToolSearchToolResultBlock object`
4130 
4131 - `ContainerUploadBlock object`
4132 
4133 Response model for a file uploaded to the container.
4134 
4135 - `index: number`
4136 
4137 - `type: "content_block_start"`
4138 
4139 default: content_block_start
4140 
4141 - `RawContentBlockDeltaEvent object`
4142 
4143 - `delta: RawContentBlockDelta`
4144 
4145 - `TextDelta object`
4146 
4147 - `text: string`
4148 
4149 - `type: "text_delta"`
4150 
4151 default: text_delta
4152 
4153 - `InputJSONDelta object`
4154 
4155 - `partial_json: string`
4156 
4157 - `type: "input_json_delta"`
4158 
4159 default: input_json_delta
4160 
4161 - `CitationsDelta object`
4162 
4163 - `citation: CitationCharLocation or CitationPageLocation or CitationContentBlockLocation or 2 more`
4164 
4165 - `CitationCharLocation object`
4166 
4167 - `CitationPageLocation object`
4168 
4169 - `CitationContentBlockLocation object`
4170 
4171 - `CitationsWebSearchResultLocation object`
4172 
4173 - `CitationsSearchResultLocation object`
4174 
4175 - `type: "citations_delta"`
4176 
4177 default: citations_delta
4178 
4179 - `ThinkingDelta object`
4180 
4181 - `thinking: string`
4182 
4183 The incremental `thinking` text for this content block. Concatenate the `thinking` values of successive `thinking_delta` events to assemble the block's full `thinking` value.
4184 
4185 - `type: "thinking_delta"`
4186 
4187 default: thinking_delta
4188 
4189 - `SignatureDelta object`
4190 
4191 - `signature: string`
4192 
4193 The `signature` for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a `signature_delta` event just before the block's `content_block_stop` event.
4194 
4195 - `type: "signature_delta"`
4196 
4197 default: signature_delta
4198 
4199 - `index: number`
4200 
4201 - `type: "content_block_delta"`
4202 
4203 default: content_block_delta
4204 
4205 - `RawContentBlockStopEvent object`
4206 
4207 - `index: number`
4208 
4209 - `type: "content_block_stop"`
4210 
4211 default: content_block_stop
4212 
4213## Example
4214 
4215```bash
40084216curl https://api.anthropic.com/v1/messages \
40094217 -H 'Content-Type: application/json' \
40104218 -H 'anthropic-version: 2023-06-01' \
from line 4258
40504258 }'
40514259```
40524260 
4053#### Response
4261### Response (200)
40544262 
40554263```json
40564264{
40574265 

api/models Changed · +30 / -27 lines

### Query parameters ### Headers #### Response (200) ### Path parameters ### Headers #### Response (200) ## Domain types ### Query Parameters ### Header Parameters #### Response ### Path Parameters ### Header Parameters #### Response ## Domain Types

from line 1
1---
2title: Models
3url: https://platform.claude.com/docs/en/api/models
4---
5 
61# Models
72 
83## List Models
94 
10**get** `/v1/models`
5**GET** `/v1/models`
116 
127List available models.
138 
149The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
1510 
16### Query Parameters
11### Query parameters
1712 
1813- `after_id: optional string`
1914 
from line 24
2924 
3025 Defaults to `20`. Ranges from `1` to `1000`.
3126 
32### Header Parameters
27 default: 20, maximum: 1000, minimum: 1
3328 
29### Headers
30 
3431- `"anthropic-beta": optional array of AnthropicBeta`
3532 
3633 Optional header to specify the beta version(s) you want to use.
from line 216
219216 
220217 RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
221218 
219 format: date-time
220 
222221 - `display_name: string`
223222 
224223 A human-readable name for the model.
from line 236
237236 
238237 For Models, this is always `"model"`.
239238 
240 - `"model"`
239 default: model
241240 
242241- `first_id: string or null`
243242 
from line 252
253252 
254253### Example
255254 
256```http
255```bash
257256curl https://api.anthropic.com/v1/models \
258257 -H 'anthropic-version: 2023-06-01' \
259258 -H "X-Api-Key: $ANTHROPIC_API_KEY"
260259```
261260 
262#### Response
261#### Response (200)
263262 
264263```json
265264{
from line 341
342341 
343342## Get a Model
344343 
345**get** `/v1/models/{model_id}`
344**GET** `/v1/models/{model_id}`
346345 
347346Get a specific model.
348347 
349348The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
350349 
351### Path Parameters
350### Path parameters
352351 
353352- `model_id: string`
354353 
355354 Model identifier or alias.
356355 
357### Header Parameters
356### Headers
358357 
359358- `"anthropic-beta": optional array of AnthropicBeta`
360359 
from line 433
434433 
435434### Returns
436435 
437- `ModelInfo object { id, capabilities, created_at, 4 more }`
436- `ModelInfo object`
438437 
439438 - `id: string`
440439 
from line 543
544543 
545544 RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
546545 
546 format: date-time
547 
547548 - `display_name: string`
548549 
549550 A human-readable name for the model.
from line 563
562563 
563564 For Models, this is always `"model"`.
564565 
565 - `"model"`
566 default: model
566567 
567568### Example
568569 
569```http
570```bash
570571curl https://api.anthropic.com/v1/models/$MODEL_ID \
571572 -H 'anthropic-version: 2023-06-01' \
572573 -H "X-Api-Key: $ANTHROPIC_API_KEY"
573574```
574575 
575#### Response
576#### Response (200)
576577 
577578```json
578579{
from line 647
646647}
647648```
648649 
649## Domain Types
650## Domain types
650651 
651652### Capability Support
652653 
653- `CapabilitySupport object { supported }`
654- `CapabilitySupport object`
654655 
655656 Indicates whether a capability is supported.
656657 
from line 661
660661 
661662### Context Management Capability
662663 
663- `ContextManagementCapability object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
664- `ContextManagementCapability object`
664665 
665666 Context management capability details.
666667 
from line 687
686687 
687688### Effort Capability
688689 
689- `EffortCapability object { high, low, max, 3 more }`
690- `EffortCapability object`
690691 
691692 Effort (reasoning_effort) capability details.
692693 
from line 721
720721 
721722### Model Capabilities
722723 
723- `ModelCapabilities object { batch, citations, code_execution, 6 more }`
724- `ModelCapabilities object`
724725 
725726 Model capability information.
726727 
from line 823
822823 
823824### Model Info
824825 
825- `ModelInfo object { id, capabilities, created_at, 4 more }`
826- `ModelInfo object`
826827 
827828 - `id: string`
828829 
from line 933
932933 
933934 RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
934935 
936 format: date-time
937 
935938 - `display_name: string`
936939 
937940 A human-readable name for the model.
from line 953
950953 
951954 For Models, this is always `"model"`.
952955 
953 - `"model"`
956 default: model
954957 
955958### Thinking Capability
956959 
957- `ThinkingCapability object { supported, types }`
960- `ThinkingCapability object`
958961 
959962 Thinking capability details.
960963 
from line 983
980983 
981984### Thinking Types
982985 
983- `ThinkingTypes object { adaptive, enabled }`
986- `ThinkingTypes object`
984987 
985988 Supported thinking type configurations.
986989 

api/models/list Changed · +15 / -16 lines

# List Models ## Query parameters ## Headers ## Returns ## Example ### Response (200) ## List Models ### Query Parameters ### Header Parameters ### Returns ### Example #### Response

from line 1
1---
2title: List Models
3url: https://platform.claude.com/docs/en/api/models/list
4---
1# List Models
52 
6## List Models
3**GET** `/v1/models`
74 
8**get** `/v1/models`
9 
105List available models.
116 
127The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
138 
14### Query Parameters
9## Query parameters
1510 
1611- `after_id: optional string`
1712 
from line 22
2722 
2823 Defaults to `20`. Ranges from `1` to `1000`.
2924 
30### Header Parameters
25 default: 20, maximum: 1000, minimum: 1
3126 
27## Headers
28 
3229- `"anthropic-beta": optional array of AnthropicBeta`
3330 
3431 Optional header to specify the beta version(s) you want to use.
from line 102
105102 
106103 - `"mid-conversation-tool-changes-2026-07-01"`
107104 
108### Returns
105## Returns
109106 
110107- `data: array of ModelInfo`
111108 
from line 214
217214 
218215 RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
219216 
217 format: date-time
218 
220219 - `display_name: string`
221220 
222221 A human-readable name for the model.
from line 234
235234 
236235 For Models, this is always `"model"`.
237236 
238 - `"model"`
237 default: model
239238 
240239- `first_id: string or null`
241240 
from line 248
249248 
250249 Last ID in the `data` list. Can be used as the `after_id` for the next page.
251250 
252### Example
251## Example
253252 
254```http
253```bash
255254curl https://api.anthropic.com/v1/models \
256255 -H 'anthropic-version: 2023-06-01' \
257256 -H "X-Api-Key: $ANTHROPIC_API_KEY"
258257```
259258 
260#### Response
259### Response (200)
261260 
262261```json
263262{

api/models/retrieve Changed · +16 / -19 lines

# Get a Model ## Path parameters ## Headers ## Returns ## Example ### Response (200) ## Get a Model ### Path Parameters ### Header Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Get a Model
3url: https://platform.claude.com/docs/en/api/models/retrieve
4---
1# Get a Model
52 
6## Get a Model
3**GET** `/v1/models/{model_id}`
74 
8**get** `/v1/models/{model_id}`
9 
105Get a specific model.
116 
127The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
138 
14### Path Parameters
9## Path parameters
1510 
1611- `model_id: string`
1712 
1813 Model identifier or alias.
1914 
20### Header Parameters
15## Headers
2116 
2217- `"anthropic-beta": optional array of AnthropicBeta`
2318 
from line 90
9590 
9691 - `"mid-conversation-tool-changes-2026-07-01"`
9792 
98### Returns
93## Returns
9994 
100- `ModelInfo object { id, capabilities, created_at, 4 more }`
95- `ModelInfo object`
10196 
10297 - `id: string`
10398 
from line 202
207202 
208203 RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
209204 
205 format: date-time
206 
210207 - `display_name: string`
211208 
212209 A human-readable name for the model.
from line 222
225222 
226223 For Models, this is always `"model"`.
227224 
228 - `"model"`
225 default: model
229226 
230### Example
227## Example
231228 
232```http
229```bash
233230curl https://api.anthropic.com/v1/models/$MODEL_ID \
234231 -H 'anthropic-version: 2023-06-01' \
235232 -H "X-Api-Key: $ANTHROPIC_API_KEY"
236233```
237234 
238#### Response
235### Response (200)
239236 
240237```json
241238{

api/skills Changed · +128 / -144 lines

### Body parameters (form-data) #### Response (200) ### Query parameters #### Response (200) ### Path parameters #### Response (200) ### Path parameters #### Response (200) ## Domain types ## Skills › Versions ### Create Skill Version #### Path parameters #### Body parameters (form-data) #### Returns #### Example ##### Response (200) ### List Skill Versions #### Path parameters #### Query parameters #### Returns #### Example ##### Response (200) ### Get Skill Version #### Path parameters #### Returns #### Example ##### Response (200) ### Delete Skill Version #### Path parameters #### Returns #### Example ##### Response (200) #### Response ### Query Parameters #### Response ### Path Parameters #### Response ### Path Parameters #### Response ## Domain Types # Versions ## Create Skill Version ### Path Parameters #### Response ## List Skill Versions ### Path Parameters ### Query Parameters #### Response ## Get Skill Version ### Path Parameters #### Response ## Delete Skill Version ### Path Parameters #### Response ## Domain Types ### Deleted Skill Version ### Skill Version

from line 1
1---
2title: Skills
3url: https://platform.claude.com/docs/en/api/skills
4---
5 
61# Skills
72 
83## Create Skill
94 
10**post** `/v1/skills`
5**POST** `/v1/skills`
116 
127Create Skill
138 
9### Body parameters (form-data)
10 
11- `files: array of string`
12 
13 Files to upload for the skill.
14 
15 All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
16 
17- `display_name: optional string or null`
18 
19 Human-readable, single-line label for the Skill. Maximum 255 characters.
20 Always set: derived from the SKILL.md frontmatter `name` when omitted at
21 creation. Not unique.
22 
1423### Returns
1524 
16- `Skill object { id, created_at, display_name, 4 more }`
25- `Skill object`
1726 
1827 - `id: string`
1928 
from line 34
2534 
2635 ISO 8601 timestamp of when the skill was created.
2736 
37 format: date-time
38 
2839 - `display_name: string`
2940 
3041 Human-readable, single-line label for the Skill. Maximum 255 characters.
from line 82
7182 
7283 For Skills, this is always `"skill"`.
7384 
74 - `"skill"`
85 default: skill
7586 
7687 - `updated_at: string`
7788 
7889 ISO 8601 timestamp of when the skill was last updated.
7990 
91 format: date-time
92 
8093### Example
8194 
82```http
95```bash
8396curl https://api.anthropic.com/v1/skills \
8497 -H 'Content-Type: multipart/form-data' \
8598 -H 'anthropic-version: 2023-06-01' \
from line 100
87100 -F files='["Example data"]'
88101```
89102 
90#### Response
103#### Response (200)
91104 
92105```json
93106{
from line 118
105118 
106119## List Skills
107120 
108**get** `/v1/skills`
121**GET** `/v1/skills`
109122 
110123List Skills
111124 
112### Query Parameters
125### Query parameters
113126 
114127- `limit: optional number`
115128 
from line 130
117130 
118131 Ranges from `1` to `1000`. Defaults to `20`.
119132 
133 default: 20, minimum: 1, maximum: 1000
134 
120135- `page: optional string`
121136 
122137 Pagination token for fetching a specific page of results.
from line 163
148163 
149164 ISO 8601 timestamp of when the skill was created.
150165 
166 format: date-time
167 
151168 - `display_name: string`
152169 
153170 Human-readable, single-line label for the Skill. Maximum 255 characters.
from line 211
194211 
195212 For Skills, this is always `"skill"`.
196213 
197 - `"skill"`
214 default: skill
198215 
199216 - `updated_at: string`
200217 
201218 ISO 8601 timestamp of when the skill was last updated.
202219 
220 format: date-time
221 
203222- `next_page: string or null`
204223 
205224 Token for fetching the next page of results.
from line 227
208227 
209228### Example
210229 
211```http
230```bash
212231curl https://api.anthropic.com/v1/skills \
213232 -H 'anthropic-version: 2023-06-01' \
214233 -H "X-Api-Key: $ANTHROPIC_API_KEY"
215234```
216235 
217#### Response
236#### Response (200)
218237 
219238```json
220239{
from line 256
237256 
238257## Get Skill
239258 
240**get** `/v1/skills/{skill_id}`
259**GET** `/v1/skills/{skill_id}`
241260 
242261Get Skill
243262 
244### Path Parameters
263### Path parameters
245264 
246265- `skill_id: string`
247266 
from line 270
251270 
252271### Returns
253272 
254- `Skill object { id, created_at, display_name, 4 more }`
273- `Skill object`
255274 
256275 - `id: string`
257276 
from line 282
263282 
264283 ISO 8601 timestamp of when the skill was created.
265284 
285 format: date-time
286 
266287 - `display_name: string`
267288 
268289 Human-readable, single-line label for the Skill. Maximum 255 characters.
from line 330
309330 
310331 For Skills, this is always `"skill"`.
311332 
312 - `"skill"`
333 default: skill
313334 
314335 - `updated_at: string`
315336 
316337 ISO 8601 timestamp of when the skill was last updated.
317338 
339 format: date-time
340 
318341### Example
319342 
320```http
343```bash
321344curl https://api.anthropic.com/v1/skills/$SKILL_ID \
322345 -H 'anthropic-version: 2023-06-01' \
323346 -H "X-Api-Key: $ANTHROPIC_API_KEY"
324347```
325348 
326#### Response
349#### Response (200)
327350 
328351```json
329352{
from line 364
341364 
342365## Delete Skill
343366 
344**delete** `/v1/skills/{skill_id}`
367**DELETE** `/v1/skills/{skill_id}`
345368 
346369Delete Skill
347370 
348### Path Parameters
371### Path parameters
349372 
350373- `skill_id: string`
351374 
from line 378
355378 
356379### Returns
357380 
358- `DeletedSkill object { id, type }`
381- `DeletedSkill object`
359382 
360383 - `id: string`
361384 
from line 392
369392 
370393 For Skills, this is always `"skill_deleted"`.
371394 
372 - `"skill_deleted"`
395 default: skill_deleted
373396 
374397### Example
375398 
376```http
399```bash
377400curl https://api.anthropic.com/v1/skills/$SKILL_ID \
378401 -X DELETE \
379402 -H 'anthropic-version: 2023-06-01' \
from line 403
380403 -H "X-Api-Key: $ANTHROPIC_API_KEY"
381404```
382405 
383#### Response
406#### Response (200)
384407 
385408```json
386409{
from line 412
389412}
390413```
391414 
392## Domain Types
415## Domain types
393416 
394417### Deleted Skill
395418 
396- `DeletedSkill object { id, type }`
419- `DeletedSkill object`
397420 
398421 - `id: string`
399422 
from line 430
407430 
408431 For Skills, this is always `"skill_deleted"`.
409432 
410 - `"skill_deleted"`
433 default: skill_deleted
411434 
412435### Skill
413436 
414- `Skill object { id, created_at, display_name, 4 more }`
437- `Skill object`
415438 
416439 - `id: string`
417440 
from line 446
423446 
424447 ISO 8601 timestamp of when the skill was created.
425448 
449 format: date-time
450 
426451 - `display_name: string`
427452 
428453 Human-readable, single-line label for the Skill. Maximum 255 characters.
from line 494
469494 
470495 For Skills, this is always `"skill"`.
471496 
472 - `"skill"`
497 default: skill
473498 
474499 - `updated_at: string`
475500 
476501 ISO 8601 timestamp of when the skill was last updated.
477502 
503 format: date-time
504 
478505### Skill Source
479506 
480- `SkillSource object { type }`
507- `SkillSource object`
481508 
482509 - `type: "custom" or "anthropic" or "anthropic_example" or "plugin"`
483510 
from line 525
498525 
499526 - `"plugin"`
500527 
501# Versions
528## Skills › Versions
502529 
503## Create Skill Version
530### Create Skill Version
504531 
505**post** `/v1/skills/{skill_id}/versions`
532**POST** `/v1/skills/{skill_id}/versions`
506533 
507534Create Skill Version
508535 
509### Path Parameters
536#### Path parameters
510537 
511538- `skill_id: string`
512539 
from line 541
514541 
515542 The format and length of IDs may change over time.
516543 
517### Returns
544#### Body parameters (form-data)
518545 
519- `SkillVersion object { id, created_at, description, 3 more }`
546- `files: array of string`
520547 
548 Files to upload for the skill.
549 
550 All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
551 
552#### Returns
553 
554- `SkillVersion object`
555 
521556 - `id: string`
522557 
523558 Unique identifier for this Skill Version. The id addresses the version in
from line 562
527562 
528563 ISO 8601 timestamp of when the skill was created.
529564 
565 format: date-time
566 
530567 - `description: string`
531568 
532569 Description of the skill version.
from line 589
552589 
553590 For Skill Versions, this is always `"skill_version"`.
554591 
555 - `"skill_version"`
592 default: skill_version
556593 
557### Example
594#### Example
558595 
559```http
596```bash
560597curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
561598 -H 'Content-Type: multipart/form-data' \
562599 -H 'anthropic-version: 2023-06-01' \
from line 601
564601 -F files='["Example data"]'
565602```
566603 
567#### Response
604##### Response (200)
568605 
569606```json
570607{
from line 614
577614}
578615```
579616 
580## List Skill Versions
617### List Skill Versions
581618 
582**get** `/v1/skills/{skill_id}/versions`
619**GET** `/v1/skills/{skill_id}/versions`
583620 
584621List Skill Versions
585622 
586### Path Parameters
623#### Path parameters
587624 
588625- `skill_id: string`
589626 
from line 628
591628 
592629 The format and length of IDs may change over time.
593630 
594### Query Parameters
631#### Query parameters
595632 
596633- `limit: optional number`
597634 
from line 636
599636 
600637 Ranges from `1` to `1000`. Defaults to `20`.
601638 
639 default: 20, minimum: 1, maximum: 1000
640 
602641- `page: optional string`
603642 
604643 Optionally set to the `next_page` token from the previous response.
605644 
606### Returns
645#### Returns
607646 
608647- `data: array of SkillVersion`
609648 
from line 657
618657 
619658 ISO 8601 timestamp of when the skill was created.
620659 
660 format: date-time
661 
621662 - `description: string`
622663 
623664 Description of the skill version.
from line 684
643684 
644685 For Skill Versions, this is always `"skill_version"`.
645686 
646 - `"skill_version"`
687 default: skill_version
647688 
648689- `next_page: string or null`
649690 
from line 692
651692 
652693 If `null`, there are no more results available. Pass this value to the `page` parameter in the next request to get the next page.
653694 
654### Example
695#### Example
655696 
656```http
697```bash
657698curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
658699 -H 'anthropic-version: 2023-06-01' \
659700 -H "X-Api-Key: $ANTHROPIC_API_KEY"
660701```
661702 
662#### Response
703##### Response (200)
663704 
664705```json
665706{
from line 718
677718}
678719```
679720 
680## Get Skill Version
721### Get Skill Version
681722 
682**get** `/v1/skills/{skill_id}/versions/{version}`
723**GET** `/v1/skills/{skill_id}/versions/{version}`
683724 
684725Get Skill Version
685726 
686### Path Parameters
727#### Path parameters
687728 
688729- `skill_id: string`
689730 
from line 738
697738 
698739 Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").
699740 
700### Returns
741#### Returns
701742 
702- `SkillVersion object { id, created_at, description, 3 more }`
743- `SkillVersion object`
703744 
704745 - `id: string`
705746 
from line 751
710751 
711752 ISO 8601 timestamp of when the skill was created.
712753 
754 format: date-time
755 
713756 - `description: string`
714757 
715758 Description of the skill version.
from line 778
735778 
736779 For Skill Versions, this is always `"skill_version"`.
737780 
738 - `"skill_version"`
781 default: skill_version
739782 
740### Example
783#### Example
741784 
742```http
785```bash
743786curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
744787 -H 'anthropic-version: 2023-06-01' \
745788 -H "X-Api-Key: $ANTHROPIC_API_KEY"
746789```
747790 
748#### Response
791##### Response (200)
749792 
750793```json
751794{
from line 801
758801}
759802```
760803 
761## Delete Skill Version
804### Delete Skill Version
762805 
763**delete** `/v1/skills/{skill_id}/versions/{version}`
806**DELETE** `/v1/skills/{skill_id}/versions/{version}`
764807 
765808Delete Skill Version
766809 
767### Path Parameters
810#### Path parameters
768811 
769812- `skill_id: string`
770813 
from line 821
778821 
779822 Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").
780823 
781### Returns
824#### Returns
782825 
783- `DeletedSkillVersion object { id, type }`
826- `DeletedSkillVersion object`
784827 
785828 - `id: string`
786829 
from line 836
793836 
794837 For Skill Versions, this is always `"skill_version_deleted"`.
795838 
796 - `"skill_version_deleted"`
839 default: skill_version_deleted
797840 
798### Example
841#### Example
799842 
800```http
843```bash
801844curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
802845 -X DELETE \
803846 -H 'anthropic-version: 2023-06-01' \
from line 847
804847 -H "X-Api-Key: $ANTHROPIC_API_KEY"
805848```
806849 
807#### Response
850##### Response (200)
808851 
809852```json
810853{
from line 855
812855 "type": "skill_version_deleted"
813856}
814857```
815 
816## Domain Types
817 
818### Deleted Skill Version
819 
820- `DeletedSkillVersion object { id, type }`
821 
822 - `id: string`
823 
824 Unique identifier for this Skill Version. The id addresses the version in
825 paths and pins it in references.
826 
827 - `type: "skill_version_deleted"`
828 
829 Deleted object type.
830 
831 For Skill Versions, this is always `"skill_version_deleted"`.
832 
833 - `"skill_version_deleted"`
834 
835### Skill Version
836 
837- `SkillVersion object { id, created_at, description, 3 more }`
838 
839 - `id: string`
840 
841 Unique identifier for this Skill Version. The id addresses the version in
842 paths and pins it in references.
843 
844 - `created_at: string`
845 
846 ISO 8601 timestamp of when the skill was created.
847 
848 - `description: string`
849 
850 Description of the skill version.
851 
852 This is extracted from the SKILL.md file in the skill upload.
853 
854 - `name: string`
855 
856 The Skill's immutable kebab-case slug, set at creation from the first
857 upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
858 later upload must resolve to the same value. Also the top-level directory
859 of the Skill's mounted files and the base name of a downloaded archive.
860 
861 - `skill_id: string`
862 
863 Unique identifier for the skill.
864 
865 The format and length of IDs may change over time.
866 
867 - `type: "skill_version"`
868 
869 Object type.
870 
871 For Skill Versions, this is always `"skill_version"`.
872 
873 - `"skill_version"`
874858 

api/skills/create Changed · +26 / -13 lines

# Create Skill ## Body parameters (form-data) ## Returns ## Example ### Response (200) ## Create Skill ### Returns ### Example #### Response

from line 1
1---
2title: Create Skill
3url: https://platform.claude.com/docs/en/api/skills/create
4---
1# Create Skill
52 
6## Create Skill
3**POST** `/v1/skills`
74 
8**post** `/v1/skills`
9 
105Create Skill
116 
12### Returns
7## Body parameters (form-data)
138 
14- `Skill object { id, created_at, display_name, 4 more }`
9- `files: array of string`
1510 
11 Files to upload for the skill.
12 
13 All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
14 
15- `display_name: optional string or null`
16 
17 Human-readable, single-line label for the Skill. Maximum 255 characters.
18 Always set: derived from the SKILL.md frontmatter `name` when omitted at
19 creation. Not unique.
20 
21## Returns
22 
23- `Skill object`
24 
1625 - `id: string`
1726 
1827 Unique identifier for the skill.
from line 32
2332 
2433 ISO 8601 timestamp of when the skill was created.
2534 
35 format: date-time
36 
2637 - `display_name: string`
2738 
2839 Human-readable, single-line label for the Skill. Maximum 255 characters.
from line 80
6980 
7081 For Skills, this is always `"skill"`.
7182 
72 - `"skill"`
83 default: skill
7384 
7485 - `updated_at: string`
7586 
7687 ISO 8601 timestamp of when the skill was last updated.
7788 
78### Example
89 format: date-time
7990 
80```http
91## Example
92 
93```bash
8194curl https://api.anthropic.com/v1/skills \
8295 -H 'Content-Type: multipart/form-data' \
8396 -H 'anthropic-version: 2023-06-01' \
from line 98
8598 -F files='["Example data"]'
8699```
87100 
88#### Response
101### Response (200)
89102 
90103```json
91104{

api/skills/delete Changed · +9 / -14 lines

# Delete Skill ## Path parameters ## Returns ## Example ### Response (200) ## Delete Skill ### Path Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Delete Skill
3url: https://platform.claude.com/docs/en/api/skills/delete
4---
1# Delete Skill
52 
6## Delete Skill
3**DELETE** `/v1/skills/{skill_id}`
74 
8**delete** `/v1/skills/{skill_id}`
9 
105Delete Skill
116 
12### Path Parameters
7## Path parameters
138 
149- `skill_id: string`
1510 
from line 12
1712 
1813 The format and length of IDs may change over time.
1914 
20### Returns
15## Returns
2116 
22- `DeletedSkill object { id, type }`
17- `DeletedSkill object`
2318 
2419 - `id: string`
2520 
from line 28
3328 
3429 For Skills, this is always `"skill_deleted"`.
3530 
36 - `"skill_deleted"`
31 default: skill_deleted
3732 
38### Example
33## Example
3934 
40```http
35```bash
4136curl https://api.anthropic.com/v1/skills/$SKILL_ID \
4237 -X DELETE \
4338 -H 'anthropic-version: 2023-06-01' \
from line 39
4439 -H "X-Api-Key: $ANTHROPIC_API_KEY"
4540```
4641 
47#### Response
42### Response (200)
4843 
4944```json
5045{

api/skills/list Changed · +14 / -13 lines

# List Skills ## Query parameters ## Returns ## Example ### Response (200) ## List Skills ### Query Parameters ### Returns ### Example #### Response

from line 1
1---
2title: List Skills
3url: https://platform.claude.com/docs/en/api/skills/list
4---
1# List Skills
52 
6## List Skills
3**GET** `/v1/skills`
74 
8**get** `/v1/skills`
9 
105List Skills
116 
12### Query Parameters
7## Query parameters
138 
149- `limit: optional number`
1510 
from line 12
1712 
1813 Ranges from `1` to `1000`. Defaults to `20`.
1914 
15 default: 20, minimum: 1, maximum: 1000
16 
2017- `page: optional string`
2118 
2219 Pagination token for fetching a specific page of results.
from line 29
3229 * `"custom"`: only return user-created skills
3330 * `"anthropic"`: only return Anthropic-created skills
3431 
35### Returns
32## Returns
3633 
3734- `data: array of Skill`
3835 
from line 45
4845 
4946 ISO 8601 timestamp of when the skill was created.
5047 
48 format: date-time
49 
5150 - `display_name: string`
5251 
5352 Human-readable, single-line label for the Skill. Maximum 255 characters.
from line 93
9493 
9594 For Skills, this is always `"skill"`.
9695 
97 - `"skill"`
96 default: skill
9897 
9998 - `updated_at: string`
10099 
101100 ISO 8601 timestamp of when the skill was last updated.
102101 
102 format: date-time
103 
103104- `next_page: string or null`
104105 
105106 Token for fetching the next page of results.
from line 107
106107 
107108 If `null`, there are no more results available. Pass this value to the `page` parameter in the next request to get the next page.
108109 
109### Example
110## Example
110111 
111```http
112```bash
112113curl https://api.anthropic.com/v1/skills \
113114 -H 'anthropic-version: 2023-06-01' \
114115 -H "X-Api-Key: $ANTHROPIC_API_KEY"
115116```
116117 
117#### Response
118### Response (200)
118119 
119120```json
120121{

api/skills/retrieve Changed · +13 / -14 lines

# Get Skill ## Path parameters ## Returns ## Example ### Response (200) ## Get Skill ### Path Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Get Skill
3url: https://platform.claude.com/docs/en/api/skills/retrieve
4---
1# Get Skill
52 
6## Get Skill
3**GET** `/v1/skills/{skill_id}`
74 
8**get** `/v1/skills/{skill_id}`
9 
105Get Skill
116 
12### Path Parameters
7## Path parameters
138 
149- `skill_id: string`
1510 
from line 12
1712 
1813 The format and length of IDs may change over time.
1914 
20### Returns
15## Returns
2116 
22- `Skill object { id, created_at, display_name, 4 more }`
17- `Skill object`
2318 
2419 - `id: string`
2520 
from line 26
3126 
3227 ISO 8601 timestamp of when the skill was created.
3328 
29 format: date-time
30 
3431 - `display_name: string`
3532 
3633 Human-readable, single-line label for the Skill. Maximum 255 characters.
from line 74
7774 
7875 For Skills, this is always `"skill"`.
7976 
80 - `"skill"`
77 default: skill
8178 
8279 - `updated_at: string`
8380 
8481 ISO 8601 timestamp of when the skill was last updated.
8582 
86### Example
83 format: date-time
8784 
88```http
85## Example
86 
87```bash
8988curl https://api.anthropic.com/v1/skills/$SKILL_ID \
9089 -H 'anthropic-version: 2023-06-01' \
9190 -H "X-Api-Key: $ANTHROPIC_API_KEY"
9291```
9392 
94#### Response
93### Response (200)
9594 
9695```json
9796{

api/skills/versions Changed · +47 / -34 lines

### Path parameters ### Body parameters (form-data) #### Response (200) ### Path parameters ### Query parameters #### Response (200) ### Path parameters #### Response (200) ### Path parameters #### Response (200) ## Domain types ### Path Parameters #### Response ### Path Parameters ### Query Parameters #### Response ### Path Parameters #### Response ### Path Parameters #### Response ## Domain Types

from line 1
1---
2title: Versions
3url: https://platform.claude.com/docs/en/api/skills/versions
4---
5 
61# Versions
72 
83## Create Skill Version
94 
10**post** `/v1/skills/{skill_id}/versions`
5**POST** `/v1/skills/{skill_id}/versions`
116 
127Create Skill Version
138 
14### Path Parameters
9### Path parameters
1510 
1611- `skill_id: string`
1712 
from line 14
1914 
2015 The format and length of IDs may change over time.
2116 
17### Body parameters (form-data)
18 
19- `files: array of string`
20 
21 Files to upload for the skill.
22 
23 All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
24 
2225### Returns
2326 
24- `SkillVersion object { id, created_at, description, 3 more }`
27- `SkillVersion object`
2528 
2629 - `id: string`
2730 
from line 35
3235 
3336 ISO 8601 timestamp of when the skill was created.
3437 
38 format: date-time
39 
3540 - `description: string`
3641 
3742 Description of the skill version.
from line 62
5762 
5863 For Skill Versions, this is always `"skill_version"`.
5964 
60 - `"skill_version"`
65 default: skill_version
6166 
6267### Example
6368 
64```http
69```bash
6570curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
6671 -H 'Content-Type: multipart/form-data' \
6772 -H 'anthropic-version: 2023-06-01' \
from line 74
6974 -F files='["Example data"]'
7075```
7176 
72#### Response
77#### Response (200)
7378 
7479```json
7580{
from line 89
8489 
8590## List Skill Versions
8691 
87**get** `/v1/skills/{skill_id}/versions`
92**GET** `/v1/skills/{skill_id}/versions`
8893 
8994List Skill Versions
9095 
91### Path Parameters
96### Path parameters
9297 
9398- `skill_id: string`
9499 
from line 101
96101 
97102 The format and length of IDs may change over time.
98103 
99### Query Parameters
104### Query parameters
100105 
101106- `limit: optional number`
102107 
from line 109
104109 
105110 Ranges from `1` to `1000`. Defaults to `20`.
106111 
112 default: 20, minimum: 1, maximum: 1000
113 
107114- `page: optional string`
108115 
109116 Optionally set to the `next_page` token from the previous response.
from line 130
123130 
124131 ISO 8601 timestamp of when the skill was created.
125132 
133 format: date-time
134 
126135 - `description: string`
127136 
128137 Description of the skill version.
from line 157
148157 
149158 For Skill Versions, this is always `"skill_version"`.
150159 
151 - `"skill_version"`
160 default: skill_version
152161 
153162- `next_page: string or null`
154163 
from line 167
158167 
159168### Example
160169 
161```http
170```bash
162171curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
163172 -H 'anthropic-version: 2023-06-01' \
164173 -H "X-Api-Key: $ANTHROPIC_API_KEY"
165174```
166175 
167#### Response
176#### Response (200)
168177 
169178```json
170179{
from line 193
184193 
185194## Get Skill Version
186195 
187**get** `/v1/skills/{skill_id}/versions/{version}`
196**GET** `/v1/skills/{skill_id}/versions/{version}`
188197 
189198Get Skill Version
190199 
191### Path Parameters
200### Path parameters
192201 
193202- `skill_id: string`
194203 
from line 213
204213 
205214### Returns
206215 
207- `SkillVersion object { id, created_at, description, 3 more }`
216- `SkillVersion object`
208217 
209218 - `id: string`
210219 
from line 224
215224 
216225 ISO 8601 timestamp of when the skill was created.
217226 
227 format: date-time
228 
218229 - `description: string`
219230 
220231 Description of the skill version.
from line 251
240251 
241252 For Skill Versions, this is always `"skill_version"`.
242253 
243 - `"skill_version"`
254 default: skill_version
244255 
245256### Example
246257 
247```http
258```bash
248259curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
249260 -H 'anthropic-version: 2023-06-01' \
250261 -H "X-Api-Key: $ANTHROPIC_API_KEY"
251262```
252263 
253#### Response
264#### Response (200)
254265 
255266```json
256267{
from line 276
265276 
266277## Delete Skill Version
267278 
268**delete** `/v1/skills/{skill_id}/versions/{version}`
279**DELETE** `/v1/skills/{skill_id}/versions/{version}`
269280 
270281Delete Skill Version
271282 
272### Path Parameters
283### Path parameters
273284 
274285- `skill_id: string`
275286 
from line 296
285296 
286297### Returns
287298 
288- `DeletedSkillVersion object { id, type }`
299- `DeletedSkillVersion object`
289300 
290301 - `id: string`
291302 
from line 309
298309 
299310 For Skill Versions, this is always `"skill_version_deleted"`.
300311 
301 - `"skill_version_deleted"`
312 default: skill_version_deleted
302313 
303314### Example
304315 
305```http
316```bash
306317curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
307318 -X DELETE \
308319 -H 'anthropic-version: 2023-06-01' \
from line 320
309320 -H "X-Api-Key: $ANTHROPIC_API_KEY"
310321```
311322 
312#### Response
323#### Response (200)
313324 
314325```json
315326{
from line 329
318329}
319330```
320331 
321## Domain Types
332## Domain types
322333 
323334### Deleted Skill Version
324335 
325- `DeletedSkillVersion object { id, type }`
336- `DeletedSkillVersion object`
326337 
327338 - `id: string`
328339 
from line 346
335346 
336347 For Skill Versions, this is always `"skill_version_deleted"`.
337348 
338 - `"skill_version_deleted"`
349 default: skill_version_deleted
339350 
340351### Skill Version
341352 
342- `SkillVersion object { id, created_at, description, 3 more }`
353- `SkillVersion object`
343354 
344355 - `id: string`
345356 
from line 361
350361 
351362 ISO 8601 timestamp of when the skill was created.
352363 
364 format: date-time
365 
353366 - `description: string`
354367 
355368 Description of the skill version.
from line 388
375388 
376389 For Skill Versions, this is always `"skill_version"`.
377390 
378 - `"skill_version"`
391 default: skill_version
379392 

api/skills/versions/create Changed · +19 / -14 lines

# Create Skill Version ## Path parameters ## Body parameters (form-data) ## Returns ## Example ### Response (200) ## Create Skill Version ### Path Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Create Skill Version
3url: https://platform.claude.com/docs/en/api/skills/versions/create
4---
1# Create Skill Version
52 
6## Create Skill Version
3**POST** `/v1/skills/{skill_id}/versions`
74 
8**post** `/v1/skills/{skill_id}/versions`
9 
105Create Skill Version
116 
12### Path Parameters
7## Path parameters
138 
149- `skill_id: string`
1510 
from line 12
1712 
1813 The format and length of IDs may change over time.
1914 
20### Returns
15## Body parameters (form-data)
2116 
22- `SkillVersion object { id, created_at, description, 3 more }`
17- `files: array of string`
2318 
19 Files to upload for the skill.
20 
21 All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
22 
23## Returns
24 
25- `SkillVersion object`
26 
2427 - `id: string`
2528 
2629 Unique identifier for this Skill Version. The id addresses the version in
from line 33
3033 
3134 ISO 8601 timestamp of when the skill was created.
3235 
36 format: date-time
37 
3338 - `description: string`
3439 
3540 Description of the skill version.
from line 60
5560 
5661 For Skill Versions, this is always `"skill_version"`.
5762 
58 - `"skill_version"`
63 default: skill_version
5964 
60### Example
65## Example
6166 
62```http
67```bash
6368curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
6469 -H 'Content-Type: multipart/form-data' \
6570 -H 'anthropic-version: 2023-06-01' \
from line 72
6772 -F files='["Example data"]'
6873```
6974 
70#### Response
75### Response (200)
7176 
7277```json
7378{

api/skills/versions/delete Changed · +9 / -14 lines

# Delete Skill Version ## Path parameters ## Returns ## Example ### Response (200) ## Delete Skill Version ### Path Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Delete Skill Version
3url: https://platform.claude.com/docs/en/api/skills/versions/delete
4---
1# Delete Skill Version
52 
6## Delete Skill Version
3**DELETE** `/v1/skills/{skill_id}/versions/{version}`
74 
8**delete** `/v1/skills/{skill_id}/versions/{version}`
9 
105Delete Skill Version
116 
12### Path Parameters
7## Path parameters
138 
149- `skill_id: string`
1510 
from line 18
2318 
2419 Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").
2520 
26### Returns
21## Returns
2722 
28- `DeletedSkillVersion object { id, type }`
23- `DeletedSkillVersion object`
2924 
3025 - `id: string`
3126 
from line 33
3833 
3934 For Skill Versions, this is always `"skill_version_deleted"`.
4035 
41 - `"skill_version_deleted"`
36 default: skill_version_deleted
4237 
43### Example
38## Example
4439 
45```http
40```bash
4641curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
4742 -X DELETE \
4843 -H 'anthropic-version: 2023-06-01' \
from line 44
4944 -H "X-Api-Key: $ANTHROPIC_API_KEY"
5045```
5146 
52#### Response
47### Response (200)
5348 
5449```json
5550{

api/skills/versions/list Changed · +13 / -14 lines

# List Skill Versions ## Path parameters ## Query parameters ## Returns ## Example ### Response (200) ## List Skill Versions ### Path Parameters ### Query Parameters ### Returns ### Example #### Response

from line 1
1---
2title: List Skill Versions
3url: https://platform.claude.com/docs/en/api/skills/versions/list
4---
1# List Skill Versions
52 
6## List Skill Versions
3**GET** `/v1/skills/{skill_id}/versions`
74 
8**get** `/v1/skills/{skill_id}/versions`
9 
105List Skill Versions
116 
12### Path Parameters
7## Path parameters
138 
149- `skill_id: string`
1510 
from line 12
1712 
1813 The format and length of IDs may change over time.
1914 
20### Query Parameters
15## Query parameters
2116 
2217- `limit: optional number`
2318 
from line 20
2520 
2621 Ranges from `1` to `1000`. Defaults to `20`.
2722 
23 default: 20, minimum: 1, maximum: 1000
24 
2825- `page: optional string`
2926 
3027 Optionally set to the `next_page` token from the previous response.
3128 
32### Returns
29## Returns
3330 
3431- `data: array of SkillVersion`
3532 
from line 41
4441 
4542 ISO 8601 timestamp of when the skill was created.
4643 
44 format: date-time
45 
4746 - `description: string`
4847 
4948 Description of the skill version.
from line 68
6968 
7069 For Skill Versions, this is always `"skill_version"`.
7170 
72 - `"skill_version"`
71 default: skill_version
7372 
7473- `next_page: string or null`
7574 
from line 76
7776 
7877 If `null`, there are no more results available. Pass this value to the `page` parameter in the next request to get the next page.
7978 
80### Example
79## Example
8180 
82```http
81```bash
8382curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
8483 -H 'anthropic-version: 2023-06-01' \
8584 -H "X-Api-Key: $ANTHROPIC_API_KEY"
8685```
8786 
88#### Response
87### Response (200)
8988 
9089```json
9190{

api/skills/versions/retrieve Changed · +11 / -14 lines

# Get Skill Version ## Path parameters ## Returns ## Example ### Response (200) ## Get Skill Version ### Path Parameters ### Returns ### Example #### Response

from line 1
1---
2title: Get Skill Version
3url: https://platform.claude.com/docs/en/api/skills/versions/retrieve
4---
1# Get Skill Version
52 
6## Get Skill Version
3**GET** `/v1/skills/{skill_id}/versions/{version}`
74 
8**get** `/v1/skills/{skill_id}/versions/{version}`
9 
105Get Skill Version
116 
12### Path Parameters
7## Path parameters
138 
149- `skill_id: string`
1510 
from line 18
2318 
2419 Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").
2520 
26### Returns
21## Returns
2722 
28- `SkillVersion object { id, created_at, description, 3 more }`
23- `SkillVersion object`
2924 
3025 - `id: string`
3126 
from line 31
3631 
3732 ISO 8601 timestamp of when the skill was created.
3833 
34 format: date-time
35 
3936 - `description: string`
4037 
4138 Description of the skill version.
from line 58
6158 
6259 For Skill Versions, this is always `"skill_version"`.
6360 
64 - `"skill_version"`
61 default: skill_version
6562 
66### Example
63## Example
6764 
68```http
65```bash
6966curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
7067 -H 'anthropic-version: 2023-06-01' \
7168 -H "X-Api-Key: $ANTHROPIC_API_KEY"
7269```
7370 
74#### Response
71### Response (200)
7572 
7673```json
7774{

build-with-claude/claude-platform-on-aws Changed · +22 / -22 lines

from line 773
773773 
774774### Managing workspaces
775775 
776Create additional workspaces, rename a workspace, or archive a workspace from the AWS Console **Workspaces** page or with the [Admin API](https://platform.claude.com/docs/en/manage-claude/admin-api) workspace endpoints. A new workspace is bound to the AWS region of the endpoint you call to create it (see [Workspace scoping](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#workspace-scoping)). The Claude Console Workspaces page is read-only.
776Create additional workspaces, rename a workspace, or archive a workspace from the AWS Console **Workspaces** page or with the [Admin API](https://platform.claude.com/docs/en/manage-claude/admin-api) workspace endpoints. A new workspace is bound to the AWS region of the endpoint you call to create it (see [Workspace scoping](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#workspace-scoping)). With the Admin role, you can also create, rename, and archive workspaces from the Claude Console **Workspaces** page.
777777 
778778## Using the Claude Console
779779 
780Claude Platform on AWS uses the standard Claude Console at [platform.claude.com](https://platform.claude.com). When you sign in from the AWS Console, an **Account managed by AWS** indicator appears in the bottom-left of the Claude Console sidebar and the Console scopes to your Claude Platform on AWS organization. It provides usage analytics, cost breakdowns, rate limit visibility, workspace visibility, and pages for managing files, Agent Skills, batch jobs, and Claude Managed Agents resources (agents, sessions, environments, credential vaults, memory stores, and webhooks).
780Claude Platform on AWS uses the standard Claude Console at [platform.claude.com](https://platform.claude.com). When you sign in from the AWS Console, an **Account managed by AWS** indicator appears in the bottom-left of the Claude Console sidebar and the Console scopes to your Claude Platform on AWS organization. It provides usage analytics, cost breakdowns, rate limit visibility, workspace management, and pages for managing files, Agent Skills, batch jobs, and Claude Managed Agents resources (agents, sessions, environments, credential vaults, memory stores, and webhooks).
781781 
782782### Signing in
783783 
from line 794
794794 
795795The **Through AWS gateway** column indicates whether the page reads and writes data through the AWS gateway (and is therefore governed by [IAM actions](https://platform.claude.com/docs/en/api/claude-platform-on-aws-iam-actions)). Pages marked **No** read organization-level metadata directly from Anthropic and bypass IAM action checks.
796796 
797| Page | Available | Through AWS gateway | Notes |
798| --------------------- | ------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
799| **Usage** | Yes | No | View token usage by model, workspace, and dimension. Data can take a few minutes to appear after a request. |
800| **Cost** | Yes | No | View cost breakdowns by model and workspace. AWS Cost Explorer shows the aggregated [Claude Consumption Unit (CCU)](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#billing) line item. |
801| **Rate limits** | Yes | No | View rate limits (read-only). Tier increases go through your Anthropic account representative; see [Rate limits and quotas](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#rate-limits-and-quotas). |
802| **Workspaces** | Yes | No | View per-region workspaces (read-only) and set per-workspace [spend limits](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#spend-limits). |
803| **Files** | Yes | Yes | View and manage uploaded files. |
804| **Skills** | Yes | Yes | View and manage Agent Skills. |
805| **Batches** | Yes | Yes | View and manage batch processing jobs. |
806| **Agents** | Yes | Yes | View and manage agent definitions. |
807| **Sessions** | Yes | Yes | View agent sessions and event history. |
808| **Environments** | Yes | Yes | View and manage cloud sandbox configurations for sessions. |
809| **Credential vaults** | Yes | Yes | View and manage credential vaults for session authentication. |
810| **Memory stores** | Yes | Yes | View and manage persistent agent memory. |
811| **Webhooks** | Yes | Yes | View and manage webhook endpoints under **Settings → Webhooks**. |
812| **API keys** | No | N/A | Manage API keys in the AWS Console (**Claude Platform on AWS → API keys**). See [API key authentication](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#api-key-authentication). |
813| **Members** | No | N/A | Not applicable. AWS IAM manages access. |
814| **Billing** | Yes (limited) | No | Set an organization monthly spend limit; see [Spend limits](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#spend-limits). AWS Marketplace manages invoicing. View cost breakdowns on the Cost page. |
815| **Claude Code** | No | N/A | View Claude Code usage on the Usage page. |
797| Page | Available | Through AWS gateway | Notes |
798| --------------------- | ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
799| **Usage** | Yes | No | View token usage by model, workspace, and dimension. Data can take a few minutes to appear after a request. |
800| **Cost** | Yes | No | View cost breakdowns by model and workspace. AWS Cost Explorer shows the aggregated [Claude Consumption Unit (CCU)](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#billing) line item. |
801| **Rate limits** | Yes | No | View rate limits (read-only). Tier increases go through your Anthropic account representative; see [Rate limits and quotas](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#rate-limits-and-quotas). |
802| **Workspaces** | Yes | Yes (except spend limits) | View per-region workspaces. With the Admin role, you can also create, rename, and archive workspaces, and set per-workspace [spend limits](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#spend-limits). |
803| **Files** | Yes | Yes | View and manage uploaded files. |
804| **Skills** | Yes | Yes | View and manage Agent Skills. |
805| **Batches** | Yes | Yes | View and manage batch processing jobs. |
806| **Agents** | Yes | Yes | View and manage agent definitions. |
807| **Sessions** | Yes | Yes | View agent sessions and event history. |
808| **Environments** | Yes | Yes | View and manage cloud sandbox configurations for sessions. |
809| **Credential vaults** | Yes | Yes | View and manage credential vaults for session authentication. |
810| **Memory stores** | Yes | Yes | View and manage persistent agent memory. |
811| **Webhooks** | Yes | Yes | View and manage webhook endpoints under **Settings → Webhooks**. |
812| **API keys** | No | N/A | Manage API keys in the AWS Console (**Claude Platform on AWS → API keys**). See [API key authentication](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#api-key-authentication). |
813| **Members** | No | N/A | Not applicable. AWS IAM manages access. |
814| **Billing** | Yes (limited) | No | Set an organization monthly spend limit; see [Spend limits](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#spend-limits). AWS Marketplace manages invoicing. View cost breakdowns on the Cost page. |
815| **Claude Code** | No | N/A | View Claude Code usage on the Usage page. |
816816 
817817### Switching organizations
818818 
from line 845
845845You can also set your own monthly spend limits below the cap, after adding at least one recipient under **Email recipients** on the Billing page:
846846 
847847* **Organization spend limit:** Go to [Settings > Billing](https://platform.claude.com/settings/billing) in the [Claude Console](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#using-the-claude-console) to set a monthly spend limit.
848* **Workspace spend limits:** Select a workspace under [Settings > Workspaces](https://platform.claude.com/settings/workspaces) and open its **Spend limits** page. Workspace details are otherwise read-only in the Claude Console on Claude Platform on AWS.
848* **Workspace spend limits:** Select a workspace under [Settings > Workspaces](https://platform.claude.com/settings/workspaces) and open its **Spend limits** page.
849849 
850850When usage reaches a limit you set, requests fail with HTTP 400 (see the [spend limit error](https://platform.claude.com/docs/en/api/rate-limits#setting-your-own-spend-limit)) until 00:00 UTC on the first day of the next month, or until you raise or remove the limit.
851851 
Feedback