> ## 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 3.0 Video Pro LoRA API：生成 1080p、2K 或 4K 视频

> Wan 3.0 Video Pro LoRA 生成 API，支持 1080p、2K 和 4K 的文本生成视频、图像生成视频及参考生成视频工作流

## 概览

Wan 3.0 Video Pro LoRA 可生成 1080p、2K 或 4K 视频。可以提交提示词、首帧图或首尾帧图，也可以使用多模态参考素材。在 APIXO Playground 试用后，可以按本页示例调用 API。

| 功能 | 值 |
| - | - |
| 模型 ID | `wan-3-0-video-pro-LoRA` |
| 模式 | `text-to-video`, `image-to-video`, `reference-to-video` |
| 提示词 | `text-to-video` 为必需参数，`image-to-video` 和 `reference-to-video` 为可选参数。 |
| 可选分辨率 | `1080p`, `2k`, `4k` |
| 纵横比 | `auto`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16` |
| 时长 | `-1` 表示智能持续时间，或 `2` 到 `30` 秒之间的任何整数；默认为 `5` |
| 图生视频图像 | 1-2 图像 URL；第二张图像是可选的最后一帧 |
| 参考输入 | 最多支持 10 个图像 URL、5 个视频 URL 或 5 个音频 URL。 |
| 结果格式 | MP4 URL 数组位于 `resultJson.resultUrls` 中 |

> [!NOTE]
>
> `wan-3-0-video-pro-LoRA` 是公共模型名称。它不接受自定义 LoRA 配置参数。

## 请选择 Wan 3.0 端点。

所有三个端点均支持文生视频、第一帧或首尾帧图生视频以及参考生成视频。在复制参数或价格前，请先选择端点。

| 端点 | 输出分辨率 | 参考视频输入 |
| - | - | - |
| [Wan 3.0 Video](https://apixo.ai/docs/zh/models/video/wan-3-0-video.md) | `480p`, `720p`, `1080p` | 支持图片、视频、音频，最多可附加一个文件 URL 或一个网页链接；文件与链接输入互斥。 |
| [Wan 3.0 Video LoRA](https://apixo.ai/docs/zh/models/video/wan-3-0-video-lora.md) | `480p`, `720p`, `1080p` | 图像、视频和音频；无 `file_urls` 或 `link_urls` |
| [Wan 3.0 Video Pro LoRA](https://apixo.ai/docs/zh/models/video/wan-3-0-video-pro-lora.md) | `1080p`, `2k`, `4k` | 图像、视频和音频；无 `file_urls` 或 `link_urls` |

有关工作流程选择，请参阅 [Wan 3.0 Video、LoRA 和 Pro LoRA 比较](https://apixo.ai/blog/wan-3-0-video-vs-lora-vs-pro-lora)。即使两个端点提供相同的分辨率，也使用 [API 定价](https://apixo.ai/pricing/api) 中所选端点的速率。

## 接口与身份验证

API 基础地址：

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

| 方法 | 端点 | 用途 |
| - | - | - |
| `POST` | `/generateTask/wan-3-0-video-pro-LoRA` | 提交生成任务 |
| `GET` | `/statusTask/wan-3-0-video-pro-LoRA?taskId={taskId}` | 查询任务状态并获取结果 |

每个请求都必须携带 APIXO API 密钥：

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

提交任务时，还需要设置以下请求头：

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

## 异步请求示例

此最小请求提交 4K 文生视频任务并返回 `taskId`。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-3-0-video-pro-LoRA" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a premium product launch film with elegant lighting and smooth camera motion",
      "resolution": "4k",
      "aspect_ratio": "16:9",
      "duration": 5,
      "sound": true
    }
  }'
```

成功响应：

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

保存 `taskId`，后续轮询结果时需要用到它。

## 轮询结果

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

任务处理中的响应示例：

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

成功响应：

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

任务失败时的响应示例：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "UPSTREAM_ERROR",
    "failMsg": "Generation failed",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
```

等 `state` 变为 `success` 后，再解析 `resultJson`：

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

## 请求体

### 文生视频

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a luxury watch rotates on black glass, crisp reflections, cinematic macro shot",
    "resolution": "4k",
    "aspect_ratio": "16:9",
    "duration": 5,
    "sound": true
  }
}
```

