GET
/v1/schemas/anthropic/chat/v1%2Fmessages%2Fcount_tokens%3Fbeta%3Dtrue
Accept:
Request body
12 properties · 2 required · 136 $defs| property | type | description | constraints |
|---|---|---|---|
| messages* | BetaInputMessage[] | Input messages. | |
| model* | string | The model that will complete your prompt. | 17 known values |
| cache_control | BetaCacheControlEphemeral | Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request. | nullable |
| context_management | BetaContextManagementConfig | Context 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_servers | BetaRequestMCPServerURLDefinition[] | MCP servers to be utilized in this request | items ≤ 20 |
| output_config | BetaOutputConfig | Configuration options for the model's output, such as the output format. | |
| output_format | BetaJsonOutputFormat | Deprecated: 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 |
| speed | enum | Inference 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 |
| system | string | BetaRequestTextBlock[] | 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 | BetaTool | BetaBashTool_20241022 | BetaBashTool_20250124[] | 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?beta=true","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}