



const main = async () => {
const response = await fetch('https://api.ai.cc/v2/video/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer ',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'luma/ray-2',
prompt: 'A DJ on the stand is playing, around a World War II battlefield, lots of explosions, thousands of dancing soldiers, between tanks shooting, barbed wire fences, lots of smoke and fire, black and white old video: hyper realistic, photorealistic, photography, super detailed, very sharp, on a very white background',
}),
}).then((res) => res.json());
console.log('Generation:', response);
};
main()
import requests
def main():
url = "https://api.ai.cc/v2/video/generations"
payload = {
"model": "luma/ray-2",
"prompt": "A DJ on the stand is playing, around a World War II battlefield, lots of explosions, thousands of dancing soldiers, between tanks shooting, barbed wire fences, lots of smoke and fire, black and white old video: hyper realistic, photorealistic, photography, super detailed, very sharp, on a very white background"
}
headers = {"Authorization": "Bearer ", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print("Generation:", response.json())
if __name__ == "__main__":
main()
-
AI Playground

Test all API models in the sandbox environment before you integrate.
We provide more than 300 models to integrate into your app.


Product Detail
Introducing Ray 2 API: Ultra-Realistic AI Video Generation by Luma AI
The Ray 2 API by Luma AI marks a revolutionary advancement in generative AI, presenting an unparalleled solution for creating ultra-realistic, photorealistic video content. Engineered with a cutting-edge multi-modal architecture and leveraging 10x the computational power of its predecessor, Ray 1, this API delivers production-ready video generation. It flawlessly interprets text instructions to produce dynamic videos with natural, coherent motion, making it indispensable for professional creative workflows demanding superior quality and efficiency.
🚀 Technical Specifications & Performance Benchmarks
Architecture & Core Capabilities:
- ✨ Architecture: A large-scale multi-modal fusion model, meticulously optimized for superior video generation.
- ✅ Supported Inputs: Currently robust Text-to-Video capabilities; future updates will include Image-to-Video, Video-to-Video, and advanced editing features.
- 💡 Resolution: Supports stunning visuals up to 1080p, characterized by smooth camera movements and cinematic aesthetics.
- ⏳ Video Duration: Typically generates videos up to 10 seconds, with ongoing developments for extended sequence lengths.
- 🌟 Motion Quality: Achieves fast, highly coherent motion with physical accuracy and lifelike lighting interactions.
- 🖼️ Output Quality: Delivers ultra-realistic details, authentic textures, fluid camera work, and logically sequenced events.
Key Performance Advantages:
- 🚀 Generates videos with significantly higher success rates of usable outputs compared to its predecessor, Ray 1.
- ⚡ Features reduced generation times, paving the way for near real-time video production workflows.
- 🧠 Demonstrates superior comprehension of complex text prompts, accurately capturing fine scene and action details.
- 🎬 Offers enhanced motion quality with a notable reduction in artifacts compared to previous generation models.
- ✨ Consistently highly rated for cinematic effects, including depth perception, dynamic lighting, and natural event sequencing.
✨ Unlocking Creativity with Ray 2 API Key Features
- 📝 Text-to-Video Generation: Transform detailed textual descriptions into captivating, dynamic, and coherent video sequences.
- ✅ Production Ready Output: Designed for professional use, effectively eliminating common artifacts and slow-motion playback issues.
- 🎥 Advanced Motion Fidelity: Captures exquisitely smooth and natural movements, including sophisticated cinematic camera pans and tracking shots.
- 🌈 High Visual Fidelity: Experience realistic lighting, accurate shadows, and intricate object interactions with exceptional detail.
- ✍️ Narrative Control: Empower your storytelling with support for customizable start and end image keyframes, guiding the video narrative.
- 🎨 Style Transfers: Seamlessly blend and control visual styles, ensuring aesthetic consistency across all frames of your video.
- 🛡️ Robust Moderation System: Features a multi-layered content moderation approach, combining advanced AI filters with human oversight to ensure safe and appropriate usage.
💰 Ray 2 API Pricing & Cost Examples
The Ray 2 API offers transparent and efficient pricing, calculated based on the total pixels generated, making it a scalable solution for diverse production requirements.
- 🏷️ Base Generation Rate: $0.00672 per 1 million pixels.
Illustrative Generation Examples (16:9 aspect ratio, no audio):
- 🎬 720p resolution · 9 seconds duration: Estimated cost — $0.462
- 🎞️ 4K resolution · 5 seconds duration: Estimated cost — $0.5145
💡 Diverse Use Cases for Ray 2 API Across Industries
Ray 2 empowers creators and businesses across various sectors to produce high-quality, compelling video content with unprecedented ease and efficiency.
- 📢 Content Creation: Develop engaging marketing videos, promotional clips, compelling storytelling narratives, and robust brand engagement content.
- 🎬 Film & Animation: Facilitate concept art animation, pre-visualization, and rapid scene prototyping for film and animation projects.
- 🎮 Interactive Media: Generate dynamic backgrounds, sophisticated UI animations, and immersive experiences for interactive applications.
- 📚 Education & Training: Craft engaging visual storytelling for educational modules, interactive tutorials, and training simulations.
- 🖼️ Creative Arts: Explore experimental video art forms and narrative explorations for artistic endeavors.
- 🛍️ Product Visualization: Create simulated product demonstrations and virtual displays without the need for expensive physical shoots.
📊 Ray 2 API: Outperforming the Competition
A clear understanding of Ray 2's distinct advantages underscores its position as a premier solution in the generative video landscape.
- vs Ray 1: Ray 2 delivers a monumental upgrade with 10x higher compute power, producing truly production-quality videos with vastly superior coherent motion and heightened realism, moving far beyond Ray 1's initial proof-of-concept capabilities.
- vs Stable Diffusion: Ray 2 distinguishes itself by offering superior natural motion and precise cinematic camera control, effectively overcoming the temporal coherence and smooth tracking limitations often observed in more basic video diffusion models.
- vs Midjourney Video: While Midjourney is renowned for its image generation prowess, Ray 2 is specifically specialized for advanced video creation from text inputs, providing robust detailed narrative and sophisticated motion handling.
- vs Flux 1.1: Ray 2 significantly surpasses Flux 1.1 across critical metrics such as resolution support, motion smoothness, and overall production readiness, establishing itself as a more robust and professional choice for high-stakes content creation.
💻 Code Sample: Integrating Ray 2 API for Text-to-Video
Integrating the Ray 2 API into your application is straightforward. Below is a typical Python snippet demonstrating how to initiate a text-to-video generation request:
import requests
import json
# Ensure your Luma AI API key is securely stored and used
API_KEY = "YOUR_LUMA_AI_API_KEY"
API_ENDPOINT = "https://api.luma.ai/ray-2/generate" # Hypothetical API endpoint
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
payload = {
"prompt": "A futuristic city skyline at dawn, with flying cars and towering skyscrapers, highly detailed, cyberpunk style.",
"model": "luma/ray-2",
"duration_seconds": 7,
"resolution": "1080p"
}
try:
response = requests.post(API_ENDPOINT, headers=headers, data=json.dumps(payload))
response.raise_for_status() # Raises HTTPError for bad responses (4xx or 5xx)
result = response.json()
print("Video generation request successfully initiated:")
print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as err:
print(f"HTTP error occurred: {err}")
except Exception as err:
print(f"An unexpected error occurred: {err}")
For comprehensive details and additional code examples, please refer to the Official Ray 2 API Documentation.
❓ Frequently Asked Questions (FAQ) about Ray 2 API
1. What is Ray 2 by Luma AI primarily used for?
Ray 2 by Luma AI is an advanced large-scale video generative AI model designed to create ultra-realistic, photorealistic video content from detailed text prompts, making it ideal for professional creative and production workflows.
2. How does Ray 2 enhance video quality compared to earlier models?
Ray 2 utilizes a new multi-modal architecture with 10x the compute power of its predecessor, Ray 1. This results in significantly improved motion coherence, enhanced realism, superior text prompt comprehension, and cinematic visual effects, minimizing common video artifacts.
3. What are the typical video resolution and duration capabilities of Ray 2?
Ray 2 supports video generation up to 1080p resolution with smooth camera movements. Videos are typically generated up to 10 seconds in length, with ongoing advancements to support longer sequences.
4. Can Ray 2 be integrated into existing professional workflows?
Yes, Ray 2 is explicitly designed to be "production-ready". Its high output quality, reduced generation times, and features like narrative control and a robust moderation system make it highly suitable for integration into professional content creation pipelines for marketing, film, interactive media, and more.
5. What types of inputs does Ray 2 currently support for video generation?
Currently, Ray 2 primarily supports Text-to-Video generation, allowing users to convert detailed text prompts into dynamic video sequences. Image-to-Video, Video-to-Video, and advanced editing capabilities are planned for future releases.
Learn how you can transformyour company with AICC APIs



Log in