# Usage

> Retrieve Raywake spending and generation activity by period, including daily totals, model breakdowns and failure counts.

Canonical: https://raywake.si/docs/reference/usage
Last updated: 2026-10-13

`GET /v1/usage`

Amount spent (net of usage-based refunds), generations, success and failure reasons per UTC day and per model. Requires `jobs:read`.

**Query parameters**

| Name | Type | Description |
| --- | --- | --- |
| `days` | integer | Period ending today. Default: `30`. Options: `7`, `30`, `90`. |

**Example**

cURL:

```bash
curl -s https://api.raywake.com/v1/usage?days=7 \
  -H "Authorization: Bearer $RAYWAKE_API_KEY"
```

Python:

```python
import json, os, requests

response = requests.get(
    "https://api.raywake.com/v1/usage?days=7",
    headers={"Authorization": f"Bearer {os.environ['RAYWAKE_API_KEY']}"},
)
print(response.json())
```

JavaScript:

```javascript
const response = await fetch("https://api.raywake.com/v1/usage?days=7", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.RAYWAKE_API_KEY}` },
});
console.log(await response.json());
```

**Response fields**

| Name | Type | Description |
| --- | --- | --- |
| `totals` | object | `spent`, `added`, `runs`, `succeeded`, `failed` and `held` (awaiting review) for the period. |
| `daily` | array | One entry per day: `date`, `spent`, `runs`, `failed`. |
| `models` | array | Per model id: `runs`, `succeeded`, `failed`, `spent`, most funds first. |
| `failures` | array | Failure reasons with counts, such as content rejected or input not accepted. |

## Related

- [API documentation](https://raywake.si/docs)
