Count message tokens
Estimate Anthropic Messages-compatible input tokens locally.
The response is a gateway estimate for request planning and policy checks. It does not call an upstream tokenizer, persist prompt content, or expose provider-native tokenization internals.
Authorizations
Org API key as Authorization: Bearer z_sk_...
Body
Request payload for countAnthropicMessageTokens. Examples use placeholder-safe values and do not include real secrets or private prompt content.
Schema for AnthropicMessagesRequest values returned by or accepted by the Nito gateway.
The messages field on AnthropicMessagesRequest.
1Nested schema within AnthropicMessagesRequest for AnthropicMessagesRequest.messages.items.
- Option 1
- Option 2
The max_tokens field on AnthropicMessagesRequest.
12
The metadata field on AnthropicMessagesRequest.
The model field on AnthropicMessagesRequest.
"openai/gpt-5.5"
The output_config field on AnthropicMessagesRequest.
The service_tier field on AnthropicMessagesRequest.
"example"
The stream field on AnthropicMessagesRequest.
true
The system field on AnthropicMessagesRequest.
"example"
The temperature field on AnthropicMessagesRequest.
0.5
The thinking field on AnthropicMessagesRequest.
The tool_choice field on AnthropicMessagesRequest.
- Option 1
- Option 2
The tools field on AnthropicMessagesRequest.
Nested schema within AnthropicMessagesRequest for AnthropicMessagesRequest.tools.items.
- Option 1
- Option 2
- Option 3
- Option 4
The top_p field on AnthropicMessagesRequest.
0.5
Response
OK
Schema for AnthropicCountTokensResponse values returned by or accepted by the Nito gateway.
The input_tokens field on AnthropicCountTokensResponse.
12

