MAGI-2 API

No. 1 in Artificial Analysis image-to-video blind tests: up to 30 seconds of 1080p video with native sound in one take, for a fraction of Seedance 2.5's price

1080p, sound included
APIMart $0.08 / second
Official$0.08
Image-to-video, Artificial Analysis
No. 1
Elo 1164, November 25, 2026
Longest single take
30 s
1080p, 25 fps
References per request
20
10 images, 5 videos, 5 audio clips

MAGI-2 API pricing per second

One 1080p rate covers text, first and last frames and references; sound and reference media add nothing. Plan for the wait: about 13–25 minutes per clip

Compare other models
Output specificationProvidersPublished provider priceTypical timeTry it
Uniform specification
Sand AIOfficial
$0.080 / second
Reference price only; not available through Yir
KIE
$0.088 / second10% more
Try it
APIMart
$0.080 / second
Try it

Automatic routing and failover

Call MAGI-2 with one model ID and Yir picks the channel for each job from APIMart and KIE: it goes to the eligible channel with the lowest estimated price and is billed at that channel's public price, with no markup. If an attempt is confirmed failed, Yir retries on another channel within your max_cost. No routing parameters needed in your request. Routing and fallback docs

Pricing notes

Billed by the channel that actually runs the job. Failover may switch channels, which can change cost and time.

No. 1 in image-to-video, at about 1/7 of Seedance 2.5's 1080p price

Elo from blind votes on Artificial Analysis (image-to-video with audio, November 25, 2026); bars show the 95% interval, and overlapping bars are a statistical tie. Prices are the lowest per second on Yir today

ModelElo and rankPrice per second
MAGI-21164#1$0.080/s1080p
Seedance 2.51160#2≈$0.5346/s1080p
Seedance 2.01142#5$0.3544/s1080p
MiniMax H31137#6$0.0155/s768p
Wan 3.01111#14$0.1315/s1080p
FLUX 3 Max1066#19$0.1885/s1080p
Kling 3.01000#27$0.1344/s1080p

Head to head, MAGI-2 loses only to Seedance 2.5

How often the row model beat the column model when professional directors, animators and designers voted blind. Higgsfield Video Arena, November 24, 2026

Seedance 2.5MAGI-2Seedance 2.0Wan 3.0Kling 4.0MiniMax H3
Seedance 2.561%77%85%95%71%
MAGI-239%71%79%83%83%
Seedance 2.023%29%60%72%77%
Wan 3.015%21%40%52%68%
Kling 4.05%17%28%48%55%
MiniMax H329%17%23%32%45%

Long takes, cuts on the second, 20 references

Generated by MAGI-2, published by Sand AI; the opening reel joins several clips

  • Picture and synced sound come from a single generation; this clip walks through five painting styles

  • Write the timing into the prompt: Sand AI asked for 15 shots with a hard cut every 2 seconds. Click a shot to jump to its cut

  • Mix 10 images, 5 videos and 5 audio clips; here they lock one character, her outfit and three settings

  • Sand AI's 1080p upscaler reads your reference images again, so small faces and on-screen text stay clear

Use the API

Hand the code to a coding agent, generate right in the chat with MCP or the Skill, or integrate yourself with the SDK or the OpenAI-compatible API.

Let a coding agent integrate it

Copy the integration prompt, or open it directly in Codex or Claude. The agent reads this page and the model contract, then writes submit, wait and result handling into your project.

Add the Yir MCP server

Connect it to ChatGPT, Claude or Cursor, then mention @Yir and ask for MAGI-2 by name. It quotes first and only generates after you confirm.

https://gateway.yir.ai/mcp
Setup steps for each client

One command for Claude Code

Create an API key in the console, set it as YIR_API_KEY, then run:

claude mcp add --transport http yir https://gateway.yir.ai/mcp --header "Authorization: Bearer $YIR_API_KEY"

Install the Yir Skill

Set YIR_API_KEY where your agent runs, add the Skill to Claude Code, Codex or another coding agent, then say “use MAGI-2 on Yir to make…”.

npx skills add yir-ai/skills
About the Yir Skill

Install the official SDK with your package manager, or copy the code snippet below to get started

$pnpm add @yir-ai/sdk
import { createNodeYirClient } from "@yir-ai/sdk/server";
 
// Reads YIR_API_KEY from the environment by default: process.env.YIR_API_KEY
const client = createNodeYirClient();
 
// 1. Submit a video generation job
const job = await client.submitVideo({
model: "sand-ai/magi-2",
input: {
type: "text",
prompt: "A sea turtle swims slowly over a coral reef. The camera tracks smoothly from the side as sunlight filters through clear water, casting moving patterns across its shell",
},
parameters: {
duration: 5,
resolution: "1080p",
aspect_ratio: "16:9",
generate_audio: true,
n: 1,
},
});
 
// 2. Wait for the job to finish and deliver its result
const result = await client.waitForJob(job.id);
console.log("Delivered files:", result.result);
if (result.result && "files" in result.result) {
for (const file of result.result.files) {
console.log("->", file.url);
}
}

Projects already on the OpenAI protocol, or gateways such as new-api, only need a new Base URL and key. OpenAI compatibility guide

OpenAI SDK base_url
https://gateway.yir.ai/openai/v1
new-api channel Base URL
https://gateway.yir.ai/openai
Key
Yir API key
Model ID
sand-ai/magi-2
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 swims slowly over a coral reef. The camera tracks smoothly from the side as sunlight filters through clear water, casting moving patterns across its shell",
    "resolution": "1080p",
    "aspect_ratio": "16:9",
    "seconds": "5"
  }'

Parameter overview

Common parameters; limits depend on the current model and selected channel

API docs
Resolution
resolution
  • 1080p

Output resolution tier. Higher resolutions offer sharper pixel fidelity and scale pricing accordingly

Aspect ratio
aspect_ratio
  • 21:9
  • 16:9
  • 4:3
  • 1:1
  • 3:4
  • 9:16

Geometric aspect ratio. Choose according to target medium (portrait, banner, or square)

Input mode
input_mode
  • Text input
  • Image input
  • Reference input

Reference limits and formats depend on the model and selected channel

Duration
duration
  • 4–30 seconds

Video output duration tier, billed per second or stepped tier

Audio
generate_audio
  • Optional

Optional synchronized native audio generation track

References
references
  • first_frame ≤ 1
  • last_frame ≤ 1
  • reference_image ≤ 10
  • reference_video ≤ 5
  • reference_audio ≤ 5

Reference limits across input modes depend on the selected channel. Counts in the price table are examples, not input limits or free allowances.

Frequently asked questions

Guides and comparisons

Start building with MAGI-2

Compare the same spec across providers and call multiple providers from one wallet.