API 协议

Wan 3.0:参数、场景与调用指南

预览指南

粘贴给 AI,帮助理解文档并完成接入。 仅包含文档与示例,不包含真实密钥。

预览指南

Wan 3.0:参数、场景与调用指南

直接答案input_reference 仅表示首帧图片;视频用 reference_videos,音频用 reference_audio,均为 URL 数组。

更新 · 审核信息

模型定位与适用场景

适合产品展示、人物动作参考、图生视频、有声短片和资料转视频。按素材用途选择首尾帧或多模态参考模式。

本指南核对本站请求契约,不代表所有场景均已完成收费出片验收。使用模型广场显示的精确模型、分组和有效端点;示例中的 example.com 素材与占位任务 ID 必须替换。先以最小请求确认可用,再逐项添加参考素材和高级参数。价格以模型广场及实际账单为准。

型号与入口

wan3.0-video

POST /v1/videos

参考素材格式

素材字段传输格式文件准备与限制
图片 / 首尾帧input_reference / first_frame / last_frame / reference_images[]HTTP(S) 图片直链,或完整 data:image/<格式>;base64,...;不传裸 Base64。PNG/JPEG/WebP/BMP;内联图片解码后最多 20 MiB。参考图最多 10 张,首尾帧与多模态参考互斥。
参考 / 编辑视频reference_videos[]HTTP(S) 视频直链数组;不支持裸 Base64、视频 data URI 或本地路径。推荐 MP4(H.264);最多 5 段、合计最多 15 秒。不要放进 input_reference。
参考音频reference_audio[]HTTP(S) 音频直链数组;不是 voice_id,不传裸 Base64 或音频 data URI。推荐 WAV/MP3;最多 5 段、合计最多 15 秒。链接须能被生成服务直接读取;此前 WAV 示例下载失败,尚未验收音频参考。
文件 / 网页file / link公开 HTTP(S) URL;不接受本地文件路径。二选一,开启 prompt_extend;不会自动上传你的电脑文件。

参数与组合限制

  • input_reference 仅表示首帧图片;视频用 reference_videos,音频用 reference_audio,均为 URL 数组。
  • 首尾帧模式不能混用 reference_images/reference_videos/reference_audio/file/link;last_frame 必须同时提供 first_frame。
  • 参考图片最多 10 张;参考视频、音频各最多 5 段且各自总长不超过 15 秒。输入视频和生成视频合计需在 30 秒内。
  • 提示词用“图片1 / 视频1 / 音频1”引用对应类型的顺序。file/link 二选一,需公开可读并开启 prompt_extend。
  • 兼容 seconds 和 size;推荐显式 duration/resolution/ratio,避免与兼容字段重复。参考音频不需要创建 voice_id。
  • 2026-11-15 主站实测:2 秒首尾帧及 reference_videos 已出片并下载解码;reference_audio 的公网 WAV 示例失败于素材下载,尚未验收音频参考。调用端能下载不代表生成服务也能读取。
