Generations

Create a generation

Changed on

Submit an image or video generation job. Returns immediately with an opaque job ID to poll via GET /generations/{id}.

post/generations

Request

  • Base URL
    https://agents.lumalabs.ai/v1
  • Auth
    HTTP bearer

Request body

CreateGenerationRequest required

Request body for submitting a generation

model, 'uni-1' | 'uni-1-max' | 'ray-3.2'

Model identifier. uni-1 is the default image tier; uni-1-max produces higher-quality output than uni-1 at a higher per-image price. ray-3.2 is the public video model for text-to-video, image-to-video, and video-to-video editing.

type, 'image' | 'image_edit' | 'video' | 'video_edit' | 'video_reframe' | 'layering'

The kind of generation to perform

prompt, string required

Text prompt

user_id, string nullable

Your end-user's stable opaque identifier (no PII). Forwarded to upstream model providers as their per-user tagging field so trust & safety violations can be attributed to a specific end-user rather than the whole API account. Also used for per-end-user usage breakdowns in /v1/usage. Strongly recommended for partner integrations.

aspect_ratio, '3:1' | '2:1' | '21:9' | '16:9' | '4:3' | '3:2' | '1:1' | '3:4' | '2:3' | '9:16' | '1:2' | '1:3' nullable

Output aspect ratio. Valid values depend on the selected model and generation type; the server validates the final model-specific set.

style, 'auto' | 'manga'

Style preset (auto, manga)

output_format, 'png' | 'jpeg' nullable

Output image format

source, ImageRef nullable

Media reference for guided generation. Provide exactly one of url, inline base64 data, generation_id, or file_id. URL/data references accept image media at image positions; video_edit and video_reframe sources also accept source.url or source.data when source.media_type is a video/* MIME. generation_id chains image_edit off a prior image output, video_edit/video_reframe off a prior video output, and video.start_frame/end_frame for extension. file_id references a file previously uploaded via POST /files — see the Files API.

image_ref, ImageRef[]

Reference images for style/content guidance. Up to 9 for type 'image', up to 8 for type 'image_edit'.

web_search, boolean

Enable web search grounding — the agent can search the web and download reference images before generating.

video, VideoOptions nullable

Ray 3.2 video request options. Common output settings live at the top level for type=video, type=video_edit, and type=video_reframe; video-to-video conditioning lives under edit.

layering, LayeringOptions nullable

Layer-extraction options for type=layering (model uni-1). The image to decompose rides body.source; body.prompt optionally guides how to split it (max 500 characters). The server plans the layers automatically before generating.

Example request

{
  "prompt": "A glass of iced coffee on a marble countertop, morning light streaming through a window"
}

Response

Generation submitted

GenerationResponse required

Generation status and output

id, string uuid required

Generation identifier

type, 'image' | 'image_edit' | 'video' | 'video_edit' | 'video_reframe' | 'layering' required

The kind of generation to perform

state, 'queued' | 'processing' | 'completed' | 'failed' required

Current state of the generation

model, 'uni-1' | 'uni-1-max' | 'ray-3.2' required

Model used

created_at, string required

Creation timestamp

output, GenerationOutput[]

Generated outputs (populated on completion)

failure_reason, string nullable

Human-readable failure description

failure_code, 'content_moderated' | 'generation_failed' | 'budget_exhausted' | 'output_not_found' | 'image_too_large' | 'unsupported_format' | 'corrupt_input' | 'invalid_request' | 'rate_limited' nullable

Machine-readable failure code for programmatic handling

Changes

    • warning

      added the new layering enum value to the type response property for the response status

    • info

      added the new optional request property layering

    • info

      added the new layering enum value to the request property type

    1 more change in this revision