GET
/v1/schemas/anthropic/chat/v1%2Fmessages%2Fcount_tokens%3Fbeta%3Dtrue
Accept:
Request body
14 properties · 2 required · 216 $defs| property | type | description | constraints |
|---|---|---|---|
| messages* | BetaInputMessageUnion[] | Input messages. | |
| model* | string | The model that will complete your prompt. | 22 known values |
| billing_policy | BetaBillingPolicy | Declares which organization is billed for the request. | nullable |
| cache_control | BetaCacheControlEphemeral | Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request. | nullable |
| compaction | BetaSummarizeCompaction | Compact 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_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 | The 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 |
| system | string | BetaRequestTextBlock[] | System prompt. | |
| thinking | ThinkingConfigEnabled | ThinkingConfigDi… | Configuration for Claude's 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", …}]}