字段类型用法与限制
Authorizationheader string必填。使用 Bearer <本站 API Key>;JSON 请求使用 Content-Type: application/json。官方鉴权及区域域名由本站渠道处理。
modelstring必填,wan3.0-video;不能仅因官方文档列出 prime 就认为本站已开放。
promptstring对应官方 input.prompt。与素材至少填写一项;官方上限 20000 字符。参考素材按类型分别编号:图1、视频1、音频1。
first_framestring首帧图片,对应 input.media 中 type=first_frame 的 url;最多 1 张。
last_framestring尾帧图片,对应 type=last_frame;最多 1 张,必须同时有首帧,不能混入其他参考素材。
reference_imagesstring[]对应 type=reference_image;最多 10 张;图片 JPEG/JPG/PNG/WEBP/BMP,单张 ≤20 MB。图片支持公网 URL 或带 MIME 的 data URI。
reference_videosstring[]对应 type=reference_video;最多 5 段,单段 1–15 秒、合计 ≤15 秒,单文件 ≤100 MB。视频使用可读取的媒体地址。
reference_audiostring[]对应 type=reference_audio;最多 5 段,单段 1–15 秒、合计 ≤15 秒,单文件 ≤15 MB;已知素材下载失败限制见上方说明。
filestring对应 type=file;最多一个公开文件地址,与 link 互斥,prompt_extend 必须为 true。
linkstring对应 type=link;最多一个无需登录的网页,与 file 互斥,prompt_extend 必须为 true。
durationinteger对应 parameters.duration;可选,默认 5;2–30 秒或 -1 智能时长。有视频输入时,输入和输出视频合计 ≤30 秒。
resolutionstring对应 parameters.resolution;480P/720P/1080P。官方默认 1080P;本站不同接入路径可能设置默认值,建议显式填写。
ratiostring对应 parameters.ratio;adaptive/21:9/16:9/4:3/1:1/3:4/9:16。官方默认 adaptive;首尾帧与编辑推荐 adaptive。
audioboolean对应 parameters.audio;可选,默认 true;false 输出无音轨,不改变官方声音开关对应的价格。
watermarkboolean对应 parameters.watermark;可选,默认 false。显式 false 保留。
prompt_extendboolean对应 parameters.prompt_extend;可选,默认 true;智能改写可能增加耗时;file/link 必须启用。
seedinteger对应 parameters.seed;可选,-1 或 0–2147483647;默认随机。相同种子不保证完全一致。
input_reference / seconds / sizesite aliases本站兼容字段,分别表示首帧、时长和像素尺寸;推荐使用上述规范字段,不重复传同一设置。
input / input.media[].type / input.media[].urlofficial object官方嵌套结构。本站平铺素材映射见上表;原生 Wan 路径支持 model+input+parameters,但其他路径不能据此推断兼容,请优先使用本站平铺示例。
X-DashScope-Asyncofficial header官方异步创建要求 enable;本站适配器负责上游请求头,用户按本站统一视频入口提交。

场景与代码示例

文生视频与声音

适用型号:wan3.0-video

POST /v1/videos

{
  "model": "wan3.0-video",
  "prompt": "雨后街道,镜头缓慢推进,雨滴声清晰。",
  "duration": 8,
  "resolution": "720P",
  "ratio": "16:9",
  "audio": true,
  "watermark": false
}

curl

curl --fail-with-body --silent --show-error --connect-timeout 10 --max-time 120 --request POST 'https://api.tu-zi.com/v1/videos' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "wan3.0-video",
  "prompt": "雨后街道,镜头缓慢推进,雨滴声清晰。",
  "duration": 8,
  "resolution": "720P",
  "ratio": "16:9",
  "audio": true,
  "watermark": false
}'

python

import json
import os
import requests

url = "https://api.tu-zi.com/v1/videos"
headers = json.loads("{\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"}")
for name in ["API_KEY"]:
    if not os.environ.get(name, "").strip():
        raise RuntimeError("Set environment variable: " + name)
headers["Authorization"] = "Bearer " + os.environ["API_KEY"]
payload = json.loads("{\"model\":\"wan3.0-video\",\"prompt\":\"雨后街道,镜头缓慢推进,雨滴声清晰。\",\"duration\":8,\"resolution\":\"720P\",\"ratio\":\"16:9\",\"audio\":true,\"watermark\":false}")
response = requests.request("POST", url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
result = response.json()
if isinstance(result, dict) and (result.get("success") is False or result.get("code") is False or result.get("error")):
    raise RuntimeError(json.dumps(result, ensure_ascii=False))
print(json.dumps(result, ensure_ascii=False, indent=2))

javascript

// Node.js 20+
const url = "https://api.tu-zi.com/v1/videos";
const headers = {
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
};
for (const name of ["API_KEY"]) {
  if (!process.env[name]?.trim()) throw new Error("Set environment variable: " + name);
}
headers.Authorization = 'Bearer ' + process.env.API_KEY;
const response = await fetch(url, { method: "POST", headers, body: JSON.stringify({
  "model": "wan3.0-video",
  "prompt": "雨后街道,镜头缓慢推进,雨滴声清晰。",
  "duration": 8,
  "resolution": "720P",
  "ratio": "16:9",
  "audio": true,
  "watermark": false
}), signal: AbortSignal.timeout(120000) });
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
if (result?.success === false || result?.code === false || result?.error) throw new Error(JSON.stringify(result));
console.log(JSON.stringify(result, null, 2));

首尾帧过渡

适用型号:wan3.0-video

POST /v1/videos

{
  "model": "wan3.0-video",
  "prompt": "镜头从近景逐渐拉远,自然过渡到尾帧。",
  "first_frame": "https://example.com/subject.png",
  "last_frame": "https://example.com/end.png",
  "duration": 6,
  "resolution": "720P"
}

curl

curl --fail-with-body --silent --show-error --connect-timeout 10 --max-time 120 --request POST 'https://api.tu-zi.com/v1/videos' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "wan3.0-video",
  "prompt": "镜头从近景逐渐拉远,自然过渡到尾帧。",
  "first_frame": "https://example.com/subject.png",
  "last_frame": "https://example.com/end.png",
  "duration": 6,
  "resolution": "720P"
}'

