> ## Documentation Index
> Fetch the complete documentation index at: https://docs.imagine.art/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage and billing

> Check your credit balance, usage totals, request logs, and audit logs through the API.

You pay in credits when a generation is accepted. Invalid requests are free, and generations that fail are refunded. Every usage endpoint takes `range`: `today`, `24h`, `7d` or `30d`.

| Endpoint | Returns | Filters |
| - | - | - |
| `GET /usage/balance` | Remaining credits | — |
| `GET /usage/summary` | Requests, successes, failures, credits and success rate, compared with the previous period | api\_key\_id, model |
| `GET /usage/timeseries` | The same totals per bucket; interval is 15m, 30m, 1h or 1d | api\_key\_id, model |
| `GET /usage/models` | Totals per model | api\_key\_id |
| `GET /usage/keys` | Totals per key, with each key's limit and reset date | model |

`GET /logs` has one row per request: status, HTTP code, credits, closing balance, key and model. `GET /audit-logs` records account actions such as creating or revoking a key. Both page with `limit` and `cursor`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.