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

Retrieve Message Batch results changedapi/beta/messages/batches/results

Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+363added
Lines−236removed
From line 1 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits26to this page, all time

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

The whole hunk

from line 1, old and new numbered
/
lines

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

from line 1
1---
2title: Retrieve Message Batch results
3url: https://platform.claude.com/docs/en/api/beta/messages/batches/results
4---
5 
6## Retrieve Message Batch results
7 
8**get** `/v1/messages/batches/{message_batch_id}/results`
1# Retrieve Message Batch results
2 
3**GET** `/v1/messages/batches/{message_batch_id}/results`
94 
105Streams the results of a Message Batch as a `.jsonl` file.
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### Path Parameters
11## Path parameters
1712 
1813- `message_batch_id: string`
1914 
2015 ID of the Message Batch.
2116 
22### Header Parameters
17## Headers
2318 
2419- `"anthropic-beta": optional array of AnthropicBeta`
2520 
from line 92
9792 
9893 - `"mid-conversation-tool-changes-2026-07-01"`
9994 
100### Returns
101 
102- `BetaMessageBatchIndividualResponse object { custom_id, result }`
95## Returns
96 
97- `BetaMessageBatchIndividualResponse object`
10398 
10499 This is a single line in the response `.jsonl` file and does not represent the response as a whole.
105100 
from line 110
115110 
116111 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.
117112 
118 - `BetaMessageBatchSucceededResult object { message, type }`
113 - `BetaMessageBatchSucceededResult object`
119114 
120115 - `message: BetaMessage`
121116 
from line 132
137132 
138133 The time at which the container will expire.
139134 
135 format: date-time
136 
140137 - `skills: array of BetaSkill or null`
141138 
142139 Skills loaded in the container
from line 142
145142 
146143 Skill ID
147144 
145 maxLength: 64, minLength: 1
146 
148147 - `type: "anthropic" or "custom"`
149148 
150149 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
from line 155
156155 - `version: string`
157156 
158157 The resolved version: a skill version ID for custom skills.
158 
159 maxLength: 64, minLength: 1
159160 
160161 - `content: array of BetaContentBlock`
161162 
from line 187
186187 [{"type": "text", "text": "B)"}]
187188 ```
188189 
189 - `BetaTextBlock object { citations, text, type }`
190 - `BetaTextBlock object`
190191 
191192 - `citations: array of BetaTextCitation or null`
192193 
from line 195
194195 
195196 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`.
196197 
197 - `BetaCitationCharLocation object { cited_text, document_index, document_title, 4 more }`
198 - `BetaCitationCharLocation object`
198199 
199200 - `cited_text: string`
200201 
201202 - `document_index: number`
202203 
204 minimum: 0
205 
203206 - `document_title: string or null`
204207 
205208 - `end_char_index: number`
from line 211
208211 
209212 - `start_char_index: number`
210213 
214 minimum: 0
215 
211216 - `type: "char_location"`
212217 
213 - `"char_location"`
214 
215 - `BetaCitationPageLocation object { cited_text, document_index, document_title, 4 more }`
218 default: char_location
219 
220 - `BetaCitationPageLocation object`
216221 
217222 - `cited_text: string`
218223 
219224 - `document_index: number`
220225 
226 minimum: 0
227 
221228 - `document_title: string or null`
222229 
223230 - `end_page_number: number`
from line 233
226233 
227234 - `start_page_number: number`
228235 
236 minimum: 1
237 
229238 - `type: "page_location"`
230239 
231 - `"page_location"`
232 
233 - `BetaCitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
240 default: page_location
241 
242 - `BetaCitationContentBlockLocation object`
234243 
235244 - `cited_text: string`
236245 
from line 249
240249 
241250 - `document_index: number`
242251 
252 minimum: 0
253 
243254 - `document_title: string or null`
244255 
245256 - `end_block_index: number`
from line 265
254265 
255266 0-based index of the first cited block in the source's `content` array.
256267 
268 minimum: 0
269 
257270 - `type: "content_block_location"`
258271 
259 - `"content_block_location"`
260 
261 - `BetaCitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
272 default: content_block_location
273 
274 - `BetaCitationsWebSearchResultLocation object`
262275 
263276 - `cited_text: string`
264277 
from line 279
266279 
267280 - `title: string or null`
268281 
282 maxLength: 512
283 
269284 - `type: "web_search_result_location"`
270285 
271 - `"web_search_result_location"`
286 default: web_search_result_location
272287 
273288 - `url: string`
274289 
275 - `BetaCitationSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
290 - `BetaCitationSearchResultLocation object`
276291 
277292 - `cited_text: string`
278293 
from line 307
292307 
293308 Counted separately from `document_index`; server-side web search results are not included in this count.
294309 
310 minimum: 0
311 
295312 - `source: string`
296313 
297314 - `start_block_index: number`
298315 
299316 0-based index of the first cited block in the source's `content` array.
300317 
318 minimum: 0
319 
301320 - `title: string or null`
302321 
303322 - `type: "search_result_location"`
304323 
305 - `"search_result_location"`
324 default: search_result_location
306325 
307326 - `text: string`
308327 
328 maxLength: 5000000, minLength: 0
329 
309330 - `type: "text"`
310331 
311 - `"text"`
312 
313 - `BetaThinkingBlock object { signature, thinking, type }`
332 default: text
333 
334 - `BetaThinkingBlock object`
314335 
315336 - `signature: string`
316337 
from line 347
326347 
327348 - `type: "thinking"`
328349 
329 - `"thinking"`
330 
331 - `BetaRedactedThinkingBlock object { data, type }`
350 default: thinking
351 
352 - `BetaRedactedThinkingBlock object`
332353 
333354 - `data: string`
334355 
from line 361
340361 
341362 - `type: "redacted_thinking"`
342363 
343 - `"redacted_thinking"`
344 
345 - `BetaToolUseBlock object { id, input, name, 3 more }`
364 default: redacted_thinking
365 
366 - `BetaToolUseBlock object`
346367 
347368 - `id: string`
348369 
370 pattern: ^[a-zA-Z0-9_-]+$
371 
349372 - `input: map[unknown]`
350373 
351374 - `name: string`
352375 
376 minLength: 1
377 
353378 - `type: "tool_use"`
354379 
355 - `"tool_use"`
380 default: tool_use
356381 
357382 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
358383 
359384 Tool invocation directly from the model.
360385 
361 - `BetaDirectCaller object { type }`
386 - `BetaDirectCaller object`
362387 
363388 Tool invocation directly from the model.
364389 
365390 - `type: "direct"`
366391 
367 - `"direct"`
368 
369 - `BetaServerToolCaller object { tool_id, type }`
392 - `BetaServerToolCaller object`
370393 
371394 Tool invocation generated by a server-side tool.
372395 
373396 - `tool_id: string`
374397 
398 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
399 
375400 - `type: "code_execution_20250825"`
376401 
377 - `"code_execution_20250825"`
378 
379 - `BetaServerToolCaller20260120 object { tool_id, type }`
402 - `BetaServerToolCaller20260120 object`
380403 
381404 - `tool_id: string`
382405 
406 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
407 
383408 - `type: "code_execution_20260120"`
384409 
385 - `"code_execution_20260120"`
386 
387410 - `toolset_name: optional string or null`
388411 
389412 For a toolset member tool_use, the toolset family.
390413 
391 - `BetaServerToolUseBlock object { id, input, name, 2 more }`
414 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
415 
416 - `BetaServerToolUseBlock object`
392417 
393418 - `id: string`
394419 
420 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
421 
395422 - `input: map[unknown]`
396423 
397424 - `name: "advisor" or "web_search" or "web_fetch" or 5 more`
from line 441
414441 
415442 - `type: "server_tool_use"`
416443 
417 - `"server_tool_use"`
444 default: server_tool_use
418445 
419446 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
420447 
421448 Tool invocation directly from the model.
422449 
423 - `BetaDirectCaller object { type }`
450 - `BetaDirectCaller object`
424451 
425452 Tool invocation directly from the model.
426453 
427 - `BetaServerToolCaller object { tool_id, type }`
454 - `BetaServerToolCaller object`
428455 
429456 Tool invocation generated by a server-side tool.
430457 
431 - `BetaServerToolCaller20260120 object { tool_id, type }`
432 
433 - `BetaWebSearchToolResultBlock object { content, tool_use_id, type, caller }`
458 - `BetaServerToolCaller20260120 object`
459 
460 - `BetaWebSearchToolResultBlock object`
434461 
435462 - `content: BetaWebSearchToolResultBlockContent`
436463 
437 - `BetaWebSearchToolResultError object { error_code, type }`
464 - `BetaWebSearchToolResultError object`
438465 
439466 - `error_code: BetaWebSearchToolResultErrorCode`
440467 
from line 479
452479 
453480 - `type: "web_search_tool_result_error"`
454481 
455 - `"web_search_tool_result_error"`
482 default: web_search_tool_result_error
456483 
457484 - `array of BetaWebSearchResultBlock`
458485 
from line 491
464491 
465492 - `type: "web_search_result"`
466493 
467 - `"web_search_result"`
494 default: web_search_result
468495 
469496 - `url: string`
470497 
471498 - `tool_use_id: string`
472499 
500 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
501 
473502 - `type: "web_search_tool_result"`
474503 
475 - `"web_search_tool_result"`
504 default: web_search_tool_result
476505 
477506 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
478507 
479508 Tool invocation directly from the model.
480509 
481 - `BetaDirectCaller object { type }`
510 - `BetaDirectCaller object`
482511 
483512 Tool invocation directly from the model.
484513 
485 - `BetaServerToolCaller object { tool_id, type }`
514 - `BetaServerToolCaller object`
486515 
487516 Tool invocation generated by a server-side tool.
488517 
489 - `BetaServerToolCaller20260120 object { tool_id, type }`
490 
491 - `BetaWebFetchToolResultBlock object { content, tool_use_id, type, caller }`
518 - `BetaServerToolCaller20260120 object`
519 
520 - `BetaWebFetchToolResultBlock object`
492521 
493522 - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
494523 
495 - `BetaWebFetchToolResultErrorBlock object { error_code, type }`
524 - `BetaWebFetchToolResultErrorBlock object`
496525 
497526 - `error_code: BetaWebFetchToolResultErrorCode`
498527 
from line 545
516545 
517546 - `type: "web_fetch_tool_result_error"`
518547 
519 - `"web_fetch_tool_result_error"`
520 
521 - `BetaWebFetchBlock object { content, retrieved_at, type, url }`
548 default: web_fetch_tool_result_error
549 
550 - `BetaWebFetchBlock object`
522551 
523552 - `content: BetaDocumentBlock`
524553 
from line 557
528557 
529558 - `enabled: boolean`
530559 
560 default: false
561 
531562 - `source: BetaBase64PDFSource or BetaPlainTextSource`
532563 
533 - `BetaBase64PDFSource object { data, media_type, type }`
564 - `BetaBase64PDFSource object`
534565 
535566 - `data: string`
536567 
568 format: byte
569 
537570 - `media_type: "application/pdf"`
538571 
539 - `"application/pdf"`
540 
541572 - `type: "base64"`
542573 
543 - `"base64"`
544 
545 - `BetaPlainTextSource object { data, media_type, type }`
574 - `BetaPlainTextSource object`
546575 
547576 - `data: string`
548577 
549578 - `media_type: "text/plain"`
550579 
551 - `"text/plain"`
552 
553580 - `type: "text"`
554581 
555 - `"text"`
556 
557582 - `title: string or null`
558583 
559584 The title of the document
560585 
561586 - `type: "document"`
562587 
563 - `"document"`
588 default: document
564589 
565590 - `retrieved_at: string or null`
566591 
from line 593
568593 
569594 - `type: "web_fetch_result"`
570595 
571 - `"web_fetch_result"`
596 default: web_fetch_result
572597 
573598 - `url: string`
574599 
from line 601
576601 
577602 - `tool_use_id: string`
578603 
604 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
605 
579606 - `type: "web_fetch_tool_result"`
580607 
581 - `"web_fetch_tool_result"`
608 default: web_fetch_tool_result
582609 
583610 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
584611 
585612 Tool invocation directly from the model.
586613 
587 - `BetaDirectCaller object { type }`
614 - `BetaDirectCaller object`
588615 
589616 Tool invocation directly from the model.
590617 
591 - `BetaServerToolCaller object { tool_id, type }`
618 - `BetaServerToolCaller object`
592619 
593620 Tool invocation generated by a server-side tool.
594621 
595 - `BetaServerToolCaller20260120 object { tool_id, type }`
596 
597 - `BetaAdvisorToolResultBlock object { content, tool_use_id, type }`
622 - `BetaServerToolCaller20260120 object`
623 
624 - `BetaAdvisorToolResultBlock object`
598625 
599626 - `content: BetaAdvisorToolResultError or BetaAdvisorResultBlock or BetaAdvisorRedactedResultBlock`
600627 
601 - `BetaAdvisorToolResultError object { error_code, type }`
628 - `BetaAdvisorToolResultError object`
602629 
603630 - `error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more`
604631 
from line 645
618645 
619646 - `type: "advisor_tool_result_error"`
620647 
621 - `"advisor_tool_result_error"`
622 
623 - `BetaAdvisorResultBlock object { stop_reason, text, type }`
648 default: advisor_tool_result_error
649 
650 - `BetaAdvisorResultBlock object`
624651 
625652 - `stop_reason: string or null`
626653 
from line 657
630657 
631658 - `type: "advisor_result"`
632659 
633 - `"advisor_result"`
634 
635 - `BetaAdvisorRedactedResultBlock object { encrypted_content, stop_reason, type }`
660 default: advisor_result
661 
662 - `BetaAdvisorRedactedResultBlock object`
636663 
637664 - `encrypted_content: string`
638665 
from line 671
644671 
645672 - `type: "advisor_redacted_result"`
646673 
647 - `"advisor_redacted_result"`
674 default: advisor_redacted_result
648675 
649676 - `tool_use_id: string`
650677 
678 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
679 
651680 - `type: "advisor_tool_result"`
652681 
653 - `"advisor_tool_result"`
654 
655 - `BetaCodeExecutionToolResultBlock object { content, tool_use_id, type }`
682 default: advisor_tool_result
683 
684 - `BetaCodeExecutionToolResultBlock object`
656685 
657686 - `content: BetaCodeExecutionToolResultBlockContent`
658687 
659688 Code execution result with encrypted stdout for PFC + web_search results.
660689 
661 - `BetaCodeExecutionToolResultError object { error_code, type }`
690 - `BetaCodeExecutionToolResultError object`
662691 
663692 - `error_code: BetaCodeExecutionToolResultErrorCode`
664693 
from line 701
672701 
673702 - `type: "code_execution_tool_result_error"`
674703 
675 - `"code_execution_tool_result_error"`
676 
677 - `BetaCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
704 default: code_execution_tool_result_error
705 
706 - `BetaCodeExecutionResultBlock object`
678707 
679708 - `content: array of BetaCodeExecutionOutputBlock`
680709 
from line 711
682711 
683712 - `type: "code_execution_output"`
684713 
685 - `"code_execution_output"`
714 default: code_execution_output
686715 
687716 - `return_code: number`
688717 
from line 721
692721 
693722 - `type: "code_execution_result"`
694723 
695 - `"code_execution_result"`
696 
697 - `BetaEncryptedCodeExecutionResultBlock object { content, encrypted_stdout, return_code, 2 more }`
724 default: code_execution_result
725 
726 - `BetaEncryptedCodeExecutionResultBlock object`
698727 
699728 Code execution result with encrypted stdout for PFC + web_search results.
700729 
from line 733
704733 
705734 - `type: "code_execution_output"`
706735 
736 default: code_execution_output
737 
707738 - `encrypted_stdout: string`
708739 
709740 - `return_code: number`
from line 743
712743 
713744 - `type: "encrypted_code_execution_result"`
714745 
715 - `"encrypted_code_execution_result"`
746 default: encrypted_code_execution_result
716747 
717748 - `tool_use_id: string`
718749 
750 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
751 
719752 - `type: "code_execution_tool_result"`
720753 
721 - `"code_execution_tool_result"`
722 
723 - `BetaBashCodeExecutionToolResultBlock object { content, tool_use_id, type }`
754 default: code_execution_tool_result
755 
756 - `BetaBashCodeExecutionToolResultBlock object`
724757 
725758 - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
726759 
727 - `BetaBashCodeExecutionToolResultError object { error_code, type }`
760 - `BetaBashCodeExecutionToolResultError object`
728761 
729762 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
730763 
from line 773
740773 
741774 - `type: "bash_code_execution_tool_result_error"`
742775 
743 - `"bash_code_execution_tool_result_error"`
744 
745 - `BetaBashCodeExecutionResultBlock object { content, return_code, stderr, 2 more }`
776 default: bash_code_execution_tool_result_error
777 
778 - `BetaBashCodeExecutionResultBlock object`
746779 
747780 - `content: array of BetaBashCodeExecutionOutputBlock`
748781 
from line 783
750783 
751784 - `type: "bash_code_execution_output"`
752785 
753 - `"bash_code_execution_output"`
786 default: bash_code_execution_output
754787 
755788 - `return_code: number`
756789 
from line 793
760793 
761794 - `type: "bash_code_execution_result"`
762795 
763 - `"bash_code_execution_result"`
796 default: bash_code_execution_result
764797 
765798 - `tool_use_id: string`
766799 
800 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
801 
767802 - `type: "bash_code_execution_tool_result"`
768803 
769 - `"bash_code_execution_tool_result"`
770 
771 - `BetaTextEditorCodeExecutionToolResultBlock object { content, tool_use_id, type }`
804 default: bash_code_execution_tool_result
805 
806 - `BetaTextEditorCodeExecutionToolResultBlock object`
772807 
773808 - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
774809 
775 - `BetaTextEditorCodeExecutionToolResultError object { error_code, error_message, type }`
810 - `BetaTextEditorCodeExecutionToolResultError object`
776811 
777812 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
778813 
from line 825
790825 
791826 - `type: "text_editor_code_execution_tool_result_error"`
792827 
793 - `"text_editor_code_execution_tool_result_error"`
794 
795 - `BetaTextEditorCodeExecutionViewResultBlock object { content, file_type, num_lines, 3 more }`
828 default: text_editor_code_execution_tool_result_error
829 
830 - `BetaTextEditorCodeExecutionViewResultBlock object`
796831 
797832 - `content: string`
798833 
from line 847
812847 
813848 - `type: "text_editor_code_execution_view_result"`
814849 
815 - `"text_editor_code_execution_view_result"`
816 
817 - `BetaTextEditorCodeExecutionCreateResultBlock object { is_file_update, type }`
850 default: text_editor_code_execution_view_result
851 
852 - `BetaTextEditorCodeExecutionCreateResultBlock object`
818853 
819854 - `is_file_update: boolean`
820855 
821856 - `type: "text_editor_code_execution_create_result"`
822857 
823 - `"text_editor_code_execution_create_result"`
824 
825 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object { lines, new_lines, new_start, 3 more }`
858 default: text_editor_code_execution_create_result
859 
860 - `BetaTextEditorCodeExecutionStrReplaceResultBlock object`
826861 
827862 - `lines: array of string or null`
828863 
from line 871
836871 
837872 - `type: "text_editor_code_execution_str_replace_result"`
838873 
839 - `"text_editor_code_execution_str_replace_result"`
874 default: text_editor_code_execution_str_replace_result
840875 
841876 - `tool_use_id: string`
842877 
878 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
879 
843880 - `type: "text_editor_code_execution_tool_result"`
844881 
845 - `"text_editor_code_execution_tool_result"`
846 
847 - `BetaToolSearchToolResultBlock object { content, tool_use_id, type }`
882 default: text_editor_code_execution_tool_result
883 
884 - `BetaToolSearchToolResultBlock object`
848885 
849886 - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
850887 
851 - `BetaToolSearchToolResultError object { error_code, error_message, type }`
888 - `BetaToolSearchToolResultError object`
852889 
853890 - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
854891 
from line 901
864901 
865902 - `type: "tool_search_tool_result_error"`
866903 
867 - `"tool_search_tool_result_error"`
868 
869 - `BetaToolSearchToolSearchResultBlock object { tool_references, type }`
904 default: tool_search_tool_result_error
905 
906 - `BetaToolSearchToolSearchResultBlock object`
870907 
871908 - `tool_references: array of BetaToolReferenceBlock`
872909 
873910 - `tool_name: string`
874911 
912 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
913 
875914 - `type: "tool_reference"`
876915 
877 - `"tool_reference"`
916 default: tool_reference
878917 
879918 - `type: "tool_search_tool_search_result"`
880919 
881 - `"tool_search_tool_search_result"`
920 default: tool_search_tool_search_result
882921 
883922 - `tool_use_id: string`
884923 
924 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
925 
885926 - `type: "tool_search_tool_result"`
886927 
887 - `"tool_search_tool_result"`
888 
889 - `BetaMCPToolUseBlock object { id, input, name, 2 more }`
928 default: tool_search_tool_result
929 
930 - `BetaMCPToolUseBlock object`
890931 
891932 - `id: string`
892933 
934 pattern: ^[a-zA-Z0-9_-]+$
935 
893936 - `input: map[unknown]`
894937 
895938 - `name: string`
from line 945
902945 
903946 - `type: "mcp_tool_use"`
904947 
905 - `"mcp_tool_use"`
906 
907 - `BetaMCPToolResultBlock object { content, is_error, tool_use_id, type }`
948 default: mcp_tool_use
949 
950 - `BetaMCPToolResultBlock object`
908951 
909952 - `content: string or array of BetaTextBlock`
910953 
from line 963
920963 
921964 - `text: string`
922965 
966 maxLength: 5000000, minLength: 0
967 
923968 - `type: "text"`
924969 
970 default: text
971 
925972 - `is_error: boolean`
926973 
974 default: false
975 
927976 - `tool_use_id: string`
928977 
978 pattern: ^[a-zA-Z0-9_-]+$
979 
929980 - `type: "mcp_tool_result"`
930981 
931 - `"mcp_tool_result"`
932 
933 - `BetaContainerUploadBlock object { file_id, type }`
982 default: mcp_tool_result
983 
984 - `BetaContainerUploadBlock object`
934985 
935986 Response model for a file uploaded to the container.
936987 
from line 989
938989 
939990 - `type: "container_upload"`
940991 
941 - `"container_upload"`
942 
943 - `BetaCompactionBlock object { content, encrypted_content, type }`
992 default: container_upload
993 
994 - `BetaCompactionBlock object`
944995 
945996 A compaction block returned when autocompact is triggered.
946997 
from line 1009
9581009 
9591010 - `type: "compaction"`
9601011 
961 - `"compaction"`
962 
963 - `BetaFallbackBlock object { from, to, trigger, type }`
1012 default: compaction
1013 
1014 - `BetaFallbackBlock object`
9641015 
9651016 Marks the point in `content` where one model's output gives way to the next.
9661017 
from line 1137
10861137 
10871138 - `type: "refusal"`
10881139 
1089 - `"refusal"`
1140 default: refusal
10901141 
10911142 - `type: "fallback"`
10921143 
1093 - `"fallback"`
1144 default: fallback
10941145 
10951146 - `context_management: BetaContextManagementResponse or null`
10961147 
from line 1153
11021153 
11031154 List of context management edits that were applied.
11041155 
1105 - `BetaClearToolUses20250919EditResponse object { cleared_input_tokens, cleared_tool_uses, type }`
1156 - `BetaClearToolUses20250919EditResponse object`
11061157 
11071158 - `cleared_input_tokens: number`
11081159 
11091160 Number of input tokens cleared by this edit.
11101161 
1162 minimum: 0
1163 
11111164 - `cleared_tool_uses: number`
11121165 
11131166 Number of tool uses that were cleared.
11141167 
1168 minimum: 0
1169 
11151170 - `type: "clear_tool_uses_20250919"`
11161171 
11171172 The type of context management edit applied.
11181173 
1119 - `"clear_tool_uses_20250919"`
1120 
1121 - `BetaClearThinking20251015EditResponse object { cleared_input_tokens, cleared_thinking_turns, type }`
1174 default: clear_tool_uses_20250919
1175 
1176 - `BetaClearThinking20251015EditResponse object`
11221177 
11231178 - `cleared_input_tokens: number`
11241179 
11251180 Number of input tokens cleared by this edit.
11261181 
1182 minimum: 0
1183 
11271184 - `cleared_thinking_turns: number`
11281185 
11291186 Number of thinking turns that were cleared.
11301187 
1188 minimum: 0
1189 
11311190 - `type: "clear_thinking_20251015"`
11321191 
11331192 The type of context management edit applied.
11341193 
1135 - `"clear_thinking_20251015"`
1194 default: clear_thinking_20251015
11361195 
11371196 - `diagnostics: BetaDiagnostics or null`
11381197 
from line 1202
11431202 
11441203 Explains why the prompt cache could not fully reuse the prefix from the request identified by `diagnostics.previous_message_id`. `null` means diagnosis is still pending — the response was serialized before the background comparison completed.
11451204 
1146 - `BetaCacheMissModelChanged object { cache_missed_input_tokens, type }`
1205 - `BetaCacheMissModelChanged object`
11471206 
11481207 - `cache_missed_input_tokens: number`
11491208 
from line 1210
11511210 
11521211 - `type: "model_changed"`
11531212 
1154 - `"model_changed"`
1155 
1156 - `BetaCacheMissSystemChanged object { cache_missed_input_tokens, type }`
1213 default: model_changed
1214 
1215 - `BetaCacheMissSystemChanged object`
11571216 
11581217 - `cache_missed_input_tokens: number`
11591218 
from line 1220
11611220 
11621221 - `type: "system_changed"`
11631222 
1164 - `"system_changed"`
1165 
1166 - `BetaCacheMissToolsChanged object { cache_missed_input_tokens, type }`
1223 default: system_changed
1224 
1225 - `BetaCacheMissToolsChanged object`
11671226 
11681227 - `cache_missed_input_tokens: number`
11691228 
from line 1230
11711230 
11721231 - `type: "tools_changed"`
11731232 
1174 - `"tools_changed"`
1175 
1176 - `BetaCacheMissMessagesChanged object { cache_missed_input_tokens, type }`
1233 default: tools_changed
1234 
1235 - `BetaCacheMissMessagesChanged object`
11771236 
11781237 - `cache_missed_input_tokens: number`
11791238 
from line 1240
11811240 
11821241 - `type: "messages_changed"`
11831242 
1184 - `"messages_changed"`
1185 
1186 - `BetaCacheMissPreviousMessageNotFound object { type }`
1243 default: messages_changed
1244 
1245 - `BetaCacheMissPreviousMessageNotFound object`
11871246 
11881247 - `type: "previous_message_not_found"`
11891248 
1190 - `"previous_message_not_found"`
1191 
1192 - `BetaCacheMissUnavailable object { type }`
1249 default: previous_message_not_found
1250 
1251 - `BetaCacheMissUnavailable object`
11931252 
11941253 - `type: "unavailable"`
11951254 
1196 - `"unavailable"`
1255 default: unavailable
11971256 
11981257 - `model: Model`
11991258 
from line 1266
12071266 
12081267 This will always be `"assistant"`.
12091268 
1210 - `"assistant"`
1269 default: assistant
12111270 
12121271 - `stop_details: BetaRefusalStopDetails or null`
12131272 
from line 1353
12941353 
12951354 - `type: "refusal"`
12961355 
1297 - `"refusal"`
1356 default: refusal
12981357 
12991358 - `stop_reason: BetaStopReason or null`
13001359 
from line 1399
13401399 
13411400 For Messages, this is always `"message"`.
13421401 
1343 - `"message"`
1402 default: message
13441403 
13451404 - `usage: BetaUsage`
13461405 
from line 1421
13621421 
13631422 The number of input tokens used to create the 1 hour cache entry.
13641423 
1424 default: 0, minimum: 0
1425 
13651426 - `ephemeral_5m_input_tokens: number`
13661427 
13671428 The number of input tokens used to create the 5 minute cache entry.
13681429 
1430 default: 0, minimum: 0
1431 
13691432 - `cache_creation_input_tokens: number or null`
13701433 
13711434 The number of input tokens used to create the cache entry.
13721435 
1436 minimum: 0
1437 
13731438 - `cache_read_input_tokens: number or null`
13741439 
13751440 The number of input tokens read from the cache.
1441 
1442 minimum: 0
13761443 
13771444 - `fallback_credit: BetaFallbackCreditUsage or null`
13781445 
from line 1454
13871454 resulting shift is zero because there was nothing to move. `not_applied`:
13881455 no reprice was applied; the arm's `reason` says why.
13891456 
1390 - `BetaFallbackCreditRedeemed object { type }`
1457 - `BetaFallbackCreditRedeemed object`
13911458 
13921459 The reprice was applied: the retry is billed as if the conversation
13931460 had been on the retry model all along.
13941461 
13951462 - `type: "redeemed"`
13961463 
1397 - `"redeemed"`
1398 
1399 - `BetaFallbackCreditNotApplied object { reason, type, remove_to_redeem }`
1464 default: redeemed
1465 
1466 - `BetaFallbackCreditNotApplied object`
14001467 
14011468 No reprice was applied; `reason` says why.
14021469 
from line 1500
14331500 
14341501 - `type: "not_applied"`
14351502 
1436 - `"not_applied"`
1503 default: not_applied
14371504 
14381505 - `remove_to_redeem: optional array of string or null`
14391506 
from line 1521
14541521 
14551522 The number of input tokens which were used.
14561523 
1524 minimum: 0
1525 
14571526 - `iterations: BetaIterationsUsage or null`
14581527 
14591528 Per-iteration token usage breakdown.
from line 1533
14641533 - Calculate the true context window size from the last iteration
14651534 - Understand token accumulation across server-side tool use loops
14661535 
1467 - `BetaMessageIterationUsage object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 4 more }`
1536 - `BetaMessageIterationUsage object`
14681537 
14691538 Token usage for a sampling iteration.
14701539 
from line 1545
14761545 
14771546 The number of input tokens used to create the cache entry.
14781547 
1548 default: 0, minimum: 0
1549 
14791550 - `cache_read_input_tokens: number`
14801551 
14811552 The number of input tokens read from the cache.
14821553 
1554 default: 0, minimum: 0
1555 
14831556 - `input_tokens: number`
14841557 
14851558 The number of input tokens which were used.
14861559 
1560 minimum: 0
1561 
14871562 - `model: Model`
14881563 
14891564 The model that will complete your prompt.
from line 1569
14941569 
14951570 The number of output tokens which were used.
14961571 
1572 minimum: 0
1573 
14971574 - `type: "message"`
14981575 
14991576 Usage for a sampling iteration
15001577 
1501 - `"message"`
1502 
1503 - `BetaCompactionIterationUsage object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
1578 default: message
1579 
1580 - `BetaCompactionIterationUsage object`
15041581 
15051582 Token usage for a compaction iteration.
15061583 
from line 1589
15121589 
15131590 The number of input tokens used to create the cache entry.
15141591 
1592 default: 0, minimum: 0
1593 
15151594 - `cache_read_input_tokens: number`
15161595 
15171596 The number of input tokens read from the cache.
15181597 
1598 default: 0, minimum: 0
1599 
15191600 - `input_tokens: number`
15201601 
15211602 The number of input tokens which were used.
15221603 
1604 minimum: 0
1605 
15231606 - `output_tokens: number`
15241607 
15251608 The number of output tokens which were used.
15261609 
1610 minimum: 0
1611 
15271612 - `type: "compaction"`
15281613 
15291614 Usage for a compaction iteration
15301615 
1531 - `"compaction"`
1532 
1533 - `BetaAdvisorMessageIterationUsage object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 4 more }`
1616 default: compaction
1617 
1618 - `BetaAdvisorMessageIterationUsage object`
15341619 
15351620 Token usage for an advisor sub-inference iteration.
15361621 
from line 1627
15421627 
15431628 The number of input tokens used to create the cache entry.
15441629 
1630 default: 0, minimum: 0
1631 
15451632 - `cache_read_input_tokens: number`
15461633 
15471634 The number of input tokens read from the cache.
15481635 
1636 default: 0, minimum: 0
1637 
15491638 - `input_tokens: number`
15501639 
15511640 The number of input tokens which were used.
15521641 
1642 minimum: 0
1643 
15531644 - `model: Model`
15541645 
15551646 The model that will complete your prompt.
from line 1651
15601651 
15611652 The number of output tokens which were used.
15621653 
1654 minimum: 0
1655 
15631656 - `type: "advisor_message"`
15641657 
15651658 Usage for an advisor sub-inference iteration
15661659 
1567 - `"advisor_message"`
1568 
1569 - `BetaFallbackMessageIterationUsage object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 4 more }`
1660 default: advisor_message
1661 
1662 - `BetaFallbackMessageIterationUsage object`
15701663 
15711664 Token usage for the fallback-model attempt of a server-side fallback request.
15721665 
from line 1676
15831676 
15841677 The number of input tokens used to create the cache entry.
15851678 
1679 default: 0, minimum: 0
1680 
15861681 - `cache_read_input_tokens: number`
15871682 
15881683 The number of input tokens read from the cache.
15891684 
1685 default: 0, minimum: 0
1686 
15901687 - `input_tokens: number`
15911688 
15921689 The number of input tokens which were used.
15931690 
1691 minimum: 0
1692 
15941693 - `model: Model`
15951694 
15961695 The model that will complete your prompt.
from line 1700
16011700 
16021701 The number of output tokens which were used.
16031702 
1703 minimum: 0
1704 
16041705 - `type: "fallback_message"`
16051706 
16061707 Usage for the fallback-model attempt that served the response
16071708 
1608 - `"fallback_message"`
1709 default: fallback_message
16091710 
16101711 - `output_tokens: number`
16111712 
16121713 The number of output tokens which were used.
1714 
1715 minimum: 0
16131716 
16141717 - `output_tokens_details: BetaOutputTokensDetails or null`
16151718 
from line 1734
16311734 generation count by a small number of tokens. Always ≤ `output_tokens`;
16321735 `output_tokens - thinking_tokens` approximates the non-reasoning output.
16331736 
1737 default: 0, minimum: 0
1738 
16341739 - `server_tool_use: BetaServerToolUsage or null`
16351740 
16361741 The number of server tool requests.
from line 1744
16391744 
16401745 The number of web fetch tool requests.
16411746 
1747 default: 0, minimum: 0
1748 
16421749 - `web_search_requests: number`
16431750 
16441751 The number of web search tool requests.
16451752 
1753 default: 0, minimum: 0
1754 
16461755 - `service_tier: "standard" or "priority" or "batch" or null`
16471756 
16481757 If the request used the priority, standard, or batch tier.
from line 1772
16631772 
16641773 - `type: "succeeded"`
16651774 
1666 - `"succeeded"`
1667 
1668 - `BetaMessageBatchErroredResult object { error, type }`
1775 default: succeeded
1776 
1777 - `BetaMessageBatchErroredResult object`
16691778 
16701779 - `error: BetaErrorResponse`
16711780 
16721781 - `error: BetaError`
16731782 
1674 - `BetaInvalidRequestError object { message, type }`
1783 - `BetaInvalidRequestError object`
16751784 
16761785 - `message: string`
16771786 
1787 default: Invalid request
1788 
16781789 - `type: "invalid_request_error"`
16791790 
1680 - `"invalid_request_error"`
1681 
1682 - `BetaAuthenticationError object { message, type }`
1791 default: invalid_request_error
1792 
1793 - `BetaAuthenticationError object`
16831794 
16841795 - `message: string`
16851796 
1797 default: Authentication error
1798 
16861799 - `type: "authentication_error"`
16871800 
1688 - `"authentication_error"`
1689 
1690 - `BetaBillingError object { message, type }`
1801 default: authentication_error
1802 
1803 - `BetaBillingError object`
16911804 
16921805 - `message: string`
16931806 
1807 default: Billing error
1808 
16941809 - `type: "billing_error"`
16951810 
1696 - `"billing_error"`
1697 
1698 - `BetaPermissionError object { message, type }`
1811 default: billing_error
1812 
1813 - `BetaPermissionError object`
16991814 
17001815 - `message: string`
17011816 
1817 default: Permission denied
1818 
17021819 - `type: "permission_error"`
17031820 
1704 - `"permission_error"`
1705 
1706 - `BetaNotFoundError object { message, type }`
1821 default: permission_error
1822 
1823 - `BetaNotFoundError object`
17071824 
17081825 - `message: string`
17091826 
1827 default: Not found
1828 
17101829 - `type: "not_found_error"`
17111830 
1712 - `"not_found_error"`
1713 
1714 - `BetaRateLimitError object { message, type }`
1831 default: not_found_error
1832 
1833 - `BetaRateLimitError object`
17151834 
17161835 - `message: string`
17171836 
1837 default: Rate limited
1838 
17181839 - `type: "rate_limit_error"`
17191840 
1720 - `"rate_limit_error"`
1721 
1722 - `BetaGatewayTimeoutError object { message, type }`
1841 default: rate_limit_error
1842 
1843 - `BetaGatewayTimeoutError object`
17231844 
17241845 - `message: string`
17251846 
1847 default: Request timeout
1848 
17261849 - `type: "timeout_error"`
17271850 
1728 - `"timeout_error"`
1729 
1730 - `BetaAPIError object { message, type }`
1851 default: timeout_error
1852 
1853 - `BetaAPIError object`
17311854 
17321855 - `message: string`
17331856 
1857 default: Internal server error
1858 
17341859 - `type: "api_error"`
17351860 
1736 - `"api_error"`
1737 
1738 - `BetaOverloadedError object { message, type }`
1861 default: api_error
1862 
1863 - `BetaOverloadedError object`
17391864 
17401865 - `message: string`
17411866 
1867 default: Overloaded
1868 
17421869 - `type: "overloaded_error"`
17431870 
1744 - `"overloaded_error"`
1871 default: overloaded_error
17451872 
17461873 - `request_id: string or null`
17471874 
17481875 - `type: "error"`
17491876 
1750 - `"error"`
1877 default: error
17511878 
17521879 - `type: "errored"`
17531880 
1754 - `"errored"`
1755 
1756 - `BetaMessageBatchCanceledResult object { type }`
1881 default: errored
1882 
1883 - `BetaMessageBatchCanceledResult object`
17571884 
17581885 - `type: "canceled"`
17591886 
1760 - `"canceled"`
1761 
1762 - `BetaMessageBatchExpiredResult object { type }`
1887 default: canceled
1888 
1889 - `BetaMessageBatchExpiredResult object`
17631890 
17641891 - `type: "expired"`
17651892 
1766 - `"expired"`
1767 
1768### Example
1769 
1770```http
1893 default: expired
1894 
1895## Example
1896 
1897```bash
17711898curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/results \
17721899 -H 'anthropic-version: 2023-06-01' \
17731900 -H 'anthropic-beta: message-batches-2024-09-24' \
17741901 
Feedback