Endpoints
Count tokens
POST /v1/messages/count_tokens: count tokens for a prompt before you send it.
Count the number of tokens a request would use, without generating a response. This is free: it is not funds-gated and is not billed.
POST
https://api.spoofzone.com/v1/messages/count_tokensRequest
modelstringrequiredThe model the count should be computed for.
messagesarrayrequiredThe conversation to count, in the same shape as Messages.
systemstring | arrayAn optional system prompt to include in the count.
toolsarrayOptional tool definitions to include in the count.
Example
bash · 7 lines
Response
json · 5 lines
This endpoint has its own, higher rate limit. See Rate limits.