Skip to content

Wan 3.0 - 生成视频 ​

本页由 ModelFold 文档站根据上游官方 OpenAPI 文档同步生成。接口路径、参数、示例与官方保持一致;品牌与 API 域名已替换为 ModelFold。

接口 ​

POST /jobs/createTask

完整 URL: https://ai.modelfold.online/v1/jobs/createTask

鉴权:所有请求都需要 Authorization: Bearer <API_KEY> 请求头。

创建任务 ​

通过 wan 3.0 生成视频。标准模型使用 model=wan/3-0-video;

  • 查询任务详情 — 提交任务后,可通过统一查询接口查看任务进度并获取生成结果

TIP

生产环境建议优先使用 callBackUrl 参数接收任务完成通知,而不是持续轮询任务状态接口。

TIP

计费秒数 = 输出时长 + 参考视频总时长。duration 为 -1 时按模型实际选定的时长计费。当前价格见 ai.modelfold.online/pricing。

相关资源 ​

请求参数 ​

请求体 (application/json) ​

参数类型必填说明
modelstring是wan/3-0-video 是标准模型。用于生成视频的模型名称。必填字段。
- 此端点必须为 wan/3-0-video 可选值:wan/3-0-video。 示例:wan/3-0-video。
callBackUrlstring否任务完成通知的回调 URL。该参数为可选项。如果提供,当任务完成时,无论成功或失败,系统都会向该 URL 发送 POST 请求。如果未提供,则不会发送回调通知。
inputobject是Wan 3.0 生成视频参数。
  input.promptstring否文本提示词,支持中英文。最多 20000 字符。文生视频必填;其他模式建议与媒体一起传。参考模式用 Image1/Video1/Audio1 引用素材。 示例:月光下一只小猫在屋顶奔跑,远处霓虹闪烁,电影质感,运镜流畅。。
  input.first_frame_urlstring否首帧图 URL,最多 1 张,严格作为视频第一帧。用于首帧生视频 / 首尾帧生视频。不可与 reference_*_urls 同传。
格式:JPEG/JPG、PNG(不支持透明通道)、BMP、WEBP;单边 [240, 8000] px;长宽比 ≤ 8:1;≤ 20MB。
  input.last_frame_urlstring否尾帧图 URL,需与 first_frame_url 一起使用,格式限制同 first_frame_url。
  input.reference_image_urlsarray&lt;string&gt;否全能参考模式的参考图,最多 10 张。按数组顺序对应 prompt 中的 Image1、Image2…。规格同 first_frame_url。不可与首帧/尾帧同传。
  input.reference_video_urlsarray&lt;string&gt;否全能参考模式的参考视频,最多 5 段。单段 1–15s,合计 ≤ 15s。按数组顺序对应 Video1、Video2…。
格式:mp4、mov;单边 [240, 4096] px;长宽比 ≤ 8:1;单文件 ≤ 100MB。
输出侧还有一层:输入视频时长 + duration 合计不能超过 30 秒。
  input.reference_audio_urlsarray&lt;string&gt;否全能参考模式的参考音频,最多 5 段。单段 1–15s,合计 ≤ 15s。按数组顺序对应 Audio1、Audio2…。格式:wav、mp3;≤ 15MB。参考音频可以作为唯一的媒体输入,搭配参考图或参考视频效果通常更好。
  input.reference_file_urlsarray&lt;string&gt;否文件生视频。最多 1 个,不能与 reference_link_urls 同传,也不能与首帧/尾帧同传。
格式:docx/doc/xlsx/xls/pptx/ppt/pdf/txt/key/pages/numbers/md;≤ 100MB;pdf/docx/ppt/key/pages 等 ≤ 50 页。
  input.reference_link_urlsarray&lt;string&gt;否链接生视频。最多 1 个公开免登录网页。不能与 reference_file_urls 同传,也不能与首帧/尾帧同传。
  input.resolutionstring否输出分辨率档位。默认 1080P。 默认值:"1080P"。 可选值:480P / 720P / 1080P。 示例:1080P。
  input.aspect_ratiostring否输出宽高比。adaptive(默认)根据输入素材和意图自动选择。 默认值:"adaptive"。 可选值:adaptive / 16:9 / 4:3 / 1:1 / 3:4 / 9:16。 示例:adaptive。
  input.durationinteger否输出视频时长(秒)。默认 5。无视频输入时取 [2, 30];有参考视频时:输入视频时长 + 输出时长合计 ≤ 30。传 -1 为智能时长,由模型决定。 默认值:5。 示例:5。
  input.audioboolean否输出视频是否带音轨。默认 true。 默认值:true。 示例:true。
  input.seedinteger否随机种子,用于复现结果。不传则随机。
  input.nsfw_checkerboolean否默认 false。为 false 时不额外进行内容过滤,结果由模型直接返回。

请求示例 ​

