MAGI-2 API for Text-to-Video and Frame-Guided Video

Send a prompt to POST /api/v1/videos/generations with model: magi-2 to generate a 1080p clip of 4 to 30 seconds, or pass a first frame and an optional last frame in image_urls. 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 crew on a coastal set at sunrise with a cinema camera on a dolly track

Text, First Frame or First and Last Frames

Text to video at 1080p

Send a prompt of up to 15,000 characters, choose a duration from 4 to 30 seconds (default 5) and one of six ratio values: 16:9 (default), 9:16, 1:1, 4:3, 3:4 or 21:9. Output is always 1080p.
Director reviewing a storyboard beside a camera on a night city street set

First and last frame guidance

Pass one HTTPS URL in image_urls to use it as the first frame, or two to set the first and last frames. The image_url and image_end_url aliases also work. With a first frame, prompt is optional.
Two printed film stills pinned on a wall with a strip of film between them

Synchronized audio included

generate_audio defaults to true and adds synchronized audio at no extra charge; set it to false for silent clips. Use seed (0 to 4,294,967,295) for more repeatable results.
Sound recordist with a boom microphone on a desert film set
Fields accepted by POST /api/v1/videos/generations for model magi-2. Only model is always required; prompt is required for text-to-video.

MAGI-2 Request Fields and Limits

model

Must be magi-2.

prompt

1 to 15,000 characters. Required for text-to-video; optional when you provide a first frame.

image_urls

1 or 2 HTTPS URLs: the first frame, followed by an optional last frame. Alternatively use image_url (first frame) and image_end_url (last frame, requires image_url).

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

Generate synchronized audio. Default true.

seed

Optional integer from 0 to 4,294,967,295 for more repeatable results.

custom_callback_url

Optional public URL that receives task updates.
Billed per requested second of output at a single 1080p rate. Tokens are deducted when the task is accepted and refunded automatically if generation fails.

MAGI-2 API Pricing

1080p: 5.2 tokens ($0.104) per second

The only resolution tier. Cost = requested duration × 5.2 tokens.

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.

No surcharge for frames or audio

First and last frame images and synchronized audio have no additional charge. The cost field in the response shows the tokens actually deducted.

Integrate the MAGI-2 API

1

1. Create an API key

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

2. Choose the input mode

Prompt only for text-to-video, one URL in image_urls for a first frame, or two URLs for first and last frames.
3

3. Submit the request

POST {"model": "magi-2", "prompt": "…", "duration": 5} to /api/v1/videos/generations, adding ratio, generate_audio or seed 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 use text-to-video and frame-guided generation.

What Developers Build with MAGI-2

Prompt-to-clip features

Turn a user prompt into a 1080p clip of 4 to 30 seconds with synchronized audio.

Photo animation

Use an uploaded image as the first frame and describe the motion in the prompt.

Scene transitions

Provide a first and a last frame to generate the motion between two fixed images.

Vertical and widescreen formats

Generate 9:16 clips for short-form feeds or 21:9 clips for widescreen layouts from the same integration.
Answers based on the published API reference.

MAGI-2 API FAQ

Which endpoint and model value do I use?

Send POST /api/v1/videos/generations with model: magi-2. A prompt is required unless you provide a first frame.

What resolutions and durations are supported?

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

How many images can I send?

Up to 2 HTTPS URLs in image_urls: the first is the first frame, the optional second is the last frame. For more reference images, or reference videos and audio, use magi-2-refs.

Does audio cost extra?

No. generate_audio defaults to true and synchronized audio has no additional charge.

How much does a 10-second video cost?

10 × 5.2 = 52 tokens ($1.04).

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 API