GET

/v1/schemas/anthropic/chat/v1/messages?kind=output

kind outputactivity chathash 7764f96a…extracted Nov 11, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
690622377a5eedc0e9f2265ed755ee34dc0c52d35b47327f425777a550f45e1e
{
  "fetchedAt": 1794374425,
  "extractorVersion": "2",
  "verifiedAt": null
}

Response body

11 properties · 11 required · 68 $defs
propertytypedescriptionconstraints
id*stringUnique object identifier.
type*constObject type."message" · default: "message"
role*constConversational role of the generated message."assistant" · default: "assistant"
content*ContentBlock[]Content generated by the model.
model*stringThe model that will complete your prompt.22 known values
stop_reason*enumThe 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*stringWhich 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*RefusalStopDetailsStructured information about a refusal.nullable
usage*UsageBilling and rate-limit usage.
diagnostics*DiagnosticsRequest-level diagnostics: why the prompt cache could not fully reuse the prefix of the request named by `diagnostics.previous_message_id`.nullable
container*ContainerInformation about the container used in the request (for the code execution tool)nullable

Types

68 $defs

Base64PDFSourceobject

data*stringformat: 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*integerThe number of input tokens used to create the 1 hour cache entry.n ≥ 0 · default: 0
ephemeral_5m_input_tokens*integerThe 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*integerApproximate 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*integerApproximate 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*integerApproximate 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*integerApproximate 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"

CacheMissUnavailableobject

A `cache_miss_reason` for when the API can't give a diagnosis. The request itself was processed normally.

type*const"unavailable" · default: "unavailable"

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*stringThe time at which the container will expire.format: date-time
id*stringIdentifier for the container used in this request
skills*ContainerSkill[]Skills loaded in the containernullable

ContainerSkillobject

A skill that was loaded in a container (response model).

skill_id*stringSkill IDlength ≥ 1 · length ≤ 64
type*enumType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)anthropic | custom
version*stringThe 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*integerNumber 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*stringThe policy category that triggered a refusal.5 known values · nullable
explanation*stringHuman-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*enuminvalid_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*integern ≥ 0
document_title*stringnullable
end_char_index*integer
file_id*stringnullable
start_char_index*integern ≥ 0
type*const"char_location" · default: "char_location"

ResponseCitationsConfigobject

enabled*booleandefault: 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*enuminvalid_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*stringThe full text of the cited block range, concatenated.
document_index*integern ≥ 0
document_title*stringnullable
end_block_index*integerExclusive 0-based end index of the cited block range in the source's `content` array.
file_id*stringnullable
start_block_index*integer0-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*ResponseCitationsConfigCitation configuration for the documentnullable
source*Base64PDFSource | PlainTextSource
title*stringThe title of the documentnullable
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*integern ≥ 0
document_title*stringnullable
end_page_number*integer
file_id*stringnullable
start_page_number*integern ≥ 1
type*const"page_location" · default: "page_location"

ResponseRedactedThinkingBlockobject

data*stringThe 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*stringThe full text of the cited block range, concatenated.
end_block_index*integerExclusive 0-based end index of the cited block range in the source's `content` array.
search_result_index*integer0-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*integer0-based index of the first cited block in the source's `content` array.n ≥ 0
title*stringnullable
type*const"search_result_location" · default: "search_result_location"

ResponseServerToolUseBlockobject

caller*DirectCaller | ServerToolCaller | ServerToolCaller_20260120default: {"type":"direct"}
id*string
input*object
name*enumweb_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*stringlength ≥ 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*integernullable
new_start*integernullable
old_lines*integernullable
old_start*integernullable
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*enuminvalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | file_not_found
error_message*stringnullable
type*const"text_editor_code_execution_tool… · default: "text_editor_code_execution_tool…

ResponseTextEditorCodeExecutionViewResultBlockobject

content*string
file_type*enumtext | image | pdf
num_lines*integernullable
start_line*integernullable
total_lines*integernullable
type*const"text_editor_code_execution_view… · default: "text_editor_code_execution_view…

ResponseThinkingBlockobject

signature*stringA value used to verify that this thinking block was generated by Claude when it is passed back to the API.
thinking*stringThe text of Claude's thinking process for this block.
type*const"thinking" · default: "thinking"

ResponseToolReferenceBlockobject

tool_name*stringlength ≥ 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*enuminvalid_tool_input | unavailable | too_many_requests | execution_time_exceeded
error_message*stringnullable
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_20260120default: {"type":"direct"}
id*string
input*object
name*stringlength ≥ 1
toolset_namestringFor 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*stringISO 8601 timestamp when the content was retrievednullable
type*const"web_fetch_result" · default: "web_fetch_result"
url*stringFetched content URL

ResponseWebFetchToolResultBlockobject

caller*DirectCaller | ServerToolCaller | ServerToolCaller_20260120default: {"type":"direct"}
content*ResponseWebFetchToolResultError | ResponseWebFetchResultBlock
tool_use_id*string
type*const"web_fetch_tool_result" · default: "web_fetch_tool_result"

ResponseWebFetchToolResultErrorobject

error_code*enuminvalid_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*stringnullable
title*string
type*const"web_search_result" · default: "web_search_result"
url*string

ResponseWebSearchResultLocationCitationobject

cited_text*string
encrypted_index*string
title*stringlength ≤ 512 · nullable
type*const"web_search_result_location" · default: "web_search_result_location"
url*string

ResponseWebSearchToolResultBlockobject

caller*DirectCaller | ServerToolCaller | ServerToolCaller_20260120default: {"type":"direct"}
content*ResponseWebSearchToolResultError | ResponseWebSearchResultBlock[]
tool_use_id*string
type*const"web_search_tool_result" · default: "web_search_tool_result"

ResponseWebSearchToolResultErrorobject

error_code*enuminvalid_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*integerThe number of web fetch tool requests.n ≥ 0 · default: 0
web_search_requests*integerThe 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*CacheCreationBreakdown of cached tokens by TTLnullable
cache_creation_input_tokens*integerThe number of input tokens used to create the cache entry.n ≥ 0 · nullable
cache_read_input_tokens*integerThe number of input tokens read from the cache.n ≥ 0 · nullable
inference_geo*stringThe geographic region where inference was performed for this request.nullable
input_tokens*integerThe number of input tokens which were used.n ≥ 0
output_tokens*integerThe number of output tokens which were used.n ≥ 0
output_tokens_details*OutputTokensDetailsBreakdown 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*ServerToolUsageThe number of server tool requests.nullable
service_tier*enumIf the request used the priority, standard, or batch tier.standard | priority | batch · nullable
speed*enumThe 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
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"anthropic","endpointId":"v1/messages","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}