The token count object

⚠️
Preview — this feature is being built; the design below is the spec.

The token_count object as the API returns it. Every field below appears in every response that returns this object; fields with no value are null rather than missing.

Example

{
  "object": "token_count",
  "model": "Amara S1.2",
  "input_tokens": 18342,
  "details": {
    "system_tokens": 412,
    "message_tokens": 15210,
    "tool_tokens": 1890,
    "image_tokens": 765,
    "document_tokens": 0
  },
  "context_window": 262144,
  "remaining_tokens": 243802
}

Fields

FieldTypeDescription
objectstringThe object type, always token_count.
modelstringModel id.
input_tokensintegerWhat usage.prompt_tokens would report for the same request, including the Syntic identity instruction.
detailsobjectBreakdown by source; the parts add up to input_tokens.
context_windowintegerThe model’s context size.
remaining_tokensintegercontext_window minus input_tokens. The reply must fit here.

Returned by

Was this page helpful?