English
  • 中文
  • English
English
  • 中文
  • English
官网
服务状态
English
  • 中文
  • English
  1. Videos
  • Quickstart & Conventions
  • Images
    • GPT Image 2 / 2.5 / 2.6 Generation & Editing
    • Nano Banana Image Generation
    • Gemini Native Sync Image Generation
    • Seedream 5.0 Pro / 5.5 Image Generation
    • Midjourney Image Generation
  • Videos
    • Seedance 2 Video Generation
    • Omni Video Generation
    • Seedance 2.5 Video Generation
    • MiniMax H3 Video Generation
    • WAN 3.0 Video Generation
    • Muse Video Generation
    • Seedance Asset Registration
    • Gemini Omni 1.2 Flash Video Generation
    • Seedance Volcengine Native Video Generation
    • MAGI-2 Video Generation
  • Text Models
    • Claude Desktop (CC Switch) Setup Guide
    • Codex in ChatGPT Desktop Setup Guide
    • Gemini Text Models (Native Format)
    • Text & Chat APIs (OpenAI / Claude)
  • Audio
    • Gemini Text-to-Speech (TTS)
  1. Videos

MAGI-2 Video Generation

Create MAGI-2 (Sand AI) 1080p videos with audio using magi-2. Pass reference images, reference videos, and reference audio via ref.
A model is callable only when it appears in GET /v1/models for your current API key. A successful creation response, task ID, or in-progress status does not mean a deliverable video has been obtained.

Endpoints & Authentication#

Request Parameters#

ParameterTypeRequiredDefaultDescription
modelstringYes—Must be magi-2.
promptstringYes—Non-empty video description, up to 20,000 characters. Reference input assets with the literal model tags @图片1, @视频1, @音频1, etc.
refobject[]Yes—Reference assets (at least 1 item required); see ref items below.
durationintegerNo5Output duration in integer seconds (4–30).
aspect_ratiostringNo16:9Supports 16:9, 9:16, 21:9, 4:3, 1:1, 3:4.
resolutionstringNo1080pOnly 1080p is supported.

ref Items#

Each item passes type and url. Every URL must be a publicly accessible HTTPS address readable throughout task execution without login, cookies, or custom request headers.
FieldRequiredDescription
typeYesimage, video, or audio.
urlYesAsset URL.
ModalityMax CountDescription
Image10 imagesReference for characters, objects, scenes, or visual style.
Video3 clipsReference for motion, camera movement, or pacing.
Audio5 clipsReference for voice or soundtrack; max 15 seconds combined across reference audio clips (MP3 or WAV recommended).
All three modalities can be used individually or together, provided ref contains at least 1 item.
Assets are numbered separately per modality starting from 1 according to their order in ref: the first image is @图片1, the first video is @视频1, and the first audio clip is @音频1 (note: @图片1, @视频1, and @音频1 are literal Chinese model syntax tags—keep them unchanged in prompts).
Strict first and last frames (role=first_frame / last_frame) are not supported.

Examples#

3 Reference Images, Landscape 10s#

Image + Reference Video + Reference Audio, Portrait 15s#

{
  "model": "magi-2",
  "prompt": "The character in @图片1 dances following the choreography in @视频1, with soundtrack matching @音频1",
  "duration": 15,
  "aspect_ratio": "9:16",
  "ref": [
    { "type": "image", "url": "https://example.com/dancer.png" },
    { "type": "video", "url": "https://example.com/dance-motion.mp4" },
    { "type": "audio", "url": "https://example.com/music.mp3" }
  ]
}

Billing#

Billed per second based on the requested duration (defaulting to 5 seconds when omitted). Requests that include a reference video (type=video) in ref are billed at 2× the per-second rate of requests without reference video; reference images and reference audio do not affect pricing. Refer to the Model Marketplace for per-second rates.

Asynchronous Responses#

Save id from the creation response and poll the same task via GET /v1/videos/{task_id}. Generation typically takes 5–15 minutes; poll every 15–30 seconds. Public statuses:
StatusAction
queuedQueued; continue polling.
in_progressGenerating; continue polling.
completedRead metadata.url.
failedRead error and stop polling.
Treat any status value not listed above as incomplete and continue polling. A deliverable video is obtained only when status=completed and metadata.url is non-empty and downloadable (result_url holds the same value as a fallback). Result URLs expire—download or persist the video immediately upon completion. If a creation request times out or returns a transient 5xx, verify whether the task was already created before submitting a second task.

Unsupported Parameters#

The following are not currently exposed: resolutions other than 1080p, durations under 4 seconds or over 30 seconds, pure text-to-video (without reference assets), strict first and last frames, and Chat Completions parameters (messages, temperature, top_p, stream).

Error Handling#

HTTP StatusCommon Cause
400Invalid parameters; querying a non-existent task also returns 400 with code set to task_not_exist
401Missing or invalid API key
403Insufficient balance/quota, or no permission for the requested model
429Rate limit exceeded
503Service temporarily unavailable
500 / 502Transient service error
Modified at 2026-12-04 07:58:01
Previous
Seedance Volcengine Native Video Generation
Next
Claude Desktop (CC Switch) Setup Guide
Built with