> ## 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 3.0 Prime

> 支持 480p/720p/1080p 与 2–30 秒或自动时长视频生成，可同步生成声音，支持文本、首尾帧、图/视频/音频、文档及公开网页参考。

## 生成模式

`wan-3.0`（Standard）与 `wan-3.0-prime`（Prime）共用 `POST /api/v1/tasks/create_task` 接口及一致的扁平 `input` 字段结构。请求体必填 `model` 与 `input`；`input` 内至少提供 `prompt` 或任一项素材字段。

nsfw\_check 为 true 时，APIstable 在提交前审核文本和图片；视频和音频交由模型供应商按其自身策略审核。开启筛查时，文档和网页中的文本、图片也须通过提取与审核；省略或 false 时跳过本站审核。

| 生成模式 | 典型 `input` 字段 | 说明 |
| - | - | - |
| 文生视频 | `prompt` | 2–30 秒或 `-1`（自动）；提示词最长 20,000 字符 |
| 首帧 / 首尾帧 | `first_frame_url`（及可选 `last_frame_url`） | 传 `last_frame_url` 时必须提供 `first_frame_url`；`prompt` 可选 |
| 多模态参考 | `reference_image_urls`、`reference_video_urls`、`reference_audio_urls` | 最多 10 张图、5 段视频、5 段音频；`prompt` 可选 |
| 文档或网页生成 | `file_url` 或 `link_url` | 文档与网页二选一（最多 1 项）；根据文档或网页内容生成视频 |

> 省略 `resolution` 默认按 `1080p`（最高费率）生成与计费，成本敏感时请显式传 `480p` 或 `720p`。时长请统一使用 `duration`（`2`–`30` 或 `-1`），传入 `duration_seconds` 会返回 HTTP 400。

## 请求示例

将以下任一请求体发送至 `POST /api/v1/tasks/create_task`（请求头携带 `Authorization: Bearer YOUR_API_KEY`），并将示例链接替换为你自己的公网 HTTPS 直链。

```json 文生视频 theme={null}
{
  "model": "wan-3.0-prime",
  "input": {
    "prompt": "Morning mist drifts across a mountain lake as the camera glides forward.",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5
  }
}
```

```json 首尾帧生视频 theme={null}
{
  "model": "wan-3.0-prime",
  "input": {
    "prompt": "The camera moves smoothly toward the cabin as dusk settles.",
    "first_frame_url": "https://cdn.example.com/start.jpg",
    "last_frame_url": "https://cdn.example.com/end.jpg",
    "resolution": "1080p",
    "aspect_ratio": "adaptive",
    "duration": 6
  }
}
```

```json 参考图、视频与音频 theme={null}
{
  "model": "wan-3.0-prime",
  "input": {
    "prompt": "Use the cabin porch appearance from the reference image, match the tracking pace of the reference video, and follow the rhythm of the reference audio.",
    "reference_image_urls": [
      "https://cdn.example.com/cabin.jpg"
    ],
    "reference_video_urls": [
      "https://cdn.example.com/camera-motion.mp4"
    ],
    "reference_audio_urls": [
      "https://cdn.example.com/beat.mp3"
    ],
    "resolution": "720p",
    "aspect_ratio": "adaptive",
    "duration": 5,
    "generate_audio": true
  }
}
```

```json 文档生成视频 theme={null}
{
  "model": "wan-3.0-prime",
  "input": {
    "file_url": "https://cdn.example.com/product-brief.pdf",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 10
  }
}
```

```json 网页生成视频 theme={null}
{
  "model": "wan-3.0-prime",
  "input": {
    "prompt": "Turn this launch page into a concise product showcase video.",
    "link_url": "https://example.com/launch-article",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 10
  }
}
```

```json 自动时长 theme={null}
{
  "model": "wan-3.0-prime",
  "input": {
    "prompt": "Raindrops slide down a night train window overlooking neon city streets.",
    "reference_image_urls": [
      "https://cdn.example.com/train-window.jpg"
    ],
    "resolution": "720p",
    "aspect_ratio": "adaptive",
    "duration": -1,
    "official_fallback": true
  }
}
```

## 在线试用与价格

