1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const axios = require('axios');
const fs = require('fs');
const path = require('path');
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/luma-ray-3-2";
const data = {
"prompt": "The woman's flowing red dress and long hair billow dramatically in the strong sea breeze, turquoise ocean waves surge and crash into white foam against the rocks below, seabirds glide gracefully across the glowing golden-hour sky, soft clouds drift slowly, gentle cinematic camera push-in, smooth fluid natural motion, photorealistic, ultra detailed",
"start_frame": "toB64('https://segmind-resources.s3.amazonaws.com/input/luma-ray-3-2-img-2-video-start-frame.jpg')",
"end_frame": "toB64('undefined')",
"resolution": "720p",
"duration": "5s",
"aspect_ratio": "16:9"
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();Required text describing scene, subject, motion and camera. Be specific about action and style.
Optional image URL used as the first frame for image-to-video. Omit for pure text-to-video.
Optional image URL for the final keyframe. Pair with start_frame for guided transitions.
Output resolution: 360p, 540p, 720p or 1080p. Use 720p for balance, 1080p for hero shots.
Allowed values:
Clip length, either 5s or 10s. Use 5s for quick tests, 10s for storytelling.
Allowed values:
Frame shape such as 16:9, 9:16 or 1:1. Use 16:9 cinematic, 9:16 vertical social.
Allowed values:
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Luma Ray 3.2 is Luma AI's production-grade video generation model, available on Segmind as a single endpoint for both text-to-video and image-to-video. Provide a prompt to generate a clip from scratch, or supply a start frame to animate an existing image. Ray 3.2 builds on Luma's reasoning-driven Ray 3 line, which plans a scene and evaluates its own output to improve realism, physics, instruction following, and shot-to-shot consistency. The result is cinematic, high-fidelity motion that holds together across the clip rather than drifting frame to frame.
On Segmind you control the prompt, an optional start and end frame, resolution (360p, 540p, 720p, 1080p), duration (5s or 10s), and aspect ratio (16:9, 9:16, 1:1, 21:9, 4:3, 3:4). Output is a ready-to-use MP4.
Ray 3.2 fits cinematic b-roll, product and brand spots, social reels, music-video moments, and animatics or previz. In our testing, an image-to-video run from a single coastal portrait produced a photorealistic clip with wind-blown hair and fabric, crashing surf, gliding seabirds, and a smooth camera push-in. That makes it well suited to bringing still concept art, photography, or product shots to life, and to generating establishing shots and mood pieces directly from a written brief.
Treat the prompt like a shot description: name the subject, the action, the lighting, and the camera move (push-in, pan, aerial). Explicit motion cues produce the most dynamic results. Use a start frame when you want to anchor composition and identity, and add an end frame to guide a specific transition. Choose 720p for fast, high-quality iterations and 1080p for hero shots; pick 10s when a scene needs room to breathe. Outputs are clean, artifact-free 24fps MP4 clips.
Yes. Add a start frame image URL to animate a still; omit it for pure text-to-video.
360p, 540p, 720p, and 1080p, at 5 or 10 seconds per clip.
16:9, 9:16, 1:1, 21:9, 4:3, and 3:4, covering widescreen and vertical delivery.
It adds reasoning-driven generation, stronger instruction following, sharper detail, and more stable motion and identity over the clip.
A standard MP4 video you can drop straight into an editor or pipeline.
Use a clean, well-composed start frame and describe the motion you want explicitly in the prompt.