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

# Requests and idempotency

> Track each generation safely from submission to completion.

Every generation submission creates a stable API request with an ID beginning
with `req_`. Use that request ID to track the workflow from submission through
its terminal state.

## Idempotency keys

`POST /api/v1/generations` requires an `Idempotency-Key` header of at most 255
safe characters.

* Reusing a key with the same request body returns the original request.
* Reusing a key with a different body returns `409 conflict`.
* Use one key per logical operation and keep it stable across network retries.
* Do not reuse keys for recurring jobs or separate user actions.

Good keys include your own order ID or a UUID:

```text theme={"system"}
Idempotency-Key: render_01J8YJ1KQSD5M2X6V7Z9BC4N3P
```

## Status lifecycle

```text theme={"system"}
IN_QUEUE -> IN_PROGRESS -> COMPLETED
                        -> FAILED
```

| Status        | Meaning                                                  |
| ------------- | -------------------------------------------------------- |
| `IN_QUEUE`    | The API accepted the request and is preparing submission |
| `IN_PROGRESS` | Generation is running                                    |
| `COMPLETED`   | Output and preview links are available                   |
| `FAILED`      | The request reached a terminal failure                   |

Completed media URLs are owner-authorized application routes. Treat them as
temporary access URLs and copy output into your own approved workflow when
needed.
