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

# Wan 2.6

> 通过文本或首帧图片生成 5、10 或 15 秒的 720p/1080p 视频，音频包含在同一每秒费率内。

## 参数与输入模式

传入 `model` 与 `input` 即可选择文生视频或首帧图生视频，两种方式均可附加自定义音轨；各字段默认值、取值范围与素材限制见下方 Body 参数列表。

nsfw\_check=true 启用本站筛查，否则跳过。

| 请求场景 | input 必填字段 |
| - | - |
| 文生视频 | `prompt` |
| 首帧图生视频 | `first_frame_url`（`prompt` 可选；须省略 `aspect_ratio`） |
| 自定义音轨（可选附加） | 在任一工作流中附加 `reference_audio_urls`（优先于 `generate_audio`） |

## 使用场景

将以下示例提交到 `POST /api/v1/tasks/create_task`。首帧示例使用已托管的样本图；请将 `cdn.example.com` 占位音频链接替换为符合下方 Body 限制的公网 HTTPS 音频直链。

```json 文生视频 theme={null}
{
  "model": "wan-2.6",
  "input": {
    "prompt": "A paper boat drifting on a calm pond at sunrise, gentle ripples",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9"
  }
}
```

```json 首帧图生视频 theme={null}
{
  "model": "wan-2.6",
  "input": {
    "first_frame_url": "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-keyframes-input-0.jpg",
    "prompt": "Slow camera push-in as golden sunrise light ripples across the water.",
    "resolution": "1080p",
    "duration": 5
  }
}
```

```json 自定义音频与多镜头 theme={null}
{
  "model": "wan-2.6",
  "input": {
    "prompt": "Opening shot glides along rain-slicked cobblestones before cutting to a warm cafe window.",
    "reference_audio_urls": [
      "https://cdn.example.com/narration-10s.mp3"
    ],
    "resolution": "720p",
    "duration": 10,
    "aspect_ratio": "16:9",
    "shot_type": "multi",
    "prompt_extend": true
  }
}
```

