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

# Usage

> Credits charged per generation, as JSON or CSV, to reconcile with your own logs and invoice.

| Request | Does |
| - | - |
| `GET /usage` | Lists your generations with the credits charged for each, one page at a time. |
| `GET /usage/export` | Returns the same rows for the whole period as one CSV file. |

Rows are sorted by `createdAt`, oldest first. Every generation is listed, failed ones included, so the list matches your own logs line by line. The CSV is also in the [dashboard](https://platform.genlook.app/generations): Generations, Export CSV, then a month under "Credits charged per generation".

## Query

**from** `string`

ISO 8601 timestamp. Only generations created at or after it.

**to** `string`

ISO 8601 timestamp. Only generations created before it.

**limit** `number` (default: 100)

1 to 1000. `GET /usage` only.

**cursor** `string`

`nextCursor` of the previous page. `GET /usage` only.

Without `from` and `to`, you get every generation of the account.

```bash JSON theme={null}
curl "https://api.genlook.app/tryon/v1/usage?from=2026-11-01T00:00:00Z&to=2026-12-01T00:00:00Z&limit=1000" \
  -H "x-api-key: gk_your_api_key"
```

```bash CSV theme={null}
curl "https://api.genlook.app/tryon/v1/usage/export?from=2026-11-01T00:00:00Z&to=2026-12-01T00:00:00Z" \
  -H "x-api-key: gk_your_api_key" \
  -o genlook-usage-2026-11.csv
```

## Response

`GET /usage` returns `{ items, nextCursor, hasMore, count }`. `nextCursor` is `null` on the last page. Each item:

**generationId** `string` *required*

The `generationId` returned by [Create Try-On](https://docs.genlook.app/docs/tryon-api/endpoints/create-try-on.md).

**createdAt** `string` *required*

When the try-on was requested. `from` and `to` filter on this field.

**completedAt** `string | null` *required*

When it completed or failed. `null` while it is running.

**status** `string` *required*

`PENDING`, `PROCESSING`, `COMPLETED` or `FAILED`.

**credits** `number` *required*

Credits charged. See the table below.

**batchId** `string | null` *required*

Set for [batch](https://docs.genlook.app/docs/tryon-api/batches.md) items.

**apiKeyId** `string | null` *required*

The API key that made the call. `null` for try-ons made without a key (the [MCP server](https://docs.genlook.app/docs/tryon-api/mcp.md)) and for calls made before 2026-11-14.

`GET /usage/export` returns `text/csv` with a header row and these columns: `generation_id`, `created_at`, `completed_at`, `status`, `credits`, `batch_id`, `api_key_id`. It is not paginated.

## What `credits` holds

| Generation | `credits` |
| - | - |
| Completed, one product | 1 |
| Completed, [2 to 4 products](https://docs.genlook.app/docs/tryon-api/multi-product.md) | 2 |
| Completed in 2K | 1 more |
| Failed | 0: the credits were refunded |
| [`mock: true`](https://docs.genlook.app/docs/tryon-api/endpoints/create-try-on#body-mock) | 0 |
| Running (`PENDING`, `PROCESSING`) | The credits held for it. They are refunded if it fails. |
| Completed [batch](https://docs.genlook.app/docs/tryon-api/batches.md) item | Half the price above, so 0.5 for one product |
| Batch item, running or failed | 0: a batch is charged once, when it ends |

A batch is charged half the credits of its completed items, rounded up once for the whole batch. The sum of `credits` over a batch's items can therefore be 0.5 under what the batch was charged.

The sum of `credits` over a period is what your generations cost in that period. A plan's allowance follows your billing period, which may not start on the 1st: set `from` and `to` to the period dates on your invoice.

```json 200 theme={null}
{
  "items": [
    {
      "generationId": "cm8gen456xyz",
      "createdAt": "2026-11-14T09:12:03.120Z",
      "completedAt": "2026-11-14T09:12:09.482Z",
      "status": "COMPLETED",
      "credits": 1,
      "batchId": null,
      "apiKeyId": "cm8key123abc"
    },
    {
      "generationId": "cm8gen457abc",
      "createdAt": "2026-11-14T09:13:40.007Z",
      "completedAt": "2026-11-14T09:13:44.911Z",
      "status": "FAILED",
      "credits": 0,
      "batchId": null,
      "apiKeyId": "cm8key123abc"
    }
  ],
  "nextCursor": null,
  "hasMore": false,
  "count": 2
}
```

```csv CSV theme={null}
generation_id,created_at,completed_at,status,credits,batch_id,api_key_id
cm8gen456xyz,2026-11-14T09:12:03.120Z,2026-11-14T09:12:09.482Z,COMPLETED,1,,cm8key123abc
cm8gen457abc,2026-11-14T09:13:40.007Z,2026-11-14T09:13:44.911Z,FAILED,0,,cm8key123abc
```


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