python

import json
import os
import requests

url = "https://api.tu-zi.com/v1/videos"
headers = json.loads("{\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"}")
for name in ["API_KEY"]:
    if not os.environ.get(name, "").strip():
        raise RuntimeError("Set environment variable: " + name)
headers["Authorization"] = "Bearer " + os.environ["API_KEY"]
payload = json.loads("{\"model\":\"wan3.0-video\",\"prompt\":\"镜头从近景逐渐拉远,自然过渡到尾帧。\",\"first_frame\":\"https://example.com/subject.png\",\"last_frame\":\"https://example.com/end.png\",\"duration\":6,\"resolution\":\"720P\"}")
response = requests.request("POST", url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
result = response.json()
if isinstance(result, dict) and (result.get("success") is False or result.get("code") is False or result.get("error")):
    raise RuntimeError(json.dumps(result, ensure_ascii=False))
print(json.dumps(result, ensure_ascii=False, indent=2))

javascript

// Node.js 20+
const url = "https://api.tu-zi.com/v1/videos";
const headers = {
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
};
for (const name of ["API_KEY"]) {
  if (!process.env[name]?.trim()) throw new Error("Set environment variable: " + name);
}
headers.Authorization = 'Bearer ' + process.env.API_KEY;
const response = await fetch(url, { method: "POST", headers, body: JSON.stringify({
  "model": "wan3.0-video",
  "prompt": "镜头从近景逐渐拉远,自然过渡到尾帧。",
  "first_frame": "https://example.com/subject.png",
  "last_frame": "https://example.com/end.png",
  "duration": 6,
  "resolution": "720P"
}), signal: AbortSignal.timeout(120000) });
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
if (result?.success === false || result?.code === false || result?.error) throw new Error(JSON.stringify(result));
console.log(JSON.stringify(result, null, 2));

人物图片与动作参考

适用型号:wan3.0-video

POST /v1/videos

{
  "model": "wan3.0-video",
  "prompt": "图片1中的人物模仿视频1中的动作。",
  "reference_images": [
    "https://example.com/subject.png"
  ],
  "reference_videos": [
    "https://example.com/action.mp4"
  ],
  "duration": 8,
  "resolution": "720P"
}

curl

curl --fail-with-body --silent --show-error --connect-timeout 10 --max-time 120 --request POST 'https://api.tu-zi.com/v1/videos' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "wan3.0-video",
  "prompt": "图片1中的人物模仿视频1中的动作。",
  "reference_images": [
    "https://example.com/subject.png"
  ],
  "reference_videos": [
    "https://example.com/action.mp4"
  ],
  "duration": 8,
  "resolution": "720P"
}'

python

import json
import os
import requests

url = "https://api.tu-zi.com/v1/videos"
headers = json.loads("{\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"}")
for name in ["API_KEY"]:
    if not os.environ.get(name, "").strip():
        raise RuntimeError("Set environment variable: " + name)
