Skip to docs
LumixAI logo
Developer API reference

LumixAI Image API Reference.

Endpoints, auth headers, request bodies, response examples, model slugs, and implementation flow for developers.

POST /v1/images/jobs
curl -X POST /api/backend/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"
  }'

Quickstart

First image in three steps.

This is the exact flow a backend developer should implement. Get an API key from the dashboard, keep it server-side, then call image endpoints with X-API-Key.

01

Get API key

Open Dashboard -> API Keys, create a key, then store the raw air_live key as LUMIXAI_API_KEY.

02

Pick model

Call GET /v1/models. Send exact slug in model field, for example imagen-nano-banana-2-flash.

03

Create and poll job

POST /v1/images/jobs. Poll GET /v1/images/jobs/{id}, then download the file from data[].download_url.

Base URL

Use the backend API base URL for server-side calls. The local default is shown below.

/api/backend

Use async by default

Prefer POST /v1/images/jobs for production apps. Use sync /v1/images/generations only when your request path can wait for completion.

Authentication

Use X-API-Key for image endpoints.

This public docs page only documents generation APIs. Create and manage API keys in the dashboard, then send the raw air_live key in X-API-Key from your backend.

Use caseHeaderValueEndpoints
Image APIsX-API-Key$LUMIXAI_API_KEY/v1/images/*
Public model catalognonenone/v1/models

Dashboard path

Open Dashboard -> API Keys -> Create key. Raw air_live key appears once.

Backend only

Store the key as an environment variable. Never expose it in browser code.

Model access

If the key is scoped, requests only work for allowed model slugs.

Endpoints

Image generation endpoints.

Use async jobs for production. Each endpoint shows method, path, auth, request example, and response shape.

POST/v1/images/jobs

Create async image job

Queues generation and returns an id. Poll with GET /v1/images/jobs/{id}.

Auth
X-API-Key
Success
202 Accepted
Request
curl -X POST /api/backend/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"
  }'
Response
{
  "id": "9f5b5e70-839b-46f5-a31c-6cf7d7e92a30",
  "status": "pending",
  "created": 1778956800,
  "usage": {
    "image_count": 1
  }
}
GET/v1/images/jobs/{id}

Poll image job

Returns pending, running, done, or error. When done, data[0].download_url streams the file through LumixAI. Upstream CDN URLs are not returned.

Auth
X-API-Key
Success
200 OK
Request
curl /api/backend/v1/images/jobs/$JOB_ID \
  -H "X-API-Key: $LUMIXAI_API_KEY"
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
  }
}
GET/v1/images/results/{id}/download

Download generated image

Streams the image file from the backend with Content-Disposition attachment. Download promptly because generated images are not stored for you.

Auth
X-API-Key
Success
200 OK
Request
curl /api/backend/v1/images/results/$JOB_ID/download \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -L \
  -o lumixai-result.png
Response
HTTP/1.1 200 OK
Content-Type: image/png
Content-Disposition: attachment; filename="lumixai-9f5b5e70-839b-46f5-a31c-6cf7d7e92a30.png"

<binary image stream>
POST/v1/images/generations

Synchronous generation

Blocks until image generation finishes. Good for scripts; async jobs are safer for apps.

Auth
X-API-Key
Success
200 OK
Request
curl -X POST /api/backend/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"
  }'
Response
{
  "created": 1778956800,
  "data": [
    {
      "download_url": "/v1/images/results/9f5b5e70-839b-46f5-a31c-6cf7d7e92a30/download"
    }
  ],
  "usage": {
    "image_count": 1
  }
}
GET/v1/models

List public models

Returns available model slugs and public model metadata.

Auth
none
Success
200 OK
Request
curl /api/backend/v1/models
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
    }
  ]
}

Node implementation loop

Server-side example: create job, poll every two seconds, throw on error, then download the generated file through LumixAI.

const createJob = await fetch("/api/backend/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(`/api/backend/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(`/api/backend${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));

Model options

Read aspect_ratios, resolutions, default_resolution, and max_resolution from /v1/models before building UI. Requests above a model max are capped before pricing and upstream generation.

Nano Banana Pro max 2k

curl -X POST /api/backend/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"
  }'

References

Send references inline.

There is no separate public reference-upload endpoint. Attach reference image data in the same generation request. The backend uploads each reference upstream during that request and does not store it on the filesystem.

Generate with inline reference

curl -X POST /api/backend/v1/images/jobs \
  -H "X-API-Key: $LUMIXAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-kontext",
    "prompt": "@img1 in a cinematic product scene",
    "aspectRatio": "1:1",
    "resolution": "2k",
    "references": [
      {
        "image": "data:image/png;base64,$REFERENCE_IMAGE_BASE64",
        "label": "img1"
      }
    ]
  }'

Schemas

Request and response fields.

Use these tables as the contract for implementation. 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.
aspectRatiostringOptional. 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, or 9:21.
resolutionstringOptional. 1k, 2k, or 4k when supported by the model. Nano Banana 2, Nano Banana Pro, and Flux.2 variants are capped to 2k.
referencesarrayOptional. One inline reference object such as { image: dataURI, label: "img1" } for Spaces flow. Multiple references are rejected in v1.
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.

API reference

Endpoint map.

This public map only includes model discovery and image generation endpoints. Auth, API-key management, user, billing, metrics, and admin endpoints are intentionally not documented here.

MethodPathAuthUse
GET/v1/modelsnoneList public active models.
POST/v1/images/generationsX-API-KeySynchronous Magnific Spaces generation.
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.

List public models

curl /api/backend/v1/models

Models

39 model slugs available.

Pass one of these slugs as the model field. The list is grouped by provider and generated from the same catalog used by the site menu.

Errors

Read error.type first.

Errors return JSON with error.type and error.message. Provider internals are normalized to service_unavailable for 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.
429rate_limit_errorAPI key exceeded configured RPM limit.
503service_unavailableProvider or upstream generation service is unavailable.

Error response format

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

Ready

Test the request in Playground.

The dashboard playground uses the same inline reference, /v1/images/jobs, polling, and download flow shown in these docs.

Open playground
API Docs | LumixAI