Skip to main content
POST
Count input tokens

Authorizations

Authorization
string
header
required

Use a JWT or abliteration.ai API key as a Bearer token.

Body

application/json
model
string
required

Model id (e.g. abliterated-model).

messages
object[]
required

Non-empty array of message objects. Each has role (user or assistant) and content (string or content-block array).

Minimum array length: 1
max_tokens
integer

Maximum number of tokens to generate.

Required range: x >= 1
temperature
number

Sampling temperature.

Required range: 0 <= x <= 2
stream
boolean
default:false

Enable Server-Sent Events streaming.

system

System prompt. Can be a string or an array of content blocks.

flagged_categories
string[]

Optional moderation categories to block. Supported: harassment, hate, illicit, sexual. Self-harm and sexual/minors are always blocked.

Response

Token count

input_tokens
integer
required

Estimated number of input tokens.

Last modified on May 2, 2026