MAGI-2 Reference to Video API

Send reference images, videos or audio clips to POST /api/v1/videos/generations with model: magi-2-refs to generate a 1080p clip of 4 to 30 seconds guided by those assets. Unlike magi-2, which takes at most a first and a last frame, this model accepts up to 10 images, 5 videos and 5 audio clips. The call returns an img_uuid; get the result by polling or by callback. GoEnhance provides independent API access; this is not Sand AI's official API.
Get API Key
Film production table with reference photos, a video monitor and a portable audio recorder

Three Kinds of References in One Request

Up to 10 reference images

Pass 1 to 10 HTTPS URLs in image_urls, up to 30 MB each. In magi-2 the same field holds only a first frame and an optional last frame.
Mood board wall covered with reference photos for a film production

Reference videos and audio

Add up to 5 video_urls (MP4 or MOV, 2–30 seconds and up to 200 MB each) and up to 5 audio_urls (WAV or MP3, 2–30 seconds and up to 15 MB each). Each type may total up to 30 seconds across its clips.
Editing suite with film reels and an audio mixing console

Same 1080p output controls

Choose duration from 4 to 30 seconds (default 5), one of six ratio values from 16:9 to 21:9, and optional synchronized audio and seed, exactly as in magi-2.
Cinema camera on a crane above a forest clearing film set
Fields accepted by POST /api/v1/videos/generations for model magi-2-refs. Only model is required; prompt is optional when references are supplied.

MAGI-2 Reference to Video Request Fields and Limits

model

Must be magi-2-refs.

prompt

1 to 15,000 characters. Optional when references are supplied.

image_urls

1 to 10 HTTPS URLs of reference images, up to 30 MB each.

video_urls

1 to 5 HTTPS URLs of reference videos. MP4 or MOV, 2–30 seconds and up to 200 MB each; up to 30 seconds total across all video references.

audio_urls

1 to 5 HTTPS URLs of reference audio. WAV or MP3, 2–30 seconds and up to 15 MB each; up to 30 seconds total across all audio references.

duration

Requested output length in seconds, any integer from 4 to 30. Default 5.

resolution

1080p only (default). The quality alias is accepted.

ratio

16:9 (default), 9:16, 1:1, 4:3, 3:4 or 21:9. The aspect_ratio alias is accepted.

generate_audio / seed

generate_audio defaults to true. Optional seed from 0 to 4,294,967,295 for more repeatable results.

custom_callback_url

Optional public URL that receives task updates.
Same per-second rate as magi-2. Billed per requested second of output; references and synchronized audio have no additional charge.

MAGI-2 Reference to Video API Pricing

1080p: 5.2 tokens ($0.104) per second

The only resolution tier. Cost = requested duration × 5.2 tokens, regardless of how many references you send.

Example: 5-second clip

The default 5-second duration costs 26 tokens ($0.52) per video.

Example: 30-second clip

The maximum 30-second duration costs 156 tokens ($3.12) per video.

Deduction and refunds

Tokens are deducted when the task is accepted and refunded automatically if generation fails. The cost field in the response shows the tokens actually deducted.

Integrate the MAGI-2 Reference to Video API

1

1. Create an API key

Generate a key at /keys and send it as Authorization: Bearer <key> from your server.
2

2. Prepare the references

Host images, videos and audio at HTTPS URLs and check the per-file size, length and 30-second total limits before submitting.
3

3. Submit the request

POST {"model": "magi-2-refs", "prompt": "…", "image_urls": ["https://…"], "duration": 5} to /api/v1/videos/generations, adding video_urls or audio_urls as needed.
4

4. Read the result

Save the returned img_uuid and poll GET /api/v1/jobs/detail, or set custom_callback_url to receive task updates.
Create an API Key
Typical integrations that guide generation with several references.

What Developers Build with MAGI-2 Reference to Video

Subject references

Send several images of the same subject in image_urls to guide how it appears in the clip.

Motion from reference footage

Add short clips in video_urls alongside image references to guide the generated video.

Audio-guided clips

Pass voice or music in audio_urls as a reference for the generated video.

Upgrading from magi-2

Keep the same duration, ratio and price, and switch the model to magi-2-refs when users need more than a first and last frame.
Answers based on the published API reference.

MAGI-2 Reference to Video API FAQ

How is this different from magi-2?

magi-2 generates from text or from a first frame plus an optional last frame (up to 2 images). magi-2-refs accepts up to 10 reference images, 5 reference videos and 5 reference audio clips. Resolution, duration, ratios and price are the same.

Is a prompt required?

No. prompt is optional when references are supplied; it can be up to 15,000 characters.

What are the reference file limits?

Images up to 30 MB each. Videos MP4 or MOV, 2–30 seconds and up to 200 MB each. Audio WAV or MP3, 2–30 seconds and up to 15 MB each. Video and audio references may each total up to 30 seconds.

Do references add to the price?

No. References and synchronized audio have no additional charge; you pay 5.2 tokens ($0.104) per requested second.

What resolutions and durations are supported?

Output is 1080p only. duration is any integer from 4 to 30 seconds, default 5.

What happens if a job fails?

Tokens are deducted when the task is accepted and refunded automatically if the generation ends in failure.

Start Building with the MAGI-2 Reference to Video API