> 使用创建任务响应中的 `data.task_id` 通过 [查询任务](https://docs.apistable.ai/zh/query-task.md) 或 `callback_url`（[Webhook 安全与验签](https://docs.apistable.ai/zh/webhook-secret.md)）获取结果；鉴权见 [快速开始](https://docs.apistable.ai/zh/quickstart.md)，提交错误见 [创建任务](https://docs.apistable.ai/zh/create-task.md)。转存视频链接保留 14 天；超过 24 小时仍未完成的任务将进入超时清理且不扣费。

## 试用与价格

每次请求生成 1 条视频，按所选分辨率的每秒费率乘以请求输出秒数计费，原生声音与自定义音频均不另收费。失败任务扣费为 0。余额查询见 [查询积分余额](https://docs.apistable.ai/zh/credits.md)。

| 分辨率 | 积分 / 秒 | 美元 / 秒 |
| - | - | - |
| `720p`（默认） | 13.0 | \$0.065 |
| `1080p` | 21.0 | \$0.105 |

> [card] [在线试用](https://apistable.ai/zh/models/wan-2.6#try)
>
> 在工作台测试文生视频、首帧图生与音频选项。

> [card] [查看价格](https://apistable.ai/zh/models/wan-2.6#pricing)
>
> 查看 720p 与 1080p 秒价、充值折合价与竞品对比。


## OpenAPI

````yaml openapi-wan-2.6-zh.json POST /api/v1/tasks/create_task
openapi: 3.1.0
info:
  title: APIstable API
  version: 1.0.0-preview
  description: >-
    Public /api/v1 protocol. Valid API keys have the same account-scoped access.
    Read the selected model documentation for its ID, supported inputs, result
    format and availability before submitting. No client submission idempotency
    or max_credits. Availability, pricing, file retention and callback formats
    follow the selected model contract. Unconfigured operations return 503.
servers:
  - url: https://apistable.ai
    description: API Stable API
security: []
paths:
  /api/v1/tasks/create_task:
    post:
      summary: Wan 2.6
      description: 通过文本或首帧图片生成 5、10 或 15 秒的 720p/1080p 视频，音频包含在同一每秒费率内。
      operationId: wan-2.6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - wan-2.6
                  example: wan-2.6
                  description: 本页对应的 APIstable 模型 ID。
                input:
                  $schema: https://json-schema.org/draft/2020-12/schema
                  type: object
                  properties:
                    nsfw_check:
                      description: true 时启用本站输入筛查；省略或 false 时跳过。不转发给生成供应商。
                      type: boolean
                    prompt:
                      description: 画面与动作描述（1–5,000 字符）；未传首帧图片时必填。
                      type: string
                      minLength: 1
                      maxLength: 5000
                    negative_prompt:
                      description: 可选负向提示词，描述不希望出现的元素（最多 500 字符）。
                      type: string
                      maxLength: 500
                    resolution:
                      default: 720p
                      description: 输出分辨率：720p（默认，13.0 积分/秒）或 1080p（21.0 积分/秒）。
                      type: string
                      enum:
                        - 720p
                        - 1080p
                    duration:
                      default: 5
                      description: 输出时长（秒）：5（默认）、10 或 15。
                      anyOf:
                        - type: number
                          const: 5
                        - type: number
                          const: 10
                        - type: number
                          const: 15
                    prompt_extend:
                      default: true
                      description: 是否开启提示词自动扩写（默认 true）。
                      type: boolean
                    watermark:
                      default: false
                      description: 是否添加 AI 生成水印（默认 false）。
                      type: boolean
                    seed:
                      description: 可选非负整数种子（0–2147483647）；省略则随机生成。
                      type: integer
                      minimum: 0
                      maximum: 2147483647
                    output_count:
                      default: 1
                      description: 单次输出数量，固定为 1。
                      type: number
                      const: 1
                    official_fallback:
                      default: false
                      description: 不支持官方回退，固定为 false。
                      type: boolean
                      const: false
                    aspect_ratio:
                      description: >-
                        可选输出宽高比（16:9 / 9:16 / 1:1 / 4:3 / 3:4，默认
                        16:9）；传入首帧时请省略，由首帧决定画幅。
                      type: string
                      enum:
                        - '16:9'
                        - '9:16'
                        - '1:1'
                        - '4:3'
                        - '3:4'
                    first_frame_url:
                      description: >-
                        可选首帧图片（未传 prompt 时必填），公网 HTTPS
                        图片直链（JPEG/PNG/BMP/WebP，所有格式均不可含透明通道，≤10 MiB，240–8000
                        px，比例 1:8–8:1）。首帧决定输出画幅，勿同时传 aspect_ratio。
                      type: string
                      maxLength: 16384
                      format: uri
                    reference_audio_urls:
                      description: >-
                        可选自定义音频数组（最多 1 段公网 HTTPS WAV/MP3，≥1 秒且不超过输出时长，≤15
                        MiB；优先于 generate_audio）。
                      maxItems: 1
                      type: array
                      items:
                        type: string
                        maxLength: 16384
                        format: uri
                    generate_audio:
                      default: true
                      description: >-
                        是否同步生成音轨（默认 true），包含在同一每秒费率内；传入 reference_audio_urls
                        时优先使用自定义音频。
                      type: boolean
                    shot_type:
                      description: >-
                        镜头类型：single（默认，单镜头）或 multi（多镜头切镜）；显式传入须保持
                        prompt_extend=true。
                      type: string
                      enum:
                        - single
                        - multi
                  additionalProperties: false
                  description: >-
                    Wan 2.6 输入参数：公网 HTTPS 素材（不含凭据、自定义端口或 #
                    片段），支持文生视频或首帧图生视频，720p/1080p，5/10/15
                    秒，音频包含在同一费率内，不支持官方回退、特效模板与视频续写。nsfw_check 为 true 时，APIstable
                    在提交前审核文本和图片；省略或 false 时跳过本站审核；视频和音频交由模型供应商按其自身策略审核。
                callback_url:
                  type: string
                  format: uri
                  description: 任务完成时接收签名回调的公网 HTTPS 地址。须为可直接访问的地址，不能跳转到其他地址。省略时可轮询查询任务接口。
            example:
              model: wan-2.6
              input:
                prompt: >-
                  A paper boat drifting on a calm pond at sunrise, gentle
                  ripples
                resolution: 720p
                duration: 5
                aspect_ratio: '16:9'
      responses:
        '200':
          description: 已受理。使用 `task_id` [查询任务](/zh/query-task)，或通过 `callback_url` 接收结果。
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - data
                additionalProperties: false
                properties:
                  code:
                    const: 200
                  msg:
                    const: success
                  data:
                    type: object
                    required:
                      - task_id
                    additionalProperties: false
                    properties:
                      task_id:
                        type: string
        '400':
          description: >-
            40001 invalid JSON, 40002 invalid input/callback or input rejected
            by screening, 40003 unsupported parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: '40201: Insufficient credits (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: '40301: Website session requests require the APIstable site origin.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '40401: Unknown model or resource not found in this account.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '40901: Resource incompatible with this operation.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: '41001: Source audio or temporary resource has expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: '41301: Request too large.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: '42201: Requested capability combination is not enabled.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '42901: Rate/concurrency limit (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '50301: Service unavailable. No live submission or charge.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      callbacks:
        Webhook:
          '{$request.body#/callback_url}':
            post:
              requestBody:
                required: true
                description: >-
                  任务成功或失败后，APIstable 向创建任务时传入的 `callback_url` 发送 JSON POST。验签后返回
                  HTTP 2xx 确认接收。


                  用 `data.status` 判断生成结果。成功时为 `succeeded`，生成视频链接位于
                  `data.result.urls`。全部失败时为 `failed`，`data.result` 为
                  `null`，`data.message` 提供失败原因。


                  签名和去重使用 `X-APIstable-Signature`、`X-APIstable-Timestamp` 和
                  `X-APIstable-Event-Id`。详见 [Webhook 安全与验签](/zh/webhook-secret)。


                  **Webhook 请求体示例**


                  ```json

                  {
                    "code": 200,
                    "msg": "success",
                    "data": {
                      "task_id": "c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb",
                      "model": "wan-2.6",
                      "status": "succeeded",
                      "created_at": "2026-11-24T08:30:00.000Z",
                      "completed_at": "2026-11-24T08:31:45.000Z",
                      "duration": 105000,
                      "charged_credits": 65,
                      "message": "",
                      "input": "{\"prompt\":\"A paper boat drifting on a calm pond at sunrise, gentle ripples\",\"resolution\":\"720p\",\"aspect_ratio\":\"16:9\",\"duration\":5}",
                      "result": {
                        "urls": [
                          "https://cdn.example.com/generated/wan-video.mp4"
                        ],
                        "items": [
                          {
                            "id": "e7aacd19-819a-4747-bbbf-46fb6f2995a5",
                            "urls": [
                              "https://cdn.example.com/generated/wan-video.mp4"
                            ],
                            "last_frame_url": null,
                            "draft": false,
                            "draft_expires_at": null
                          }
                        ]
                      }
                    }
                  }

                  ```
                content:
                  application/json:
                    schema:
                      type: object
                      required:
                        - code
                        - msg
                        - data
                      properties:
                        code:
                          type: integer
                          const: 200
                        msg:
                          type: string
                          const: success
                        data:
                          type: object
                          additionalProperties: false
                          required:
                            - task_id
                            - model
                            - status
                            - created_at
                            - completed_at
                            - duration
                            - charged_credits
                            - message
                            - input
                            - result
                          properties:
                            task_id:
                              type: string
                            model:
                              type: string
                              const: wan-2.6
                            status:
                              type: string
                              enum:
                                - succeeded
                                - failed
                            created_at:
                              type: string
                              format: date-time
                            completed_at:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            duration:
                              type:
                                - integer
                                - 'null'
                              minimum: 0
                              description: >-
                                Total elapsed milliseconds; null while
                                processing.
                            charged_credits:
                              type:
                                - number
                                - 'null'
                              minimum: 0
                              description: Final charged Credits; null until completion.
                            message:
                              type: string
                              description: >-
                                Failure reason for failed tasks, or an
                                actionable pending-settlement message while
                                processing; empty on success.
                            input:
                              type: string
                              contentMediaType: application/json
                              description: JSON-serialized accepted model input.
                            result:
                              type:
                                - object
                                - 'null'
                              required:
                                - urls
                                - items
                              properties:
                                urls:
                                  type: array
                                  items:
                                    type: string
                                    format: uri
                                items:
                                  type: array
                                  maxItems: 1
                                  items:
                                    type: object
                                    required:
                                      - id
                                      - urls
                                      - last_frame_url
                                      - draft
                                      - draft_expires_at
                                    properties:
                                      id:
                                        type: string
                                        format: uuid
                                      urls:
                                        type: array
                                        items:
                                          type: string
                                          format: uri
                                      last_frame_url:
                                        type:
                                          - string
                                          - 'null'
                                        format: uri
                                      draft:
                                        type: boolean
                                      draft_expires_at:
                                        type:
                                          - string
                                          - 'null'
                                        format: date-time
                    example:
                      code: 200
                      msg: success
                      data:
                        task_id: c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb
                        model: wan-2.6
                        status: succeeded
                        created_at: '2026-11-24T08:30:00.000Z'
                        completed_at: '2026-11-24T08:31:45.000Z'
                        duration: 105000
                        charged_credits: 65
                        message: ''
                        input: >-
                          {"prompt":"A paper boat drifting on a calm pond at
                          sunrise, gentle
                          ripples","resolution":"720p","aspect_ratio":"16:9","duration":5}
                        result:
                          urls:
                            - https://cdn.example.com/generated/wan-video.mp4
                          items:
                            - id: e7aacd19-819a-4747-bbbf-46fb6f2995a5
                              urls:
                                - >-
                                  https://cdn.example.com/generated/wan-video.mp4
                              last_frame_url: null
                              draft: false
                              draft_expires_at: null
              responses:
                2XX:
                  description: 已接收 Webhook。
              method: post
              type: path
            path: '{$request.body#/callback_url}'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - code
        - msg
        - data
      properties:
        code:
          type: integer
        msg:
          type: string
        data:
          type: 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        登录 APIstable 后，在 [API Key 管理](https://apistable.ai/zh/console/keys)
        创建并复制密钥。


        每次调用都要在 HTTP 请求头传入：


        ```http

        Authorization: Bearer YOUR_API_KEY

        ```


        将 YOUR_API_KEY 替换为你创建的 API Key。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.