> ## Documentation Index
> Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Wan 2.6 Video

> Alibaba Wan 2.6 Video generation API for text, image, and reference-driven workflows

## Overview

Wan 2.6 Video is an Alibaba video model for text-to-video, image-to-video, and reference-guided generation. Use this page when you are ready to call the API after trying the model in the APIXO playground.

| Capability                 | Value                                                                                                                                   |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Model ID                   | `wan-2-6-video`                                                                                                                         |
| Modes                      | `text-to-video`, `image-to-video-flash`, `image-to-video`, `reference-to-video-flash`, `reference-to-video`                             |
| Prompt                     | Required for all modes, non-empty, max `1500` chars                                                                                     |
| Negative prompt            | Optional, max `500` chars                                                                                                               |
| Resolution tiers           | `720p`, `1080p`                                                                                                                         |
| Duration                   | `text/image`: `2-15` seconds (default `5`); `reference`: `2-10` seconds (default `5`)                                                   |
| Prompt rewrite             | `prompt_extend` optional boolean; `true` (default) enables rewrite, `false` disables rewrite                                            |
| Image inputs               | Exactly `1` URL for `image-to-video-flash` and `image-to-video`; `JPEG/JPG/PNG(no alpha)/BMP/WEBP`, `240-8000` px, `<=20MB`             |
| Reference inputs           | `1-5` URLs for `reference-to-video-flash` and `reference-to-video`; mixed image/video with `images<=5`, `videos<=3`, `images+videos<=5` |
| Audio input (`audio_urls`) | Optional `1` URL; `wav/mp3`, `3-30s`, `<=15MB`                                                                                          |
| Flash audio switch         | `sound` is flash-only and defaults to `true`                                                                                            |

## Endpoint and authentication

Base URL:

```text theme={null}
https://api.apixo.ai/api/v1
```

| Method | Endpoint                                    | Purpose                               |
| ------ | ------------------------------------------- | ------------------------------------- |
| `POST` | `/generateTask/wan-2-6-video`               | Submit a generation task              |
| `GET`  | `/statusTask/wan-2-6-video?taskId={taskId}` | Poll task status and retrieve results |

All requests require your APIXO API key:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

Submit requests also require:

```http theme={null}
Content-Type: application/json
```

## Copy-paste async quickstart

This minimal request submits a text-to-video task and returns a `taskId`.

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-6-video" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic fox walking through neon rain",
      "resolution": "720p",
      "duration": 5,
      "prompt_extend": true
    }
  }'
```

Successful response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
```

Save the `taskId`; you need it to poll for the final result.

## Poll for result

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/wan-2-6-video?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Processing response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
```

Success response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965752317,
    "costTime": 141388
  }
}
```

Failed response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "PromptInvalid",
    "failMsg": "Prompt is invalid or rejected by provider",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
```

Parse `resultJson` after `state` becomes `success`:

```javascript theme={null}
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;
```

## Request body

### Text-to-video

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a cinematic fox walking through neon rain",
    "audio_urls": [
      "https://example.com/background.mp3"
    ],
    "negative_prompt": "blurry, low quality",
    "resolution": "1080p",
    "duration": 8,
    "prompt_extend": true,
    "shot_type": "multi",
    "seed": 42,
    "watermark": false
  }
}
```

### Image-to-video-flash

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video-flash",
    "prompt": "make the character speak with subtle camera motion",
    "image_urls": [
      "https://example.com/hero.png"
    ],
    "audio_urls": [
      "https://example.com/voice.mp3"
    ],
    "resolution": "1080p",
    "duration": 5,
    "sound": true
  }
}
```

### Reference-to-video

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "reference-to-video",
    "prompt": "character1 is reading a book in a cafe",
    "reference_urls": [
      "https://example.com/character1.png",
      "https://example.com/scene.mp4"
    ],
    "resolution": "720p",
    "duration": 6
  }
}
```

For non-flash modes, use `image-to-video` or `reference-to-video` and omit `sound`.

## Parameters

<ParamField body="request_type" type="string" required default="async">
  Result delivery mode. Use `async` for polling with `statusTask`, or `callback` for webhook delivery.
</ParamField>

<ParamField body="callback_url" type="string">
  Required when `request_type` is `callback`. Must be a public callback URL that can receive the final task payload. See [Webhooks](/api-reference/webhooks).
</ParamField>

