GET

/v1/schemas/anthropic/chat/v1%2Fmessages%2Fcount_tokens%3Fbeta%3Dtrue

kind inputactivity chathash 6895ea88…extracted Nov 20, 2026version currentsource upstream spec ↗

Request body

14 properties · 2 required · 216 $defs
propertytypedescriptionconstraints
messages*BetaInputMessageUnion[]Input messages.
model*stringThe model that will complete your prompt.22 known values
billing_policyBetaBillingPolicyDeclares which organization is billed for the request.nullable
cache_controlBetaCacheControlEphemeralTop-level cache control automatically applies a cache_control marker to the last cacheable block in the request.nullable
compactionBetaSummarizeCompactionCompact the whole conversation and return a signed `compaction` block, alone, that a later request sends back first in `messages`, in place of the messages it summarizes. There is no trigger and no pause flag: sending the parameter compacts, and nothing is sam…nullable
context_managementBetaContextManagementConfigContext management configuration. This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.nullable
mcp_serversBetaRequestMCPServerURLDefinition[]MCP servers to be utilized in this requestitems ≤ 20
output_configBetaOutputConfigConfiguration options for the model's output, such as the output format.
output_formatBetaJsonOutputFormatDeprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) A schema to specify Claude's output format in responses. This parameter will be removed in a future release.nullable · deprecated
speedenumThe inference speed mode for this request. `"fast"` enables high output-tokens-per-second inference. Some models require the `fast-mode-2026-02-01` beta header for any `speed` value. See [fast mode](https://platform.claude.com/docs/en/build-with-claude/fast-mode) for which models.standard | fast · nullable
systemstring | BetaRequestTextBlock[]System prompt.
thinkingThinkingConfigEnabled | ThinkingConfigDi…Configuration for Claude's thinking.
tool_choiceToolChoiceAuto | ToolChoiceAny | ToolCho…How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
toolsBetaTool | BetaBashTool_20241022 | BetaBashTool_20250124[]Definitions of tools that the model may use.

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"anthropic","endpointId":"v1/messages/count_tokens?beta=true","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}