X6.AI

Usage (period)

Markdown version

Replace <BASE_URL> with https://api.x6.ai. See Endpoints.

Aggregate token usage for the current API key over a time window (no money amounts; use balance delta or per-request billing for charges).

GET <BASE_URL>/v1/usage?start_time=<unix_sec>&end_time=<unix_sec>

Authentication

Required: Authorization: Bearer <API_KEY>.

Query (required)

ParamDescription
start_timeUnix seconds (inclusive start)
end_timeUnix seconds (exclusive end; must be greater than start_time)

Missing or invalid params return 400, e.g. start_time must be a Unix timestamp in seconds.

Response (200)

{
  "start_time": 1730700000,
  "end_time": 1730786400,
  "requests": 12,
  "usage": {
    "input_tokens": 1000,
    "cached_write_tokens": 200,
    "cached_write_short_tokens": 150,
    "cached_write_long_tokens": 50,
    "cached_read_tokens": 80,
    "output_tokens": 300,
    "total_tokens": 1580
  }
}
FieldDescription
requestsRequest count in the window
usage.input_tokensPlain input (excludes cache read)
usage.cached_read_tokensCache read total
usage.cached_write_tokensCache write total
usage.cached_write_short_tokens / cached_write_long_tokensShort/long TTL write (x6 extension)
usage.output_tokens / total_tokensOutput / total

Scoped to the current API key only.

Related