Skip to main content

Luma

Luma Dream Machine provides high-quality video generation capabilities. Official docs: docs.lumalabs.ai

Create Video

POST /luma/generations

Request Parameters

ParameterTypeRequiredDescription
user_promptstringYesVideo description prompt
model_namestringNoModel name: ray-v1, ray-v2
durationstringNoVideo duration (seconds)
resolutionstringNoResolution: 540p, 720p, 1080p
expand_promptbooleanNoWhether to auto-expand the prompt
image_urlstringNoFirst frame reference image URL
image_end_urlstringNoLast frame reference image URL

Request Examples

curl -X POST https://crazyrouter.com/luma/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "user_prompt": "A drone shot flying over a tropical island with crystal clear water",
    "model_name": "ray-v2",
    "duration": "5",
    "resolution": "720p",
    "expand_prompt": true
  }'

Response Example

{
  "id": "luma_gen_abc123",
  "state": "queued",
  "created_at": "2024-03-01T12:00:00Z"
}

Image-to-Video

Pass image_url as the first frame:
{
  "user_prompt": "The person in the image starts walking forward",
  "model_name": "ray-v2",
  "image_url": "https://example.com/portrait.jpg"
}
First-last frame mode:
{
  "user_prompt": "Smooth transition between two scenes",
  "model_name": "ray-v2",
  "image_url": "https://example.com/start.jpg",
  "image_end_url": "https://example.com/end.jpg"
}

Query Task

GET /luma/generations/{task_id}
cURL
curl https://crazyrouter.com/luma/generations/luma_gen_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "id": "luma_gen_abc123",
  "state": "completed",
  "created_at": "2024-03-01T12:00:00Z",
  "video": {
    "url": "https://storage.cdn-luma.com/...",
    "download_url": "https://storage.cdn-luma.com/..."
  }
}

Extend Video

POST /luma/generations/{task_id}/extend
Extend a completed video.
cURL
curl -X POST https://crazyrouter.com/luma/generations/luma_gen_abc123/extend \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "user_prompt": "Continue the drone shot, camera pans to reveal a beach resort"
  }'

Task Status

StatusDescription
queuedQueued
dreamingGenerating
completedCompleted
failedFailed