Skip to main content
POST
Estimate input tokens using the same request parser as the message endpoint. This count is an estimate, not a model generation or proof decision. The example uses a plain-text conversation; use the deployed message contract for complex content blocks.

Headers

string
Retry-safe key. Replaying the same key with the same body returns the original response and sets idempotent-replayed; a different body with the same key is rejected 422. Use it so a retried write cannot double-execute or double-bill.

Request body

object
object[]
required
Conversation turns to count.
string,null
Model identifier accepted by your deployment.
string | object[],null
integer,null
Minimum: 0.
any[]
Default: [].
object,null
string[]
Default: [].
object
Opaque JSON metadata; defaults to null.
number,null
number,null
number,null
integer,null
Minimum: 0.
integer,null
Minimum: 0.
integer,null
Minimum: 0.
boolean,null
boolean,null
boolean,null
RecursiveChatKbLimits,null
RecursiveChatFactInput[],null
RecursiveChatRuleInput[],null

Response

CountTokensResponse
integer (int32)
required
Minimum: 0.

Status codes

Using this contract

Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.
Last modified on September 21, 2026