headers["Authorization"] = "Bearer " + os.environ["API_KEY"]
payload = json.loads("{\"model\":\"wan3.0-video\",\"prompt\":\"图片1中的人物模仿视频1中的动作。\",\"reference_images\":[\"https://example.com/subject.png\"],\"reference_videos\":[\"https://example.com/action.mp4\"],\"duration\":8,\"resolution\":\"720P\"}")
response = requests.request("POST", url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
result = response.json()
if isinstance(result, dict) and (result.get("success") is False or result.get("code") is False or result.get("error")):
    raise RuntimeError(json.dumps(result, ensure_ascii=False))
print(json.dumps(result, ensure_ascii=False, indent=2))

javascript

// Node.js 20+
const url = "https://api.tu-zi.com/v1/videos";
const headers = {
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
};
for (const name of ["API_KEY"]) {
  if (!process.env[name]?.trim()) throw new Error("Set environment variable: " + name);
}
headers.Authorization = 'Bearer ' + process.env.API_KEY;
const response = await fetch(url, { method: "POST", headers, body: JSON.stringify({
  "model": "wan3.0-video",
  "prompt": "图片1中的人物模仿视频1中的动作。",
  "reference_images": [
    "https://example.com/subject.png"
  ],
  "reference_videos": [
    "https://example.com/action.mp4"
  ],
  "duration": 8,
  "resolution": "720P"
}), signal: AbortSignal.timeout(120000) });
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
if (result?.success === false || result?.code === false || result?.error) throw new Error(JSON.stringify(result));
console.log(JSON.stringify(result, null, 2));

人物与参考音频

适用型号:wan3.0-video

POST /v1/videos

字段已核对;2026-11-15 主站音频参考实测失败于素材下载,未通过出片验收。先确认音频直链可被生成服务读取,勿自动重试创建。

{
  "model": "wan3.0-video",
  "prompt": "图片1中的人物用音频1的声音说话。",
  "reference_images": [
    "https://example.com/subject.png"
  ],
  "reference_audio": [
    "https://example.com/voice.wav"
  ],
  "audio": true,
  "duration": 8,
  "resolution": "720P"
}

参考视频局部编辑

适用型号:wan3.0-video

POST /v1/videos

{
  "model": "wan3.0-video",
  "prompt": "保持视频1的动作和镜头,把背景改为雪山。",
  "reference_videos": [
    "https://example.com/action.mp4"
  ],
  "duration": 8,
  "resolution": "720P",
  "prompt_extend": true
}

curl

curl --fail-with-body --silent --show-error --connect-timeout 10 --max-time 120 --request POST 'https://api.tu-zi.com/v1/videos' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "wan3.0-video",
  "prompt": "保持视频1的动作和镜头,把背景改为雪山。",
  "reference_videos": [
    "https://example.com/action.mp4"
  ],
  "duration": 8,
  "resolution": "720P",
  "prompt_extend": true
}'

python

import json
import os
import requests

url = "https://api.tu-zi.com/v1/videos"
headers = json.loads("{\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"}")
for name in ["API_KEY"]:
    if not os.environ.get(name, "").strip():
        raise RuntimeError("Set environment variable: " + name)
headers["Authorization"] = "Bearer " + os.environ["API_KEY"]
payload = json.loads("{\"model\":\"wan3.0-video\",\"prompt\":\"保持视频1的动作和镜头,把背景改为雪山。\",\"reference_videos\":[\"https://example.com/action.mp4\"],\"duration\":8,\"resolution\":\"720P\",\"prompt_extend\":true}")
response = requests.request("POST", url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
result = response.json()
if isinstance(result, dict) and (result.get("success") is False or result.get("code") is False or result.get("error")):
    raise RuntimeError(json.dumps(result, ensure_ascii=False))
print(json.dumps(result, ensure_ascii=False, indent=2))

javascript

// Node.js 20+
const url = "https://api.tu-zi.com/v1/videos";
const headers = {
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
};
for (const name of ["API_KEY"]) {
  if (!process.env[name]?.trim()) throw new Error("Set environment variable: " + name);
}
headers.Authorization = 'Bearer ' + process.env.API_KEY;
const response = await fetch(url, { method: "POST", headers, body: JSON.stringify({
  "model": "wan3.0-video",
  "prompt": "保持视频1的动作和镜头,把背景改为雪山。",
  "reference_videos": [
    "https://example.com/action.mp4"
  ],
  "duration": 8,
  "resolution": "720P",
  "prompt_extend": true
}), signal: AbortSignal.timeout(120000) });
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
if (result?.success === false || result?.code === false || result?.error) throw new Error(JSON.stringify(result));
console.log(JSON.stringify(result, null, 2));

文档内容转视频

适用型号:wan3.0-video

POST /v1/videos

{
  "model": "wan3.0-video",
  "prompt": "根据文件内容制作产品讲解视频。",
  "file": "https://example.com/brief.pdf",
  "prompt_extend": true,
  "duration": 10,
  "resolution": "720P"
}

curl

curl --fail-with-body --silent --show-error --connect-timeout 10 --max-time 120 --request POST 'https://api.tu-zi.com/v1/videos' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "wan3.0-video",
  "prompt": "根据文件内容制作产品讲解视频。",
  "file": "https://example.com/brief.pdf",
  "prompt_extend": true,
  "duration": 10,
  "resolution": "720P"
}'

python

import json
import os
import requests

url = "https://api.tu-zi.com/v1/videos"
headers = json.loads("{\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"}")
for name in ["API_KEY"]:
    if not os.environ.get(name, "").strip():
        raise RuntimeError("Set environment variable: " + name)
