---
title: "Retrieve a mockup generation"
url: https://docs.light-ai.app/api-reference/mockups/get-mockup-generation.md
canonical_url: https://docs.light-ai.app/api-reference/mockups/get-mockup-generation
last_updated: 2026-10-13
summary: "GET /v1/mockup_generations/{mockup_generation_id}: The generation with each image's status."
api_status: beta
related:
  - https://docs.light-ai.app/api-reference/mockups
---

# Retrieve a mockup generation

> GET /v1/mockup_generations/{mockup_generation_id}: The generation with each image's status.

`GET /v1/mockup_generations/{mockup_generation_id}`

The generation with each image's status. Succeeded images carry a signed URL (WebP, valid for one hour: read it again for a fresh one) and their `mockup_id` in the project's mockup history.

|   |   |
| --- | --- |
| Scope | `mockups:read` |
| Credential | API key: `Authorization: Bearer lai_live_…` (or `lai_test_…`). Partner keys add `Light-AI-Organization`. |
| Test mode | Works with test keys against simulated test objects. |

## Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `mockup_generation_id` | string | yes | The generation id (`mgen_…`). Id prefix `mgen_`. |

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Light-AI-Organization` | string |  | Partner keys: the connected organization to act for (`org_…`). Organization keys may omit it. Id prefix `org_`. |
| `Light-AI-Version` | string |  | Pin a dated API version (defaults to the key's version). One of: `2026-11-01`. |

## Response 200

The generation.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Id prefix `mgen_`. |
| `object` | string | yes | Always `mockup_generation`. |
| `livemode` | boolean | yes | false for objects created with a test key. |
| `status` | string | yes | `succeeded` when at least one image succeeded (each image has its own status), `failed` when none did. Every failed image is refunded. One of: `queued`, `processing`, `succeeded`, `failed`. |
| `project_id` | string \| null | yes | Id prefix `prj_`. |
| `model` | string | yes | Always `light-ai-gen-3.0`. |
| `model_name` | string | yes |  |
| `images_requested` | integer | yes | 1–4. |
| `images_succeeded` | integer | yes |  |
| `images_failed` | integer | yes |  |
| `source` | object | yes |  |
| `source.type` | string | yes | One of: `front_view`, `photo_url`, `photo_upload`. |
| `source.front_view_id` | string \| null |  |  |
| `options` | object | yes | The options the generation used (preset, bulb colors, pattern, ambiance, features, instructions). |
| `credits` | object | yes |  |
| `credits.per_image` | integer | yes | Credits per image (5, as in the app). |
| `credits.reserved` | integer | yes | Held for images still generating. |
| `credits.charged` | integer | yes | Spent on succeeded images. |
| `credits.refunded` | integer | yes | Returned for failed images. |
| `images` | object[] | yes |  |
| `images[].index` | integer | yes | 1–4. |
| `images[].status` | string | yes | One of: `queued`, `processing`, `succeeded`, `failed`. |
| `images[].mockup_id` | string \| null | yes | The mockup in the project's mockup history (`mk_…`), once succeeded. Id prefix `mk_`. |
| `images[].url` | string \| null | yes | Signed image URL (WebP), valid until expires_at. null in webhook payloads: GET the generation for a fresh URL. |
| `images[].expires_at` | timestamp \| null | yes | RFC 3339 timestamp (UTC, milliseconds). |
| `images[].removed` | boolean | yes | true when the image was generated but has since been deleted from the project. |
| `images[].failure_code` | string \| null | yes | `generation_failed` (the image could not be generated), `generation_paused` (too many recent failures or too much at once for this account: retry in a few minutes), `generation_interrupted`, `generation_unavailable`, `queue_timeout` (the image could not be started within 6 hours: request it again), `source_photo_unavailable`, `project_deleted`. A failed image is always refunded. One of: `generation_failed`, `generation_paused`, `generation_interrupted`, `generation_unavailable`, `queue_timeout`, `source_photo_unavailable`, `project_deleted`. |
| `images[].sample` | boolean |  | Test mode: a fixed sample image, nothing was generated. |
| `failure_code` | string \| null | yes | One of: `generation_failed`, `generation_paused`, `generation_interrupted`, `generation_unavailable`, `queue_timeout`, `source_photo_unavailable`, `project_deleted`. |
| `generated_via` | string | yes | The requester label in the contractor's credit and project history: "Generated via API by <partner>" or "Generated via API key "<name>"". The organization and the partner that made the request see it; any other partner sees "Generated via API". |
| `created_at` | timestamp | yes | RFC 3339 timestamp (UTC, milliseconds). |
| `updated_at` | timestamp | yes | RFC 3339 timestamp (UTC, milliseconds). |
| `completed_at` | timestamp \| null | yes | RFC 3339 timestamp (UTC, milliseconds). |
| `simulated` | boolean |  | Test mode only. |

## Errors

| Status | Meaning |
| --- | --- |
| `400` | Bad request. [`bad_request`](https://docs.light-ai.app/errors#bad_request), [`test_mode_mismatch`](https://docs.light-ai.app/errors#test_mode_mismatch), [`test_mode_unsupported`](https://docs.light-ai.app/errors#test_mode_unsupported), [`unsupported_api_version`](https://docs.light-ai.app/errors#unsupported_api_version) |
| `401` | Missing or invalid credential. [`authentication_required`](https://docs.light-ai.app/errors#authentication_required), [`invalid_api_key`](https://docs.light-ai.app/errors#invalid_api_key), [`api_key_revoked`](https://docs.light-ai.app/errors#api_key_revoked), [`api_key_expired`](https://docs.light-ai.app/errors#api_key_expired), [`api_key_suspended`](https://docs.light-ai.app/errors#api_key_suspended) |
| `403` | Not allowed. [`insufficient_scope`](https://docs.light-ai.app/errors#insufficient_scope), [`plan_upgrade_required`](https://docs.light-ai.app/errors#plan_upgrade_required), [`organization_paused`](https://docs.light-ai.app/errors#organization_paused), [`organization_off_season`](https://docs.light-ai.app/errors#organization_off_season), [`api_disabled`](https://docs.light-ai.app/errors#api_disabled), [`api_access_not_enabled`](https://docs.light-ai.app/errors#api_access_not_enabled), [`ip_not_allowed`](https://docs.light-ai.app/errors#ip_not_allowed), [`forbidden`](https://docs.light-ai.app/errors#forbidden) |
| `404` | Not found (also for objects of other organizations and for organizations without an active grant). |
| `422` | Validation failed. [`idempotency_key_reused`](https://docs.light-ai.app/errors#idempotency_key_reused) |
| `429` | Rate limited or daily cap reached. See Retry-After and the RateLimit headers. [`rate_limited`](https://docs.light-ai.app/errors#rate_limited), [`daily_cap_reached`](https://docs.light-ai.app/errors#daily_cap_reached) |
| `500` | Unexpected server error. Safe to retry with exponential backoff; quote the Request-Id to support. [`internal_error`](https://docs.light-ai.app/errors#internal_error) |
| `503` | Temporarily unavailable. Retry with exponential backoff. [`service_unavailable`](https://docs.light-ai.app/errors#service_unavailable) |

## Examples

**Request**

curl:

```bash
curl -X GET "https://api.light-ai.app/v1/mockup_generations/{mockup_generation_id}" \
  -H "Authorization: Bearer $LIGHT_AI_API_KEY"
