Skip to main content
POST
Count Message tokens

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Headers

X-Opper-Name
string

Function name for tracing and project-level guardrail function-scope filtering.

X-Opper-Parent-Span-Id
string<uuid>

Parent span ID for distributed tracing context.

Body

application/json
max_tokens
integer
required
messages
object[]
required
model
string
required
metadata
object
output_format
object
stop_sequences
string[]
stream
boolean
system
any

Any value

temperature
number
thinking
any

Any value

tool_choice
any

Any value

tools
object[]
top_k
integer
top_p
number

Response

Successful response

input_tokens
integer
required

The number of input tokens the request would consume.