cURL
curl https://api.apipod.ai/v1/videos/generations \
-H "Authorization: Bearer $APIPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "magi-2-t2v",
"prompt": "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
"duration": 5,
"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-t2v",
"prompt": "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
"duration": 5,
"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-t2v\",\n \"prompt\": \"A paper boat drifting down a rainy city street at dusk, slow tracking shot, puddle reflections, gentle rain ambience\"\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-t2v",
prompt: "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
duration: 5,
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 Text to Video
Sand AI MAGI-2 Text to Video generates 4-30 second 1080p, 25 fps videos with synchronized native audio from prompts up to 8000 characters across six aspect ratios.
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-t2v",
"prompt": "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
"duration": 5,
"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-t2v",
"prompt": "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
"duration": 5,
"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-t2v\",\n \"prompt\": \"A paper boat drifting down a rainy city street at dusk, slow tracking shot, puddle reflections, gentle rain ambience\"\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-t2v",
prompt: "A paper boat drifting down a rainy city street at dusk, slow tracking shot",
duration: 5,
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 renders native 1080p, 25 fps audio-video clips (finished output is ~0.24s longer than
duration) and typically takes 13–20 minutes depending on length. Use callback_url or patient polling on GET /v1/videos/status/{task_id}. Billing is flat per requested second regardless of aspect ratio or generate_audio.Authorizations
Body
application/json
Was this page helpful?