Count Message Tokens
Count input tokens for an Anthropic Messages request without generating a completion.
X-API-Key<token>
Project-scoped Nebul API key. Also accepted as Authorization: Bearer <key>.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v1/messages/count_tokens" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "messages": [ { "role": "user", "content": "string" } ] }'{ "input_tokens": 0}