GET
/v1/schemas/anthropic/chat/v1%2Fmessages%2Fcount_tokens
Accept:
Request body
8 properties · 2 required · 96 $defs| property | type | description | constraints |
|---|---|---|---|
| messages* | InputMessage[] | Input messages. | |
| model* | string | The model that will complete your prompt. | 17 known values |
| cache_control | CacheControlEphemeral | Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request. | nullable |
| output_config | OutputConfig | Configuration options for the model's output, such as the output format. | |
| system | string | RequestTextBlock[] | System prompt. | |
| thinking | ThinkingConfigEnabled | ThinkingConfigDi… | Configuration for enabling Claude's extended thinking. | |
| tool_choice | ToolChoiceAuto | 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. | |
| tools | Tool | BashTool_20250124 | CodeExecutionTool_20250522[] | Definitions of tools that the model may use. |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"anthropic","endpointId":"v1/messages/count_tokens","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}