# Luma Ray 3.2 > Generate cinematic text-to-video and image-to-video clips up to 1080p with Luma Ray 3.2's reasoning-driven realism and motion. ## Overview - **Endpoint**: `https://api.segmind.com/v1/luma-ray-3-2` - **Model ID**: `luma-ray-3-2` - **Category**: Image-to-Video Generation - **Type**: Synchronous (Direct response) - **Average Cost**: $1.6666666666666667 ## Pricing | resolution | duration | cost | | --- | --- | --- | | 360p | 5s | 0.625 | | 360p | 10s | 1.25 | | 540p | 5s | 0.625 | | 540p | 10s | 1.25 | | 720p | 5s | 1.25 | | 720p | 10s | 2.5 | | 1080p | 5s | 2.5 | | 1080p | 10s | 5 | ## API Information This model uses a **synchronous response pattern**: 1. Make a POST request with your parameters 2. Receive the output directly in the response (binary for images/videos/audio, JSON for text) 3. No polling required - response is immediate ### Input Schema The API accepts the following input parameters: - **`prompt`** (`string`, _required_): Prompt Required text describing scene, subject, motion and camera. Be specific about action and style. - **`start_frame`** (`File (URL)`, _optional_): Start frame Optional image URL used as the first frame for image-to-video. Omit for pure text-to-video. - Default: `"https://segmind-resources.s3.amazonaws.com/input/luma-ray-3-2-img-2-video-start-frame.jpg"` - **`end_frame`** (`File (URL)`, _optional_): End frame Optional image URL for the final keyframe. Pair with start_frame for guided transitions. - **`resolution`** (`string | null`, _optional_): Resolution Output resolution: 360p, 540p, 720p or 1080p. Use 720p for balance, 1080p for hero shots. - Default: `"720p"` - Options: "360p" (360p), "540p" (540p), "720p" (720p), "1080p" (1080p) - **`duration`** (`string | null`, _optional_): Duration Clip length, either 5s or 10s. Use 5s for quick tests, 10s for storytelling. - Default: `"5s"` - Options: "5s" (5s), "10s" (10s) - **`aspect_ratio`** (`string | null`, _optional_): Aspect ratio Frame shape such as 16:9, 9:16 or 1:1. Use 16:9 cinematic, 9:16 vertical social. - Default: `"16:9"` - Options: "16:9" (16:9), "1:1" (1:1), "21:9" (21:9), "3:4" (3:4), "4:3" (4:3), "9:16" (9:16) **Required Parameters Example**: ```json { "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" } ``` **Full Example**: ```json { "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": "https://segmind-resources.s3.amazonaws.com/input/luma-ray-3-2-img-2-video-start-frame.jpg", "end_frame": "https://example.com/image.jpg", "resolution": "720p", "duration": "5s", "aspect_ratio": "16:9" } ``` ### Output Schema The API returns a synchronous response based on the model type: **For Image/Video/Audio Models**: - Response contains binary data (image/png, video/mp4, audio/mp3) - Content-Type header indicates the media type - Save the response body directly to a file **For Text Models**: - Response is JSON with the generated text - Structure varies by model **HTTP Response Codes**: - **200 - OK**: Request successful, output in response body - **400 - Bad Request**: Invalid parameters - **401 - Unauthorized**: Invalid or missing API key - **404 - Not Found**: Model not found - **406 - Not Acceptable**: Insufficient credits - **429 - Too Many Requests**: Rate limit exceeded - **500 - Server Error**: Internal server error ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/luma-ray-3-2" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "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": "https://segmind-resources.s3.amazonaws.com/input/luma-ray-3-2-img-2-video-start-frame.jpg", "end_frame": "https://example.com/image.jpg", "resolution": "720p", "duration": "5s", "aspect_ratio": "16:9" }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/luma-ray-3-2" 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": "https://segmind-resources.s3.amazonaws.com/input/luma-ray-3-2-img-2-video-start-frame.jpg", "end_frame": "https://example.com/image.jpg", "resolution": "720p", "duration": "5s", "aspect_ratio": "16:9" } response = requests.post( url, json=data, headers={ 'x-api-key': api_key, 'Content-Type': 'application/json' } ) if response.status_code == 200: # For image/video/audio models, response.content contains the binary data with open('output.png', 'wb') as f: f.write(response.content) print('Generation complete, saved to output.png') else: print(f"Error: {response.status_code}") print(response.text) ``` ### JavaScript ```javascript const apiKey = '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": "https://segmind-resources.s3.amazonaws.com/input/luma-ray-3-2-img-2-video-start-frame.jpg", "end_frame": "https://example.com/image.jpg", "resolution": "720p", "duration": "5s", "aspect_ratio": "16:9" }; const response = await fetch(url, { method: 'POST', headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json', }, body: JSON.stringify(data), }); if (response.ok) { // For image/video/audio models, response contains binary data const blob = await response.blob(); const downloadUrl = URL.createObjectURL(blob); // Create download link const a = document.createElement('a'); a.href = downloadUrl; a.download = 'output.png'; a.click(); console.log('Generation complete'); } ``` ## Additional Resources ### Documentation - [Model Playground](https://www.segmind.com/models/luma-ray-3-2) - [API Documentation](https://www.segmind.com/models/luma-ray-3-2/api) - [Pricing Details](https://www.segmind.com/models/luma-ray-3-2/pricing) - [Platform Documentation](https://docs.segmind.com/) ### Tags No tags available