Luma Ray 2
Generate videos from text or images using the Luma Ray 2 model with camera concepts, loop, and keyframe support.
POST /v2/videos/generate — model: "luma-ray-2"
Generate high-quality 720p videos from text prompts or input images. Supports start and end image keyframes, looping, aspect ratio control, and camera motion concepts.
See Video Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
lumaParams.duration | number | No | 5 | Video duration in seconds: 5 or 9 |
lumaParams.aspect_ratio | string | No | — | Aspect ratio: "16:9", "9:16", "1:1", "4:3", "3:4", "21:9" |
lumaParams.start_image | string | No | — | Image URL for the first frame |
lumaParams.end_image | string | No | — | Image URL for the last frame |
lumaParams.loop | boolean | No | — | Whether the video should loop seamlessly |
lumaParams.concepts | string[] | No | — | Camera motion concepts (see list below) |
Camera concepts
truck_left, truck_right, pan_left, pan_right, pedestal_up, pedestal_down, tilt_up, tilt_down, roll_left, roll_right, zoom_in, zoom_out, push_in, pull_out, dolly_zoom, orbit_left, orbit_right, crane_up, crane_down, aerial, aerial_drone, low_angle, high_angle, eye_level, ground_level, over_the_shoulder, pov, selfie, handheld, static, bolt_cam, overhead, elevator_doors, tiny_planet
Credit cost
| Variant | Credits |
|---|---|
5s | 10 |
9s | 20 |
Code examples
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a cinematic aerial shot over a misty mountain range at sunrise",
"model": "luma-ray-2",
"lumaParams": {
"duration": 5,
"aspect_ratio": "16:9"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/videos/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "a cinematic aerial shot over a misty mountain range at sunrise",
"model": "luma-ray-2",
"lumaParams": {
"duration": 5,
"aspect_ratio": "16:9",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/videos/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "a cinematic aerial shot over a misty mountain range at sunrise",
model: "luma-ray-2",
lumaParams: {
duration: 5,
aspect_ratio: "16:9",
},
}),
});
console.log(await response.json());body := `{
"prompt": "a cinematic aerial shot over a misty mountain range at sunrise",
"model": "luma-ray-2",
"lumaParams": {
"duration": 5,
"aspect_ratio": "16:9"
}
}`
req, _ := http.NewRequest("POST", "https://api.apiframe.ai/v2/videos/generate",
strings.NewReader(body))
req.Header.Set("X-API-Key", "afk_your_api_key_here")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)With camera concepts
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a car speeding through a neon-lit city at night",
"model": "luma-ray-2",
"lumaParams": {
"duration": 9,
"concepts": ["push_in", "low_angle"]
}
}'Image-to-video with keyframes
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "smooth transition between two scenes",
"model": "luma-ray-2",
"lumaParams": {
"start_image": "https://example.com/start.jpg",
"end_image": "https://example.com/end.jpg"
}
}'Try it
/v2/videos/generateTry it