<ParamField body="input" type="object" required>
  Wan 2.6 Video input parameters.

  <Expandable title="properties">
    <ParamField body="mode" type="string" required>
      Generation mode. Supported values: `text-to-video`, `image-to-video-flash`, `image-to-video`, `reference-to-video-flash`, `reference-to-video`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Prompt text. Required for all modes and cannot be empty after trimming. Supports Chinese and English; maximum length is `1500` characters and excess content is truncated by the model service.
    </ParamField>

    <ParamField body="negative_prompt" type="string">
      Optional negative prompt. Supports Chinese and English; maximum length is `500` characters and excess content is truncated by the model service.
    </ParamField>

    <ParamField body="image_urls" type="string[]">
      Required for `image-to-video-flash` and `image-to-video`. Must contain exactly one URL. Image constraints: formats `JPEG/JPG/PNG` (no alpha), `BMP`, `WEBP`; width and height `240-8000` px; file size `<= 20MB`.
    </ParamField>

    <ParamField body="reference_urls" type="string[]">
      Required for `reference-to-video-flash` and `reference-to-video`. Must contain `1-5` URLs. Mixed image/video is supported with limits: images `0-5`, videos `0-3`, and total `images + videos <= 5`. Reference ordering maps to role order (`character1`, `character2`, ...). Reference video constraints: `mp4/mov`, `1-30s`, file size `<= 100MB`. Reference image constraints: `JPEG/JPG/PNG` (no alpha), `BMP`, `WEBP`, width/height `240-8000` px, file size `<= 20MB`.
    </ParamField>

    <ParamField body="audio_urls" type="string[]">
      Public audio input. Optional. If provided, must contain exactly one URL. Audio constraints: formats `wav/mp3`, duration `3-30s`, file size `<= 15MB`. If audio is longer than `duration`, only the first `duration` seconds are used; if audio is shorter than output video duration, the remaining segment is silent. In flash modes, when `sound=false`, audio input is ignored.
    </ParamField>

    <ParamField body="resolution" type="string">
      Output resolution tier. Supported values: `720p`, `1080p`. Defaults: `text-to-video` -> `720p`; `image-to-video` and `image-to-video-flash` -> `720p`; `reference-to-video` and `reference-to-video-flash` -> `1080p`.
    </ParamField>

    <ParamField body="duration" type="integer" default="5">
      Accepts integer or numeric string input. `text-to-video`, `image-to-video-flash`, and `image-to-video`: `2-15`. `reference-to-video-flash` and `reference-to-video`: `2-10`.
    </ParamField>

    <ParamField body="prompt_extend" type="boolean" default="true">
      Whether to enable prompt rewriting before generation. `true` (default) enables rewriting and can improve short prompts but may increase latency. `false` disables rewriting.
    </ParamField>

    <ParamField body="shot_type" type="string">
      Optional shot mode. Supported values: `single`, `multi`. When both `shot_type` and prompt shot instructions are present, `shot_type` takes priority.
    </ParamField>

    <ParamField body="seed" type="integer">
      Optional random seed. Supported values: `0-2147483647`. A fixed seed improves reproducibility, but identical seeds do not guarantee identical outputs.
    </ParamField>

    <ParamField body="watermark" type="boolean">
      Optional watermark switch. `false` (default) means no watermark. `true` adds a bottom-right watermark with fixed text `AI 生成`.
    </ParamField>

    <ParamField body="sound" type="boolean" default="true (flash modes only)">
      Flash-only audio generation switch for `image-to-video-flash` and `reference-to-video-flash`. `true` (default) generates voiced video. `false` generates silent video and ignores optional audio input.
    </ParamField>
  </Expandable>
</ParamField>

## Response format

### Submit task response

`POST /generateTask/wan-2-6-video` returns a task ID when the task is accepted:

<ResponseField name="code" type="integer">
  API status code. `200` means the task was accepted.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message.
</ResponseField>

<ResponseField name="data.taskId" type="string">
  Unique task identifier used with the status endpoint.
</ResponseField>

### Status response fields

<ResponseField name="taskId" type="string">
  Unique task identifier.
</ResponseField>

<ResponseField name="state" type="string">
  Current task state: `pending`, `processing`, `success`, or `failed`.
</ResponseField>

<ResponseField name="resultJson" type="string">
  JSON string containing generated video URLs in `resultUrls`. Present when `state` is `success`.
</ResponseField>

<ResponseField name="failCode" type="string">
  Machine-readable failure code. Present when `state` is `failed`.
</ResponseField>

<ResponseField name="failMsg" type="string">
  Human-readable failure message. Present when `state` is `failed`.
</ResponseField>

<ResponseField name="createTime" type="integer">
  Task creation timestamp in Unix milliseconds.
</ResponseField>

<ResponseField name="completeTime" type="integer">
  Task completion timestamp in Unix milliseconds. Present after completion.
</ResponseField>

<ResponseField name="costTime" type="integer">
  Processing duration in milliseconds. Present after completion when provider timing is available.
</ResponseField>

## Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-6-video" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "image-to-video-flash",
      "prompt": "make the character speak with subtle camera motion",
      "image_urls": [
        "https://example.com/hero.png"
      ],
      "resolution": "720p",
      "duration": 5,
      "sound": false
    }
  }'
