Sign in

Delete a generation

Permanently remove a single generation and its stored files. Deletes the request by its id — works for images and videos alike. Use this to honor deletion requests from your end-users or to prune your own history.

DELETE /v1/generations/{requestId}

Delete a generation and its stored files.

The generation must be in a terminal state (`succeeded`, `failed`, or `expired`). If it is still `queued` or `processing`, the response is 409 `conflict` — wait for it to finish, then retry. We do not delete in-flight work: it is already paid for and mid-execution.

Stored-file cleanup is best-effort. An `expired` generation's files are already gone (URLs are only valid ~23h), so `removedObjects` will be 0; any individual storage error is logged but never fails the call. The metadata row is always removed.

bash
curl -X DELETE 'https://api.xmode.ai/v1/generations/req_3xN7kQ1aJpL9wDvE' \
  -H "Authorization: Bearer xm_live_<your-key>"

# 200 OK
{
  "requestId": "req_3xN7kQ1aJpL9wDvE",
  "deleted": true,
  "removedObjects": 1
}

# 409 Conflict (still queued/processing)
{
  "error": {
    "code": "conflict",
    "message": "Generation is still in progress. Wait for it to reach a terminal state, then retry."
  }
}