bash
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "wan/3-0-video",
  "callBackUrl": "https://your-domain.com/api/callback",
  "input": {
    "prompt": "月光下一只小猫在屋顶奔跑,远处霓虹闪烁,电影质感,运镜流畅。",
    "first_frame_url": "https://your-domain.com/input.png",
    "last_frame_url": "https://your-domain.com/input.png",
    "reference_image_urls": [
      "https://your-domain.com/input.png"
    ],
    "reference_video_urls": [
      "https://your-domain.com/input.png"
    ],
    "reference_audio_urls": [
      "https://your-domain.com/input.png"
    ],
    "reference_file_urls": [
      "https://your-domain.com/input.png"
    ],
    "reference_link_urls": [
      "https://your-domain.com/input.png"
    ],
    "resolution": "1080P",
    "aspect_ratio": "adaptive",
    "duration": 5,
    "audio": true,
    "seed": 0,
    "nsfw_checker": false
  }
}'
json
{
  "model": "wan/3-0-video",
  "callBackUrl": "https://your-domain.com/api/callback",
  "input": {
    "prompt": "月光下一只小猫在屋顶奔跑,远处霓虹闪烁,电影质感,运镜流畅。",
    "first_frame_url": "https://your-domain.com/input.png",
    "last_frame_url": "https://your-domain.com/input.png",
    "reference_image_urls": [
      "https://your-domain.com/input.png"
    ],
    "reference_video_urls": [
      "https://your-domain.com/input.png"
    ],
    "reference_audio_urls": [
      "https://your-domain.com/input.png"
    ],
    "reference_file_urls": [
      "https://your-domain.com/input.png"
    ],
    "reference_link_urls": [
      "https://your-domain.com/input.png"
    ],
    "resolution": "1080P",
    "aspect_ratio": "adaptive",
    "duration": 5,
    "audio": true,
    "seed": 0,
    "nsfw_checker": false
  }
}

响应 ​

200 — 请求成功 ​

参数类型必填说明
codeinteger是请求状态码。请求失败时 HTTP 状态仍为 200,请始终以本字段判断:200 表示成功,其他值均表示失败,原因见 msg。常见值:401 API key 无效或缺失;402 积分不足;429 超出频率限制;422 或 500 请求未能处理(请先查看 msg、检查参数,再决定是否重试)。 可选值:200 / 401 / 402 / 404 / 422 / 429 / 433 / 455 / 500 / 501 / 505。 示例:200。
msgstring是响应消息,失败时的错误描述
dataobject是—
  data.taskIdstring是可以使用任务 ID 与“获取任务详细信息”端点一起查询任务状态。
json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_wan_1765180586443"
  }
}

回调 ​

videoTaskCompleted ​

回调地址:{request.body#/callBackUrl}(即请求体里的 callBackUrl)。

当 wan/3-0-video 任务成功或失败时,系统会发送此回调。

回调体参数

参数类型必填说明
codeinteger是统一回调状态码:成功为 200,失败为 501。 可选值:200 / 501。 示例:200。
msgstring是统一回调消息。 可选值:Playground task completed successfully. / Playground task failed.。 示例:Playground task completed successfully.。
dataobject是—
  data.taskIdstring是任务唯一标识符。
  data.modelstring是任务使用的模型。 可选值:wan/3-0-video。 示例:wan/3-0-video。
  data.statestring是任务最终状态。 可选值:success / fail。 示例:success。
  data.paramstring是包含已提交任务参数的 JSON 字符串。
  data.resultJsonstring否任务成功时,包含 resultUrls 的 JSON 字符串。仅在 state 为 success 时出现。
  data.failCodestring否失败码,数字字符串,如 "400"、"500"。仅在 state 为 fail 时出现。
  data.failMsgstring否失败原因,仅在 state 为 fail 时出现。
  data.costTimeinteger否处理耗时(秒),成功和失败回调都会返回。
  data.completeTimeinteger否任务完成时间戳。
  data.createTimeinteger否任务创建时间戳。
  data.updateTimeinteger否完成时间请以 completeTime 为准;updateTime 可能与 createTime 相同。
  data.creditsConsumednumber否本任务消耗的积分;失败任务为 0。

任务成功完成

json
{
  "code": 200,
  "msg": "Playground task completed successfully.",
  "data": {
    "taskId": "bd8f4b1a52048d0f17a38b49591abfa1",
    "model": "wan/3-0-video",
    "state": "success",
    "param": "{\"input\":\"{\\\"duration\\\":5,\\\"aspect_ratio\\\":\\\"adaptive\\\",\\\"audio\\\":true,\\\"prompt\\\":\\\"月光下一只小猫在屋顶奔跑,远处霓虹闪烁,电影质感,运镜流畅。\\\",\\\"resolution\\\":\\\"480P\\\",\\\"nsfw_checker\\\":false}\",\"callBackUrl\":\"https://webhook.uutool.cn/09df5d64-a00b-4ecf-823f-b992378a1cf3\",\"model\":\"wan/3-0-video\"}",
    "resultJson": "{\"resultUrls\":[\"https://tempfile.aiquickdraw.com/wan30-video-alibaba/1787567408129-b1fmz5um3co.mp4\"]}",
    "costTime": 89,
    "completeTime": 1787567409000,
    "createTime": 1787567320000,
    "updateTime": 1787567409000,
    "creditsConsumed": 40
  }
}

任务失败

json
{
  "code": 501,
  "msg": "Playground task failed.",
  "data": {
    "taskId": "bd8f4b1a52048d0f17a38b49591abfa1",
    "model": "wan/3-0-video",
    "state": "fail",
    "param": "{\"input\":\"{\\\"duration\\\":5,\\\"aspect_ratio\\\":\\\"adaptive\\\",\\\"audio\\\":true,\\\"prompt\\\":\\\"月光下一只小猫在屋顶奔跑,远处霓虹闪烁,电影质感,运镜流畅。\\\",\\\"resolution\\\":\\\"480P\\\",\\\"nsfw_checker\\\":false}\",\"callBackUrl\":\"https://webhook.uutool.cn/09df5d64-a00b-4ecf-823f-b992378a1cf3\",\"model\":\"wan/3-0-video\"}",
    "failCode": "400",
    "failMsg": "<error detail>",
    "costTime": 89,
    "creditsConsumed": 0
  }
}

ModelFold — 一个 API,接入所有主流 AI 模型。