---
title: Generation result
description: "GET /v1/requests/{request_id} — fetch the result."
---

Fetch the finished generation result with media links.

## Playground

<ApiPlayground path="/v1/requests/{request_id}" method="get" />

`GET /v1/requests/:id` returns the generation result with an `output` field (code `200`) once the status is terminal (`COMPLETED` / `FAILED` / `CANCELED`), or `202` while the request is still queued or running. All media URLs point to the `media.clipia.ai` CDN.

<Method name="GET" path="/v1/requests/:id" />

## Request

<TypeTable
  type={{
    id: { type: 'string', description: 'The request identifier (request_id, uuid) returned by submit.', required: true }
  }}
/>

<Tabs items={['cURL', 'TypeScript', 'Python']}>
<Tab value="cURL">

```bash
curl https://api.clipia.ai/v1/requests/764cabcf-b745-4b3e-ae38-1200304cf45b \
  -H "Authorization: Bearer $CLIPIA_KEY"
```

</Tab>
<Tab value="TypeScript">

```ts
const result = await clipia.queue.result('764cabcf-b745-4b3e-ae38-1200304cf45b');

// While still running, the API returns 202 → result.pending === true.
if (result.pending) {
  console.log('still running:', result.status);
} else {
  console.log(result.output?.images?.[0]?.url);
}
```

</Tab>
<Tab value="Python">

```python
result = client.result("764cabcf-b745-4b3e-ae38-1200304cf45b")

# While still running, the API returns 202 → result.pending == True.
if result.pending:
    print("still running:", result.status)
else:
    print(result.output["images"][0]["url"])
```

</Tab>
</Tabs>

## Image result

```json
{
  "request_id": "764cabcf-b745-4b3e-ae38-1200304cf45b",
  "status": "COMPLETED",
  "model": "nano-banana-2",
  "output": {
    "images": [
      { "url": "https://media.clipia.ai/works/8f3a1c7e.png", "width": 1024, "height": 1024 }
    ]
  },
  "cost": 12,
  "created_at": "2026-06-01T12:00:00Z",
  "completed_at": "2026-06-01T12:00:18Z"
}
```

For images, `output.images` is an array of objects with `url`, `width`, and `height`. Each item holds a link to the finished frame; when the model returns a full-quality original, it is available in `original_url`.

## Video result

```json
{
  "request_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "status": "COMPLETED",
  "model": "seedance-2-fast-i2v",
  "output": {
    "video": {
      "url": "https://media.clipia.ai/works/a1b2c3d4.mp4",
      "width": 1280,
      "height": 720,
      "duration": 4
    }
  },
  "cost": 40,
  "created_at": "2026-06-01T12:00:00Z",
  "completed_at": "2026-06-01T12:00:42Z"
}
```

For video, `output.video` is an object with `url`, `width`, `height`, and `duration`.

## Response fields

<TypeTable
  type={{
    request_id: { type: 'string', description: 'Generation request identifier (uuid)' },
    status: { type: 'string', description: 'Terminal status: COMPLETED, FAILED, or CANCELED' },
    model: { type: 'string', description: 'Slug of the model that ran the generation' },
    output: { type: 'object', description: 'Result: images: [{ url, width, height }] or video: { url, width, height, duration }' },
    cost: { type: 'number', description: 'Final cost in credits (0 on FAILED)' },
    created_at: { type: 'string', description: 'Request creation time (ISO 8601)' },
    completed_at: { type: 'string', description: 'Generation completion time (ISO 8601)' },
    error: { type: 'object', description: 'Sanitized error { code, message } — only when status = FAILED' }
  }}
/>

## Response codes

| HTTP | When | Body |
|------|------|------|
| `200` | `COMPLETED` | result with `output` |
| `200` | `FAILED` | `{ request_id, status: "FAILED", error: { code, message }, cost: 0, ... }` |
| `200` | `CANCELED` | terminal response with status `CANCELED` |
| `202` | `IN_QUEUE` / `IN_PROGRESS` | current status — keep polling |
| `404` | unknown `request_id` | error envelope |

<Callout type="info" title="202 is expected">
A `202` arrives only for non-terminal statuses: the job is still running. The terminal `FAILED` and `CANCELED` are final responses and arrive with code `200`. On `FAILED`, credits are fully refunded and `error` is sanitized.
</Callout>