### 图生视频

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "the portrait subtly smiles while the camera moves closer",
    "image_urls": [
      "https://example.com/first-frame.png",
      "https://example.com/last-frame.png"
    ],
    "resolution": "2k",
    "aspect_ratio": "auto",
    "duration": 5,
    "sound": true
  }
}
```

### 参考生成视频

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "reference-to-video",
    "prompt": "keep the subject identity and use the motion reference",
    "image_urls": [
      "https://example.com/person.png"
    ],
    "video_urls": [
      "https://example.com/motion-reference.mp4"
    ],
    "audio_urls": [
      "https://example.com/audio-reference.mp3"
    ],
    "resolution": "1080p",
    "aspect_ratio": "auto",
    "duration": -1,
    "sound": true
  }
}
```

## 参数

**request\_type** `string` (default: async)

Result交付方式。支持的值：`async`、`callback`。使用 `async` 时通过 `statusTask` 轮询获取结果，使用 `callback` 时通过 Webhook 传递结果。

**callback\_url** `string`

当 `request_type` 为 `callback` 时必填。请提供公网可访问的 HTTPS 地址，用于接收任务的最终结果。详见 [Webhook](https://apixo.ai/docs/zh/api-reference/webhooks.md)。

**input** `object` *required*

Wan 3.0 Video Pro LoRA 的输入参数。

**属性**

**mode** `string` *required*

生成模式。支持的值：`text-to-video`、`image-to-video`、`reference-to-video`。参考视频至少需要一个受支持的参考输入；请参阅下面的模式表。

**prompt** `string`

提示文字。`text-to-video` 必填；`image-to-video` 和 `reference-to-video` 可选。修剪后必填提示不能为空。最大长度：20000 个字符。

**resolution** `string` (default: 1080p)

输出分辨率档位。可选值为 `1080p`、`2k`、`4k`。

**aspect\_ratio** `string` (default: auto)

输出纵横比。支持的值：`auto`、`16:9`、`4:3`、`1:1`、`3:4`、`9:16`。使用 `auto` 进行自动取景。

**duration** `integer|string` (default: 5)

输出持续时间（以秒为单位）。支持 `-1` 智能持续时间，或从 `2` 到 `30` 的整数，包括数字字符串，例如 `"8"`。拒绝诸如 `-1.0` 之类的十进制值。

**sound** `boolean` (default: true)

生成的视频是否应包含音频。此设置不会影响价格。

**seed** `integer|string`

可选的随机种子。支持范围为 `0` 至 `2147483647`。支持数字字符串形式；小数值将被拒绝。

**image\_urls** `string[]`

图像 URL。`image-to-video` 生成时需提供 1-2 张图像，其中 `image_urls[0]` 为第一帧，`image_urls[1]` 为可选的最后一帧；`reference-to-video` 生成时最多可提供 10 张图像，为可选。每张图像的宽高必须在 240 至 8000 像素之间（含边界值）。`text-to-video` 不支持图像 URL。

**video\_urls** `string[]`

`reference-to-video` 的参考视频 URL。最多支持 5 个 URL。每个视频时长需在 1-15 秒之间，所有参考视频总时长不得超过 15 秒，参考视频的秒数按所选 `resolution` 的相同每秒费率计费。`text-to-video` 和 `image-to-video` 不支持视频 URL。

**audio\_urls** `string[]`

`reference-to-video` 的参考音频 URL。如果提供，最多支持 5 个 URL。每个音频文件必须为 1-15 秒，总参考音频持续时间不能超过 15 秒。音频不单独计费。`text-to-video` 和 `image-to-video` 不接受音频 URL。

| 模式 | 所需输入 | 不支持的媒体字段 | 计费说明 |
| - | - | - | - |
| `text-to-video` | `prompt` | `image_urls`, `video_urls`, `audio_urls` | 按输出时长计费，单位为秒。 |
| `image-to-video` | `image_urls` 字段包含 1 到 2 张图像 | `video_urls`, `audio_urls` | 按输出时长计费，单位为秒。 |
| `reference-to-video` | `image_urls`、`video_urls` 或 `audio_urls` 中至少提供一项。 | 无 | 输出时长和参考视频秒数按秒计费。 |

> [!TIP]
>
> 对所有媒体输入使用公共、可直接访问的 URL。视频参考应该是常见的视频文件，例如 MP4、MOV 或 M4V；音频参考应该是常见的音频文件，例如 MP3、WAV 或 M4A。

> [!TIP]
>
> 当`duration`为正且提供`video_urls`时，总参考视频秒数加上`duration`不能超过30秒。当 `duration` 为 `-1` 时，请求使用智能持续时间，并预扣费为输入视频秒数加上 30 输出秒数。

有关选择和组合参考的指南，请参阅 [Wan 3.0 参考工作流程](https://apixo.ai/blog/wan-3-0-multimodal-reference-guide)。其文件和 Web 链接步骤仅适用于标准 Wan 3.0 Video，不适用于此端点。

## 响应格式

### 提交任务时的响应

任务受理后，`POST /generateTask/wan-3-0-video-pro-LoRA` 会返回任务 ID：

**code** `integer`

API 状态码。`200` 表示任务已受理。

**message** `string`

状态说明。

**data.taskId** `string`

任务的唯一 ID，用于查询任务状态。

### 状态响应字段

**taskId** `string`

任务的唯一标识符。

**state** `string`

当前任务状态，可能的值为 `processing`、`success`、`failed`。

**resultJson** `string`

当 `state` 为 `success` 时返回。解析此 JSON 字符串后，可从 `resultUrls` 读取生成的视频链接。

**failCode** `string`

供程序处理的错误码，仅在 `state` 为 `failed` 时返回。

**failMsg** `string`

失败原因说明，仅在 `state` 为 `failed` 时返回。

**createTime** `integer`

任务创建时的 Unix 时间戳，单位为毫秒。

**completeTime** `integer`

任务完成时的 Unix 时间戳，单位为毫秒。任务完成后返回。

**costTime** `integer`

处理耗时，以毫秒为单位。任务完成且有计时数据时返回。

**billing** `object`

最终计费明细。仅在成功终态响应时出现，适用于 `wan-3-0-video-pro-LoRA` 任务中提交且 `duration=-1` 的情况。

**billing.settlementState** `string`

结算状态。对于此最终快照，该值始终为 `final`。

**billing.inputVideoSeconds** `number`

所有输入视频的总时长（以秒为单位），四舍五入到小数点后 3 位。

**billing.outputVideoSeconds** `number`

实际生成的输出视频持续时间（以秒为单位），四舍五入到小数点后 3 位。

**billing.totalBillableSeconds** `number`

最终计费持续时间（以秒为单位）。这始终是 `inputVideoSeconds + outputVideoSeconds`。

**billing.unit** `string`

时长单位，值为 `second`。

**billing.rounding** `string`

用于持续时间字段的舍入规则。值为 `round half up to 3 decimal places`。

**billing.inputVideoCount** `integer`

`inputVideoSeconds` 中包含的输入视频数量。

**billing.outputVideoCount** `integer`

`outputVideoSeconds` 中包含的输出视频数量。

## Webhook 回调模式

如果希望服务端自动收到最终结果，可以使用回调模式，无需轮询。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-3-0-video-pro-LoRA" \
  -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": "reference-to-video",
      "prompt": "create a polished product video using the references",
      "image_urls": [
        "https://example.com/ref.png"
      ],
      "resolution": "1080p",
      "aspect_ratio": "auto",
      "duration": -1,
      "sound": true
    }
  }'
