Skip to content
MAGI-2 AI
Image to VideoText to VideoExamplesPromptsAPISkill
Open studio

MAGI-2 API

Generate MAGI-2 video from your app with Sand.ai native, OpenAI-compatible, or xAI-compatible requests. Submit a prompt or first frame and retrieve the finished MP4.

API access coming soon

View workflow Agent Skill
POST /v2/generationsJSON
{
  "model": "magi-2",
  "parts": [
    {
      "type": "text",
      "text": "A slow tracking shot along a riverside promenade at dusk."
    }
  ],
  "duration": 8,
  "aspectRatio": "16:9",
  "generateAudio": true
}

MAGI-2 API request formats

Choose the video request format that fits your app. Each format will run MAGI-2 on magi2ai.run.

Sand.ai native video API

Use the native parts array to send a text prompt and media references. Set duration, aspect ratio, and audio in the same request.

Format reference

OpenAI-compatible video API

Use the OpenAI Videos request format with a prompt, seconds, size, and an optional first-frame file.

Format reference

xAI-compatible video API

Use the xAI video generation format with a prompt, duration, and aspect ratio. For image to video, include a first-frame image URL.

Format reference

From prompt to MP4

Create, track, and download clips through the same account as the web studio.

Prepare a generation

Start with a text prompt or a first frame. Pick the clip length, aspect ratio, and sound, then review the estimated cost.

Submit and retrieve the job

Use a magi2ai.run API key to create a job. Track that job by ID until it succeeds or fails. Download the MP4 when the job returns its video URL.

Use the same account in an agent

Describe the shot to the MAGI-2 Agent Skill. Review the prompt and estimate, then approve the job to get the MP4 in your coding agent.

Check the job status

A create request will return a job ID. Use that ID with the status endpoint. Your app can persist it and restore progress after a reload.

With the Sand.ai native format, add a first-frame asset ID to the prompt in the parts array. When the job succeeds, read the MP4 download address from output.videoUrl.

GET /v2/generations/{id}Sample response
{
  "id": "123456789",
  "status": "succeeded",
  "output": {
    "videoUrl": "https://static.magi.world/media/website/01f847c8f459fa2b2831796dade7fa9b72acdfe5f77538044d455973f07c6362.mp4"
  }
}
Sand.ai native statusWhat the client does
queuedThe request is accepted and waiting for a worker.
processingThe video is rendering. Keep the same job ID.
succeededThe MP4 is ready at the URL in the response.
failedThe job has finished with an error. Read the error before retrying.
canceledThe generation was canceled. Stop polling the job.
Coming soon

MAGI-2 Agent Skill

Turn a product description or reference photo into a video job from your coding agent.

Try the MAGI-2 Skill demo
  1. Describe the shot and where each sound should land.
  2. Read the estimated cost and approve the job.
  3. Track the job and receive the MP4 through magi2ai.run.

Developer questions

Can I get a magi2ai.run API key now?
API keys are coming soon. Choose a request format and run the example to see a sample MP4.
How much will MAGI-2 API calls cost?
We’ll publish magi2ai.run pricing and trial details when API access opens. See Sand.ai model pricing
How will the skill authenticate?
The Skill will use a magi2ai.run API key and the same account balance as the web studio.
Prepare a text request

Draft the prompt, framing, duration, and sound.

Prepare a first frame

Try the sample reference or preview a photo of your own.

Run MAGI-2 in ComfyUI

Import a workflow for text, first frames, or multiple references.

Video prompt examples

Start with dialogue, a product shot, or timed cuts.

MAGI-2 AI

Video studio, examples, and prompts for
Sand.ai’s MAGI-2 model.

Create

StudioImage to VideoText to Video

Explore

ExamplesPromptsMAGI-2 PreviewMAGI-2 in ComfyUIMAGI-2 vs Seedance 2.5Frequently asked questions

Develop

MAGI-2 APIMAGI-2 Agent Skill
magi2ai.runFree tools and generation access