```

JavaScript:

```javascript
const response = await fetch('https://api.light-ai.app/v1/mockup_generations/{mockup_generation_id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.LIGHT_AI_API_KEY}`,
  },
});
const data = await response.json();
```

Python:

```python
import os, uuid, requests

response = requests.get(
    "https://api.light-ai.app/v1/mockup_generations/{mockup_generation_id}",
    headers={
        "Authorization": f"Bearer {os.environ['LIGHT_AI_API_KEY']}",
    },
    timeout=30,
)
data = response.json()
```

**Response 200**

```json
{
  "id": "mgen_3f9c2a7be41d…",
  "object": "mockup_generation",
  "livemode": false,
  "status": "queued",
  "project_id": "prj_3f9c2a7be41d…",
  "model": "light-ai-gen-3.0",
  "model_name": "string",
  "images_requested": 1,
  "images_succeeded": 1,
  "images_failed": 1,
  "source": {
    "type": "front_view",
    "front_view_id": "string"
  },
  "options": {},
  "credits": {
    "per_image": 0,
    "reserved": 0,
    "charged": 0,
    "refunded": 0
  },
  "images": [
    {
      "index": 1,
      "status": "queued",
      "mockup_id": "mk_3f9c2a7be41d…",
      "url": "https://example.com/…",
      "expires_at": "2026-10-12T14:03:11.000Z",
      "removed": true,
      "failure_code": "generation_failed",
      "sample": true
    }
  ],
  "failure_code": "generation_failed",
  "generated_via": "string",
  "created_at": "2026-10-12T14:03:11.000Z",
  "updated_at": "2026-10-12T14:03:11.000Z",
  "completed_at": "2026-10-12T14:03:11.000Z",
  "simulated": true
}
```
