Video GenerationLuma
Luma Ray Flash 2
Generate videos quickly using the Luma Ray Flash 2 model — a faster, more cost-effective variant of Ray 2.
POST /v2/videos/generate — model: "luma-ray-flash-2"
A speed-optimized variant of Luma Ray 2 that generates 720p videos faster at lower cost. Supports the same parameter set including keyframes, looping, aspect ratio, and camera 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 Luma Ray 2 for the full list) |
Credit cost
| Variant | Credits |
|---|---|
5s | 51 |
9s | 92 |
Example result
Once the job is COMPLETED, the result object on GET /v2/jobs/:id looks like:
{
"videoUrl": "https://cdn2.apiframe.ai/videos/b2c3d4e5-f6a7-8901-bcde-f23456789012.mp4"
}See Result format for field details.
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 butterfly emerging from a cocoon in a sunlit garden",
"model": "luma-ray-flash-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 butterfly emerging from a cocoon in a sunlit garden",
"model": "luma-ray-flash-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 butterfly emerging from a cocoon in a sunlit garden",
model: "luma-ray-flash-2",
lumaParams: {
duration: 5,
aspect_ratio: "16:9",
},
}),
});
console.log(await response.json());body := `{
"prompt": "a butterfly emerging from a cocoon in a sunlit garden",
"model": "luma-ray-flash-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)Try it
POST
/v2/videos/generateTry it