# Muse Video generation API

> Generate a 720p video with audio from a prompt and up to nine reference images, then check the task status and download the MP4.

Web page: https://wanapi.ai/docs/muse-video

Describe the scene, camera movement and sound in your prompt. Add reference images when you want to guide the appearance of a subject or setting. Each request creates an asynchronous job. Use its task ID to track progress and download the clip.

## At a glance

| Item | Value |
| --- | --- |
| model | muse-video-ext |
| Output | 720p video with an audio track. |
| duration / seconds / duration_seconds | Use any one of these fields. Supply 2–10 whole seconds as an integer, a numeric string or a string ending in s, such as 4, "4" or "4s". Omit all three for a 10-second clip. If you send multiple fields, their durations must agree. |
| aspect_ratio | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 |
| image_urls | Optional array of up to nine reference images. Each item can be a publicly accessible HTTP(S) image URL, an image data URI or a raw base64 string. The original images combined must fit within 11 MiB, measured after download or base64 decoding. |
| Price | At the 1× group rate, each second of output costs CNY 0.021385. The default 10-second clip costs approximately CNY 0.21385 after quota rounding. |

## Setup steps

### 1. Submit a text-to-video job

Set WANAPIS_API_KEY in your environment and send the model ID and prompt to POST /v1/video/generations. Save data.task_id from the response. This example requests a four-second widescreen clip.

**cURL**

```
curl -fsS "https://api.wanapis.com/v1/video/generations" \
  -H "Authorization: Bearer $WANAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "muse-video-ext",
  "prompt": "Track a red bicycle along a cobbled street, with the sound of tires on stone.",
  "duration": 4,
  "aspect_ratio": "16:9"
}'
```

### 2. Guide the subject and scene with photos

Send this JSON to the same endpoint after replacing both example URLs with your images. The first photo supplies the bicycle and the second supplies the setting. Muse takes image references only. It does not support first or last frame controls, video inputs or audio inputs.

**Request body with two reference images**

```
{
  "model": "muse-video-ext",
  "prompt": "Show the red bicycle from the first photo passing the bakery in the second photo.",
  "seconds": "6s",
  "aspect_ratio": "3:2",
  "image_urls": [
    "https://example.com/bicycle.jpg",
    "https://example.com/bakery.jpg"
  ]
}
```

### 3. Check task status

Replace task_example with data.task_id from the submission response and poll every few seconds. Download the clip when data.status is SUCCESS. On FAILURE, check data.fail_reason. OpenAI-compatible clients can also poll GET /v1/videos/{task_id} and read the top-level status field.

**Poll the submitted job**

```
TASK_ID=task_example
curl -fsS "https://api.wanapis.com/v1/video/generations/$TASK_ID" \
  -H "Authorization: Bearer $WANAPIS_API_KEY"
```

### 4. Download the MP4 with audio

Once the task succeeds, send the same API key to GET /v1/videos/{task_id}/content and save the response as an MP4 file.

**Save the video**

```
curl -fsS "https://api.wanapis.com/v1/videos/$TASK_ID/content" \
  -H "Authorization: Bearer $WANAPIS_API_KEY" \
  -o muse-video.mp4
```

## FAQ

### How do I send a local reference image?

Base64-encode the file and place the resulting string in image_urls. You can also include the image MIME type using a data URI such as data:image/png;base64,.... A local file path cannot be used as an image URL.

---

Generated by the WanAPIs website and kept in sync with the web page. All guides in Markdown: https://wanapi.ai/docs/index.md
