X6.AI

Billing request

Markdown version

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

Look up token tiers and the sell-price charge for a single chat request (Teamo-style).

GET <BASE_URL>/v1/billing/requests/{request_id}

Authentication

Required: Authorization: Bearer <API_KEY>. Only requests created by this key are visible.

Path

ParamDescription
request_idResponse header X-Request-Id (same value as X-SNX-Trace-ID). Do not use body ids such as msg_ / chatcmpl_ / resp_

Usually available within 1–a few seconds after the call; 404 if not settled yet (retry).

Response (200)

{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "created_at": 1730700123,
  "model": "claude-haiku-5-5-discount",
  "usage": {
    "input_tokens": 100,
    "cached_write_tokens": 80,
    "cached_write_short_tokens": 80,
    "cached_write_long_tokens": 0,
    "cached_read_tokens": 0,
    "output_tokens": 20,
    "total_tokens": 200
  },
  "amount": {
    "value": "0.001234",
    "currency": "USD"
  }
}
FieldDescription
amount.valueCustomer sell charge (sell_amount) as a decimal string
usage.*Aligned with Model pricing four tiers; short/long write are extensions

TTL bucket detail still comes from Messages usage.cache_creation; this API returns write totals plus short/long columns.

Probe tips

  1. GET /v1/billing/balance → before
  2. POST /v1/messages (or chat / responses) → read X-Request-Id
  3. Poll this endpoint → check amount and tokens
  4. Optionally re-fetch balance; use Usage (period) for window totals

Related