# Wan 3.0 Video Prime (https://reapi.ai/docs/wan-3-0-video-prime)

import { Callout } from 'fumadocs-ui/components/callout';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

> The high-speed tier of Alibaba's Wan 3.0 video model. Wan 3.0 Video Prime
> takes the same inputs as the standard tier — text, first/last frame images,
> reference images, video, audio, a document, or a public web page — and
> returns 2 to 30 second clips at 480P through 4K with an audio track by
> default. See current pricing on the
> [model page](https://reapi.ai/models/wan-3-0-video-prime).

<Callout title="Content filtering and Playground">
  Use `content_filter` to select the behavior without changing the model id:

  * `true`: content filtering enabled; supports 480P, 720P and 1080P.
  * `false` or omitted: existing API behavior, including 2K, 4K, documents and web pages.

  Playground shows a Content filter switch, enabled by default. API requests
  can set `content_filter` explicitly. Playground checks submitted text and images at the supplied URLs
  before video generation when filtering is enabled. If input review rejects the
  request or is unavailable, no video task is created and no generation credits
  are charged. This precheck does not inspect video or audio content and does not
  apply to API-key requests. Existing
  per-resolution prices stay the same. A filtered request never falls back to
  an unfiltered request. Failed tasks are refunded.
</Callout>

For **2K or 4K**, use the same model id with `content_filter: false`.

<Callout title="Prime vs the standard tier">
  The two models support similar input families but use different request fields.
  Prime uses `aspect_ratio`, explicit frame fields, and `reference_*_urls`;
  standard Wan 3.0 uses `size` and its own media fields. Translate the payload
  when switching models. Prime is positioned for faster turnaround at a higher
  per-second rate, without a fixed latency guarantee or a documented quality
  advantage. Choose by how much the wait is worth to you — see
  [Wan 3.0](/docs/wan-3-0) for the standard tier.
</Callout>

## Quick example

<Tabs items={['cURL', 'Python', 'Node.js', 'Go']}>
  <Tab value="cURL">
    ```bash
    curl https://api.reapi.ai/v1/videos/generations \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "wan3.0-video-prime",
            "content_filter": true,
        "prompt": "A lighthouse keeper climbing a spiral staircase at dawn",
        "resolution": "720P",
        "aspect_ratio": "16:9",
        "duration": 10
      }'
    ```
  </Tab>

  <Tab value="Python">
    ```python
    import requests

    resp = requests.post(
        "https://api.reapi.ai/v1/videos/generations",
        headers={
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json",
        },
        json={
            "model": "wan3.0-video-prime",
            "content_filter": True,
            "prompt": "A lighthouse keeper climbing a spiral staircase at dawn",
            "resolution": "720P",
            "aspect_ratio": "16:9",
            "duration": 10,
        },
    )
    task_id = resp.json()["id"]
    ```
  </Tab>

  <Tab value="Node.js">
    ```js
    const resp = await fetch('https://api.reapi.ai/v1/videos/generations', {
      method: 'POST',
      headers: {
        Authorization: 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        model: 'wan3.0-video-prime',
        content_filter: true,
        prompt: 'A lighthouse keeper climbing a spiral staircase at dawn',
        resolution: '720P',
        aspect_ratio: '16:9',
        duration: 10,
      }),
    });
    const { id } = await resp.json();
    ```
  </Tab>

  <Tab value="Go">
    ```go
    body := strings.NewReader(`{
      "model": "wan3.0-video-prime",
            "content_filter": true,
      "prompt": "A lighthouse keeper climbing a spiral staircase at dawn",
      "resolution": "720P",
      "aspect_ratio": "16:9",
      "duration": 10
    }`)

    req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/videos/generations", body)
    req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")
    resp, err := http.DefaultClient.Do(req)
    ```
  </Tab>
</Tabs>

## Authentication

Every request needs an API key in the `Authorization` header:

```
Authorization: Bearer YOUR_API_KEY
```

Create one in [API keys](https://reapi.ai/settings/apikeys).

## Endpoint

```
POST https://api.reapi.ai/v1/videos/generations
```

Generation is asynchronous. The response carries a task `id`; poll
`GET /api/v1/tasks/{id}` until `status` settles.

## Modes

There is no `mode` field — the model picks the mode from which media fields
are present. The two media families are mutually exclusive and a request that
mixes them is rejected.

| Mode               | Fields to send                                                                  |
| ------------------ | ------------------------------------------------------------------------------- |
| Text to video      | `prompt` only                                                                   |
| First frame        | `first_frame_url`                                                               |
| First + last frame | `first_frame_url` + `last_frame_url`                                            |
| Omni-reference     | any of `reference_image_urls` / `reference_video_urls` / `reference_audio_urls` |
| Document           | `reference_file_urls`                                                           |
| Web page           | `reference_link_urls`                                                           |

<Callout type="warn">
  Frame fields (`first_frame_url`, `last_frame_url`) cannot be combined with any
  `reference_*_urls` field. `reference_file_urls` and `reference_link_urls` are
  also mutually exclusive with each other.
</Callout>

In reference mode, address your material from the prompt as `Image 1`,
`Video 1`, `Audio 1` and so on (Chinese prompts: `图 1` / `视频 1` / `音频 1`),
numbered per media type by position within each array.

With `content_filter: true`, generation requires a text prompt (either `prompt` or a text part in `content`).
Document and web-page fields, and 2K/4K output, require `content_filter: false`.
`content_filter: true` supports `21:9` in addition to the aspect ratios below. Reference
video and audio each have a combined 15-second input limit. The moderated API forwards
additional parameters to the upstream; acceptance does not prove an extension
has an effect. Unsupported combinations may fail upstream and are refunded.

## Request body

| Field                  | Type      | Required | Notes                                                                                                                                                                                                                      |
| ---------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`                | string    | yes      | `wan3.0-video-prime`                                                                                                                                                                                                       |
| `prompt`               | string    | no       | Up to 20,000 characters. Required in practice for text-to-video. Chinese and English.                                                                                                                                      |
| `first_frame_url`      | string    | no       | One image used as the opening frame.                                                                                                                                                                                       |
| `last_frame_url`       | string    | no       | One image used as the closing frame.                                                                                                                                                                                       |
| `reference_image_urls` | string\[] | no       | Up to 10 images.                                                                                                                                                                                                           |
| `reference_video_urls` | string\[] | no       | Up to 5 clips, 1–15s each, 15s combined. Input duration + `duration` must not exceed 30s.                                                                                                                                  |
| `reference_audio_urls` | string\[] | no       | Up to 5 clips, 1–15s each, 15s combined.                                                                                                                                                                                   |
| `reference_file_urls`  | string\[] | no       | Exactly one document: docx, doc, xlsx, xls, pptx, ppt, pdf, txt, key, pages, numbers, md.                                                                                                                                  |
| `reference_link_urls`  | string\[] | no       | Exactly one public, login-free web page.                                                                                                                                                                                   |
| `resolution`           | enum      | no       | `480P` / `720P` / `1080P` / `2K` / `4K`. Default `1080P`.                                                                                                                                                                  |
| `aspect_ratio`         | enum      | no       | `adaptive` / `16:9` / `4:3` / `1:1` / `3:4` / `9:16`; `content_filter: true` also supports `21:9`. Default `adaptive`.                                                                                                     |
| `duration`             | integer   | no       | 2–30 seconds, or `-1` to let the model choose. Default 5.                                                                                                                                                                  |
| `audio`                | boolean   | no       | Whether the clip carries an audio track. Default `true`.                                                                                                                                                                   |
| `content_filter`       | boolean   | no       | API default `false`: existing unfiltered behavior (API only). Set `true` to enable content filtering. Playground defaults to `true`. Legacy alias `nsfw_checker` is accepted; `content_filter` wins when both are present. |
| `prompt_extend`        | boolean   | no       | When `content_filter: true`: prompt expansion, default `true`.                                                                                                                                                             |
| `watermark`            | boolean   | no       | When `content_filter: true`: output watermark, default `false`.                                                                                                                                                            |
| `content`              | object\[] | no       | When `content_filter: true`: native `text`, `image_url`, `video_url`, `audio_url` parts, with nested `{ "url": "https://…" }` media and `role`. Appended before flat media fields; reference video seconds are billed.     |
| `seed`                 | integer   | no       | 0–2147483647; `content_filter: true` also accepts -1 for random.                                                                                                                                                           |

<Callout>
  All media inputs must be public `http(s)` URLs. reAPI does not accept base64 or
  `data:` URIs on any endpoint, for any model.
</Callout>

## Response envelope

Submitting returns a task id:

```json
{ "id": "task_01k9s419324drezfbwnsvxyr6h", "status": "processing" }
```

Poll `GET /api/v1/tasks/{id}`. A completed task looks like:

```json
{
  "id": "task_01k9s419324drezfbwnsvxyr6h",
  "model": "wan3.0-video-prime",
  "status": "completed",
  "created_at": 1762853430,
  "output": {
    "video_urls": [
      "https://cdn.reapi.ai/media/tasks/01k9s419324drezfbwnsvxyr6h/0.mp4"
    ]
  },
  "usage": { "credits": 1386 },
  "error": null
}
```

`usage.credits` is what the task actually cost once settled — see
[Tasks](/docs/api/tasks).

## Pricing

Billing has two dimensions: **billable seconds × resolution**.

Neither the mode nor the audio track changes the rate — a document-to-video
request costs the same per second as a text-to-video one at the same
resolution, with or without sound. Current per-second rates for each resolution
are on the [model page](https://reapi.ai/models/wan-3-0-video-prime).

```
billable_seconds = reference_video_seconds + duration
credits          = ceil(public_per_second_usd × billable_seconds × 1000)
```

`1 credit = $0.001 USD`. Use the public rate at its billing precision;
the model page rounds rates for display. The task estimate and settled
`usage.credits` provide the charge for a specific request.

Three things to know before you send a request:

* **Omitting `resolution` bills at `1080P`** because
  that is the model's own default.
* **Reference video is billable on top of `duration`.** Each clip in
  `reference_video_urls` is processed as well as generated, so its own length
  is charged too. reAPI measures the clips server-side at submit time, and
  their combined length with `duration` is capped at 30 seconds — a 6-second
  clip with `duration: 8` bills 14 seconds. Reference images, audio, documents
  and web pages carry no billable length. A clip reAPI cannot read is rejected
  rather than billed as zero.
* **`duration: -1` reserves the 30-second ceiling.** The final length is not
  knowable at submit time, so the hold is taken at the maximum. Pass an
  explicit `duration` when cost matters.

Failed tasks are refunded automatically.

## Errors

| Code    | Meaning                                                                             |
| ------- | ----------------------------------------------------------------------------------- |
| `20003` | Invalid parameter value — mixed media families, out-of-range duration, unknown enum |
| `20004` | Model not supported on this endpoint                                                |
| `30001` | Insufficient credits                                                                |
| `80006` | Rejected by content moderation                                                      |
| `80007` | Upstream rejected the input                                                         |

Full catalog: [Errors](/docs/api/errors).

## Tips

* Iterate at `480P` and switch to `1080P` only for the final render — the rate
  scales with the tier and the framing does not change.
* Reference images hold characters and wardrobe across a long take. Name them
  positionally in the prompt (`Image 1`, `Image 2`) rather than describing them
  again in prose.
* With reference video, remember input seconds count against the 30-second
  budget: a 10-second reference leaves 20 seconds of output.
* Write prompts as a shot list with explicit time ranges. The model follows
  timed beats more reliably than a single paragraph of description.
* Pick the standard [Wan 3.0](/docs/wan-3-0) tier when turnaround is not the
  constraint. It has a lower rate but different request fields; adapt the
  payload using the standard model documentation.

## Related

* [Wan 3.0](/docs/wan-3-0) — the standard tier of the same model
* [Tasks](/docs/api/tasks) — polling, `usage.credits`, and task lifecycle
* [Errors](/docs/api/errors) — full error code catalog
