Skip to main content
POST
Count message tokens

Authorizations

Authorization
string
header
default:YOUR_API_KEY
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required
Example:

"glm-5.3-abliterated"

messages
object[]
required
system
max_tokens
integer

Output limit. Defaults to the model's max output.

stream
boolean
default:false
temperature
number
top_p
number
top_k
integer
stop_sequences
string[]
Maximum array length: 4
tools
object[]
tool_choice
object
thinking
object
output_config
object
reasoning_effort
enum<string>
Available options:
off,
low,
high,
max

Response

Token estimate

input_tokens
integer