headers["Authorization"] = "Bearer " + os.environ["API_KEY"]
payload = json.loads("{\"model\":\"wan3.0-video\",\"prompt\":\"根据文件内容制作产品讲解视频。\",\"file\":\"https://example.com/brief.pdf\",\"prompt_extend\":true,\"duration\":10,\"resolution\":\"720P\"}")
response = requests.request("POST", url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
result = response.json()
if isinstance(result, dict) and (result.get("success") is False or result.get("code") is False or result.get("error")):
    raise RuntimeError(json.dumps(result, ensure_ascii=False))
print(json.dumps(result, ensure_ascii=False, indent=2))

javascript

// Node.js 20+
const url = "https://api.tu-zi.com/v1/videos";
const headers = {
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
};
for (const name of ["API_KEY"]) {
  if (!process.env[name]?.trim()) throw new Error("Set environment variable: " + name);
}
headers.Authorization = 'Bearer ' + process.env.API_KEY;
const response = await fetch(url, { method: "POST", headers, body: JSON.stringify({
  "model": "wan3.0-video",
  "prompt": "根据文件内容制作产品讲解视频。",
  "file": "https://example.com/brief.pdf",
  "prompt_extend": true,
  "duration": 10,
  "resolution": "720P"
}), signal: AbortSignal.timeout(120000) });
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
if (result?.success === false || result?.code === false || result?.error) throw new Error(JSON.stringify(result));
console.log(JSON.stringify(result, null, 2));

网页内容转竖屏视频

适用型号:wan3.0-video

POST /v1/videos

{
  "model": "wan3.0-video",
  "prompt": "根据网页内容制作竖屏产品介绍。",
  "link": "https://example.com/product",
  "prompt_extend": true,
  "ratio": "9:16",
  "resolution": "720P",
  "duration": 8
}

curl

curl --fail-with-body --silent --show-error --connect-timeout 10 --max-time 120 --request POST 'https://api.tu-zi.com/v1/videos' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "wan3.0-video",
  "prompt": "根据网页内容制作竖屏产品介绍。",
  "link": "https://example.com/product",
  "prompt_extend": true,
  "ratio": "9:16",
  "resolution": "720P",
  "duration": 8
}'

python

import json
import os
import requests

url = "https://api.tu-zi.com/v1/videos"
headers = json.loads("{\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"}")
for name in ["API_KEY"]:
    if not os.environ.get(name, "").strip():
        raise RuntimeError("Set environment variable: " + name)
headers["Authorization"] = "Bearer " + os.environ["API_KEY"]
payload = json.loads("{\"model\":\"wan3.0-video\",\"prompt\":\"根据网页内容制作竖屏产品介绍。\",\"link\":\"https://example.com/product\",\"prompt_extend\":true,\"ratio\":\"9:16\",\"resolution\":\"720P\",\"duration\":8}")
response = requests.request("POST", url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
result = response.json()
if isinstance(result, dict) and (result.get("success") is False or result.get("code") is False or result.get("error")):
    raise RuntimeError(json.dumps(result, ensure_ascii=False))
print(json.dumps(result, ensure_ascii=False, indent=2))

javascript

// Node.js 20+
const url = "https://api.tu-zi.com/v1/videos";
const headers = {
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
};
for (const name of ["API_KEY"]) {
  if (!process.env[name]?.trim()) throw new Error("Set environment variable: " + name);
}
headers.Authorization = 'Bearer ' + process.env.API_KEY;
const response = await fetch(url, { method: "POST", headers, body: JSON.stringify({
  "model": "wan3.0-video",
  "prompt": "根据网页内容制作竖屏产品介绍。",
  "link": "https://example.com/product",
  "prompt_extend": true,
  "ratio": "9:16",
  "resolution": "720P",
  "duration": 8
}), signal: AbortSignal.timeout(120000) });
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
if (result?.success === false || result?.code === false || result?.error) throw new Error(JSON.stringify(result));
console.log(JSON.stringify(result, null, 2));

固定随机种子与静音

适用型号:wan3.0-video

POST /v1/videos

{
  "model": "wan3.0-video",
  "prompt": "同一机位拍摄一只白兔走过草地。",
  "duration": 5,
  "resolution": "480P",
  "ratio": "16:9",
  "seed": 0,
  "audio": false,
  "watermark": false
}

curl

curl --fail-with-body --silent --show-error --connect-timeout 10 --max-time 120 --request POST 'https://api.tu-zi.com/v1/videos' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "wan3.0-video",
  "prompt": "同一机位拍摄一只白兔走过草地。",
  "duration": 5,
  "resolution": "480P",
  "ratio": "16:9",
  "seed": 0,
  "audio": false,
  "watermark": false
}'

