# MAGI-2

> 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

- Model page: https://yir.ai/models/magi-2
- Model ID: `sand-ai/magi-2`
- Billing: by the channel that ran the job; attempts the upstream did not bill are free.

## Long takes, cuts on the second, 20 references

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

### 30 seconds of 1080p in one take

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

### Cut on the second you ask for

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

### Up to 20 references per request

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

### Faces that hold up in close-up

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

## Pricing

Current public prices by channel for the same output specification; official prices are a reference. You are billed by the channel that actually runs the job, which may change on failover.

| Output specification | Channel | Public price |
|---|---|---|
| Uniform specification | Sand AI (official) | $0.08 / second |
| Uniform specification | APIMart | $0.08 / second |
| Uniform specification | KIE | $0.088 / second |

## Parameters

- Operation: `generate_video`

| Parameter | Values | Default |
|---|---|---|
| `input` | text / image / reference | text |
| `resolution` | 1080p | 1080p |
| `aspect_ratio` | 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 | 16:9 |
| `duration` | 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15 / 16 / 17 / 18 / 19 / 20 / 21 / 22 / 23 / 24 / 25 / 26 / 27 / 28 / 29 / 30 | 5 |
| `generate_audio` | true / false | true |

## Integration

Pick either: the official SDK for new code, or swap the Base URL in projects already using the OpenAI protocol.

### Official SDK (TypeScript)

The SDK calls the Standard API (https://gateway.yir.ai) to submit, wait for and collect jobs; a Go SDK is also available. https://yir.ai/docs/integrations/sdk

```bash
pnpm add @yir-ai/sdk
```

```ts
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);
  }
}
```

### OpenAI-compatible API

OpenAI Images and Sora Videos protocols for OpenAI SDKs and gateways such as new-api; no chat. https://yir.ai/docs/integrations/openai-compatibility

- OpenAI SDK base_url: `https://gateway.yir.ai/openai/v1`
- new-api channel Base URL (channel type OpenAI): `https://gateway.yir.ai/openai`
- Model ID: `sand-ai/magi-2`

```bash
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"
  }'
```

## FAQ

### Does MAGI-2 have an official API?

Yes, on Sand AI's own platform at $0.08 per second for 1080p, but as of November 25, 2026 it does not accept top-ups. Through Yir you can call it now with one API key.

### MAGI-2 or Seedance 2.5: which should I use?

On the Artificial Analysis image-to-video board they are within the margin of error (1164 vs 1160, November 25, 2026). In Higgsfield's blind votes Seedance 2.5 won 61% of their matchups. MAGI-2 costs far less at 1080p. Pick Seedance 2.5 for 480p, 720p or 4K output, more than 20 references, or a faster turnaround.

### How long does MAGI-2 take to generate a video?

About 13–25 minutes. NanoAPI's documentation gives 13–17 minutes for a 4-second clip and about 20 for 30 seconds; a 4-second clip we ran on November 25, 2026 took about 24. Jobs run asynchronously: submit one, then poll it or receive a webhook.

### What can I pass to MAGI-2 as a reference?

Up to 10 images, 5 videos and 5 audio clips in one request, and audio alone is fine. Each video or audio clip runs 2–30 seconds, with at most 30 seconds of video and 30 seconds of audio in total. Name them in the prompt as @image_1, @video_1 and @audio_1.

### Can I turn off sound in MAGI-2?

Yes, set generate_audio to false. The price per second is the same with or without sound.

### Is MAGI-2 open source?

Sand AI released the 114B MAGI-2 Preview in August 2026 as a research release. It says open-source releases of the 480B MAGI-2 will follow; as of November 25, 2026 the full model is available only through hosted APIs.

## Rules

- Authenticate with Authorization: Bearer $YIR_API_KEY; keep the key in a server environment variable, never in browser code, source control, prompts or logs.
- Jobs are asynchronous: keep the Job ID, wait for a terminal state, then read the result; handle failure and cancellation.
- For safe retries, reuse the same idempotency key and request; do not blindly resubmit when the result is unknown.
- Result URLs are temporary; copy files elsewhere if you need to keep them.

## Links

- [Quickstart](https://yir.ai/docs/getting-started/quickstart)
- [API reference](https://yir.ai/docs/reference)
- [llms.txt](https://yir.ai/llms.txt)
