When to use
- Build a custom spend chart outside the console
- Detect a model-cost regression after switching
modelslug - Reconcile credits-headers against a wider window (per-call vs daily roll-up)
/me/billing/transactions. For per-call data (raw inference log items), wait for the per-call audit endpoint — not yet exposed in v1.
Request
Query parameters
| Param | Type | Notes |
|---|---|---|
since | string | ISO date / timestamp — bucket from this moment (inclusive). Default: 30 days ago. |
until | string | ISO date / timestamp — bucket until this moment (exclusive). Default: now. |
group_by | string | day (default) / hour / model / api_key. Combine via comma: ?group_by=day,model. |
model | string | Filter to a single model slug. |
api_key | string | Filter to a single key (server-side resolved by key id; you can pass either the masked form or the key’s id). |
since / until default windows cap at 90 days of history.
Response — group_by=day
Response — group_by=day,model
Response fields
| Field | Type | Notes |
|---|---|---|
buckets[].bucket | string | ISO date (for day), ISO timestamp truncated to hour (for hour), or the dimension value (model id / key id). |
buckets[].total_usd | number | Billed amount in this bucket. |
buckets[].input_tokens | integer | Sum of input tokens. |
buckets[].output_tokens | integer | Sum of output tokens. |
buckets[].call_count | integer | Number of successful calls. Failed calls are free + excluded. |
totals | object | Same shape, summed across every returned bucket. |
Errors
| Status | error.type | Trigger |
|---|---|---|
| 400 | invalid_request_error | since/until malformed, group_by unknown, or window > 90 days. |
| 401 | authentication_error | Missing / revoked key. |