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/modelsfor your current API key. A successful creation response, task ID, or in-progress status does not mean a deliverable video has been obtained.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | Must be magi-2. |
prompt | string | Yes | — | Non-empty video description, up to 20,000 characters. Reference input assets with the literal model tags @图片1, @视频1, @音频1, etc. |
ref | object[] | Yes | — | Reference assets (at least 1 item required); see ref items below. |
duration | integer | No | 5 | Output duration in integer seconds (4–30). |
aspect_ratio | string | No | 16:9 | Supports 16:9, 9:16, 21:9, 4:3, 1:1, 3:4. |
resolution | string | No | 1080p | Only 1080p is supported. |
ref Itemstype and url. Every URL must be a publicly accessible HTTPS address readable throughout task execution without login, cookies, or custom request headers.| Field | Required | Description |
|---|---|---|
type | Yes | image, video, or audio. |
url | Yes | Asset URL. |
| Modality | Max Count | Description |
|---|---|---|
| Image | 10 images | Reference for characters, objects, scenes, or visual style. |
| Video | 3 clips | Reference for motion, camera movement, or pacing. |
| Audio | 5 clips | Reference for voice or soundtrack; max 15 seconds combined across reference audio clips (MP3 or WAV recommended). |
ref contains at least 1 item.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).role=first_frame / last_frame) are not supported.{
"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" }
]
}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.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:| Status | Action |
|---|---|
queued | Queued; continue polling. |
in_progress | Generating; continue polling. |
completed | Read metadata.url. |
failed | Read error and stop polling. |
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.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).| HTTP Status | Common Cause |
|---|---|
400 | Invalid parameters; querying a non-existent task also returns 400 with code set to task_not_exist |
401 | Missing or invalid API key |
403 | Insufficient balance/quota, or no permission for the requested model |
429 | Rate limit exceeded |
503 | Service temporarily unavailable |
500 / 502 | Transient service error |