Where to call MAGI-2
| Provider | Per 1080p second | Notes |
|---|---|---|
| Sand AI (official) | $0.080 | The model’s maker, at sand.ai; not accepting top-ups on 25 Nov (per Yir) |
| NanoAPI | $0.078 | Lowest published price; typical time 21.9 min |
| APIMart | $0.080 | |
| Higgsfield | $0.080 | Also offers MAGI-2 inside its creative app |
| KIE | $0.088 | Three endpoints: text, image (first + optional last frame), reference |
| Yir (router) | Channel price, no markup | One model id; routes to the cheapest channel and fails over |
Published prices from Yir’s MAGI-2 page and KIE’s MAGI-2 page, 26 November 2026.
Parameters
| Parameter | Values |
|---|---|
| model | sand-ai/magi-2 (Yir); each reseller has its own id |
| duration / seconds | 4–30 whole seconds, billed per second |
| resolution | 1080p (25 fps). There is no cheaper lower tier |
| aspect_ratio | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 |
| generate_audio | true or false; same price either way |
| first_frame / last_frame | One image each; last frame depends on the channel |
| reference images / videos / audio | Up to 10 / 5 / 5 per request (20 in total) |
TypeScript (Yir SDK)
import { createNodeYirClient } from "@yir-ai/sdk/server";
const client = createNodeYirClient(); // reads YIR_API_KEY
const job = await client.submitVideo({
model: "sand-ai/magi-2",
input: {
type: "text",
prompt: "A sea turtle glides over a coral reef; sunlight ripples on its shell. Gentle underwater ambience.",
},
parameters: {
duration: 10,
resolution: "1080p",
aspect_ratio: "16:9",
generate_audio: true,
n: 1,
},
});
const result = await client.waitForJob(job.id); // MAGI-2 usually takes 13–25 minutes
for (const file of result.result?.files ?? []) console.log(file.url);cURL (OpenAI-compatible endpoint)
curl https://gateway.yir.ai/openai/v1/videos \
-H "Authorization: Bearer $YIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sand-ai/magi-2",
"prompt": "A sea turtle glides over a coral reef; sunlight ripples on its shell.",
"resolution": "1080p",
"aspect_ratio": "16:9",
"seconds": "10"
}'Python
import os, requests
r = requests.post(
"https://gateway.yir.ai/openai/v1/videos",
headers={"Authorization": f"Bearer {os.environ['YIR_API_KEY']}"},
json={
"model": "sand-ai/magi-2",
"prompt": "A sea turtle glides over a coral reef; sunlight ripples on its shell.",
"resolution": "1080p",
"aspect_ratio": "16:9",
"seconds": "10",
},
timeout=60,
)
r.raise_for_status()
video = r.json()
print(video["id"]) # store it, then poll the job status as described in the provider's docsBecause a clip takes 13–25 minutes, never block a web request on it. Submit, save the job id with the user’s request, and check status from a background worker or a webhook. Set a cost cap per job where the provider allows it (Yir takes max_cost) so a fallback channel can’t bill more than you planned.
Don’t want to write code?
The Magi2Gen generator runs the same model with one-time credit packs: no API key, no wallet top-up, and failed renders refund automatically.