python

import json
import os
import requests

url = "https://api.tu-zi.com/v1/videos"
headers = json.loads("{\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"}")
for name in ["API_KEY"]:
    if not os.environ.get(name, "").strip():
        raise RuntimeError("Set environment variable: " + name)
headers["Authorization"] = "Bearer " + os.environ["API_KEY"]
payload = json.loads("{\"model\":\"wan3.0-video\",\"prompt\":\"同一机位拍摄一只白兔走过草地。\",\"duration\":5,\"resolution\":\"480P\",\"ratio\":\"16:9\",\"seed\":0,\"audio\":false,\"watermark\":false}")
response = requests.request("POST", url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
result = response.json()
if isinstance(result, dict) and (result.get("success") is False or result.get("code") is False or result.get("error")):
    raise RuntimeError(json.dumps(result, ensure_ascii=False))
print(json.dumps(result, ensure_ascii=False, indent=2))

javascript

// Node.js 20+
const url = "https://api.tu-zi.com/v1/videos";
const headers = {
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
};
for (const name of ["API_KEY"]) {
  if (!process.env[name]?.trim()) throw new Error("Set environment variable: " + name);
}
headers.Authorization = 'Bearer ' + process.env.API_KEY;
const response = await fetch(url, { method: "POST", headers, body: JSON.stringify({
  "model": "wan3.0-video",
  "prompt": "同一机位拍摄一只白兔走过草地。",
  "duration": 5,
  "resolution": "480P",
  "ratio": "16:9",
  "seed": 0,
  "audio": false,
  "watermark": false
}), signal: AbortSignal.timeout(120000) });
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
if (result?.success === false || result?.code === false || result?.error) throw new Error(JSON.stringify(result));
console.log(JSON.stringify(result, null, 2));

任务结果与下载

保存提交返回的 id 或 task_id。统一视频查询使用 GET /v1/videos/{task_id},等待 queued / in_progress 到 completed 或 failed;完成后读取 video_url(部分响应同时在 metadata.url 提供)。本站相对路径需与调用域名拼接,/content 入口使用本站 Key;外部下载 URL 不携带本站 Key。结果可能过期,请及时下载。网络超时保留任务 ID 继续 GET,不自动重试创建 POST。

统一视频完整 Python / JavaScript 轮询下载示例

常见问题定位

现象检查方式
Error validating image / 图片 URI 错误视频或任务 ID 是否误填到了图片字段;检查媒体 URL 是否返回真实素材
unsupported content type / 字段不支持检查系列、版本和 content/contents/input 的准确类型;不要把音频 URL 填入 voice_id
400 参数冲突检查 prompt 与 input、首尾帧与多参考、秒数与 response_format 的互斥项
HTTP 成功但任务 failed记录本站任务 ID、时间、模型、域名和已脱敏参数;按任务错误定位,不能依据提交 200 宣称成功
404 或不可访问任务确认域名、Key 权限、本站任务类型;不要使用其他站点或官方任务 ID
本地文件无法访问使用系列明确支持的上传方式,或提供可读取的 HTTPS 媒体 URL

资料与适用范围

Wan 3.0 API

适用场景

  • 选择视频模型和素材协议
  • 排查参数与任务失败

API 协议

  • /v1/videos

常见问题

拿到 task_id 就代表生成成功吗?

不代表。保存本站任务 ID,查询到成功终态并确认结果可读取后才算完成;failed 要查看错误,不要自动重建任务。

本地图片、视频和 WAV 能直接填写路径吗?

不能。URL 字段需要服务可读取的媒体地址;localhost、电脑路径及需要浏览器登录的链接不可用。Kling 本地 PCM WAV 的 multipart 音色上传需本站先启用该接口(2026-11-15 两站实测均为 404);其他素材按该系列上传或素材流程处理。

能把不同模型的参数和任务 ID 互换吗?

不能假定兼容。核对精确型号、入口、大小写、媒体角色及互斥字段。编辑、草稿和音色都要求对应类型、本人可访问的成功任务;官方能力也不等于本站已验收。

官方来源

  1. Wan 3.0 API 官方