```

回调有效负载使用与状态轮询相同的顶级结构，包含 `code`、`message` 和 `data` 字段。成功回调包含最终的 `state` 和 `resultJson`。对于 `duration=-1` 任务，成功终端回调包含与状态轮询一致的 `data.billing` 对象。详情请参阅 [Webhooks](https://apixo.ai/docs/zh/api-reference/webhooks.md) 中的交付要求和重试行为。

## 计费

市场参考价等于标准 APIXO 价格乘以 1.30，四舍五入到小数点后三位。它们是对比值，而非实时第三方报价或实际收费金额。

新提交的非 LLM 请求按 **1 积分 = `$0.001`** 计费。先按用量和附加项目计算总额，再应用账号折扣，最后将请求总额向上取整到整数积分。如果约定了固定单价，则按该单价的原始精度计算，不再使用标准价或另行打折；最终积分仍向上取整。详见[积分换算与取整](https://apixo.ai/docs/zh/pricing.md#credit-conversion-and-rounding)。

Wan 3.0 Video Pro LoRA 按秒计费。单价取决于 `resolution`；对于给定分辨率，所有支持的模式共享相同费率。

| 模式 | 分辨率 | APIXO 官方价格 | 市场参考价 |
| - | - | - | -: |
| `text-to-video` | `1080p` | `$0.20 / second` | `$0.260 / second` |
| `text-to-video` | `2k` | `$0.23 / second` | `$0.299 / second` |
| `text-to-video` | `4k` | `$0.26 / second` | `$0.338 / second` |
| `image-to-video` | `1080p` | `$0.20 / second` | `$0.260 / second` |
| `image-to-video` | `2k` | `$0.23 / second` | `$0.299 / second` |
| `image-to-video` | `4k` | `$0.26 / second` | `$0.338 / second` |
| `reference-to-video` | `1080p` | `$0.20 / second` | `$0.260 / second` |
| `reference-to-video` | `2k` | `$0.23 / second` | `$0.299 / second` |
| `reference-to-video` | `4k` | `$0.26 / second` | `$0.338 / second` |

计费公式：

| 请求 | 公式 |
| - | - |
| `text-to-video` 或 `image-to-video` 且 `duration` 为正数 | `duration * unitPrice` |
| `reference-to-video` 且 `duration` 为正数 | `(input video seconds + duration) * unitPrice` |
| `duration = -1` 的任意模式 | 预扣费用为 `(input video seconds + 30) * unitPrice`；任务成功后，最终计费秒数为 `input video seconds + actual output seconds`，差额将退还。 |

输入的图像和音频文件不会额外增加计费秒数。

对使用 `duration=-1` 的任务，成功结束后的响应会在 `data.billing` 中返回最终结算秒数。以下示例假设参考视频为 5.371 秒、输出视频为 10.042 秒，用于说明计费明细，并非任务实测结果。

```json theme={null}
{
  "billing": {
    "settlementState": "final",
    "inputVideoSeconds": 5.371,
    "outputVideoSeconds": 10.042,
    "totalBillableSeconds": 15.413,
    "unit": "second",
    "rounding": "round half up to 3 decimal places",
    "inputVideoCount": 1,
    "outputVideoCount": 1
  }
}
```

`billing` 中的时长均以秒为单位，四舍五入至小数点后三位。`inputVideoSeconds` 是所有输入视频的总时长，`inputVideoCount` 是计入总时长的视频个数，`outputVideoSeconds` 是实际生成的视频时长。`totalBillableSeconds` 始终等于 `inputVideoSeconds + outputVideoSeconds`。未提供输入视频时，`inputVideoSeconds` 为 `0.000`，`inputVideoCount` 为 `0`。只有最终结算成功后才会返回此 `billing` 对象，成功回调中也会包含它。重复轮询会得到相同的值。

如果没有参考视频，输入视频秒数为零。视频参考仍然需要至少一个受支持的参考输入。对于`duration=-1`，30输出秒数是预扣费基础，而不是承诺的输出长度。最终费用为`(input video seconds + actual output seconds) * unitPrice`；使用 `data.billing.settlementState=final` 的成功响应来确定秒数。

例如，使用记录的 `1080p` 基础速率 `$0.20/second`，一个 5 秒参考视频和固定 10 秒输出成本 `$3.00`。当 `duration=-1` 时，相同输入的初始费用为 `(5 + 30) * $0.20 = $7.00`。如果输出成功为 10 秒，则最终费用为 `$3.00`，退还差额为 `$4.00`。这些是算术示例，而不是测量的生成结果。

有关预算演练，请参阅 [Wan 3.0 持续时间和成本指南](https://apixo.ai/blog/wan-3-0-duration-and-cost)。其美元示例使用标准 Wan 3.0 Video 费率；检查 [API 定价](https://apixo.ai/pricing/api) 以了解所选端点的当前费率。API 使用量以 USD 计费，与 Studio 每月积分分开计费。

最新的美元费率见 [API 价目表](https://apixo.ai/pricing/api)。

## 延迟与轮询

Wan 3.0 Video Pro LoRA 任务是异步的。实际延迟可能因提示复杂性、持续时间、参考媒体可访问性、分辨率、路由队列负载和生成时间而异。

| 工作量 | 通常生成耗时 | 建议首次查询时间 | 轮询间隔 |
| - | - | - | - |
| 文本转视频或图像转视频 | 因提示、分辨率和持续时间而异 | 任务创建 60 秒后 | 10s-15s |
| 支持图像、视频或音频作为输入的视频参考 | 通常比简单生成耗时更长 | 任务创建 60 至 90 秒后 | 10s-15s |

> [!TIP]
>
> 生产环境建议使用回调，避免在视频生成期间频繁轮询。

结果链接有时效。任务完成后，请尽快下载并保存重要文件。

请求频率和并发上限因账号、API 密钥和路由而异。收到 `429` 时，请降低请求频率，逐步延长重试间隔。账号级限制见[系统 API](https://apixo.ai/docs/zh/api-reference/system.md)。

## 错误与排查

### HTTP 错误

| 代码 | 含义 | 处理方式 |
| - | - | - |
| `400` | 请求体无效、缺少 `input`、不受支持的 `mode`、缺少所需的 `prompt` 或媒体、无效的 `resolution`、无效的 `aspect_ratio`、无效的 `duration` 或无效的媒体数组 | 在重试前修复请求 |
| `401` | 缺少 API 密钥，或密钥无效 | 检查 `Authorization` 请求头 |
| `402` | 余额或配额不足 | 充值或更换账号或API密钥 |
| `403` | 密钥或路由无权访问该模型 | 检查权限和路由策略 |
| `404` | 轮询时未找到任务 | 检查`taskId` |
| `429` | 已达到速率或并发限制 | 按指数退避策略重试 |
| `500` | 服务器错误或未知任务失败 | 逐步延长间隔后重试 |
| `502` | 服务错误 | 逐步延长间隔后重试 |
| `504` | 服务超时 | 重试；耗时较长的任务可改用回调模式 |

### 验证说明

| 条件 | 后端行为 |
| - | - |
| 缺少 `input` | 请求会被拒绝，系统不会创建任务。 |
| 缺少 `mode` | 请求会被拒绝，系统不会创建任务。 |
| 不支持的 `mode` 值 | 请求会被拒绝，任务不会创建。可选值为 `text-to-video`、`image-to-video`、`reference-to-video`。 |
| 在 `text-to-video` 任务中缺少 `prompt` | 请求会被拒绝，系统不会创建任务。 |
| `prompt` 字段为空（必需） | 请求会被拒绝，系统不会创建任务。 |
| 缺少 `resolution` | 默认值为 `1080p`。 |
| 不支持的 `resolution` 值 | 请求会被拒绝，任务不会创建。可选值为 `1080p`、`2k`、`4k`。 |
| 缺少 `aspect_ratio` | 默认值为 `auto`。 |
| 不支持的 `aspect_ratio` 值 | 请求在任务创建前失败。请使用 `auto`、`16:9`、`4:3`、`1:1`、`3:4` 或 `9:16` 设置比例。 |
| 缺少 `duration` | 默认值为 `5`。 |
| `duration` 在 `-1` 或 `2` 到 `30` 之外，或十进制值 | 请求会被拒绝，系统不会创建任务。 |
| `image-to-video` 未提供 `image_urls` | 请求会被拒绝，系统不会创建任务。 |
| `image-to-video` 模式的图片超过 2 张 | 请求会被拒绝，系统不会创建任务。 |
| `reference-to-video` 未提供任何参考输入 | 请求会被拒绝，系统不会创建任务。 |
| 参考视频或音频的时长不足 1 秒或超过 15 秒 | 请求会被拒绝，系统不会创建任务。 |
| 总参考视频时长或总参考音频时长超过 15 秒 | 请求会被拒绝，系统不会创建任务。 |
| 正 `duration` 加上参考视频总时长超过 30 秒 | 请求会被拒绝，系统不会创建任务。 |

### 任务失败错误码

`failCode` 表示任务失败的原因，常见值如下。

| 错误码 | 含义 | 处理方式 |
| - | - | - |
| `SensitiveContent` | 提示或输入/输出内容被安全检查拒绝 | 更改提示或参考媒体 |
| `PromptInvalid` | 提示词无效或被拒绝 | 修改提示词后重试 |
| `ImageFormatIncorrect` | 无法处理参考图像格式 | 提供公开可访问的图片直链，并使用常见图片格式 |
| `RateLimited` | 请求频率达到上限 | 按指数退避策略重试 |
| `Timeout` | 任务超时 | 稍后重试或使用回调模式 |
| `Unknown error` | 任务因未知原因失败 | 逐步延长间隔后重试，或联系支持团队并提供 `taskId` |

完整列表见[错误码](https://apixo.ai/docs/zh/api-reference/errors.md)。

## MCP 集成

[完整模型 Schema](https://apixo.ai/docs/models/schemas/video/wan-3-0-video-pro-lora.json) 中的 `mcp.result` 指定了结果的解析方式，`mcp.attachments` 列出支持绑定文件的字段。这些元数据供客户端集成使用，无需作为生成参数提交。附件字段为 `image_urls`, `video_urls`, `audio_urls`。请保留用户指定的文件顺序。API 负责校验模型参数。

## 相关链接

* [生成 API 概览](https://apixo.ai/docs/zh/models.md)
* [Wan 3.0 Video LoRA](https://apixo.ai/docs/zh/models/video/wan-3-0-video-lora.md)


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