Skip to main content
POST
Count tokens

Authorizations

Authorization
string
header
required

Your virtual key, sk-alt-.... What every OpenAI and Anthropic SDK sends.

Headers

x-request-id
string

Your own reference for the request. Altrum uses it instead of making one, and returns it.

Body

application/json

An Anthropic token count request.

model
string
required

The provider and the model, such as openai/gpt-4o-mini. A name without a provider is matched to one your organization can serve.

Example:

"openai/gpt-4o-mini"

messages
object[]
required

Response

The count.

input_tokens
integer