Skip to main content

Endpoint

Anthropic-compatible: send the same body you would send to /v1/messagesmodel, system, messages, tools — and get a token count back without generating anything.

Example

Request
Response

Response fields

The count is an estimate for budgeting, not an invoice: use it to decide what fits in a context window. Billing always uses the exact usage counts returned on the response that actually generates.