Skip to Content
Video ModelsLuma Ray 2

Luma Ray 2

Overview

Luma Ray 2 is a high-quality video generation model that supports both text-to-video and image-to-video modes.

Test API KEY: key_00000000000000000000000000000000

Endpoints

1. Create Task

Request

POST https://api.pixwith.ai/api/task/create

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Api-Key{API_KEY}Yes

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe input prompt (e.g., “A cat walking in the garden”)
image_urlsarrayConditional[“https://cdn.pixwith.ai/xxx.jpg ”]. Provide 1 image (start_image) or 2 images (start_image and end_image). Second image is optional.
model_idstringYes2-4
optionsobjectYesConfiguration options for the task
options.prompt_optimizationbooleanYesIf true, all prompt words will be automatically translated into English.
options.aspect_ratiostringYesAspect ratio of the output. Valid values: '16:9', '9:16', '1:1', '4:3', '3:4', '9:21', or '21:9'
options.resolutionstringYesResolution of the output. Valid values: '540p' or '720p'
options.durationintYesDuration in seconds. Valid values: 5 or 9
options.loopbooleanNoLoop the video. Default: false

Example Request - Text-to-Video

{ "prompt": "A cat walking in the garden", "model_id": "2-4", "options": { "prompt_optimization": true, "aspect_ratio": "16:9", "resolution": "540p", "duration": 5, "loop": false } }

Example Request - Image-to-Video (with start and end images)

{ "prompt": "A cat walking in the garden", "image_urls": [ "https://cdn.pixwith.ai/images/cf0ddb5ad6a0f0c85ab4d1dceb9fd89c_0.jpeg", "https://cdn.pixwith.ai/images/cf0ddb5ad6a0f0c85ab4d1dceb9fd89c_1.jpeg" ], "model_id": "3-4", "options": { "prompt_optimization": true, "aspect_ratio": "16:9", "resolution": "540p", "duration": 5, "loop": false } }

Response Parameters

ParameterTypeDescription
codeint1=success, 0=error
messagestringSuccess and failure messages
dataobject
data.task_idstring
data.estimated_timeintEstimated time in seconds

Response

{ "code": 1, "message": "success", "data": { "task_id": "d425ab4dc256f0ebaa84862b9cea8a3d", "estimated_time": 42 } }
Last updated on