Skip to main content
POST
Anthropic Messages Count Tokens

Authorizations

Authorization
string
header
required

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

Headers

xi-api-key
string | null
x-api-key
string | null

Body

application/json
model
string
required
messages
Messages · object[]
required
system
tools
AnthropicTool · object[] | null
thinking
AnthropicThinkingConfig · object | null

Anthropic thinking config: {type: enabled|disabled|adaptive, budget_tokens}.

enabled is a legacy pre-spec field this endpoint used to accept; it only applies when type is absent.

tool_choice
Tool Choice · object | null

Response

Successful Response