Skip to docs
LumixAI logo

Studio

LumixAI Image and Video API Reference

REST API on https://api.lumixai.live/v1: choose an image or video model slug, submit a generation job, poll by job id, then download the generated result.

Note: replace YOUR_LUMIXAI_API_KEY with your dashboard key. The public catalog currently exposes 104 image and video model slugs.

Base

/v1

Auth

X-API-Key

Mode

image + video

Authentication

Authentication

Every image endpoint requires X-API-Key. Keep the raw air_live key on your server and send it from backend code only.

Use caseHeaderValueEndpoints
Image APIsX-API-Key$LUMIXAI_API_KEY/v1/images/*
Video APIsX-API-Key$LUMIXAI_API_KEY/v1/videos/*
Public catalogsnonenone/v1/models, /v1/models/catalog, /v1/models/credits, /v1/models/credits/catalog, /v1/videos/models

Dashboard path

Open Dashboard -> API Keys -> Create key. The raw key appears once.

Backend only

Never expose X-API-Key in browser code.

Model access

Scoped keys only work for allowed model slugs.

Reference images

Upload reference files

There is no separate public upload endpoint. Send metadata and binary files together as multipart/form-data.

POST/v1/images/jobs

Add one request part containing JSON, then append each local image as a repeated referenceFiles part. Do not set the multipart Content-Type boundary manually. Each file and the aggregate upload are limited to 300 MiB, and uploaded files plus JSON references must total at most 5. JSON URL references remain accepted; legacy data URIs are limited to 10 MiB decoded per image.

cURL example

curl --location 'https://api.lumixai.live/v1/images/jobs' \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -F 'request={
    "model": "flux-kontext",
    "prompt": "a cute cat catching a mouse",
    "aspectRatio": "1:1",
    "resolution": "2k"
  };type=application/json' \
  -F 'referenceFiles=@./reference-1.png;type=image/png' \
  -F 'referenceFiles=@./reference-2.webp;type=image/webp'

Generation

Create async image job

Use async jobs for production. The create call returns an id immediately; poll that id until the job is done or error.

POST/v1/images/jobs
Auth
X-API-Key
Success
202 Accepted
Use
Queue image generation and return job id.

cURL example

curl --location 'https://api.lumixai.live/v1/images/jobs' \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-nano-banana-2-flash",
    "prompt": "premium product render on glass, studio lighting",
    "aspectRatio": "16:9",
    "resolution": "2k"
  }'

Example response

{
  "id": "9f5b5e70-839b-46f5-a31c-6cf7d7e92a30",
  "status": "pending",
  "created": 1778956800,
  "usage": {
    "image_count": 1
  }
}

Node polling loop

const createJob = await fetch("https://api.lumixai.live/v1/images/jobs", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": process.env.LUMIXAI_API_KEY
  },
  body: JSON.stringify({
    model: "imagen-nano-banana-2-flash",
    prompt: "premium product render on glass, studio lighting",
    aspectRatio: "16:9",
    resolution: "2k"
  })
});

const job = await createJob.json();

let result = job;
while (result.status === "pending" || result.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 2000));
  const poll = await fetch(`https://api.lumixai.live/v1/images/jobs/${job.id}`, {
    headers: { "X-API-Key": process.env.LUMIXAI_API_KEY }
  });
  result = await poll.json();
}

if (result.status === "error") throw new Error(result.error);
const download = await fetch(`https://api.lumixai.live${result.data[0].download_url}`, {
  headers: { "X-API-Key": process.env.LUMIXAI_API_KEY }
});

if (!download.ok) throw new Error("download failed");
const file = Buffer.from(await download.arrayBuffer());
await import("node:fs/promises").then((fs) => fs.writeFile("lumixai-result.png", file));

Polling

Poll image job

The job endpoint returns pending, running, done, or error. When done, use data[0].download_url to stream the generated image through LumixAI.

GET/v1/images/jobs/{id}
Auth
X-API-Key
Success
200 OK
Terminal states
done, error

cURL example

curl --location 'https://api.lumixai.live/v1/images/jobs/$JOB_ID' \
  -H "X-API-Key: $LUMIXAI_API_KEY"

Example response

{
  "id": "9f5b5e70-839b-46f5-a31c-6cf7d7e92a30",
  "status": "done",
  "created": 1778956800,
  "completed": 1778956842,
  "data": [
    {
      "download_url": "/v1/images/results/9f5b5e70-839b-46f5-a31c-6cf7d7e92a30/download"
    }
  ],
  "usage": {
    "image_count": 1
  }
}

Downloads

Download generated image

Generated files stream from the backend with Content-Disposition attachment. Download promptly; the API does not store generated images for you.

GET/v1/images/results/{id}/download
Auth
X-API-Key
Success
200 OK
Output
Binary image stream

cURL example

curl --location 'https://api.lumixai.live/v1/images/results/$JOB_ID/download' \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -L \
  -o lumixai-result.png

Example response

HTTP/1.1 200 OK
Content-Type: image/png
Content-Disposition: attachment; filename="lumixai-9f5b5e70-839b-46f5-a31c-6cf7d7e92a30.png"

<binary image stream>

Video catalog

List video model capabilities

Use /v1/videos/models for live provider capabilities, then pair it with /v1/models?category=video or /v1/models/catalog for public pricing and display metadata.

GET/v1/videos/models
Auth
none
Success
200 OK
Use
Read video durations, aspect ratios, resolutions, sound, image-to-video, and reference support.

cURL example

curl --location 'https://api.lumixai.live/v1/videos/models'

Example response

{
  "data": [
    {
      "slug": "google-veo3_1-lite",
      "name": "Google Veo 3.1 Lite",
      "api": "google",
      "model": "veo3_1",
      "mode": "veo3_1_lite",
      "resolutions": ["720p", "1080p"],
      "durations": [4, 6, 8],
      "aspectRatios": ["16:9", "9:16"],
      "sound": true,
      "i2v": true,
      "refs": ["startFrame", "endFrame", "reference"]
    }
  ]
}

Video generation

Create async video job

Video generation is async only. Create a job, reserve credits, then poll until done or error. Failed generation returns a public error message and refunds reserved credits automatically.

POST/v1/videos/jobs
Auth
X-API-Key
Success
202 Accepted
Use
Queue text-to-video or image-to-video generation and return job id.

cURL example

curl --location 'https://api.lumixai.live/v1/videos/jobs'   -H "X-API-Key: $LUMIXAI_API_KEY"   -H "Content-Type: application/json"   -d '{
    "model": "google-veo3_1-lite",
    "prompt": "a cinematic product reveal with soft camera motion",
    "aspectRatio": "16:9",
    "resolution": "720p",
    "duration": 6,
    "withSoundEffects": true
  }'

Example response

{
  "id": "2ff3e6c3-6b6f-4b47-b9f2-d64691712e2a",
  "status": "pending",
  "created": 1778956800,
  "usage": {
    "video_count": 6
  }
}

Image-to-video example

curl --location 'https://api.lumixai.live/v1/videos/jobs' \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -F 'request={
    "model": "google-veo3_1-lite",
    "prompt": "animate these product frames with a slow dolly-in",
    "maxRefs": 5,
    "aspectRatio": "16:9",
    "resolution": "720p",
    "duration": 6
  };type=application/json' \
  -F 'referenceFiles=@./product-frame-1.png;type=image/png' \
  -F 'referenceFiles=@./product-frame-2.png;type=image/png'

Start/end frame example

curl --location 'https://api.lumixai.live/v1/videos/jobs' \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -F 'request={
    "model": "google-veo3_1-lite",
    "prompt": "smooth transition between the two frames",
    "aspectRatio": "16:9",
    "resolution": "720p",
    "duration": 6
  };type=application/json' \
  -F 'startImage=@./start-frame.png;type=image/png' \
  -F 'endImage=@./end-frame.png;type=image/png'

Video polling

Poll video job

Poll the job endpoint until status is done or error. When done, use data[0].download_url to stream the generated video through LumixAI.

GET/v1/videos/jobs/{id}
Auth
X-API-Key
Success
200 OK
Terminal states
done, error

cURL example

curl --location 'https://api.lumixai.live/v1/videos/jobs/$JOB_ID'   -H "X-API-Key: $LUMIXAI_API_KEY"

Example response

{
  "id": "2ff3e6c3-6b6f-4b47-b9f2-d64691712e2a",
  "status": "done",
  "created": 1778956800,
  "completed": 1778956902,
  "data": [
    {
      "download_url": "/v1/videos/results/2ff3e6c3-6b6f-4b47-b9f2-d64691712e2a/download",
      "web_url": "https://magnific.com/video/example"
    }
  ],
  "usage": {
    "video_count": 6
  }
}

Video downloads

Download generated video

Generated videos stream from the backend with Content-Disposition attachment. Download promptly; provider URLs can expire.

GET/v1/videos/results/{id}/download
Auth
X-API-Key
Success
200 OK
Output
Binary video stream

cURL example

curl --location 'https://api.lumixai.live/v1/videos/results/$JOB_ID/download'   -H "X-API-Key: $LUMIXAI_API_KEY"   -L   -o lumixai-result.mp4

Example response

HTTP/1.1 200 OK
Content-Type: video/mp4
Content-Disposition: attachment; filename="lumixai-2ff3e6c3-6b6f-4b47-b9f2-d64691712e2a.mp4"

<binary video stream>

Sync path

Synchronous generation

Use synchronous generation for scripts or short blocking workflows. Production apps should use async jobs.

POST/v1/images/generations

cURL example

curl --location 'https://api.lumixai.live/v1/images/generations' \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-nano-banana-2-flash",
    "prompt": "premium product render on glass",
    "aspectRatio": "1:1",
    "resolution": "1k"
  }'

Example response

{
  "created": 1778956800,
  "data": [
    {
      "download_url": "/v1/images/results/9f5b5e70-839b-46f5-a31c-6cf7d7e92a30/download"
    }
  ],
  "usage": {
    "image_count": 1
  }
}

Models

Model and pricing catalogs

Call catalog endpoints before building UI. Use category=image or category=video for flat lists, and catalog endpoints when you need image and video grouped for pricing pages.

GET/v1/models

cURL example

curl --location 'https://api.lumixai.live/v1/models'

Example response

{
  "data": [
    {
      "slug": "imagen-nano-banana-2-flash",
      "display_name": "Nano Banana 2",
      "modality": "image",
      "aspect_ratios": ["1:1", "2:3", "3:2", "4:3", "3:4", "5:4", "4:5", "16:9", "9:16", "21:9"],
      "default_aspect_ratio": "1:1",
      "resolutions": ["1k", "2k", "4k"],
      "default_resolution": "1k",
      "max_resolution": "2k",
      "group": "Google",
      "timing": "~29s",
      "unlimited": true,
      "max_n": 1,
      "image_credit_micros_per_unit": 5000000,
      "public": true,
      "active": true
    }
  ]
}
GET/v1/models/catalog

cURL example

curl --location 'https://api.lumixai.live/v1/models/catalog'

Example response

{
  "data": {
    "image": [
      {
        "slug": "imagen-nano-banana-2-flash",
        "display_name": "Nano Banana 2",
        "modality": "image",
        "resolutions": ["1k", "2k", "4k"],
        "pricing_tiers": [
          { "label": "1k", "resolution": "1k", "billing_unit": "image", "credits": "5", "credits_micros": 5000000 }
        ]
      }
    ],
    "video": [
      {
        "slug": "google-veo3_1-lite",
        "display_name": "Google Veo 3.1 Lite",
        "modality": "video",
        "resolutions": ["720p", "1080p"],
        "pricing_tiers": [
          { "label": "720p", "resolution": "720p", "billing_unit": "second", "credits": "25", "credits_micros": 25000000 }
        ]
      }
    ]
  }
}
GET/v1/models/credits/catalog

cURL example

curl --location 'https://api.lumixai.live/v1/models/credits/catalog'

Example response

{
  "data": {
    "image": [
      {
        "slug": "imagen-nano-banana-2-flash",
        "display_name": "Nano Banana 2",
        "modality": "image",
        "credits": "5",
        "image_credit_micros_per_unit": 5000000
      }
    ],
    "video": [
      {
        "slug": "google-veo3_1-lite",
        "display_name": "Google Veo 3.1 Lite",
        "modality": "video",
        "credits": "25",
        "image_credit_micros_per_unit": 25000000
      }
    ]
  }
}

Resolution cap example

curl --location 'https://api.lumixai.live/v1/images/jobs' \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-nano-banana-2",
    "prompt": "premium product render on glass, studio lighting",
    "aspectRatio": "9:16",
    "resolution": "2k"
  }'

Auto

1 models

Schemas

Request and response fields

Use these tables as the implementation contract. Optional fields can be omitted unless your workflow needs them.

ImageGenerationRequest

FieldTypeNotes
modelstringRequired. Model slug, for example imagen-nano-banana-2-flash.
promptstringRequired. Natural language prompt. Prompt-only requests use Spaces T2I.
sizestringOptional legacy pixel size. Use only when not sending aspectRatio/resolution or width/height.
aspectRatiostringOptional. Must match selected model aspect_ratios. If omitted, backend uses model default when available.
resolutionstringOptional. Must match selected model resolutions; backend caps above max_resolution before pricing and generation.
width / heightintegerOptional legacy pixel override. If one is sent, both must resolve to positive values.
referenceFilesFile[]Preferred for local files. In multipart/form-data, append this field once per JPEG, PNG, WebP, or GIF file. Files plus JSON references total at most 5.
referencesobject[]Legacy JSON option for data URI or HTTP(S) URL references. Do not base64-encode local files when multipart is available; inline data URIs are limited to 10 MiB decoded per image.
referenceCountintegerQuote only. Number of selected local reference files, from 0 to 5. Generation endpoints reject this field.
spaceIdstringOptional. Magnific Space UUID. If omitted, backend uses env or the active Magnific Space tab context.
timeoutMsintegerOptional. Magnific Spaces render wait timeout in milliseconds.
seedintegerOptional. Repeatable generation seed when provider supports it.

ImageJobStatusResponse

FieldTypeNotes
idstringJob id used by GET /v1/images/jobs/{id}.
statusstringpending, running, done, or error.
creatednumberUnix timestamp for job creation.
completednumberUnix timestamp when terminal, returned when available.
data[].download_urlstringLumixAI download endpoint for streaming the generated image file.
errorstringHuman-readable error message when status is error.
usage.image_countnumberNumber of generated images charged or reserved.

VideoGenerationRequest

FieldTypeNotes
modelstringRequired. Video model slug, for example google-veo3_1-lite.
promptstringRequired for text-to-video. Natural language prompt for the video.
aspectRatiostringOptional. Common values include 16:9, 9:16, or 1:1. Read supported values from /v1/videos/models and /v1/models?category=video.
resolutionstringOptional. Common values include 720p or 1080p when supported by the model.
durationintegerOptional. Duration in seconds. Read supported values from /v1/videos/models.
withSoundEffectsbooleanOptional. Request sound effects when the selected model supports sound.
startImageFilePreferred multipart field for one uploaded start frame.
referenceFilesFile[]Preferred multipart field for uploaded generic references. Append once per file.
endImage (multipart)FilePreferred multipart field for one uploaded end frame.
imagestringLegacy JSON data URI source image, limited to 10 MiB decoded. Raw base64 without data:image/...;base64, is rejected.
imageUrlstringOptional. Remote source image URL for image-to-video.
refCreationIdstringOptional. Existing upstream creation id to use as the start frame.
imagesstring[]Legacy JSON data URI source images for image-to-video, up to 5.
imageUrlsstring[]Optional. Multiple remote source image URLs for image-to-video, up to 5 total references.
refCreationIdsstring[]Optional. Multiple upstream creation ids for image-to-video, up to 5 total references.
endImage (JSON)stringLegacy JSON data URI end frame, limited to 10 MiB decoded, for models whose refs include endFrame. Raw base64 is rejected.
startImageCount / referenceCount / endImageCountintegerQuote only. Describe selected local file counts without uploading or base64-encoding them. Start and end counts are limited to 1; total start/reference count is limited to 5.
endImageUrlstringOptional. Remote end frame URL for models whose refs include endFrame.
endRefCreationIdstringOptional. Existing upstream creation id to use as the end frame.
maxRefsintegerOptional. Start/reference cap. Must be between 0 and 5; end frame is separate.
spaceIdstringOptional. Magnific Space UUID. If omitted, backend uses env or active Space context.
folderRefstringOptional. Folder reference in Magnific.
timeoutMsintegerOptional. Provider wait timeout in milliseconds.

VideoJobStatusResponse

FieldTypeNotes
idstringVideo job id used by GET /v1/videos/jobs/{id}.
statusstringpending, running, done, or error.
creatednumberUnix timestamp for job creation.
completednumberUnix timestamp when terminal, returned when available.
data[].download_urlstringLumixAI download endpoint for streaming the generated video file.
data[].web_urlstringOptional upstream web URL when returned by the provider.
data[].preview_urlstringOptional upstream preview URL when returned by the provider.
errorstringHuman-readable error message when status is error. Reserved credits are refunded automatically on failed generation.
usage.video_countnumberVideo seconds charged or reserved.

Endpoint map

MethodPathAuthUse
GET/v1/modelsnoneList public active models. Optional category=image, video, or all.
GET/v1/models/catalognoneList public active models grouped by image and video.
GET/v1/models/creditsnoneList public model credit costs. Optional category=image, video, or all.
GET/v1/models/credits/catalognoneList model credit costs grouped by image and video.
GET/v1/videos/modelsnoneList live video model capabilities such as durations, aspect ratios, resolutions, sound, and image-to-video support.
POST/v1/images/generationsX-API-KeySynchronous Magnific Spaces generation.
POST/v1/images/quoteX-API-KeyQuote image generation cost before creating a job.
POST/v1/images/jobsX-API-KeyCreate an async Magnific Spaces generation job.
GET/v1/images/jobs/{id}X-API-KeyPoll an async job.
GET/v1/images/results/{id}/downloadX-API-KeyStream generated image file through LumixAI.
POST/v1/videos/quoteX-API-KeyQuote video generation cost before creating a job.
POST/v1/videos/jobsX-API-KeyCreate an async video generation job.
GET/v1/videos/jobs/{id}X-API-KeyPoll an async video job.
GET/v1/videos/results/{id}/downloadX-API-KeyStream generated video file through LumixAI.

Errors

Read error.type first

Errors return JSON with error.type and error.message. Provider internals are normalized before returning to public callers.

HTTPTypeMeaning
400validation_errorRequest body or path parameter is invalid.
401authentication_errorMissing or invalid API key.
402insufficient_credits_errorWorkspace does not have enough available credits.
403permission_denied_errorAPI key exists but cannot access the resource.
404resource_not_found_errorResource does not exist or is not visible to this workspace.
409idempotency_conflictDuplicate request conflict.
413request_too_largeThe multipart upload, JSON generation body, or reverse-proxy body exceeds its documented limit.
415unsupported_media_typeGeneration endpoints accept application/json or multipart/form-data.
429rate_limit_errorRequest rate limit exceeded.
503service_unavailableProvider or upstream generation service is unavailable.

Example response

{
  "error": {
    "type": "insufficient_credits_error",
    "message": "insufficient credits"
  }
}

Test full flow in Playground

Playground uses the same multipart upload, async job, polling, and download flow shown here.

Open playground