cURL
curl https://api.apipod.ai/v1/videos/generations \
-H "Authorization: Bearer $APIPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "magi-2-r2v",
"prompt": "The character from @image_1 walks through the floral valley in @image_2 following @video_1 and synced to @audio_1.",
"image_urls": [
"https://cdn.example.com/character.png",
"https://cdn.example.com/valley.png"
],
"video_urls": ["https://cdn.example.com/camera-ref.mp4"],
"audio_urls": ["https://cdn.example.com/score.mp3"],
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}'import os import requests
response = requests.post(
"https://api.apipod.ai/v1/videos/generations",
headers={
"Authorization": f"Bearer {os.environ['APIPOD_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "magi-2-r2v",
"prompt": "The character from @image_1 walks through the floral valley in @image_2.",
"image_urls": [
"https://cdn.example.com/character.png",
"https://cdn.example.com/valley.png",
],
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": True,
},
timeout=60,
) response.raise_for_status() print(response.json())package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apipod.ai/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"magi-2-r2v\",\n \"prompt\": \"The character from @image_1 walks through the floral valley in @image_2 following @video_1 and synced to @audio_1.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}falseconst response = await fetch("https://api.apipod.ai/v1/videos/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.APIPOD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "magi-2-r2v",
prompt: "The character from @image_1 walks through the floral valley in @image_2.",
image_urls: [
"https://cdn.example.com/character.png",
"https://cdn.example.com/valley.png",
],
duration: 15,
resolution: "1080p",
aspect_ratio: "16:9",
generate_audio: true,
}),
});
if (!response.ok) {
throw new Error(`APIPod request failed: ${response.status} ${await response.text()}`);
}
console.log(await response.json());{
"code": 200,
"message": "success",
"data": {
"task_id": "vid_task_01JEXAMPLE"
}
}MAGI-2
MAGI-2 Reference to Video
Sand AI MAGI-2 Reference to Video accepts up to 20 multimodal references (images, videos, and audio—including audio-only) to generate 4-30 second 1080p native audio-video clips.
POST
https://api.apipod.ai
/
v1
/
videos
/
generations
cURL
curl https://api.apipod.ai/v1/videos/generations \
-H "Authorization: Bearer $APIPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "magi-2-r2v",
"prompt": "The character from @image_1 walks through the floral valley in @image_2 following @video_1 and synced to @audio_1.",
"image_urls": [
"https://cdn.example.com/character.png",
"https://cdn.example.com/valley.png"
],
"video_urls": ["https://cdn.example.com/camera-ref.mp4"],
"audio_urls": ["https://cdn.example.com/score.mp3"],
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}'import os import requests
response = requests.post(
"https://api.apipod.ai/v1/videos/generations",
headers={
"Authorization": f"Bearer {os.environ['APIPOD_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "magi-2-r2v",
"prompt": "The character from @image_1 walks through the floral valley in @image_2.",
"image_urls": [
"https://cdn.example.com/character.png",
"https://cdn.example.com/valley.png",
],
"duration": 15,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": True,
},
timeout=60,
) response.raise_for_status() print(response.json())package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apipod.ai/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"magi-2-r2v\",\n \"prompt\": \"The character from @image_1 walks through the floral valley in @image_2 following @video_1 and synced to @audio_1.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}falseconst response = await fetch("https://api.apipod.ai/v1/videos/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.APIPOD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "magi-2-r2v",
prompt: "The character from @image_1 walks through the floral valley in @image_2.",
image_urls: [
"https://cdn.example.com/character.png",
"https://cdn.example.com/valley.png",
],
duration: 15,
resolution: "1080p",
aspect_ratio: "16:9",
generate_audio: true,
}),
});
if (!response.ok) {
throw new Error(`APIPod request failed: ${response.status} ${await response.text()}`);
}
console.log(await response.json());{
"code": 200,
"message": "success",
"data": {
"task_id": "vid_task_01JEXAMPLE"
}
}Combine 1–20 public HTTPS references across
image_urls (0–10, <30 MB), video_urls (0–5 MP4, 2–30s each, ≤30s total), and audio_urls (0–5, ≤15 MB, 2–30s each, ≤30s total—audio-only requests are supported). Reference items in order as @image_1, @video_1, and @audio_1. Billing is flat per requested output second; typical generation time is 13–20 minutes.Authorizations
Body
application/json
Was this page helpful?