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
| Field | Type | Description |
|---|---|---|
object | string | The object type, always token_count. |
model | string | Model id. |
input_tokens | integer | What usage.prompt_tokens would report for the same request, including the Syntic identity instruction. |
details | object | Breakdown by source; the parts add up to input_tokens. |
context_window | integer | The model’s context size. |
remaining_tokens | integer | context_window minus input_tokens. The reply must fit here. |
Returned by
Was this page helpful?