Endpoint
model, 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.