# Wan video

Call wan3.0-video and wan3.0-video-prime with POST /v1/videos. Send a JSON body with fields at the top level.

Wan 3.0 uses an asynchronous task API. The create call returns a task object, not the finished video file.

```http
POST /v1/videos
```

Poll and download:

```http
GET /v1/videos/{task_id}
GET /v1/videos/{task_id}/content
```

Send JSON. Put every field at the top level. Do not wrap these fields in `metadata`. `images`, `videos`, and `audio` accept only public `http` or `https` URLs. Base64 and data URIs are not supported. The links must stay available until the task finishes.

Check `GET /v1/models` before calling.

## Models

| Model ID | Description |
| --- | --- |
| `wan3.0-video` | Wan3 standard |
| `wan3.0-video-prime` | Wan3 Prime |

## Parameters

| Parameter | Values |
| --- | --- |
| `mode` | `text2video` or `reference`. `image2video` is not supported. Use `reference` when a picture is an input |
| `duration` | An integer from 2 to 30 seconds. The default is 5. Smart duration is not supported. A value outside the range returns an error and is not billed as a shortened clip |
| `resolution` | `480p`, `720p`, or `1080p`. The default is `720p`. `4k` is not supported |
| `aspect_ratio` | The default is `16:9`. Supported values include `16:9`, `9:16`, `1:1`, and `3:4` |
| `prompt` | Required, at most 5000 characters. Refer to inputs as "image 1", "video 1", and "audio 1". Number each array separately, in array order |
| `images` / `videos` / `audio` | `reference` only, and at least one item is required. At most 10 images, 5 videos, and 5 audio files. URLs only, not base64 |
| `generate_audio` | Whether the finished video has sound. The default is `true`. This controls the output, not reference audio. `false` can return 400 for some models or modes; send `true` instead |
| `face_check` | Do not send it |

## Text to video

```bash
curl https://kaienapi.com/v1/videos \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan3.0-video",
    "prompt": "A quiet sea at dawn, gulls crossing the waves, camera held still",
    "mode": "text2video",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }'
```

For Prime, set `model` to `wan3.0-video-prime`.

## Reference inputs

```bash
curl https://kaienapi.com/v1/videos \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan3.0-video-prime",
    "prompt": "The cat in image 1 turns its head, following the motion in video 1",
    "mode": "reference",
    "duration": 5,
    "resolution": "1080p",
    "aspect_ratio": "9:16",
    "images": [
      "https://example.com/cat.jpg"
    ],
    "videos": [
      "https://example.com/motion.mp4"
    ]
  }'
```

Omit `videos` when there is only a picture. Omit `images` when there is only a reference video. Put reference audio in `audio`, and call it "audio 1" in `prompt`.

## Polling

Save `id` from the create response. Poll every 3–5 seconds until `completed` or `failed`:

```bash
curl "https://kaienapi.com/v1/videos/$TASK_ID" \
  -H "Authorization: Bearer <YOUR_API_KEY>"
```

Read `url` when the task completes. That URL is the video file. `cost` in the response is not the account charge; use the console usage record. On failure, read `error.message`.

Download the bytes directly:

```bash
curl "https://kaienapi.com/v1/videos/$TASK_ID/content" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  --output result.mp4
```

## Prices

The charge is based on output seconds. Prices are CNY per second and follow the API key group, `standard` or `stable`.

| Model | Resolution | `standard` | `stable` |
| --- | --- | ---: | ---: |
| `wan3.0-video` | 480p / 720p / 1080p | 0.30 / 0.60 / 1.20 | 0.43 / 0.86 / 1.71 |
| `wan3.0-video-prime` | 480p / 720p / 1080p | 0.32 / 0.63 / 1.26 | 0.45 / 0.90 / 1.80 |

If the console model page and the bill disagree, the bill is the charge.