```

See [Webhooks](/api-reference/webhooks) for delivery requirements and retry behavior.

## Billing

Wan 2.6 Video is billed per second. Total cost is `duration * unitPrice`.

Standard (non-flash) modes:

| Mode                 | Resolution | APIXO official price |
| -------------------- | ---------- | -------------------- |
| `text-to-video`      | `720p`     | `$0.10 / second`     |
| `text-to-video`      | `1080p`    | `$0.15 / second`     |
| `image-to-video`     | `720p`     | `$0.10 / second`     |
| `image-to-video`     | `1080p`    | `$0.15 / second`     |
| `reference-to-video` | `720p`     | `$0.20 / second`     |
| `reference-to-video` | `1080p`    | `$0.30 / second`     |

Flash modes:

| Mode                       | Resolution | `sound=false`      | `sound=true`      |
| -------------------------- | ---------- | ------------------ | ----------------- |
| `image-to-video-flash`     | `720p`     | `$0.025 / second`  | `$0.05 / second`  |
| `image-to-video-flash`     | `1080p`    | `$0.0375 / second` | `$0.075 / second` |
| `reference-to-video-flash` | `720p`     | `$0.05 / second`   | `$0.10 / second`  |
| `reference-to-video-flash` | `1080p`    | `$0.08 / second`   | `$0.16 / second`  |

For current route and market comparison pricing, see [Pricing](https://apixo.ai/pricing).

## Latency and polling

Wan 2.6 Video tasks are asynchronous. The backend does not provide a fixed public latency SLA; actual latency varies by mode, duration, resolution, prompt complexity, media fetch speed, and provider queue load.

| Workflow                                          | Recommended first poll  | Poll interval |
| ------------------------------------------------- | ----------------------- | ------------- |
| `text-to-video`                                   | 30s after task creation | 10s           |
| `image-to-video` / `image-to-video-flash`         | 30s after task creation | 10s           |
| `reference-to-video` / `reference-to-video-flash` | 45s after task creation | 10s-15s       |

<Tip>
  For production workloads, use callback mode to avoid frequent polling on long-running video jobs.
</Tip>

Rate limits and concurrency can vary by account, API key, and route. If you receive `429`, slow down requests and retry with backoff. For account-level details, see [System APIs](/api-reference/system).

## Errors and troubleshooting

### HTTP errors

| Code  | Meaning                                                   | What to do                           |
| ----- | --------------------------------------------------------- | ------------------------------------ |
| `400` | Invalid request body, mode, parameter, or media URL shape | Fix the request before retrying      |
| `401` | Missing or invalid API key                                | Check the `Authorization` header     |
| `402` | Insufficient balance or quota                             | Add balance or switch account/key    |
| `403` | Key or route cannot access the model                      | Check permissions and route strategy |
| `429` | Rate limit or concurrency limit reached                   | Retry with exponential backoff       |
| `500` | Server error                                              | Retry with backoff                   |
| `502` | Model provider error                                      | Retry with backoff                   |
| `504` | Model provider timeout                                    | Retry or use callback mode           |

### Task failure codes

`failCode` is route-dependent and may come from mapped third-party model failures. Common values include:

| Fail code                                       | Meaning                                            | What to do                          |
| ----------------------------------------------- | -------------------------------------------------- | ----------------------------------- |
| `PromptInvalid`                                 | Prompt is invalid or rejected by the model service | Rewrite the prompt and retry        |
| `MissingParameter` / `BadRequest`               | Required fields are missing or malformed           | Check mode-specific required fields |
| `SensitiveContent` / `SensitiveContentDetected` | Prompt or media failed safety checks               | Change prompt or media              |
| `RateLimitExceeded`                             | Model service or route rate limit was reached      | Retry with exponential backoff      |
| `Task TimeOut` / `Timeout`                      | Model generation timed out                         | Retry or use callback mode          |

### Parameter troubleshooting

* `prompt` is required and must be non-empty for all modes.
* `image-to-video-flash` and `image-to-video` require exactly one `image_urls` item.
* `reference-to-video-flash` and `reference-to-video` require `reference_urls` with `1-5` items.
* `sound` is valid only for flash modes.
* `duration` defaults to `5`, but `reference` modes only allow up to `10`.
* In flash modes, when `sound=false`, optional audio input is ignored.

See [Error Codes](/api-reference/errors) for the full error reference.

## Related links

* [Generation API Overview](/models)
* [Generate Task](/api-reference/generate-task)
* [Status Task](/api-reference/status-task)
* [Webhooks](/api-reference/webhooks)
* [Error Codes](/api-reference/errors)
* [Parameter Specification](/api-reference/parameters)
* [Routing Strategies](/concepts/routing-strategies)
* [Pricing](https://apixo.ai/pricing)
