Skip to main content
POST
Count a Messages request's input tokens (cached 10 min by body; not billed; counts toward RPM only)

Authorizations

Authorization
string
header
required

ak_… project API key (or x-api-key)

Body

application/json
model
string
required

Public model ID, e.g. a1 (A-05)

Minimum string length: 1
Example:

"a1"

messages
object[]
required
Required array length: 1 - 10000 elements
system
tools
object[]
Maximum array length: 128
tool_choice
object
thinking
Available options:
false

Response

OK

input_tokens
integer
required