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: Create a Message
3url: https://platform.claude.com/docs/en/api/messages/create
4---
5
16# Create a Message
27
38**POST** `/v1/messages`
from line 18
1318- `"anthropic-user-profile-id": optional string`
1419
1520 The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.
21
22- `"anthropic-workspace-id": optional string`
1623
1724## Body parameters
1825
from line 94
8794
8895 - `TextBlockParam object`
8996
97 - `type: "text"`
98
9099 - `text: string`
91100
92101 minLength: 1
93
94 - `type: "text"`
95102
96103 - `cache_control: optional CacheControlEphemeral or null`
97104
from line 125
118125
119126 - `CitationCharLocationParam object`
120127
128 - `type: "char_location"`
129
121130 - `cited_text: string`
122131
123132 - `document_index: number`
from line 143
134143
135144 minimum: 0
136145
137 - `type: "char_location"`
138
139146 - `CitationPageLocationParam object`
140147
148 - `type: "page_location"`
149
141150 - `cited_text: string`
142151
143152 - `document_index: number`
from line 163
154163
155164 minimum: 1
156165
157 - `type: "page_location"`
158
159166 - `CitationContentBlockLocationParam object`
160167
168 - `type: "content_block_location"`
169
161170 - `cited_text: string`
162171
163172 The full text of the cited block range, concatenated.
from line 193
184193
185194 minimum: 0
186195
187 - `type: "content_block_location"`
188
189196 - `CitationWebSearchResultLocationParam object`
190197
198 - `type: "web_search_result_location"`
199
191200 - `cited_text: string`
192201
193202 - `encrypted_index: string`
from line 205
196205
197206 maxLength: 512, minLength: 1
198207
199 - `type: "web_search_result_location"`
200
201208 - `url: string`
202209
203210 minLength: 1
204211
205212 - `CitationSearchResultLocationParam object`
206213
214 - `type: "search_result_location"`
215
207216 - `cited_text: string`
208217
209218 The full text of the cited block range, concatenated.
from line 243
234243
235244 - `title: string or null`
236245
237 - `type: "search_result_location"`
238
239246 - `ImageBlockParam object`
240247
248 - `type: "image"`
249
241250 - `source: Base64ImageSource or URLImageSource or FileImageSource`
242251
243252 - `Base64ImageSource object`
244253
254 - `type: "base64"`
255
245256 - `data: string`
246257
247258 format: byte
from line 267
256267
257268 - `"image/webp"`
258269
270 - `URLImageSource object`
271
272 - `type: "url"`
273
274 - `url: string`
275
276 - `FileImageSource object`
277
278 - `type: "file"`
279
280 - `file_id: string`
281
282 - `cache_control: optional CacheControlEphemeral or null`
283
284 Create a cache control breakpoint at this content block.
285
286 - `transformations: optional ImageTransformationsParam or null`
287
288 Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
289
290 - `oversized_image: optional "downsize" or "error"`
291
292 What the server does when this image exceeds the model's maximum image size. `"downsize"` (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. `"error"` instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
293
294 - `"downsize"`
295
296 - `"error"`
297
298 - `DocumentBlockParam object`
299
300 - `type: "document"`
301
302 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
303
304 - `Base64PDFSource object`
305
259306 - `type: "base64"`
260307
261 - `URLImageSource object`
308 - `data: string`
309
310 format: byte
311
312 - `media_type: "application/pdf"`
313
314 - `PlainTextSource object`
315
316 - `type: "text"`
317
318 - `data: string`
319
320 - `media_type: "text/plain"`
321
322 - `ContentBlockSource object`
323
324 - `type: "content"`
325
326 - `content: string or array of ContentBlockSourceContent`
327
328 - `string`
329
330 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
331
332 - `TextBlockParam object`
333
334 - `ImageBlockParam object`
335
336 - `URLPDFSource object`
262337
263338 - `type: "url"`
264339
265340 - `url: string`
266341
267 - `FileImageSource object`
342 - `FileDocumentSource object`
343
344 - `type: "file"`
268345
269346 - `file_id: string`
270347
271 - `type: "file"`
272
273 - `type: "image"`
274
275348 - `cache_control: optional CacheControlEphemeral or null`
276349
277350 Create a cache control breakpoint at this content block.
278351
279 - `transformations: optional ImageTransformationsParam or null`
280
281 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.
282
283 - `oversized_image: optional "downsize" or "error"`
284
285 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.
286
287 - `"downsize"`
288
289 - `"error"`
290
291 - `DocumentBlockParam object`
292
293 - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or 2 more`
294
295 - `Base64PDFSource object`
296
297 - `data: string`
298
299 format: byte
300
301 - `media_type: "application/pdf"`
302
303 - `type: "base64"`
304
305 - `PlainTextSource object`
306
307 - `data: string`
308
309 - `media_type: "text/plain"`
310
311 - `type: "text"`
312
313 - `ContentBlockSource object`
314
315 - `content: string or array of ContentBlockSourceContent`
316
317 - `string`
318
319 - `ContentBlockSourceContent = array of ContentBlockSourceContent`
320
321 - `TextBlockParam object`
322
323 - `ImageBlockParam object`
324
325 - `type: "content"`
326
327 - `URLPDFSource object`
328
329 - `type: "url"`
330
331 - `url: string`
332
333 - `FileDocumentSource object`
334
335 - `file_id: string`
336
337 - `type: "file"`
338
339 - `type: "document"`
352 - `citations: optional CitationsConfigParam or null`
353
354 - `enabled: optional boolean`
355
356 - `context: optional string or null`
357
358 minLength: 1
359
360 - `title: optional string or null`
361
362 maxLength: 500, minLength: 1
363
364 - `SearchResultBlockParam object`
365
366 - `type: "search_result"`
367
368 - `content: array of TextBlockParam`
369
370 - `type: "text"`
371
372 - `text: string`
373
374 minLength: 1
375
376 - `cache_control: optional CacheControlEphemeral or null`
377
378 Create a cache control breakpoint at this content block.
379
380 - `citations: optional array of TextCitationParam or null`
381
382 - `source: string`
383
384 - `title: string`
340385
341386 - `cache_control: optional CacheControlEphemeral or null`
342387
343388 Create a cache control breakpoint at this content block.
344389
345 - `citations: optional CitationsConfigParam or null`
346
347 - `enabled: optional boolean`
348
349 - `context: optional string or null`
350
351 minLength: 1
352
353 - `title: optional string or null`
354
355 maxLength: 500, minLength: 1
356
357 - `SearchResultBlockParam object`
358
359 - `content: array of TextBlockParam`
360
361 - `text: string`
362
363 minLength: 1
364
365 - `type: "text"`
366
367 - `cache_control: optional CacheControlEphemeral or null`
368
369 Create a cache control breakpoint at this content block.
370
371 - `citations: optional array of TextCitationParam or null`
372
373 - `source: string`
374
375 - `title: string`
376
377 - `type: "search_result"`
390 - `citations: optional CitationsConfigParam`
391
392 - `ThinkingBlockParam object`
393
394 - `type: "thinking"`
395
396 - `signature: string`
397
398 The `signature` value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
399
400 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
401
402 - `thinking: string`
403
404 The `thinking` text of this block as returned by the API.
405
406 - `RedactedThinkingBlockParam object`
407
408 - `type: "redacted_thinking"`
409
410 - `data: string`
411
412 The `data` value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.
413
414 - `ToolUseBlockParam object`
415
416 - `type: "tool_use"`
417
418 - `id: string`
419
420 pattern: ^[a-zA-Z0-9_-]+$
421
422 - `input: map[unknown]`
423
424 - `name: string`
425
426 maxLength: 200, minLength: 1
378427
379428 - `cache_control: optional CacheControlEphemeral or null`
380429
381430 Create a cache control breakpoint at this content block.
382431
383 - `citations: optional CitationsConfigParam`
384
385 - `ThinkingBlockParam object`
386
387 - `signature: string`
388
389 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.
390
391 Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 `invalid_request_error`.
392
393 - `thinking: string`
394
395 The `thinking` text of this block as returned by the API.
396
397 - `type: "thinking"`
398
399 - `RedactedThinkingBlockParam object`
400
401 - `data: string`
402
403 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.
404
405 - `type: "redacted_thinking"`
406
407 - `ToolUseBlockParam object`
408
409 - `id: string`
432 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
433
434 Tool invocation directly from the model.
435
436 - `DirectCaller object`
437
438 Tool invocation directly from the model.
439
440 - `type: "direct"`
441
442 - `ServerToolCaller object`
443
444 Tool invocation generated by a server-side tool.
445
446 - `type: "code_execution_20250825"`
447
448 - `tool_id: string`
449
450 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
451
452 - `ServerToolCaller20260120 object`
453
454 - `type: "code_execution_20260120"`
455
456 - `tool_id: string`
457
458 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
459
460 - `toolset_name: optional string or null`
461
462 For a toolset member tool_use, the toolset family this member belongs to.
463
464 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
465
466 - `ToolResultBlockParam object`
467
468 - `type: "tool_result"`
469
470 - `tool_use_id: string`
410471
411472 pattern: ^[a-zA-Z0-9_-]+$
412473
413 - `input: map[unknown]`
414
415 - `name: string`
416
417 maxLength: 200, minLength: 1
418
419 - `type: "tool_use"`
420
421474 - `cache_control: optional CacheControlEphemeral or null`
422475
423476 Create a cache control breakpoint at this content block.
424477
425 - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
426
427 Tool invocation directly from the model.
428
429 - `DirectCaller object`
430
431 Tool invocation directly from the model.
432
433 - `type: "direct"`
434
435 - `ServerToolCaller object`
436
437 Tool invocation generated by a server-side tool.
438
439 - `tool_id: string`
440
441 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
442
443 - `type: "code_execution_20250825"`
444
445 - `ServerToolCaller20260120 object`
446
447 - `tool_id: string`
448
449 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
450
451 - `type: "code_execution_20260120"`
452
453 - `toolset_name: optional string or null`
454
455 For a toolset member tool_use, the toolset family this member belongs to.
456
457 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
458
459 - `ToolResultBlockParam object`
460
461 - `tool_use_id: string`
462
463 pattern: ^[a-zA-Z0-9_-]+$
464
465 - `type: "tool_result"`
466
467 - `cache_control: optional CacheControlEphemeral or null`
468
469 Create a cache control breakpoint at this content block.
470
471478 - `content: optional string or array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 3 more`
472479
473480 - `string`
from line 493
486493
487494 Tool reference block that can be included in tool_result content.
488495
496 - `type: "tool_reference"`
497
489498 - `tool_name: string`
490499
491500 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
492
493 - `type: "tool_reference"`
494501
495502 - `cache_control: optional CacheControlEphemeral or null`
496503
from line 513
506513 browser toolset member `tool_use`. The server renders the
507514 model-visible text from it; the model never sees the raw fields.
508515
516 - `type: "browser_state"`
517
509518 - `tabs: array of BrowserStateTabEntry`
510519
511520 All tabs open in the browser after this call — the full inventory, not a delta. May be empty. Whenever non-empty, exactly one entry carries `active: true`.
from line 542
533542 - `active: optional boolean`
534543
535544 Whether this tab is the active tab after this call. Whenever `tabs` is non-empty, exactly one entry is marked `active: true`.
536
537 - `type: "browser_state"`
538545
539546 - `cache_control: optional CacheControlEphemeral or null`
540547
from line 563
556563 during a failed call gets no deferred `tab_opened`; it simply appears
557564 in the next result's `tabs` inventory.
558565
566 - `type: "tab_opened"`
567
559568 - `tab_id: string`
560569
561570 The `tab_id` of the opened tab, present in `tabs`.
562571
563572 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
564573
565 - `type: "tab_opened"`
566
567574 - `BrowserStateChangeDownloadStarted object`
568575
569576 A file download that started during this call.
570577
578 - `type: "download_started"`
579
571580 - `download_id: string`
572581
573582 The caller-assigned identifier for this download, stable across the state changes reporting it.
574583
575584 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
576
577 - `type: "download_started"`
578585
579586 - `url: string`
580587
from line 596
589596 `download_started`, when the download finished during the call that
590597 started it (at most one state change per `download_id` per result).
591598
599 - `type: "download_completed"`
600
592601 - `download_id: string`
593602
594603 The caller-assigned identifier for this download, stable across the state changes reporting it.
595604
596605 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
597606
598 - `type: "download_completed"`
599
600607 - `url: string`
601608
602609 The final post-redirect URL the download was served from.
from line 626
619626
620627 A file download that failed — or was cancelled — during this call.
621628
629 - `type: "download_failed"`
630
622631 - `download_id: string`
623632
624633 The caller-assigned identifier for this download, stable across the state changes reporting it.
625634
626635 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
627636
628 - `type: "download_failed"`
629
630637 - `url: string`
631638
632639 The final post-redirect URL the download was served from.
from line 656
649656
650657 - `ServerToolUseBlockParam object`
651658
659 - `type: "server_tool_use"`
660
652661 - `id: string`
653662
654663 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 680
671680
672681 - `"tool_search_tool_bm25"`
673682
674 - `type: "server_tool_use"`
675
676683 - `cache_control: optional CacheControlEphemeral or null`
677684
678685 Create a cache control breakpoint at this content block.
from line 700
693700
694701 - `WebSearchToolResultBlockParam object`
695702
703 - `type: "web_search_tool_result"`
704
696705 - `content: WebSearchToolResultBlockParamContent`
697706
698707 - `WebSearchToolResultBlockItem = array of WebSearchResultBlockParam`
699708
709 - `type: "web_search_result"`
710
700711 - `encrypted_content: string`
701712
702713 - `title: string`
703714
704 - `type: "web_search_result"`
705
706715 - `url: string`
707716
708717 - `page_age: optional string or null`
709718
710719 - `WebSearchToolRequestError object`
711720
721 - `type: "web_search_tool_result_error"`
722
712723 - `error_code: WebSearchToolResultErrorCode`
713724
714725 - `"invalid_tool_input"`
from line 734
723734
724735 - `"request_too_large"`
725736
726 - `type: "web_search_tool_result_error"`
727
728737 - `tool_use_id: string`
729738
730739 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
731740
732 - `type: "web_search_tool_result"`
733
734741 - `cache_control: optional CacheControlEphemeral or null`
735742
736743 Create a cache control breakpoint at this content block.
from line 758
751758
752759 - `WebFetchToolResultBlockParam object`
753760
761 - `type: "web_fetch_tool_result"`
762
754763 - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
755764
756765 - `WebFetchToolResultErrorBlockParam object`
757766
767 - `type: "web_fetch_tool_result_error"`
768
758769 - `error_code: WebFetchToolResultErrorCode`
759770
760771 - `"invalid_tool_input"`
from line 786
775786
776787 - `"unavailable"`
777788
778 - `type: "web_fetch_tool_result_error"`
789 - `"content_too_large"`
779790
780791 - `WebFetchBlockParam object`
781792
793 - `type: "web_fetch_result"`
794
782795 - `content: DocumentBlockParam`
783796
784 - `type: "web_fetch_result"`
785
786797 - `url: string`
787798
788799 Fetched content URL
from line 806
795806
796807 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
797808
798 - `type: "web_fetch_tool_result"`
799
800809 - `cache_control: optional CacheControlEphemeral or null`
801810
802811 Create a cache control breakpoint at this content block.
from line 826
817826
818827 - `CodeExecutionToolResultBlockParam object`
819828
829 - `type: "code_execution_tool_result"`
830
820831 - `content: CodeExecutionToolResultBlockParamContent`
821832
822833 Code execution result with encrypted stdout for PFC + web_search results.
823834
824835 - `CodeExecutionToolResultErrorParam object`
825836
837 - `type: "code_execution_tool_result_error"`
838
826839 - `error_code: CodeExecutionToolResultErrorCode`
827840
828841 - `"invalid_tool_input"`
from line 846
833846
834847 - `"execution_time_exceeded"`
835848
836 - `type: "code_execution_tool_result_error"`
837
838849 - `CodeExecutionResultBlockParam object`
839850
851 - `type: "code_execution_result"`
852
840853 - `content: array of CodeExecutionOutputBlockParam`
841854
855 - `type: "code_execution_output"`
856
842857 - `file_id: string`
843858
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
844873 - `type: "code_execution_output"`
845874
875 - `file_id: string`
876
877 - `encrypted_stdout: string`
878
846879 - `return_code: number`
847880
848881 - `stderr: string`
849882
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
850927 - `stdout: string`
851928
852 - `type: "code_execution_result"`
853
854 - `EncryptedCodeExecutionResultBlockParam object`
855
856 Code execution result with encrypted stdout for PFC + web_search results.
857
858 - `content: array of CodeExecutionOutputBlockParam`
859
860 - `file_id: string`
861
862 - `type: "code_execution_output"`
863
864 - `encrypted_stdout: string`
865
866 - `return_code: number`
867
868 - `stderr: string`
869
870 - `type: "encrypted_code_execution_result"`
871
872929 - `tool_use_id: string`
873930
874931 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
875932
876 - `type: "code_execution_tool_result"`
877
878933 - `cache_control: optional CacheControlEphemeral or null`
879934
880935 Create a cache control breakpoint at this content block.
881936
882 - `BashCodeExecutionToolResultBlockParam object`
883
884 - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
885
886 - `BashCodeExecutionToolResultErrorParam object`
887
888 - `error_code: BashCodeExecutionToolResultErrorCode`
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`
889948
890949 - `"invalid_tool_input"`
891950
from line 954
895954
896955 - `"execution_time_exceeded"`
897956
898 - `"output_file_too_large"`
899
900 - `type: "bash_code_execution_tool_result_error"`
901
902 - `BashCodeExecutionResultBlockParam object`
903
904 - `content: array of BashCodeExecutionOutputBlockParam`
905
906 - `file_id: string`
907
908 - `type: "bash_code_execution_output"`
909
910 - `return_code: number`
911
912 - `stderr: string`
913
914 - `stdout: string`
915
916 - `type: "bash_code_execution_result"`
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`
9171000
9181001 - `tool_use_id: string`
9191002
9201003 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
9211004
922 - `type: "bash_code_execution_tool_result"`
923
9241005 - `cache_control: optional CacheControlEphemeral or null`
9251006
9261007 Create a cache control breakpoint at this content block.
9271008
928 - `TextEditorCodeExecutionToolResultBlockParam object`
929
930 - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
931
932 - `TextEditorCodeExecutionToolResultErrorParam object`
933
934 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
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`
9351020
9361021 - `"invalid_tool_input"`
9371022
from line 1026
9411026
9421027 - `"execution_time_exceeded"`
9431028
944 - `"file_not_found"`
945
946 - `type: "text_editor_code_execution_tool_result_error"`
947
9481029 - `error_message: optional string or null`
9491030
950 - `TextEditorCodeExecutionViewResultBlockParam object`
951
952 - `content: string`
953
954 - `file_type: "text" or "image" or "pdf"`
955
956 - `"text"`
957
958 - `"image"`
959
960 - `"pdf"`
961
962 - `type: "text_editor_code_execution_view_result"`
963
964 - `num_lines: optional number or null`
965
966 - `start_line: optional number or null`
967
968 - `total_lines: optional number or null`
969
970 - `TextEditorCodeExecutionCreateResultBlockParam object`
971
972 - `is_file_update: boolean`
973
974 - `type: "text_editor_code_execution_create_result"`
975
976 - `TextEditorCodeExecutionStrReplaceResultBlockParam object`
977
978 - `type: "text_editor_code_execution_str_replace_result"`
979
980 - `lines: optional array of string or null`
981
982 - `new_lines: optional number or null`
983
984 - `new_start: optional number or null`
985
986 - `old_lines: optional number or null`
987
988 - `old_start: optional number or null`
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 maxLength: 256, minLength: 1, 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.
9891046
9901047 - `tool_use_id: string`
9911048
9921049 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
993
994 - `type: "text_editor_code_execution_tool_result"`
995
996 - `cache_control: optional CacheControlEphemeral or null`
997
998 Create a cache control breakpoint at this content block.
999
1000 - `ToolSearchToolResultBlockParam object`
1001
1002 - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
1003
1004 - `ToolSearchToolResultErrorParam object`
1005
1006 - `error_code: ToolSearchToolResultErrorCode`
1007
1008 - `"invalid_tool_input"`
1009
1010 - `"unavailable"`
1011
1012 - `"too_many_requests"`
1013
1014 - `"execution_time_exceeded"`
1015
1016 - `type: "tool_search_tool_result_error"`
1017
1018 - `error_message: optional string or null`
1019
1020 - `ToolSearchToolSearchResultBlockParam object`
1021
1022 - `tool_references: array of ToolReferenceBlockParam`
1023
1024 - `tool_name: string`
1025
1026 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1027
1028 - `type: "tool_reference"`
1029
1030 - `cache_control: optional CacheControlEphemeral or null`
1031
1032 Create a cache control breakpoint at this content block.
1033
1034 - `type: "tool_search_tool_search_result"`
1035
1036 - `tool_use_id: string`
1037
1038 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
1039
1040 - `type: "tool_search_tool_result"`
10411050
10421051 - `cache_control: optional CacheControlEphemeral or null`
10431052
from line 1057
10481057 A content block that represents a file to be uploaded to the container
10491058 Files uploaded via this block will be available in the container's input directory.
10501059
1060 - `type: "container_upload"`
1061
10511062 - `file_id: string`
10521063
1053 - `type: "container_upload"`
1054
10551064 - `cache_control: optional CacheControlEphemeral or null`
10561065
10571066 Create a cache control breakpoint at this content block.
from line 1177
11681177
11691178 maxItems: 20
11701179
1180 - `type: "anthropic" or "custom"`
1181
1182 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1183
1184 - `"anthropic"`
1185
1186 - `"custom"`
1187
11711188 - `skill_id: string`
11721189
11731190 Skill ID
11741191
11751192 maxLength: 64, minLength: 1
11761193
1177 - `type: "anthropic" or "custom"`
1178
1179 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
1180
1181 - `"anthropic"`
1182
1183 - `"custom"`
1184
11851194 - `version: optional string`
11861195
11871196 Skill version or 'latest' for most recent version
from line 1237
12281237
12291238 A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
12301239
1240 - `type: "json_schema"`
1241
12311242 - `schema: map[unknown]`
12321243
12331244 The JSON schema of the format
12341245
1235 - `type: "json_schema"`
1236
12371246- `service_tier: optional "auto" or "standard_only"`
12381247
12391248 Determines whether to use priority capacity (if available) or standard capacity for this request.
from line 1277
12681277
12691278 - `array of TextBlockParam`
12701279
1280 - `type: "text"`
1281
12711282 - `text: string`
12721283
12731284 minLength: 1
12741285
1275 - `type: "text"`
1276
12771286 - `cache_control: optional CacheControlEphemeral or null`
12781287
12791288 Create a cache control breakpoint at this content block.
from line 1299
12901299
12911300 - `ThinkingConfigEnabled object`
12921301
1302 - `type: "enabled"`
1303
12931304 - `budget_tokens: number`
12941305
12951306 Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
from line 1311
13001311
13011312 minimum: 1024
13021313
1303 - `type: "enabled"`
1304
13051314 - `display: optional "summarized" or "omitted" or null`
13061315
13071316 Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1367
13581367
13591368 The model will use the specified tool with `tool_choice.name`.
13601369
1370 - `type: "tool"`
1371
13611372 - `name: string`
13621373
13631374 The name of the tool to use.
1364
1365 - `type: "tool"`
13661375
13671376 - `disable_parallel_tool_use: optional boolean`
13681377
from line 1451
14421451
14431452 - `Tool object`
14441453
1454 - `type: optional "custom" or null`
1455
14451456 - `input_schema: object`
14461457
14471458 [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
from line 1507
14961507
14971508 When true, guarantees schema validation on tool names and inputs
14981509
1499 - `type: optional "custom" or null`
1500
15011510 - `ToolBash20250124 object`
15021511
1512 - `type: "bash_20250124"`
1513
15031514 - `name: "bash"`
15041515
15051516 Name of the tool.
15061517
15071518 This is how the tool will be called by the model and in `tool_use` blocks.
15081519
1509 - `type: "bash_20250124"`
1510
15111520 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15121521
15131522 - `"direct"`
from line 1543
15341543
15351544 - `CodeExecutionTool20250522 object`
15361545
1546 - `type: "code_execution_20250522"`
1547
15371548 - `name: "code_execution"`
15381549
15391550 Name of the tool.
15401551
15411552 This is how the tool will be called by the model and in `tool_use` blocks.
15421553
1543 - `type: "code_execution_20250522"`
1544
15451554 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15461555
15471556 - `"direct"`
from line 1575
15661575
15671576 - `CodeExecutionTool20250825 object`
15681577
1578 - `type: "code_execution_20250825"`
1579
15691580 - `name: "code_execution"`
15701581
15711582 Name of the tool.
15721583
15731584 This is how the tool will be called by the model and in `tool_use` blocks.
15741585
1575 - `type: "code_execution_20250825"`
1576
15771586 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
15781587
15791588 - `"direct"`
from line 1609
16001609
16011610 Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
16021611
1612 - `type: "code_execution_20260120"`
1613
16031614 - `name: "code_execution"`
16041615
16051616 Name of the tool.
16061617
16071618 This is how the tool will be called by the model and in `tool_use` blocks.
16081619
1609 - `type: "code_execution_20260120"`
1610
16111620 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16121621
16131622 - `"direct"`
from line 1643
16341643
16351644 Code execution tool with REPL state persistence.
16361645
1646 - `type: "code_execution_20260521"`
1647
16371648 - `name: "code_execution"`
16381649
16391650 Name of the tool.
16401651
16411652 This is how the tool will be called by the model and in `tool_use` blocks.
1642
1643 - `type: "code_execution_20260521"`
16441653
16451654 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
16461655
from line 1695
16861695 absent. Unknown keys are rejected: the field set is this toolset
16871696 version's complete member set.
16881697
1698 - `type: optional BrowserTypeConfig or null`
1699
1700 `type`'s config overrides.
1701
1702 - `defer_loading: optional boolean or null`
1703
1704 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
1705
1706 - `enabled: optional boolean or null`
1707
1708 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
1709
16891710 - `close_tab: optional BrowserCloseTabConfig or null`
16901711
16911712 `close_tab`'s config overrides.
from line 2043
20222043
20232044 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
20242045
2025 - `type: optional BrowserTypeConfig or null`
2026
2027 `type`'s config overrides.
2028
2029 - `defer_loading: optional boolean or null`
2030
2031 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2032
2033 - `enabled: optional boolean or null`
2034
2035 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
2036
20372046 - `wait: optional BrowserWaitConfig or null`
20382047
20392048 `wait`'s config overrides.
from line 2069
20602069
20612070 - `MemoryTool20250818 object`
20622071
2072 - `type: "memory_20250818"`
2073
20632074 - `name: "memory"`
20642075
20652076 Name of the tool.
20662077
20672078 This is how the tool will be called by the model and in `tool_use` blocks.
2068
2069 - `type: "memory_20250818"`
20702079
20712080 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
20722081
from line 2127
21182127 absent. Unknown keys are rejected: the field set is this toolset
21192128 version's complete member set.
21202129
2130 - `type: optional ComputerTypeConfig or null`
2131
2132 `type`'s config overrides.
2133
2134 - `defer_loading: optional boolean or null`
2135
2136 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2137
2138 - `enabled: optional boolean or null`
2139
2140 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
2141
21212142 - `cursor_position: optional ComputerCursorPositionConfig or null`
21222143
21232144 `cursor_position`'s config overrides.
from line 2307
22862307
22872308 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
22882309
2289 - `type: optional ComputerTypeConfig or null`
2290
2291 `type`'s config overrides.
2292
2293 - `defer_loading: optional boolean or null`
2294
2295 Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
2296
2297 - `enabled: optional boolean or null`
2298
2299 Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
2300
23012310 - `wait: optional ComputerWaitConfig or null`
23022311
23032312 `wait`'s config overrides.
from line 2333
23242333
23252334 - `ToolTextEditor20250124 object`
23262335
2336 - `type: "text_editor_20250124"`
2337
23272338 - `name: "str_replace_editor"`
23282339
23292340 Name of the tool.
23302341
23312342 This is how the tool will be called by the model and in `tool_use` blocks.
23322343
2333 - `type: "text_editor_20250124"`
2334
23352344 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23362345
23372346 - `"direct"`
from line 2367
23582367
23592368 - `ToolTextEditor20250429 object`
23602369
2370 - `type: "text_editor_20250429"`
2371
23612372 - `name: "str_replace_based_edit_tool"`
23622373
23632374 Name of the tool.
23642375
23652376 This is how the tool will be called by the model and in `tool_use` blocks.
23662377
2367 - `type: "text_editor_20250429"`
2368
23692378 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
23702379
23712380 - `"direct"`
from line 2401
23922401
23932402 - `ToolTextEditor20250728 object`
23942403
2404 - `type: "text_editor_20250728"`
2405
23952406 - `name: "str_replace_based_edit_tool"`
23962407
23972408 Name of the tool.
23982409
23992410 This is how the tool will be called by the model and in `tool_use` blocks.
24002411
2401 - `type: "text_editor_20250728"`
2402
24032412 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24042413
24052414 - `"direct"`
from line 2441
24322441
24332442 - `WebSearchTool20250305 object`
24342443
2444 - `type: "web_search_20250305"`
2445
24352446 - `name: "web_search"`
24362447
24372448 Name of the tool.
24382449
24392450 This is how the tool will be called by the model and in `tool_use` blocks.
24402451
2441 - `type: "web_search_20250305"`
2442
24432452 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
24442453
24452454 - `"direct"`
from line 2517
25082517
25092518 - `WebFetchTool20250910 object`
25102519
2520 - `type: "web_fetch_20250910"`
2521
25112522 - `name: "web_fetch"`
25122523
25132524 Name of the tool.
25142525
25152526 This is how the tool will be called by the model and in `tool_use` blocks.
25162527
2517 - `type: "web_fetch_20250910"`
2518
25192528 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25202529
25212530 - `"direct"`
from line 2573
25642573
25652574 - `WebSearchTool20260209 object`
25662575
2576 - `type: "web_search_20260209"`
2577
25672578 - `name: "web_search"`
25682579
25692580 Name of the tool.
25702581
25712582 This is how the tool will be called by the model and in `tool_use` blocks.
25722583
2573 - `type: "web_search_20260209"`
2574
25752584 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
25762585
25772586 - `"direct"`
from line 2623
26142623
26152624 - `WebFetchTool20260209 object`
26162625
2626 - `type: "web_fetch_20260209"`
2627
26172628 - `name: "web_fetch"`
26182629
26192630 Name of the tool.
26202631
26212632 This is how the tool will be called by the model and in `tool_use` blocks.
26222633
2623 - `type: "web_fetch_20260209"`
2624
26252634 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26262635
26272636 - `"direct"`
from line 2681
26722681
26732682 Web fetch tool with use_cache parameter for bypassing cached content.
26742683
2684 - `type: "web_fetch_20260309"`
2685
26752686 - `name: "web_fetch"`
26762687
26772688 Name of the tool.
26782689
26792690 This is how the tool will be called by the model and in `tool_use` blocks.
26802691
2681 - `type: "web_fetch_20260309"`
2682
26832692 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
26842693
26852694 - `"direct"`
from line 2741
27322741
27332742 - `WebSearchTool20260318 object`
27342743
2744 - `type: "web_search_20260318"`
2745
27352746 - `name: "web_search"`
27362747
27372748 Name of the tool.
27382749
27392750 This is how the tool will be called by the model and in `tool_use` blocks.
27402751
2741 - `type: "web_search_20260318"`
2742
27432752 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
27442753
27452754 - `"direct"`
from line 2799
27902799
27912800 - `WebFetchTool20260318 object`
27922801
2802 - `type: "web_fetch_20260318"`
2803
27932804 - `name: "web_fetch"`
27942805
27952806 Name of the tool.
27962807
27972808 This is how the tool will be called by the model and in `tool_use` blocks.
27982809
2799 - `type: "web_fetch_20260318"`
2800
28012810 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28022811
28032812 - `"direct"`
from line 2867
28582867
28592868 - `ToolSearchToolBm25_20251119 object`
28602869
2870 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2871
2872 - `"tool_search_tool_bm25_20251119"`
2873
2874 - `"tool_search_tool_bm25"`
2875
28612876 - `name: "tool_search_tool_bm25"`
28622877
28632878 Name of the tool.
28642879
28652880 This is how the tool will be called by the model and in `tool_use` blocks.
28662881
2867 - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
2868
2869 - `"tool_search_tool_bm25_20251119"`
2870
2871 - `"tool_search_tool_bm25"`
2872
28732882 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
28742883
28752884 - `"direct"`
from line 2903
28942903
28952904 - `ToolSearchToolRegex20251119 object`
28962905
2906 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2907
2908 - `"tool_search_tool_regex_20251119"`
2909
2910 - `"tool_search_tool_regex"`
2911
28972912 - `name: "tool_search_tool_regex"`
28982913
28992914 Name of the tool.
29002915
29012916 This is how the tool will be called by the model and in `tool_use` blocks.
29022917
2903 - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
2904
2905 - `"tool_search_tool_regex_20251119"`
2906
2907 - `"tool_search_tool_regex"`
2908
29092918 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
29102919
29112920 - `"direct"`
from line 2977
29682977
29692978- `Message object`
29702979
2980 - `type: "message"`
2981
2982 Object type.
2983
2984 For Messages, this is always `"message"`.
2985
2986 default: message
2987
29712988 - `id: string`
29722989
29732990 Unique object identifier.
from line 3009
29923009
29933010 Skills loaded in the container
29943011
3012 - `type: "anthropic" or "custom"`
3013
3014 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
3015
3016 - `"anthropic"`
3017
3018 - `"custom"`
3019
29953020 - `skill_id: string`
29963021
29973022 Skill ID
29983023
29993024 maxLength: 64, minLength: 1
3000
3001 - `type: "anthropic" or "custom"`
3002
3003 Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
3004
3005 - `"anthropic"`
3006
3007 - `"custom"`
30083025
30093026 - `version: string`
30103027
from line 3060
30433060
30443061 - `TextBlock object`
30453062
3063 - `type: "text"`
3064
3065 default: text
3066
30463067 - `citations: array of TextCitation or null`
30473068
30483069 Citations supporting the text block.
from line 3072
30513072
30523073 - `CitationCharLocation object`
30533074
3075 - `type: "char_location"`
3076
3077 default: char_location
3078
30543079 - `cited_text: string`
30553080
30563081 - `document_index: number`
from line 3092
30673092
30683093 minimum: 0
30693094
3070 - `type: "char_location"`
3071
3072 default: char_location
3073
30743095 - `CitationPageLocation object`
30753096
3097 - `type: "page_location"`
3098
3099 default: page_location
3100
30763101 - `cited_text: string`
30773102
30783103 - `document_index: number`
from line 3114
30893114
30903115 minimum: 1
30913116
3092 - `type: "page_location"`
3093
3094 default: page_location
3095
30963117 - `CitationContentBlockLocation object`
30973118
3119 - `type: "content_block_location"`
3120
3121 default: content_block_location
3122
30983123 - `cited_text: string`
30993124
31003125 The full text of the cited block range, concatenated.
from line 3146
31213146
31223147 minimum: 0
31233148
3124 - `type: "content_block_location"`
3125
3126 default: content_block_location
3127
31283149 - `CitationsWebSearchResultLocation object`
31293150
3151 - `type: "web_search_result_location"`
3152
3153 default: web_search_result_location
3154
31303155 - `cited_text: string`
31313156
31323157 - `encrypted_index: string`
from line 3160
31353160
31363161 maxLength: 512
31373162
3138 - `type: "web_search_result_location"`
3139
3140 default: web_search_result_location
3141
31423163 - `url: string`
31433164
31443165 - `CitationsSearchResultLocation object`
31453166
3167 - `type: "search_result_location"`
3168
3169 default: search_result_location
3170
31463171 - `cited_text: string`
31473172
31483173 The full text of the cited block range, concatenated.
from line 3198
31733198
31743199 - `title: string or null`
31753200
3176 - `type: "search_result_location"`
3177
3178 default: search_result_location
3179
31803201 - `text: string`
31813202
3182 maxLength: 5000000, minLength: 0
3183
3184 - `type: "text"`
3185
3186 default: text
3203 minLength: 0
31873204
31883205 - `ThinkingBlock object`
31893206
3207 - `type: "thinking"`
3208
3209 default: thinking
3210
31903211 - `signature: string`
31913212
31923213 A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
from line 3220
31993220
32003221 The text of Claude's thinking process for this block.
32013222
3202 - `type: "thinking"`
3203
3204 default: thinking
3205
32063223 - `RedactedThinkingBlock object`
32073224
3225 - `type: "redacted_thinking"`
3226
3227 default: redacted_thinking
3228
32083229 - `data: string`
32093230
32103231 The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.
from line 3234
32133234
32143235 See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks) for details.
32153236
3216 - `type: "redacted_thinking"`
3217
3218 default: redacted_thinking
3219
32203237 - `ToolUseBlock object`
32213238
3239 - `type: "tool_use"`
3240
3241 default: tool_use
3242
32223243 - `id: string`
32233244
32243245 pattern: ^[a-zA-Z0-9_-]+$
from line 3260
32393260
32403261 Tool invocation generated by a server-side tool.
32413262
3263 - `type: "code_execution_20250825"`
3264
32423265 - `tool_id: string`
32433266
32443267 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
32453268
3246 - `type: "code_execution_20250825"`
3247
32483269 - `ServerToolCaller20260120 object`
32493270
3271 - `type: "code_execution_20260120"`
3272
32503273 - `tool_id: string`
32513274
32523275 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
32533276
3254 - `type: "code_execution_20260120"`
3255
32563277 - `input: map[unknown]`
32573278
32583279 - `name: string`
32593280
32603281 minLength: 1
32613282
3262 - `type: "tool_use"`
3263
3264 default: tool_use
3265
32663283 - `toolset_name: optional string or null`
32673284
32683285 For a toolset member tool_use, the toolset family.
from line 3288
32713288
32723289 - `ServerToolUseBlock object`
32733290
3291 - `type: "server_tool_use"`
3292
3293 default: server_tool_use
3294
32743295 - `id: string`
32753296
32763297 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
from line 3330
33093330
33103331 - `"tool_search_tool_bm25"`
33113332
3312 - `type: "server_tool_use"`
3313
3314 default: server_tool_use
3315
33163333 - `WebSearchToolResultBlock object`
33173334
3335 - `type: "web_search_tool_result"`
3336
3337 default: web_search_tool_result
3338
33183339 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
33193340
33203341 Tool invocation directly from the model.
from line 3356
33353356
33363357 - `WebSearchToolResultError object`
33373358
3359 - `type: "web_search_tool_result_error"`
3360
3361 default: web_search_tool_result_error
3362
33383363 - `error_code: WebSearchToolResultErrorCode`
33393364
33403365 - `"invalid_tool_input"`
from line 3374
33493374
33503375 - `"request_too_large"`
33513376
3352 - `type: "web_search_tool_result_error"`
3353
3354 default: web_search_tool_result_error
3355
33563377 - `array of WebSearchResultBlock`
33573378
3379 - `type: "web_search_result"`
3380
3381 default: web_search_result
3382
33583383 - `encrypted_content: string`
33593384
33603385 - `page_age: string or null`
33613386
33623387 - `title: string`
33633388
3364 - `type: "web_search_result"`
3365
3366 default: web_search_result
3367
33683389 - `url: string`
33693390
33703391 - `tool_use_id: string`
33713392
33723393 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
33733394
3374 - `type: "web_search_tool_result"`
3375
3376 default: web_search_tool_result
3377
33783395 - `WebFetchToolResultBlock object`
33793396
3397 - `type: "web_fetch_tool_result"`
3398
3399 default: web_fetch_tool_result
3400
33803401 - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
33813402
33823403 Tool invocation directly from the model.
from line 3418
33973418
33983419 - `WebFetchToolResultErrorBlock object`
33993420
3421 - `type: "web_fetch_tool_result_error"`
3422
3423 default: web_fetch_tool_result_error
3424
34003425 - `error_code: WebFetchToolResultErrorCode`
34013426
34023427 - `"invalid_tool_input"`
from line 3442
34173442
34183443 - `"unavailable"`
34193444
3420 - `type: "web_fetch_tool_result_error"`
3421
3422 default: web_fetch_tool_result_error
3445 - `"content_too_large"`
34233446
34243447 - `WebFetchBlock object`
34253448
3449 - `type: "web_fetch_result"`
3450
3451 default: web_fetch_result
3452
34263453 - `content: DocumentBlock`
34273454
3455 - `type: "document"`
3456
3457 default: document
3458
34283459 - `citations: CitationsConfig or null`
34293460
34303461 Citation configuration for the document
from line 3468
34373468
34383469 - `Base64PDFSource object`
34393470
3471 - `type: "base64"`
3472
34403473 - `data: string`
34413474
34423475 format: byte
34433476
34443477 - `media_type: "application/pdf"`
34453478
3446 - `type: "base64"`
3447
34483479 - `PlainTextSource object`
34493480
3481 - `type: "text"`
3482
34503483 - `data: string`
34513484
34523485 - `media_type: "text/plain"`
34533486
3454 - `type: "text"`
3455
34563487 - `title: string or null`
34573488
34583489 The title of the document
34593490
3460 - `type: "document"`
3461
3462 default: document
3463
34643491 - `retrieved_at: string or null`
34653492
34663493 ISO 8601 timestamp when the content was retrieved
34673494
3468 - `type: "web_fetch_result"`
3469
3470 default: web_fetch_result
3471
34723495 - `url: string`
34733496
34743497 Fetched content URL
from line 3500
34773500
34783501 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
34793502
3480 - `type: "web_fetch_tool_result"`
3481
3482 default: web_fetch_tool_result
3483
34843503 - `CodeExecutionToolResultBlock object`
34853504
3505 - `type: "code_execution_tool_result"`
3506
3507 default: code_execution_tool_result
3508
34863509 - `content: CodeExecutionToolResultBlockContent`
34873510
34883511 Code execution result with encrypted stdout for PFC + web_search results.
34893512
34903513 - `CodeExecutionToolResultError object`
34913514
3515 - `type: "code_execution_tool_result_error"`
3516
3517 default: code_execution_tool_result_error
3518
34923519 - `error_code: CodeExecutionToolResultErrorCode`
34933520
34943521 - `"invalid_tool_input"`
from line 3526
34993526
35003527 - `"execution_time_exceeded"`
35013528
3502 - `type: "code_execution_tool_result_error"`
3503
3504 default: code_execution_tool_result_error
3505
35063529 - `CodeExecutionResultBlock object`
35073530
3531 - `type: "code_execution_result"`
3532
3533 default: code_execution_result
3534
35083535 - `content: array of CodeExecutionOutputBlock`
35093536
3537 - `type: "code_execution_output"`
3538
3539 default: code_execution_output
3540
35103541 - `file_id: string`
35113542
3543 - `return_code: number`
3544
3545 - `stderr: string`
3546
3547 - `stdout: string`
3548
3549 - `EncryptedCodeExecutionResultBlock object`
3550
3551 Code execution result with encrypted stdout for PFC + web_search results.
3552
3553 - `type: "encrypted_code_execution_result"`
3554
3555 default: encrypted_code_execution_result
3556
3557 - `content: array of CodeExecutionOutputBlock`
3558
35123559 - `type: "code_execution_output"`
35133560
35143561 default: code_execution_output
35153562
3563 - `file_id: string`
3564
3565 - `encrypted_stdout: string`
3566
35163567 - `return_code: number`
35173568
35183569 - `stderr: string`
35193570
3571 - `tool_use_id: string`
3572
3573 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3574
3575 - `BashCodeExecutionToolResultBlock object`
3576
3577 - `type: "bash_code_execution_tool_result"`
3578
3579 default: bash_code_execution_tool_result
3580
3581 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
3582
3583 - `BashCodeExecutionToolResultError object`
3584
3585 - `type: "bash_code_execution_tool_result_error"`
3586
3587 default: bash_code_execution_tool_result_error
3588
3589 - `error_code: BashCodeExecutionToolResultErrorCode`
3590
3591 - `"invalid_tool_input"`
3592
3593 - `"unavailable"`
3594
3595 - `"too_many_requests"`
3596
3597 - `"execution_time_exceeded"`
3598
3599 - `"output_file_too_large"`
3600
3601 - `BashCodeExecutionResultBlock object`
3602
3603 - `type: "bash_code_execution_result"`
3604
3605 default: bash_code_execution_result
3606
3607 - `content: array of BashCodeExecutionOutputBlock`
3608
3609 - `type: "bash_code_execution_output"`
3610
3611 default: bash_code_execution_output
3612
3613 - `file_id: string`
3614
3615 - `return_code: number`
3616
3617 - `stderr: string`
3618
35203619 - `stdout: string`
35213620
3522 - `type: "code_execution_result"`
3523
3524 default: code_execution_result
3525
3526 - `EncryptedCodeExecutionResultBlock object`
3527
3528 Code execution result with encrypted stdout for PFC + web_search results.
3529
3530 - `content: array of CodeExecutionOutputBlock`
3531
3532 - `file_id: string`
3533
3534 - `type: "code_execution_output"`
3535
3536 default: code_execution_output
3537
3538 - `encrypted_stdout: string`
3539
3540 - `return_code: number`
3541
3542 - `stderr: string`
3543
3544 - `type: "encrypted_code_execution_result"`
3545
3546 default: encrypted_code_execution_result
3547
35483621 - `tool_use_id: string`
35493622
35503623 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
35513624
3552 - `type: "code_execution_tool_result"`
3553
3554 default: code_execution_tool_result
3555
3556 - `BashCodeExecutionToolResultBlock object`
3557
3558 - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
3559
3560 - `BashCodeExecutionToolResultError object`
3561
3562 - `error_code: BashCodeExecutionToolResultErrorCode`
3625 - `TextEditorCodeExecutionToolResultBlock object`
3626
3627 - `type: "text_editor_code_execution_tool_result"`
3628
3629 default: text_editor_code_execution_tool_result
3630
3631 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
3632
3633 - `TextEditorCodeExecutionToolResultError object`
3634
3635 - `type: "text_editor_code_execution_tool_result_error"`
3636
3637 default: text_editor_code_execution_tool_result_error
3638
3639 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
35633640
35643641 - `"invalid_tool_input"`
35653642
from line 3646
35693646
35703647 - `"execution_time_exceeded"`
35713648
3572 - `"output_file_too_large"`
3573
3574 - `type: "bash_code_execution_tool_result_error"`
3575
3576 default: bash_code_execution_tool_result_error
3577
3578 - `BashCodeExecutionResultBlock object`
3579
3580 - `content: array of BashCodeExecutionOutputBlock`
3581
3582 - `file_id: string`
3583
3584 - `type: "bash_code_execution_output"`
3585
3586 default: bash_code_execution_output
3587
3588 - `return_code: number`
3589
3590 - `stderr: string`
3591
3592 - `stdout: string`
3593
3594 - `type: "bash_code_execution_result"`
3595
3596 default: bash_code_execution_result
3649 - `"file_not_found"`
3650
3651 - `error_message: string or null`
3652
3653 - `TextEditorCodeExecutionViewResultBlock object`
3654
3655 - `type: "text_editor_code_execution_view_result"`
3656
3657 default: text_editor_code_execution_view_result
3658
3659 - `content: string`
3660
3661 - `file_type: "text" or "image" or "pdf"`
3662
3663 - `"text"`
3664
3665 - `"image"`
3666
3667 - `"pdf"`
3668
3669 - `num_lines: number or null`
3670
3671 - `start_line: number or null`
3672
3673 - `total_lines: number or null`
3674
3675 - `TextEditorCodeExecutionCreateResultBlock object`
3676
3677 - `type: "text_editor_code_execution_create_result"`
3678
3679 default: text_editor_code_execution_create_result
3680
3681 - `is_file_update: boolean`
3682
3683 - `TextEditorCodeExecutionStrReplaceResultBlock object`
3684
3685 - `type: "text_editor_code_execution_str_replace_result"`
3686
3687 default: text_editor_code_execution_str_replace_result
3688
3689 - `lines: array of string or null`
3690
3691 - `new_lines: number or null`
3692
3693 - `new_start: number or null`
3694
3695 - `old_lines: number or null`
3696
3697 - `old_start: number or null`
35973698
35983699 - `tool_use_id: string`
35993700
36003701 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
36013702
3602 - `type: "bash_code_execution_tool_result"`
3603
3604 default: bash_code_execution_tool_result
3605
3606 - `TextEditorCodeExecutionToolResultBlock object`
3607
3608 - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
3609
3610 - `TextEditorCodeExecutionToolResultError object`
3611
3612 - `error_code: TextEditorCodeExecutionToolResultErrorCode`
3703 - `ToolSearchToolResultBlock object`
3704
3705 - `type: "tool_search_tool_result"`
3706
3707 default: tool_search_tool_result
3708
3709 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
3710
3711 - `ToolSearchToolResultError object`
3712
3713 - `type: "tool_search_tool_result_error"`
3714
3715 default: tool_search_tool_result_error
3716
3717 - `error_code: ToolSearchToolResultErrorCode`
36133718
36143719 - `"invalid_tool_input"`
36153720
from line 3724
36193724
36203725 - `"execution_time_exceeded"`
36213726
3622 - `"file_not_found"`
3623
36243727 - `error_message: string or null`
36253728
3626 - `type: "text_editor_code_execution_tool_result_error"`
3627
3628 default: text_editor_code_execution_tool_result_error
3629
3630 - `TextEditorCodeExecutionViewResultBlock object`
3631
3632 - `content: string`
3633
3634 - `file_type: "text" or "image" or "pdf"`
3635
3636 - `"text"`
3637
3638 - `"image"`
3639
3640 - `"pdf"`
3641
3642 - `num_lines: number or null`
3643
3644 - `start_line: number or null`
3645
3646 - `total_lines: number or null`
3647
3648 - `type: "text_editor_code_execution_view_result"`
3649
3650 default: text_editor_code_execution_view_result
3651
3652 - `TextEditorCodeExecutionCreateResultBlock object`
3653
3654 - `is_file_update: boolean`
3655
3656 - `type: "text_editor_code_execution_create_result"`
3657
3658 default: text_editor_code_execution_create_result
3659
3660 - `TextEditorCodeExecutionStrReplaceResultBlock object`
3661
3662 - `lines: array of string or null`
3663
3664 - `new_lines: number or null`
3665
3666 - `new_start: number or null`
3667
3668 - `old_lines: number or null`
3669
3670 - `old_start: number or null`
3671
3672 - `type: "text_editor_code_execution_str_replace_result"`
3673
3674 default: text_editor_code_execution_str_replace_result
3729 - `ToolSearchToolSearchResultBlock object`
3730
3731 - `type: "tool_search_tool_search_result"`
3732
3733 default: tool_search_tool_search_result
3734
3735 - `tool_references: array of ToolReferenceBlock`
3736
3737 - `type: "tool_reference"`
3738
3739 default: tool_reference
3740
3741 - `tool_name: string`
3742
3743 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
36753744
36763745 - `tool_use_id: string`
36773746
36783747 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
36793748
3680 - `type: "text_editor_code_execution_tool_result"`
3681
3682 default: text_editor_code_execution_tool_result
3683
3684 - `ToolSearchToolResultBlock object`
3685
3686 - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
3687
3688 - `ToolSearchToolResultError object`
3689
3690 - `error_code: ToolSearchToolResultErrorCode`
3691
3692 - `"invalid_tool_input"`
3693
3694 - `"unavailable"`
3695
3696 - `"too_many_requests"`
3697
3698 - `"execution_time_exceeded"`
3699
3700 - `error_message: string or null`
3701
3702 - `type: "tool_search_tool_result_error"`
3703
3704 default: tool_search_tool_result_error
3705
3706 - `ToolSearchToolSearchResultBlock object`
3707
3708 - `tool_references: array of ToolReferenceBlock`
3709
3710 - `tool_name: string`
3711
3712 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
3713
3714 - `type: "tool_reference"`
3715
3716 default: tool_reference
3717
3718 - `type: "tool_search_tool_search_result"`
3719
3720 default: tool_search_tool_search_result
3721
3722 - `tool_use_id: string`
3723
3724 pattern: ^srvtoolu_[a-zA-Z0-9_]+$
3725
3726 - `type: "tool_search_tool_result"`
3727
3728 default: tool_search_tool_result
3729
37303749 - `ContainerUploadBlock object`
37313750
37323751 Response model for a file uploaded to the container.
37333752
3753 - `type: "container_upload"`
3754
3755 default: container_upload
3756
37343757 - `file_id: string`
37353758
3736 - `type: "container_upload"`
3737
3738 default: container_upload
3739
37403759 - `model: Model`
37413760
37423761 The model that will complete your prompt.
from line 3850
38313850
38323851 Structured information about a refusal.
38333852
3853 - `type: "refusal"`
3854
3855 default: refusal
3856
38343857 - `category: "cyber" or "bio" or "frontier_llm" or 2 more or null`
38353858
38363859 The policy category that triggered a refusal.
from line 3883
38603883 Human-readable explanation of the refusal.
38613884
38623885 This text is not guaranteed to be stable. `null` when no explanation is available for the category.
3863
3864 - `type: "refusal"`
3865
3866 default: refusal
38673886
38683887 - `stop_reason: StopReason or null`
38693888
from line 3920
39013920
39023921 This value will be a non-null string if one of your custom stop sequences was generated.
39033922
3904 - `type: "message"`
3905
3906 Object type.
3907
3908 For Messages, this is always `"message"`.
3909
3910 default: message
3911
39123923 - `usage: Usage`
39133924
39143925 Billing and rate-limit usage.
from line 4028
40174028
40184029 - `RawMessageStartEvent object`
40194030
4031 - `type: "message_start"`
4032
4033 default: message_start
4034
40204035 - `message: Message`
40214036
4022 - `type: "message_start"`
4023
4024 default: message_start
4025
40264037 - `RawMessageDeltaEvent object`
40274038
4039 - `type: "message_delta"`
4040
4041 default: message_delta
4042
40284043 - `delta: object`
40294044
40304045 - `container: Container or null`
from line 4053
40384053 - `stop_reason: StopReason or null`
40394054
40404055 - `stop_sequence: string or null`
4041
4042 - `type: "message_delta"`
4043
4044 default: message_delta
40454056
40464057 - `usage: MessageDeltaUsage`
40474058
from line 4109
40984109
40994110 - `RawContentBlockStartEvent object`
41004111
4112 - `type: "content_block_start"`
4113
4114 default: content_block_start
4115
41014116 - `content_block: TextBlock or ThinkingBlock or RedactedThinkingBlock or 9 more`
41024117
41034118 Response model for a file uploaded to the container.
from line 4145
41304145
41314146 - `index: number`
41324147
4133 - `type: "content_block_start"`
4134
4135 default: content_block_start
4136
41374148 - `RawContentBlockDeltaEvent object`
41384149
4150 - `type: "content_block_delta"`
4151
4152 default: content_block_delta
4153
41394154 - `delta: RawContentBlockDelta`
41404155
41414156 - `TextDelta object`
41424157
4158 - `type: "text_delta"`
4159
4160 default: text_delta
4161
41434162 - `text: string`
41444163
4145 - `type: "text_delta"`
4146
4147 default: text_delta
4148
41494164 - `InputJSONDelta object`
41504165
4166 - `type: "input_json_delta"`
4167
4168 default: input_json_delta
4169
41514170 - `partial_json: string`
41524171
4153 - `type: "input_json_delta"`
4154
4155 default: input_json_delta
4156
41574172 - `CitationsDelta object`
41584173
4174 - `type: "citations_delta"`
4175
4176 default: citations_delta
4177
41594178 - `citation: CitationCharLocation or CitationPageLocation or CitationContentBlockLocation or 2 more`
41604179
41614180 - `CitationCharLocation object`
from line 4187
41684187
41694188 - `CitationsSearchResultLocation object`
41704189
4171 - `type: "citations_delta"`
4172
4173 default: citations_delta
4174
41754190 - `ThinkingDelta object`
41764191
4192 - `type: "thinking_delta"`
4193
4194 default: thinking_delta
4195
41774196 - `thinking: string`
41784197
41794198 The incremental `thinking` text for this content block. Concatenate the `thinking` values of successive `thinking_delta` events to assemble the block's full `thinking` value.
41804199
4181 - `type: "thinking_delta"`
4182
4183 default: thinking_delta
4184
41854200 - `SignatureDelta object`
41864201
4202 - `type: "signature_delta"`
4203
4204 default: signature_delta
4205
41874206 - `signature: string`
41884207
41894208 The `signature` for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a `signature_delta` event just before the block's `content_block_stop` event.
41904209
4191 - `type: "signature_delta"`
4192
4193 default: signature_delta
4194
41954210 - `index: number`
41964211
4197 - `type: "content_block_delta"`
4198
4199 default: content_block_delta
4200
42014212 - `RawContentBlockStopEvent object`
42024213
4214 - `type: "content_block_stop"`
4215
4216 default: content_block_stop
4217
42034218 - `index: number`
4204
4205 - `type: "content_block_stop"`
4206
4207 default: content_block_stop
42084219
42094220## Example
42104221
42114222