GET

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

kind inputactivity chathash bd0c7963extracted Jul 25, 2026version currentsource upstream spec ↗

Request body

12 properties · 2 required · 136 $defs
propertytypedescriptionconstraints
messages*BetaInputMessage[]Input messages.
model*stringThe model that will complete your prompt.17 known values
cache_controlBetaCacheControlEphemeralTop-level cache control automatically applies a cache_control marker to the last cacheable block in the request.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
speedenumInference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.standard | fast · nullable
systemstring | BetaRequestTextBlock[]System prompt.
thinkingThinkingConfigEnabled | ThinkingConfigDi…Configuration for enabling Claude's extended 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", …}]}