GET

/v1/schemas/anthropic/chat/v1%2Fmessages%2Fcount_tokens

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

Request body

8 properties · 2 required · 96 $defs
propertytypedescriptionconstraints
messages*InputMessage[]Input messages.
model*stringThe model that will complete your prompt.17 known values
cache_controlCacheControlEphemeralTop-level cache control automatically applies a cache_control marker to the last cacheable block in the request.nullable
output_configOutputConfigConfiguration options for the model's output, such as the output format.
systemstring | RequestTextBlock[]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.
toolsTool | BashTool_20250124 | CodeExecutionTool_20250522[]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","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}