GET

/v1/schemas/anthropic/chat/v1/messages/count_tokens?beta=true?kind=output

kind outputactivity chathash e49375f0…extracted Sep 20, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
4f83b07f1f6aeb85c4f5c42156859c05f206224f35cb6bda9a650069772bc1c8
{
  "fetchedAt": 1789881662,
  "extractorVersion": "1",
  "verifiedAt": null
}

Response body

2 properties · 2 required · 1 $defs
propertytypedescriptionconstraints
context_management*BetaContextManagementResponseInformation about context management applied to the message.nullable
input_tokens*integerThe total number of tokens across the provided list of messages, system prompt, and tools.

Types

1 $defs

BetaContextManagementResponseobject

original_input_tokens*integerThe original token count before context management was applied

Validate a payload

before you spend tokens
shell
$ 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", …}]}