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