messages
Count Message Tokens
Changed onAnthropic /v1/messages/count_tokens-compatible endpoint.
Returns {"input_tokens": N} without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:create_message — hybrid mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
post/api/v1/messages/count_tokens
Request
- The document declares no server URL.
- Auth: one of:
- API key in header Otari-Key
- API key in header x-api-key
Request body
Response
Successful Response
Changes
- info
added the optional property
to the response with the status
- info
- info
api operation id
count_message_tokens_api_v1_messages_count_tokens_postremoved and replaced withmessages-count_message_tokens
- info