
AI Media Creator
Create AI images and videos in one unified workspace
Create videos from text with the Magi 2 API by Sand AI on Flaq AI. Describe action and camera movement, choose framing, and create 4–30s scenes with optional sound.
// Step 1: Submit generation request
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
model_name: 'magi-2-text-to-video',
prompt: 'The camera glides toward a lighthouse at dusk as waves crash against the rocks',
duration: 8,
aspect_ratio: '16:9',
sound: true
})
});
const { data } = await response.json();
const taskId = data.task_id;
// Step 2: Poll for results
const taskId = data.task_id;
const pollResult = async (taskId) => {
const res = await fetch(`https://api.flaq.ai/api/v1/video/${taskId}`, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
return res.json();
};
while (true) {
const pollResultData = await pollResult(taskId);
const status = pollResultData.data.task_status;
if (status === 'succeed') {
console.log(pollResultData.data.task_result.videos[0].url);
break;
}
if (status === 'failed') {
console.error(pollResultData.data.task_status_msg);
break;
}
await new Promise(resolve => setTimeout(resolve, 10000));
}
# Step 1: Submit generation request
import requests
response = requests.post(
'https://api.flaq.ai/api/v1/video/task',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
json={
'model_name': 'magi-2-text-to-video',
'prompt': 'The camera glides toward a lighthouse at dusk as waves crash against the rocks',
'duration': 8,
'aspect_ratio': '16:9',
'sound': True
}
)
result = response.json()
task_id = result['data']['task_id']
# Step 2: Poll for results
task_id = response.json()['data']['task_id']
poll_url = f"https://api.flaq.ai/api/v1/video/{task_id}"
while True:
poll_result = requests.get(poll_url, headers={'Authorization': 'Bearer YOUR_API_KEY'}).json()
status = poll_result['data']['task_status']
if status == 'succeed':
print(poll_result['data']['task_result']['videos'][0]['url'])
break
if status == 'failed':
print(poll_result['data']['task_status_msg'])
break
time.sleep(10)
# Step 1: Submit generation request
curl -X POST https://api.flaq.ai/api/v1/video/task \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model_name": "magi-2-text-to-video",
"prompt": "The camera glides toward a lighthouse at dusk as waves crash against the rocks",
"duration": 8,
"aspect_ratio": "16:9",
"sound": true
}'
# Step 2: Poll for results
# Replace {task_id} with the task_id returned from the submit response
curl -X GET "https://api.flaq.ai/api/v1/video/{task_id}" \
-H "Authorization: Bearer YOUR_API_KEY"
| Parameters | Price | Original Price | Discount |
|---|
Sand AI Magi 2 Text-to-Video API turns natural-language prompts into video clips with synchronized audio on Flaq AI. Describe the scene, character actions, camera movement, and sound direction, then choose the clip length and framing for your placement. Built for both quick concepts and extended sequences, it supports advertising, social video, storyboarding, and automated content pipelines.
Note An explicit output duration is required for every request, and usage is billed per second based on the requested clip duration. Please ensure all prompts comply with Sand AI's content safety guidelines.
Magi 2 Text-to-Video vs. Magi 2 Image-to-Video
Magi 2 Text-to-Video creates an entire scene from written direction alone, while Magi 2 Image-to-Video starts from a required first frame and accepts an optional ending frame for tighter visual continuity.
Magi 2 Text-to-Video vs. Magi 2 Reference-to-Video
Text-to-Video relies solely on your prompt, whereas Reference-to-Video lets you supply optional reference images, video clips, and audio tracks to steer appearance, motion, and sound.
Magi 2 Text-to-Video vs. Seedance 2.5 Text-to-Video
Seedance 2.5 Text-to-Video offers selectable output resolution tiers alongside prompt-driven generation and sound. Magi 2 Text-to-Video focuses on prompt-led generation with flexible framing, native audio control, and explicit duration selection.
Magi 2 Text-to-Video vs. Veo 3.1 Fast Text-to-Video
Veo 3.1 Fast emphasizes rapid generation within Google's video model lineup. Magi 2 Text-to-Video provides Sand AI's prompt-led generation with broad framing options, optional sound, and extended clip durations.
Live parameters, supported inputs, and capabilities for Magi 2 Text to Video on Flaq AI.
Try the model in the Playground before making an API request.
Use one credit balance across video, image, LLM, voice, and 3D models. Purchased credits never expire. If a task fails due to a system error, your balance is not deducted.
Copy the model ID below into your API request for Magi 2 Text to Video.
Explore other models from Sand AI and check their supported inputs and pricing.
Everything you need to know about capabilities, pricing, failed tasks, and API usage.
Create videos from text with the Magi 2 API by Sand AI on Flaq AI. Describe action and camera movement, choose framing, and create 4–30s scenes with optional sound.
Supported tasks: Text To Video. Available inputs and settings include Duration, Aspect Ratio. See the specifications for their supported values.
Billing model: Per second. The pricing table above lists rates and the settings that determine which rate applies.
If a task fails due to a system error, your balance will not be deducted.
Use magi-2-text-to-video as the model ID in your request. Refer to the API documentation for authentication and request details.
Other models include Magi 2 Image to Video, Magi 2 Reference to Video. Compare their supported inputs, output settings, and pricing on their model pages.
Purchased credits do not expire. Commercial use of outputs is subject to Flaq AI’s terms of service and the applicable model provider’s terms.
Explore several AI creation tools for quick image and video workflows in your browser, then scale successful ideas with Flaq AI's production-ready model APIs. Flaq AI provides a unified API layer for all models, making it easy to use and scale your workflows.

Create AI images and videos in one unified workspace
Open your agent workspace and pick up a conversation

Build visual AI image and video workflows on an infinite canvas

Create consistent videos from reference media

Create AI images from text prompts

Create AI images from images and text prompts

Create AI videos from text prompts

Animate images into AI videos