> [card] [在线试用](https://apistable.ai/zh/models/wan-3.0-prime#try)
>
> 在工作台直接测试提示词、首尾帧、参考素材、文档或网页生成。

> [card] [查看价格](https://apistable.ai/zh/models/wan-3.0-prime#pricing)
>
> 按分辨率查看标准档与回退档每秒价格。


## OpenAPI

````yaml openapi-wan-3.0-prime-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 3.0 Prime
      description: 支持 480p/720p/1080p 与 2–30 秒或自动时长视频生成，可同步生成声音，支持文本、首尾帧、图/视频/音频、文档及公开网页参考。
      operationId: wan-3.0-prime
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - wan-3.0-prime
                  example: wan-3.0-prime
                  description: 本页对应的 APIstable 模型 ID。
                input:
                  $schema: https://json-schema.org/draft/2020-12/schema
                  type: object
                  properties:
                    nsfw_check:
                      description: true 时启用本站输入筛查；省略或 false 时跳过。不转发给生成供应商。
                      type: boolean
                    prompt:
                      type: string
                      minLength: 1
                      maxLength: 20000
                      description: 描述画面主体、动作与声音（去首尾空白后 1–20,000 字符）。未传任何素材 URL 时必填。
                    resolution:
                      default: 1080p
                      type: string
                      enum:
                        - 480p
                        - 720p
                        - 1080p
                      description: >-
                        输出分辨率：可选 `480p`、`720p` 或 `1080p`（默认
                        `1080p`，费率最高）。对成本敏感时请显式传入 `480p` 或 `720p`。
                    aspect_ratio:
                      default: adaptive
                      type: string
                      enum:
                        - adaptive
                        - '16:9'
                        - '4:3'
                        - '1:1'
                        - '3:4'
                        - '9:16'
                      description: >-
                        输出宽高比：支持
                        `adaptive`（默认，自适应）、`16:9`、`4:3`、`1:1`、`3:4`、`9:16`，不支持
                        `21:9`。
                    watermark:
                      default: false
                      type: boolean
                      description: 是否为生成视频添加水印。默认 `false`。
                    prompt_extend:
                      default: true
                      type: boolean
                      description: >-
                        是否开启提示词扩写。默认 `true`。使用 `file_url` 或 `link_url` 且设为
                        `false` 时不可触发回退，仅在首选渠道执行。
                    generate_audio:
                      default: true
                      type: boolean
                      description: 是否同步生成音轨。默认 `true`，开关声音不改变每秒费率。
                    seed:
                      default: -1
                      type: integer
                      minimum: -1
                      maximum: 2147483647
                      description: 随机种子，支持 `-1`（随机，默认）或 `0`–`2147483647` 的整数。
                    output_count:
                      default: 1
                      type: number
                      const: 1
                      description: 单次请求生成的视频数量，固定为 `1`。
                    official_fallback:
                      default: false
                      type: boolean
                      description: >-
                        默认 `false`。设为 `true`
                        允许在完整请求兼容且遇到容量或临时错误时启用回退渠道；仅回退成功时按回退档费率结算。
                    duration:
                      default: 5
                      type: integer
                      minimum: -1
                      maximum: 30
                      description: >-
                        输出时长（秒）：`2`–`30` 的整数（默认 `5`），或
                        `-1`（自动时长）。包含参考视频时，参考视频总时长加输出时长须 ≤30 秒。
                    first_frame_url:
                      type: string
                      format: uri
                      description: 首帧图片 URL，不可与参考素材、文档或网页混用。
                    last_frame_url:
                      type: string
                      format: uri
                      description: 尾帧图片 URL，须同时提供 first_frame_url。
                    reference_image_urls:
                      type: array
                      items:
                        type: string
                        format: uri
                      description: 最多 10 个参考图片 URL，不可与首尾帧混用。
                    reference_video_urls:
                      type: array
                      items:
                        type: string
                        format: uri
                      description: 最多 5 个参考视频 URL，单段 1–15 秒、合计 ≤15 秒。每个传入片段均计入收费，包括重复 URL。
                    reference_audio_urls:
                      type: array
                      items:
                        type: string
                        format: uri
                      description: 最多 5 个参考音频 URL，单段 1–15 秒、合计 ≤15 秒。
                    file_url:
                      type: string
                      format: uri
                      description: >-
                        文档 URL，与 link_url 及首尾帧互斥，nsfw_check 为 true
                        时须通过有界提取及文本、图片审核。
                    link_url:
                      type: string
                      format: uri
                      description: >-
                        静态公开网页 URL，与 file_url 及首尾帧互斥，不支持动态网页，nsfw_check 为 true
                        时提取出的文本和图片须审核。
                  additionalProperties: false
                  description: >-
                    Wan 3.0 视频生成参数。至少提供 `prompt` 或一个素材 URL；时长字段统一使用
                    `duration`（`2`–`30` 或 `-1`）。nsfw_check 为 true 时，APIstable
                    在提交前审核文本和图片；省略或 false
                    时跳过本站审核；视频和音频交由模型供应商按其自身策略审核。开启筛查时，文档和网页提取出的文本、图片同样须审核。
                callback_url:
                  type: string
                  format: uri
                  description: 任务完成时接收签名回调的公网 HTTPS 地址。须为可直接访问的地址，不能跳转到其他地址。省略时可轮询查询任务接口。
            example:
              model: wan-3.0-prime
              input:
                prompt: >-
                  Morning mist drifts across a mountain lake as the camera
                  glides forward.
                resolution: 720p
                aspect_ratio: '16:9'
                duration: 5
      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-3.0-prime",
                      "status": "succeeded",
                      "created_at": "2026-11-24T08:30:00.000Z",
                      "completed_at": "2026-11-24T08:31:45.000Z",
                      "duration": 105000,
                      "charged_credits": 105,
                      "message": "",
                      "input": "{\"prompt\":\"Morning mist drifts across a mountain lake as the camera glides forward.\",\"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-3.0-prime
                            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-3.0-prime
                        status: succeeded
                        created_at: '2026-11-24T08:30:00.000Z'
                        completed_at: '2026-11-24T08:31:45.000Z'
                        duration: 105000
                        charged_credits: 105
                        message: ''
                        input: >-
                          {"prompt":"Morning mist drifts across a mountain lake
                          as the camera glides
                          forward.","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.