Billing request
Markdown versionReplace <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
| Param | Description |
|---|---|
request_id | Response 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"
}
}| Field | Description |
|---|---|
amount.value | Customer 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
GET /v1/billing/balance→ beforePOST /v1/messages(or chat / responses) → readX-Request-Id- Poll this endpoint → check
amountand tokens - Optionally re-fetch balance; use Usage (period) for window totals