Developer API

Magi 2 API

The Magi 2 API lets your app turn a prompt, an image or a set of reference files into a 4 to 30 second 1080p video with sound, rendered by Sand.ai's flagship video model. One Magi 2 API key, one REST endpoint, 40 credits per second, and the same credits as the web app.

  • 1080p at 25 fps
  • 4–30 seconds
  • Sound included
  • Text, image or references
curl -X POST https://magi2.cc/api/v1/videos \
  -H "Authorization: Bearer $MAGI2_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "A lighthouse keeper climbs a spiral staircase in a storm, waves crashing outside, he says \"Almost there.\"",
  "duration": 10,
  "aspect_ratio": "16:9",
  "generate_audio": true
}'

curl https://magi2.cc/api/v1/videos/VIDEO_ID \
  -H "Authorization: Bearer $MAGI2_API_KEY"

Magi 2 API pricing

Every Magi 2 API request costs 40 credits per second of video, whatever the mode and with sound included, the same rate the web app charges. In dollars a Magi 2 API second is about $0.12 to $0.44, depending on the plan or pack your credits came from.

400 credits

about $1.19–$4.45

Magi 2 API cost by clip length

LengthCreditsAbout
5 seconds200 credits$0.60–$2.23
10 seconds400 credits$1.19–$4.45
15 seconds600 credits$1.79–$6.67
30 seconds1,200 credits$3.57–$13.35

Failed jobs are refunded in full. Credits from a plan or a pack work in the Magi 2 API and in the web app alike.

Who can use the Magi 2 API

Magi 2 API keys are being switched on account by account. Email support with your account email to ask for access.

Magi 2 API quick start

  1. 1

    Create a Magi 2 API key

    Open Settings → API Keys and create a key. It starts with magi2_ and is shown once, so store it as a secret. Send it on every Magi 2 API call as "Authorization: Bearer" plus the key.

  2. 2

    Send a Magi 2 API request

    POST your prompt and settings as JSON to /api/v1/videos. The Magi 2 API checks the request, charges the credits and answers 202 with a video id.

  3. 3

    Poll the Magi 2 API for the result

    GET /api/v1/videos/{id} every 10 to 20 seconds. Status moves from queued to processing to completed, usually in 3 to 11 minutes; busy hours take longer.

  4. 4

    Download the video

    When the status is completed, video_url is a signed MP4 link that stays valid for 24 hours. Poll again for a fresh link, or copy the file to your own storage.

Magi 2 API response

{
  "id": "V1StGXR8_Z5jdHi6B-myT",
  "object": "video",
  "model": "magi-2",
  "mode": "text-to-video",
  "status": "completed",
  "duration": 10,
  "aspect_ratio": "16:9",
  "resolution": "1080p",
  "credits_charged": 400,
  "video_url": "https://magi2.cc/api/storage/shared/…mp4?expires=…",
  "error": null
}

Magi 2 API modes

The mode follows the fields you send. Leave the media fields out for text to video.

Magi 2 API text to video

Send a prompt with duration, aspect_ratio and generate_audio. Describe the scene, the camera and the sound, and put spoken lines in quotes so the Magi 2 API voices them with lip sync.

prompt, duration, aspect_ratio, generate_audio

Magi 2 API image to video

Send image_url for the first frame, and last_image_url too if the shot should end on a set frame. The prompt is optional here; the frame sets the shape of the video.

image_url, last_image_url, prompt, duration

Magi 2 API reference to video

Send a prompt plus up to 9 reference images, 3 reference videos and 3 audio clips, 12 files in all. Name them in the prompt as @image_1, @video_1 and @audio_1 to place characters, motion and voices.

reference_images, reference_videos, reference_audios, prompt

Magi 2 API parameters

FieldTypeDefaultWhat it does
promptstring—Scene, motion, camera and sound.
durationinteger5Seconds of video, 4 to 30.
aspect_ratiostring16:916:9, 9:16, 1:1, 4:3, 3:4, 21:9
generate_audiobooleantrueDialogue, effects, ambience and music.
image_urlhttps URL—First frame, JPG, PNG or WebP.
last_image_urlhttps URL—Last frame (needs image_url).
reference_images / videos / audioshttps URL[]—Up to 9 / 3 / 3 files.

Linked files are downloaded once, must be under 25 MB each, and must be public https links. Videos may be MP4, MOV or WebM; audio MP3, WAV, M4A, AAC or OGG.

Magi 2 API endpoints

MethodPathUse
POST/api/v1/videosCreate a video
GET/api/v1/videos/{id}Status and video_url
GET/api/v1/creditsCredit balance

Magi 2 API errors

Errors come back as JSON with a code and a message you can show to a user.

HTTPCodeMeaning
400invalid_requestA field is missing or out of range.
400file_unreachableA linked file could not be downloaded.
401invalid_api_keyThe key is wrong, expired or disabled.
402insufficient_creditsNot enough credits for this clip.
403plan_requiredThe account has no qualifying plan.

Videos made with Magi 2

Clips Sand.ai published on launch day. Each is one generation: picture and sound come out together, which is what a Magi 2 API call returns.

With sound

A walk through famous paintings

A first-person stroll that moves through the styles of Van Gogh, Monet, Hokusai and Klimt, with its own soundtrack.

Made with Magi 2 AI · published by Sand.ai

With sound

A two-person dialogue scene

A period-drama conversation on a boat: lip-synced speech and room sound from a single generation.

Made with Magi 2 AI · published by Sand.ai

With sound

Girl with a Pearl Earring in a giant garden

A painted character stepping through a live-action world of giant flowers, with the camera changing angle as she goes.

Made with Magi 2 AI · published by Sand.ai

Magi 2 API FAQ

How much does the Magi 2 API cost?

40 credits per second of video, so a 5-second Magi 2 API clip is 200 credits and a 30-second one is 1200. Sound costs nothing extra.

Is there a free Magi 2 API?

No. Magi 2 API calls are open to the Pro and Max plans and to buyers of the Standard pack or larger. The signup credits work in the web app only.

Is this the official Magi 2 API?

No. The model is made by Sand.ai and launched on Higgsfield and its API. This site is independent: it runs the model for you behind its own Magi 2 API key, billing and history.

How long does a Magi 2 API job take?

Usually 3 to 11 minutes per clip, longer at busy times. Jobs wait their turn in a queue, and their status reads queued until the render starts.

What resolution and length does the Magi 2 API return?

Every clip is 1080p at 25 fps and 4 to 30 seconds long, in 6 aspect ratios. Sand.ai notes the 1080p comes from an upscaling pass inside the model.

Does the Magi 2 API generate audio?

Yes. Dialogue with lip sync, sound effects, ambience and music come in the same pass. Set generate_audio to false for a silent clip at the same price.

Are failed Magi 2 API jobs refunded?

Yes. When a job fails, the credits go back to the account automatically and the status response says why it failed.

Can I self-host Magi 2 instead?

Not the full model yet. Sand.ai has said the weights are coming but gave no date. The open Preview release from August 2026 is a smaller 10-second model, not the one this API runs.

Can I use Magi 2 API videos commercially?

Yes. Videos from the Magi 2 API can be used in client work, ads, apps and products you sell, on every qualifying plan.

Build with the Magi 2 API

Create a key, send one request, and get a 1080p video with sound back.

Updated 2026-11-24