Light AIDocs Beta Open Light AI

Mockups

Mockups

Generate lighting mockups for a project with Light AI Gen 3.0: asynchronous, 5 credits per image from the contractor's own credits.

The API generates mockups exactly as the app does, with the same model (Light AI Gen 3.0, id light-ai-gen-3.0), the same options and the same price. Finished images join the project's mockup history.

Modellight-ai-gen-3.0 (Light AI Gen 3.0), the only model
Price5 credits per image, 1–4 images per generation
Who paysAlways the contractor, from their own credits (top-ups and Auto Top-Up work as in the app). Partners are never billed.
Scopesmockups:write to generate, mockups:read to read results
ConcurrencyAt most 3 generations per organization at once
Test keysSimulated: a sample image, no credits

1. Start a generation#

By default Light AI uses the project's front view and its measured guide lines, like the app. Idempotency-Key is required: a retry with the same key returns the same generation and never charges twice.

curl -X POST "https://api.light-ai.app/v1/projects/prj_…/mockups" \
  -H "Authorization: Bearer $LIGHT_AI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "light-ai-gen-3.0",
  "images": 2,
  "style_preset": "classic_warm_white",
  "ambiance": {
    "snow": true
  }
}'

The answer is 202 with a mgen_… generation in queued status. Credits are reserved now and settled per image; every failed image is refunded.

Sources#

source.typeUse
front_view (default)A front view of the project (front_view_id, default the first with a photo). Optional features limits which measured features are lit.
photo_urlA public HTTPS photo (JPEG, PNG or WebP, at most 10 MB, no redirects), fetched once.
photo_uploadA photo you upload: POST /v1/projects/{id}/photo_uploads, then PUT the bytes to upload_url within 2 hours.

Options#

style_preset (classic_warm_white, cool_white, multicolor, candy_cane, red_and_green), bulb_colors (c9, mini), c9_pattern, ambiance toggles of the project's template and instructions (up to 500 characters). See the reference for every field.

2. Get the result#

Subscribe to mockup.completed and mockup.failed (they carry no image URLs), or poll:

curl "https://api.light-ai.app/v1/mockup_generations/mgen_…" \
  -H "Authorization: Bearer $LIGHT_AI_API_KEY"
ExcerptJSON
{
  "id": "mgen_3f9c2a7be41d…",
  "object": "mockup_generation",
  "status": "succeeded",
  "model": "light-ai-gen-3.0",
  "model_name": "Light AI Gen 3.0",
  "images_requested": 2,
  "images_succeeded": 2,
  "images_failed": 0,
  "images": [
    {
      "index": 1,
      "status": "succeeded",
      "mockup_id": "mk_3f9c2a7be41d…",
      "url": "https://…",
      "expires_at": "2026-10-12T15:03:11.000Z"
    }
  ]
}

Image URLs are signed WebP links valid for one hour; read the generation again for fresh ones. status is succeeded when at least one image succeeded and failed when none did (failure_code says why).

Credits and errors#

AnswerMeaning
402 insufficient_creditsNot enough credits. Includes required and top_up_url, plus balance for organization keys (never for partner keys). Nothing was charged.
402 partner_spend_cap_reachedA partner key hit the spend cap the contractor set.
429 rate_limitedThree generations already running for the organization.
403 organization_pausedThe organization is paused.
403 organization_off_seasonThe organization is on Off-Season: mockups resume when the owner resumes the plan.

Partners#

A partner can generate for a contractor only when the contractor approved mockups:write, shown on the consent screen as "Can generate mockups using your credits". Each partner has a spend cap per organization: 200 credits a day and 2,000 a month by default, which the owner can change or remove. Every API generation is labeled in the contractor's credit history and project ("Generated via API by …").