# List generations

URL: https://www.atmee.ai/docs/api/reference/generation/listGenerations

`GET /v1/generation`

The account's generations, newest first: every clip, portrait and
voice call that finished (charged), and every one still running, so
a clip shows here as `rendering` as soon as its `POST` starts. A
call that was flagged, refused or failed charged nothing and is not
listed. Calls made before this list existed show `madeBy: null` and
`inputs: null`.

Each item says who made it (`madeBy`: a member of the account or an
API key), what it was made from (`inputs`, enough to make it again;
`remake` says what must be given again), what it charged, and its
outputs. A `ready` output has a fresh download `url` on every read
(a link on this API's host or a Storage link, depending on the
server, saving the file as `atmee-clip-xxxxxxxx.mp4`). A clip's
output carries a small JPEG `poster` of its first frame, kept after
the file has gone, so an expired clip still shows a picture.

| `status` | Meaning |
|---|---|
| `rendering` | The call is running. |
| `ready` | At least one output can be downloaded (`outputs[].url`). |
| `expired` | The outputs were made but can no longer be downloaded: past `expiresAt` (a clip is kept 30 days, a portrait or voice 7), or used by an avatar. |
| `deleted` | The outputs were deleted (`DELETE /v1/generation/{requestId}` or `DELETE /v1/uploads/{uploadId}`). |
| `stalled` | The call stopped without finishing; retry its `POST` with the same `Idempotency-Key` and inputs. |

Page with `cursor`: pass the `nextCursor` of the previous page, with
the same filters; `nextCursor` is `null` on the last page.

Any member of the account sees every generation of the account. An
API key scoped to an avatar sees only the generations made by keys
of that avatar. Requires `generation:write`, `avatars:read` or
`avatars:write`. Reading charges nothing.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `kind` | query | no | Only generations of this kind. Absent lists every kind. |
| `mode` | query | no | Only clips made one of these ways: `picture` (from an image), `avatar` (a saved avatar speaking) or `unknown` (made before modes were recorded, as `clipModes.unknown` counts them). Repeat it, or separate values with commas. Implies `kind=clip`. |
| `madeBy` | query | no | Only generations made by any of these: `me` (the caller), `apiKeys` (any API key), `former` (any former member), or a member's user id or an API key id (`GET /v1/generation/summary` lists them). Repeat it, or separate values with commas. |
| `status` | query | no | Only generations in one of these states: `rendering` (stalled included), `ready`, `expiringSoon` (ready, ending within 3 days), `expired` or `deleted`. Repeat it, or separate values with commas. |
| `since` | query | no | Only generations started at or after this time. |
| `q` | query | no | Only generations whose prompt, script or description contains this text, ignoring case. |
| `limit` | query | no |  |
| `cursor` | query | no | The `nextCursor` of the previous page. |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | One page of generations. | `GenerationListResponse` |
| `400` | invalid_input -- an unknown `mode`, `madeBy` or `status`, a malformed `cursor`, `mode` with another `kind`, or `q` too long. | `ApiErrorResponse` |
| `401` | Missing or invalid API key, or a user token that is invalid, anonymous or of a user who may act for no account (`invalid_login`). | none |
| `403` | insufficient_scope (needs generation:write, avatars:read or avatars:write) \| account_not_allowed (`X-Account-Id` names an account the user may not act for) | `ApiErrorResponse` |
| `409` | account_ambiguous -- a user of several accounts sent no `X-Account-Id` and their Personal account cannot be told. `accounts` lists the choices. | `ApiErrorResponse` |
| `422` | A query parameter failed schema validation (e.g. `limit` over 50). | none |
| `503` | generation_unavailable -- this instance does not offer generation. | `ApiErrorResponse` |

## `200` response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array of `Generation` | yes |  |
| `nextCursor` | string | no | Pass as `cursor` for the next page; `null` on the last page. |
