MAGI-2 API
Sand AI's MAGI-2 over REST: up to 30 seconds of 1080p video with dialogue, sound effects, and music generated in the same pass. Start from a prompt, a first and last frame, or up to 20 reference images, clips, and audio files.
One 1080p rate of $0.0800/s covers all three routes, so a 10-second clip is $0.8 and a full 30-second clip is $2.4. Audio on or off costs the same, and reference media is never billed. Confirmed upstream failures are refunded in full.
One model, three routes
Text, image, and reference to video, each returning a 4–30 second 1080p clip with native audio, from $0.0800/s.
MAGI-2 is exposed through Kinovi's /api/v1/jobs/createTask interface. magi-2/text-to-video takes a prompt of up to 15,000 characters. magi-2/image-to-video starts from your first frame and can end on a last frame. magi-2/reference-to-video follows reference images, videos, and audio that you describe in the prompt.
Video and audio are generated together, so dialogue, sound effects, and music need no separate step. Output is always 1080p, so there is no resolution field and no tier to choose. The family is 3 live endpoints on one API key and one credit wallet.
3 Live Routes
Text · Image · Reference
1080p · Audio
4–30s · default 5s
Output Seconds Only
Auto-refund on failure
Text, image, and reference to video
3 live routes. Open a card for the playground, schema, and pricing.
1080p · Text to VideoMAGI-2 Text to Video
Prompt only. 4–30 second 1080p clips with synchronized audio, in 16:9, 9:16, 1:1, 4:3, 3:4, or 21:9.
1080p · Image to VideoMAGI-2 Image to Video
One required first frame and an optional last frame that guides the ending. With a single image, the output follows the first frame.
1080p · Reference to VideoMAGI-2 Reference to Video
Up to 10 reference images, 5 videos, and 5 audio clips. Describe in the prompt what each reference is for.
MAGI-2 examples
Clips from the MAGI-2 model pages. Open a model page to try the same kind of prompt in the playground.
A first-person walk through five visual worlds
MAGI-2 Text to VideoA 15-shot snowboard chase through the city
MAGI-2 Text to VideoAn alpine lake from blue hour to sunrise
MAGI-2 Text to VideoA streetwear sports-ad montage
MAGI-2 Text to VideoA quiet breakdown by a car window
MAGI-2 Text to VideoA conversation inside a riverboat
MAGI-2 Text to VideoA pearl-earring girl in a giant flower garden
MAGI-2 Reference to VideoSCENE CONTEXT Early morning on an empty city street at dawn. A young woman drops her skateboard, rides down the long empty road toward the skyline and pops an ollie against the rising sun. Energetic, playful skate-film editing, no other people. ACTIVE REFERENCES Image 1: young woman, about 20, slim, soft features, light freckles. Choppy layered copper-orange bob with darker roots, two light-blue hair clips on her left side, pink translucent rectangular glasses, silver chain necklace with small charms. Oversized royal-blue T-shirt with a white checkerboard band across the chest, worn over a white long-sleeve top, black leather belt, leopard-print cargo shorts, pink socks with flowers, black loafers. Her face and outfit 100% match Image 1 in every shot. Skateboard: plain light natural-wood deck with no graphics, light wheels. Image 2: location reference. Image 2 controls the geography: the long empty road with worn cracked asphalt and a dashed white line, the ornate pale stone balustrade with vintage lamp posts on the left, the trolley poles, overhead wires and the low tiled-roof building on the right, and the skyline of high-rise towers at the end of the road. No cars, no people. No readable text or logos anywhere. FORMAT MODE Controlled four-shot sequence, HARD CUTs at 1.2s, 2.2s and 3.5s. Real-time motion, energetic rhythm, no slow motion. Outfit, hair, glasses, board and golden light stay identical in every shot. LIGHT LOGIC A low sun rises between the towers at the end of the road. When the camera faces her front, her face is lit by warm golden sun. When the camera faces the city, she is backlit with a glowing rim and the sun flares between the towers. SHOT 1 — 0.0s to 1.2s — FACE LENS LOCK = 29° short telephoto portrait, camera 2 meters in front of her, at eye level. Close-up of her face, front view. Warm low sun lights her face; behind her the road and lamp posts melt into soft golden bokeh. She pushes her pink glasses up her nose with one finger, looks past the camera toward the city, and a small confident half-smile appears. The blue hair clips catch the light; loose strands move in the breeze. SHOT 2 — 1.2s to 2.2s — BOARD DROP LENS LOCK = 84° wide, camera on the asphalt, 30 cm from the board. Ground-level close shot: the skateboard slaps flat onto the cracked asphalt, a black loafer with a pink flower sock steps onto it, the other foot gives one hard push, and the board shoots out of frame toward the city. SHOT 3 — 2.2s to 3.5s — RIDE LENS LOCK = 84° wide, camera low on a moving vehicle, 3 meters behind her, facing the city. She rides away from camera toward the skyline, pushing twice, then carving smooth S-turns along the dashed white line. The sun glows between the towers ahead; her backlit hair and T-shirt flutter in the wind. The camera chases her with speed and slight bumps from the road. SHOT 4 — 3.5s to 5.0s — OLLIE AGAINST THE SUN LENS LOCK = 84° wide, camera very low behind her left shoulder, moving with her, facing the city. She crouches, then pops an ollie over a crack in the asphalt: the tail snaps sharply on the road, the board rises to her feet, and at the top of the jump she hangs for a split second in the air, a crisp silhouette against the sun between the towers, with a lens flare. She lands with a solid thud, knees absorbing the impact, and rolls on toward the waking city, grinning into the sun as the clip ends. PHYSICS Real skateboard physics: the deck flexes under her weight, wheels vibrate over rough asphalt, carves come from shifting weight, the ollie has a sharp pop, a real arc and a weighted landing. Hair and clothes react to speed and wind with natural delay. AUDIO Only live sound, cut to the picture: quiet morning and distant birds, the slap of the board on asphalt, the push, wheels rolling louder over rough asphalt, wind rushing past, a short laugh, the sharp clack of the ollie pop, the thud of the landing and the board rolling away on the last frame. No music. STYLE 35mm film, warm golden-hour cinema, fine film grain, soft halation around the sun and the glowing lamps, natural colour, energetic indie skate-film mood.
MAGI-2 Reference to VideoFour steps to a finished file
Create a key, submit a task, poll until it finishes, then read the file URL. Copyable cURL, Node, and Python samples are in the next section.
Get an API key
Create a bearer token in Kinovi API Keys. The same key calls every MAGI-2 route and the rest of the catalog.
Submit a task
POST JSON to /api/v1/jobs/createTask. Set model to a MAGI-2 ID such as magi-2/image-to-video, and put your fields under inputs. The response returns a taskId immediately.
Poll for completion
GET /api/v1/jobs/recordInfo?taskId=... until state is success or fail.
Read the output URL
On success, parse data.resultJson and download resultUrls[0].
What teams build with MAGI-2
Scenes with sound from a prompt, clips that start and end on your frames, and shots guided by your own images, video, and audio.
Draft a scene with sound from one prompt
Send a prompt to magi-2/text-to-video. Set duration from 4 to 30 seconds (default 5) and aspectRatio to 16:9, 9:16, 1:1, 4:3, 3:4, or 21:9. With generateAudio left at true, the dialogue, sound effects, and music you describe come back in the MP4.
Start from a frame, and optionally land on another
magi-2/image-to-video takes 1–2 images in imageUrls. The first image is the opening frame and the optional second is the last frame, so a product still, a character, or a scene change can start and end where you need it.
Guide a shot with images, clips, and audio
magi-2/reference-to-video accepts up to 10 reference images, 5 reference videos, and 5 audio clips. Videos and audio run 2–30 seconds each and 30 seconds together; anything longer is trimmed rather than rejected.
Keep one character across many shots
Reuse the same reference image in every job and say what it is for in the prompt. Because you pay per output second, a set of 4–5 second shots is cheap to iterate before you commit to a long take.
Prompting notes
How to brief a reference, write dialogue, handle aspect ratio on image to video, and keep drafts cheap.
- 01
Say what each reference is for
On reference to video, the prompt is how the model knows whether an image is the character, the setting, or the style. State the role of each upload in plain words instead of relying on order.
- 02
Put spoken lines in quotation marks
Describe the scene, motion, camera, and the sound you want. Write suggested dialogue in quotation marks. Generated wording and timing can still vary, so check the audio before you lock a take.
- 03
Mind the aspect ratio on image to video
With one image, the output follows the aspect ratio of the first frame. aspectRatio only takes effect when you also send a last frame, and image to video does not offer 21:9.
- 04
Draft short, then extend
Price scales with duration and the audio switch changes nothing, so iterate on 4–5 second clips. Raise duration once the prompt holds.
MAGI-2 API pricing per second
Every route bills output seconds × the 1080p rate, so a 30-second clip is the per-second rate × 30. Reference images, videos, and audio add nothing, and audio on or off costs the same.
| Route | Resolution | USD / second | Credits / second | 10-second clip | 30-second clip |
|---|---|---|---|---|---|
| MAGI-2 Text to Video | 1080p | $0.0800/s | 17.24/s | $0.8 | $2.4 |
| MAGI-2 Image to Video | 1080p | $0.0800/s | 17.24/s | $0.8 | $2.4 |
| MAGI-2 Reference to Video | 1080p | $0.0800/s | 17.24/s | $0.8 | $2.4 |
cURL, Node, and Python samples
Copyable requests for text, image, and reference to video, plus a silent vertical request. Auth, task creation, and polling are covered in the Kinovi API docs. Replace the example image, video, and audio URLs with your own files.
curl -X POST "https://kinovi.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $KINOVI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "magi-2/text-to-video",
"inputs": {
"prompt": "A cinematic ocean wave at sunrise, highly detailed. Gulls overhead, surf rolling up the sand.",
"aspectRatio": "16:9",
"duration": 5,
"generateAudio": true
}
}'
# Poll until state === "success"
curl -X GET "https://kinovi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $KINOVI_API_KEY"const apiKey = process.env.KINOVI_API_KEY;
const res = await fetch("https://kinovi.ai/api/v1/jobs/createTask", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "magi-2/text-to-video",
"inputs": {
"prompt": "A cinematic ocean wave at sunrise, highly detailed. Gulls overhead, surf rolling up the sand.",
"aspectRatio": "16:9",
"duration": 5,
"generateAudio": true
}
}),
});
const { data } = await res.json();
while (true) {
const poll = await fetch(`https://kinovi.ai/api/v1/jobs/recordInfo?taskId=${data.taskId}`, {
headers: { Authorization: `Bearer ${apiKey}` },
});
const result = await poll.json();
if (result.data?.state === "success") {
console.log(JSON.parse(result.data.resultJson).resultUrls);
break;
}
if (result.data?.state === "fail") throw new Error(result.data.failMsg);
await new Promise((r) => setTimeout(r, 3000));
}import json, os, time, urllib.request
api_key = os.environ["KINOVI_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
body = json.dumps({
"model": "magi-2/text-to-video",
"inputs": {
"prompt": "A cinematic ocean wave at sunrise, highly detailed. Gulls overhead, surf rolling up the sand.",
"aspectRatio": "16:9",
"duration": 5,
"generateAudio": true
}
}).encode()
req = urllib.request.Request("https://kinovi.ai/api/v1/jobs/createTask", data=body, headers=headers, method="POST")
with urllib.request.urlopen(req) as resp:
task_id = json.load(resp)["data"]["taskId"]
while True:
poll = urllib.request.Request(f"https://kinovi.ai/api/v1/jobs/recordInfo?taskId={task_id}", headers=headers)
with urllib.request.urlopen(poll) as resp:
state_data = json.load(resp)["data"]
if state_data["state"] == "success":
print(json.loads(state_data["resultJson"])["resultUrls"])
break
if state_data["state"] == "fail":
raise RuntimeError(state_data.get("failMsg"))
time.sleep(3)Common questions
More models on Kinovi
Other video model APIs on the same key and credit wallet.
Wan 3.0 API
Wan 3.0 and Prime: text, image, and reference to video at 480p–1080p.
Kling API
Kling 4.0 text, image, and reference to video at 720p or 1080p.
Seedance 2.5 API
ByteDance Seedance 2.5 and Flash: generate, extend, and edit 4–30s video from 480p to 4K.
Seedance 2.0 API
Standard, Fast, and Mini tiers for 4–15s clips from 480p up to 4K.
MiniMax H3 API
MiniMax H3 video generation over the same REST interface.
Open a playground or create an API key
One API key for every MAGI-2 route, plus the rest of the video, image, and audio catalog.