/v1/schemas/anthropic/chat/v1/messages?kind=output
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source trace690622377a5eedc0e9f2265ed755ee34dc0c52d35b47327f425777a550f45e1e{
"fetchedAt": 1794374425,
"extractorVersion": "2",
"verifiedAt": null
} |
Response body
11 properties · 11 required · 68 $defs| property | type | description | constraints |
|---|---|---|---|
| id* | string | Unique object identifier. | |
| type* | const | Object type. | "message" · default: "message" |
| role* | const | Conversational role of the generated message. | "assistant" · default: "assistant" |
| content* | ContentBlock[] | Content generated by the model. | |
| model* | string | The model that will complete your prompt. | 22 known values |
| stop_reason* | enum | The reason that we stopped. This may be one the following values: * `"end_turn"`: the model reached a natural stopping point * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated * `"tool_use"`: the model invoked one or more tools * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue. * `"refusal"`: when streaming classifiers intervene to handle potential policy violations * `"model_context_window_exceeded"`: we exceeded the model's context window In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise. | end_turn | max_tokens | stop_sequence | tool_use | pause_turn | refusal · +1 more · nullable |
| stop_sequence* | string | Which custom stop sequence was generated, if any. This value will be a non-null string if one of your custom stop sequences was generated. | nullable |
| stop_details* | RefusalStopDetails | Structured information about a refusal. | nullable |
| usage* | Usage | Billing and rate-limit usage. | |
| diagnostics* | Diagnostics | Request-level diagnostics: why the prompt cache could not fully reuse the prefix of the request named by `diagnostics.previous_message_id`. | nullable |
| container* | Container | Information about the container used in the request (for the code execution tool) | nullable |
Types
68 $defsBase64PDFSourceobject
| data* | string | format: byte | |
| media_type* | const | "application/pdf" | |
| type* | const | "base64" |
BashCodeExecutionToolResultErrorCodeenum
invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | output_file_too_large
CacheCreationobject
| ephemeral_1h_input_tokens* | integer | The number of input tokens used to create the 1 hour cache entry. | n ≥ 0 · default: 0 |
| ephemeral_5m_input_tokens* | integer | The number of input tokens used to create the 5 minute cache entry. | n ≥ 0 · default: 0 |
CacheMissMessagesChangedobject
A `cache_miss_reason` for a request whose `messages` differ from the previous request's in an earlier entry, instead of only having entries appended. The `model`, `system`, and `tools` match.
| cache_missed_input_tokens* | integer | Approximate number of input tokens that would have been read from cache had the prefix matched the previous request. | |
| type* | const | "messages_changed" · default: "messages_changed" |
CacheMissModelChangedobject
A `cache_miss_reason` for a request whose `model` or `speed` differs from the previous request's.
| cache_missed_input_tokens* | integer | Approximate number of input tokens that would have been read from cache had the prefix matched the previous request. | |
| type* | const | "model_changed" · default: "model_changed" |
CacheMissPreviousMessageNotFoundobject
A `cache_miss_reason` for when the API doesn't have a stored record of the request that `diagnostics.previous_message_id` references.
| type* | const | "previous_message_not_found" · default: "previous_message_not_found" |
CacheMissReasonCacheMissModelChanged | CacheMissSystemChanged | CacheMissToolsChanged | …
CacheMissSystemChangedobject
A `cache_miss_reason` for a request whose `system` differs from the previous request's.
| cache_missed_input_tokens* | integer | Approximate number of input tokens that would have been read from cache had the prefix matched the previous request. | |
| type* | const | "system_changed" · default: "system_changed" |
CacheMissToolsChangedobject
A `cache_miss_reason` for a request whose `tools` differ from the previous request's, for example because tools were added, removed, or reordered.
| cache_missed_input_tokens* | integer | Approximate number of input tokens that would have been read from cache had the prefix matched the previous request. | |
| type* | const | "tools_changed" · default: "tools_changed" |
CodeExecutionToolResultErrorCodeenum
invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded
Containerobject
Information about the container used in the request (for the code execution tool)
| expires_at* | string | The time at which the container will expire. | format: date-time |
| id* | string | Identifier for the container used in this request | |
| skills* | ContainerSkill[] | Skills loaded in the container | nullable |
ContainerSkillobject
A skill that was loaded in a container (response model).
| skill_id* | string | Skill ID | length ≥ 1 · length ≤ 64 |
| type* | enum | Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined) | anthropic | custom |
| version* | string | The resolved version: a skill version ID for custom skills. | length ≥ 1 · length ≤ 64 |
ContentBlockResponseTextBlock | ResponseThinkingBlock | ResponseRedactedThinkingBlock | …
Diagnosticsobject
Request-level diagnostics: why the prompt cache could not fully reuse the prefix of the request named by `diagnostics.previous_message_id`.
| cache_miss_reason* | CacheMissModelChanged | CacheMissSystemChanged | CacheMissToolsChanged | … | Explains why the prompt cache could not fully reuse the prefix from the request identified by `diagnostics.previous_message_id`. `null` means diagnosis is still pending — the response was serialized before the background comparison completed. | nullable |
DirectCallerobject
Tool invocation directly from the model.
| type* | const | "direct" |
Modelstring
The model that will complete your prompt.
22 known values
OutputTokensDetailsobject
| thinking_tokens* | integer | Number of output tokens the model generated as internal reasoning, including the thinking-block delimiter tokens. | n ≥ 0 · default: 0 |
PlainTextSourceobject
| data* | string | ||
| media_type* | const | "text/plain" | |
| type* | const | "text" |
RefusalCategorystring
The policy category that triggered a refusal.
5 known values
RefusalStopDetailsobject
Structured information about a refusal.
| category* | string | The policy category that triggered a refusal. | 5 known values · nullable |
| explanation* | string | Human-readable explanation of the refusal. This text is not guaranteed to be stable. `null` when no explanation is available for the category. | nullable |
| type* | const | "refusal" · default: "refusal" |
ResponseBashCodeExecutionOutputBlockobject
| file_id* | string | ||
| type* | const | "bash_code_execution_output" · default: "bash_code_execution_output" |
ResponseBashCodeExecutionResultBlockobject
| content* | ResponseBashCodeExecutionOutputBlock[] | ||
| return_code* | integer | ||
| stderr* | string | ||
| stdout* | string | ||
| type* | const | "bash_code_execution_result" · default: "bash_code_execution_result" |
ResponseBashCodeExecutionToolResultBlockobject
| content* | ResponseBashCodeExecutionToolResultError | ResponseBashCodeExecutionResultBlock | ||
| tool_use_id* | string | ||
| type* | const | "bash_code_execution_tool_result… · default: "bash_code_execution_tool_result… |
ResponseBashCodeExecutionToolResultErrorobject
| error_code* | enum | invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | output_file_too_large | |
| type* | const | "bash_code_execution_tool_result… · default: "bash_code_execution_tool_result… |
ResponseCharLocationCitationobject
| cited_text* | string | ||
| document_index* | integer | n ≥ 0 | |
| document_title* | string | nullable | |
| end_char_index* | integer | ||
| file_id* | string | nullable | |
| start_char_index* | integer | n ≥ 0 | |
| type* | const | "char_location" · default: "char_location" |
ResponseCitationsConfigobject
| enabled* | boolean | default: false |
ResponseCodeExecutionOutputBlockobject
| file_id* | string | ||
| type* | const | "code_execution_output" · default: "code_execution_output" |
ResponseCodeExecutionResultBlockobject
| content* | ResponseCodeExecutionOutputBlock[] | ||
| return_code* | integer | ||
| stderr* | string | ||
| stdout* | string | ||
| type* | const | "code_execution_result" · default: "code_execution_result" |
ResponseCodeExecutionToolResultBlockobject
| content* | ResponseCodeExecutionToolResultError | ResponseCodeExecutionResultBlock | ResponseEncryptedCodeExecutionResultBlock | ||
| tool_use_id* | string | ||
| type* | const | "code_execution_tool_result" · default: "code_execution_tool_result" |
ResponseCodeExecutionToolResultErrorobject
| error_code* | enum | invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | |
| type* | const | "code_execution_tool_result_erro… · default: "code_execution_tool_result_erro… |
ResponseContainerUploadBlockobject
Response model for a file uploaded to the container.
| file_id* | string | ||
| type* | const | "container_upload" · default: "container_upload" |
ResponseContentBlockLocationCitationobject
| cited_text* | string | The full text of the cited block range, concatenated. | |
| document_index* | integer | n ≥ 0 | |
| document_title* | string | nullable | |
| end_block_index* | integer | Exclusive 0-based end index of the cited block range in the source's `content` array. | |
| file_id* | string | nullable | |
| start_block_index* | integer | 0-based index of the first cited block in the source's `content` array. | n ≥ 0 |
| type* | const | "content_block_location" · default: "content_block_location" |
ResponseDocumentBlockobject
| citations* | ResponseCitationsConfig | Citation configuration for the document | nullable |
| source* | Base64PDFSource | PlainTextSource | ||
| title* | string | The title of the document | nullable |
| type* | const | "document" · default: "document" |
ResponseEncryptedCodeExecutionResultBlockobject
The output and exit code of Python code that Claude ran with the code execution tool, with standard output in encrypted form.
| content* | ResponseCodeExecutionOutputBlock[] | ||
| encrypted_stdout* | string | ||
| return_code* | integer | ||
| stderr* | string | ||
| type* | const | "encrypted_code_execution_result… · default: "encrypted_code_execution_result… |
ResponsePageLocationCitationobject
| cited_text* | string | ||
| document_index* | integer | n ≥ 0 | |
| document_title* | string | nullable | |
| end_page_number* | integer | ||
| file_id* | string | nullable | |
| start_page_number* | integer | n ≥ 1 | |
| type* | const | "page_location" · default: "page_location" |
ResponseRedactedThinkingBlockobject
| data* | string | 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. | |
| type* | const | "redacted_thinking" · default: "redacted_thinking" |
ResponseSearchResultLocationCitationobject
| cited_text* | string | The full text of the cited block range, concatenated. | |
| end_block_index* | integer | Exclusive 0-based end index of the cited block range in the source's `content` array. | |
| search_result_index* | integer | 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. | n ≥ 0 |
| source* | string | ||
| start_block_index* | integer | 0-based index of the first cited block in the source's `content` array. | n ≥ 0 |
| title* | string | nullable | |
| type* | const | "search_result_location" · default: "search_result_location" |
ResponseServerToolUseBlockobject
| caller* | DirectCaller | ServerToolCaller | ServerToolCaller_20260120 | default: {"type":"direct"} | |
| id* | string | ||
| input* | object | ||
| name* | enum | web_search | web_fetch | code_execution | bash_code_execution | text_editor_code_execution | tool_search_tool_regex · +1 more | |
| type* | const | "server_tool_use" · default: "server_tool_use" |
ResponseTextBlockobject
| citations* | ResponseCharLocationCitation | ResponsePageLocationCitation | ResponseContentBlockLocationCitation[] | Citations supporting the text block. The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`. | nullable |
| text* | string | length ≥ 0 | |
| type* | const | "text" · default: "text" |
ResponseTextEditorCodeExecutionCreateResultBlockobject
| is_file_update* | boolean | ||
| type* | const | "text_editor_code_execution_crea… · default: "text_editor_code_execution_crea… |
ResponseTextEditorCodeExecutionStrReplaceResultBlockobject
| lines* | string[] | nullable | |
| new_lines* | integer | nullable | |
| new_start* | integer | nullable | |
| old_lines* | integer | nullable | |
| old_start* | integer | nullable | |
| type* | const | "text_editor_code_execution_str_… · default: "text_editor_code_execution_str_… |
ResponseTextEditorCodeExecutionToolResultBlockobject
| content* | ResponseTextEditorCodeExecutionToolResultError | ResponseTextEditorCodeExecutionViewResultBlock | ResponseTextEditorCodeExecutionCreateResultBlock | … | ||
| tool_use_id* | string | ||
| type* | const | "text_editor_code_execution_tool… · default: "text_editor_code_execution_tool… |
ResponseTextEditorCodeExecutionToolResultErrorobject
| error_code* | enum | invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | file_not_found | |
| error_message* | string | nullable | |
| type* | const | "text_editor_code_execution_tool… · default: "text_editor_code_execution_tool… |
ResponseTextEditorCodeExecutionViewResultBlockobject
| content* | string | ||
| file_type* | enum | text | image | pdf | |
| num_lines* | integer | nullable | |
| start_line* | integer | nullable | |
| total_lines* | integer | nullable | |
| type* | const | "text_editor_code_execution_view… · default: "text_editor_code_execution_view… |
ResponseThinkingBlockobject
| signature* | string | A value used to verify that this thinking block was generated by Claude when it is passed back to the API. | |
| thinking* | string | The text of Claude's thinking process for this block. | |
| type* | const | "thinking" · default: "thinking" |
ResponseToolReferenceBlockobject
| tool_name* | string | length ≥ 1 · length ≤ 256 | |
| type* | const | "tool_reference" · default: "tool_reference" |
ResponseToolSearchToolResultBlockobject
| content* | ResponseToolSearchToolResultError | ResponseToolSearchToolSearchResultBlock | ||
| tool_use_id* | string | ||
| type* | const | "tool_search_tool_result" · default: "tool_search_tool_result" |
ResponseToolSearchToolResultErrorobject
| error_code* | enum | invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | |
| error_message* | string | nullable | |
| type* | const | "tool_search_tool_result_error" · default: "tool_search_tool_result_error" |
ResponseToolSearchToolSearchResultBlockobject
| tool_references* | ResponseToolReferenceBlock[] | ||
| type* | const | "tool_search_tool_search_result" · default: "tool_search_tool_search_result" |
ResponseToolUseBlockobject
| caller* | DirectCaller | ServerToolCaller | ServerToolCaller_20260120 | default: {"type":"direct"} | |
| id* | string | ||
| input* | object | ||
| name* | string | length ≥ 1 | |
| toolset_name | string | For a toolset member tool_use, the toolset family. | length ≥ 1 · length ≤ 64 · nullable |
| type* | const | "tool_use" · default: "tool_use" |
ResponseWebFetchResultBlockobject
| content* | ResponseDocumentBlock | ||
| retrieved_at* | string | ISO 8601 timestamp when the content was retrieved | nullable |
| type* | const | "web_fetch_result" · default: "web_fetch_result" | |
| url* | string | Fetched content URL |
ResponseWebFetchToolResultBlockobject
| caller* | DirectCaller | ServerToolCaller | ServerToolCaller_20260120 | default: {"type":"direct"} | |
| content* | ResponseWebFetchToolResultError | ResponseWebFetchResultBlock | ||
| tool_use_id* | string | ||
| type* | const | "web_fetch_tool_result" · default: "web_fetch_tool_result" |
ResponseWebFetchToolResultErrorobject
| error_code* | enum | invalid_tool_input | url_too_long | url_not_allowed | url_not_in_prior_context | url_not_accessible | unsupported_content_type · +4 more | |
| type* | const | "web_fetch_tool_result_error" · default: "web_fetch_tool_result_error" |
ResponseWebSearchResultBlockobject
| encrypted_content* | string | ||
| page_age* | string | nullable | |
| title* | string | ||
| type* | const | "web_search_result" · default: "web_search_result" | |
| url* | string |
ResponseWebSearchResultLocationCitationobject
| cited_text* | string | ||
| encrypted_index* | string | ||
| title* | string | length ≤ 512 · nullable | |
| type* | const | "web_search_result_location" · default: "web_search_result_location" | |
| url* | string |
ResponseWebSearchToolResultBlockobject
| caller* | DirectCaller | ServerToolCaller | ServerToolCaller_20260120 | default: {"type":"direct"} | |
| content* | ResponseWebSearchToolResultError | ResponseWebSearchResultBlock[] | ||
| tool_use_id* | string | ||
| type* | const | "web_search_tool_result" · default: "web_search_tool_result" |
ResponseWebSearchToolResultErrorobject
| error_code* | enum | invalid_tool_input | unavailable | max_uses_exceeded | too_many_requests | query_too_long | request_too_large | |
| type* | const | "web_search_tool_result_error" · default: "web_search_tool_result_error" |
ServerToolCallerobject
Tool invocation generated by a server-side tool.
| tool_id* | string | ||
| type* | const | "code_execution_20250825" |
ServerToolCaller_20260120object
| tool_id* | string | ||
| type* | const | "code_execution_20260120" |
ServerToolUsageobject
| web_fetch_requests* | integer | The number of web fetch tool requests. | n ≥ 0 · default: 0 |
| web_search_requests* | integer | The number of web search tool requests. | n ≥ 0 · default: 0 |
Speedenum
standard | fast
StopReasonenum
end_turn | max_tokens | stop_sequence | tool_use | pause_turn | refusal · +1 more
TextEditorCodeExecutionToolResultErrorCodeenum
invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | file_not_found
ToolSearchToolResultErrorCodeenum
invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded
Usageobject
| cache_creation* | CacheCreation | Breakdown of cached tokens by TTL | nullable |
| cache_creation_input_tokens* | integer | The number of input tokens used to create the cache entry. | n ≥ 0 · nullable |
| cache_read_input_tokens* | integer | The number of input tokens read from the cache. | n ≥ 0 · nullable |
| inference_geo* | string | The geographic region where inference was performed for this request. | nullable |
| input_tokens* | integer | The number of input tokens which were used. | n ≥ 0 |
| output_tokens* | integer | The number of output tokens which were used. | n ≥ 0 |
| output_tokens_details* | OutputTokensDetails | Breakdown of output tokens by category. `output_tokens` remains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you. | nullable |
| server_tool_use* | ServerToolUsage | The number of server tool requests. | nullable |
| service_tier* | enum | If the request used the priority, standard, or batch tier. | standard | priority | batch · nullable |
| speed* | enum | The inference speed mode used for this request. | standard | fast · nullable |
WebFetchToolResultErrorCodeenum
invalid_tool_input | url_too_long | url_not_allowed | url_not_in_prior_context | url_not_accessible | unsupported_content_type · +4 more
WebSearchToolResultErrorCodeenum
invalid_tool_input | unavailable | max_uses_exceeded | too_many_requests | query_too_long | request_too_large
Validate a payload
before you spend tokens$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"anthropic","endpointId":"v1/messages","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}