Wan3.0 Video
wan3.0-video
试用 wan3.0-video
输入
输出
video价格
wan3.0-video 每秒
| 规格 | 单价 |
|---|---|
| 480P | $0.040 |
| 720P | $0.080 |
| 1080P | $0.160 |
模型介绍撰写中
该模型的详细指南正在准备中。下方的价格、参数与 API 文档已可查阅。
提交生成任务
https://api.hiapi.ai/v1/tasks 请求头
Authorizationstring必填账号 API Key,所有请求必填。示例:Bearer YOUR_HIAPI_API_KEY。获取 API Key
Content-Typestring可选请求体固定按 JSON 解析;如携带,仅接受 application/json(可带 charset),其他取值返回 415。示例:application/json。
Idempotency-Keystring可选幂等键,最长 255 字节。同账户同键的重试只创建一次任务,重放返回首次 taskId。
网络超时或客户端自动重试时,同键只创建一次任务、不会重复扣费(幂等范围 = API Key 所属账户)。建议用业务侧唯一标识做键(如 "order-42");同键重放返回首次 taskId,键在首次提交 24 小时后过期。详细的场景矩阵见统一异步接口介绍页。
请求体
modelstring必填当前固定值:wan3.0-video
routestring可选当前固定值:default
inputobject必填
wan3.0-video 和线路 default 的业务参数对象,见下方参数表。
seedinteger可选min 0max 2147483647Use a fixed seed when reproducible output is needed.
audioboolean可选默认值: trueInclude a synchronized audio track in the output video.
promptstring必填minLength 1maxLength 20000Describe the scene, motion, camera, lighting, and sound. In reference mode, refer to assets in array order as Image1, Video1, or Audio1.
durationinteger可选默认值: 5min 2max 30Output duration in seconds. Reference video duration plus output duration must not exceed 30 seconds.
resolutionstring可选默认值: "1080P"Output resolution.
480P720P1080Paspect_ratiostring可选默认值: "adaptive"adaptive follows the input media and prompt.
adaptive16:94:31:13:49:16last_frame_urlstring可选One publicly reachable image used as the last frame together with first_frame_url.
first_frame_urlstring可选One publicly reachable image used as the first frame. Do not combine with reference media arrays.
reference_file_urlsarray可选maxItems 1At most one publicly reachable document or presentation.
Array [ string ]
reference_link_urlsarray可选maxItems 1At most one publicly reachable webpage that does not require login.
Array [ string ]
reference_audio_urlsarray可选maxItems 5Up to 5 WAV or MP3 clips, each 1-15 seconds. Pair audio with an image or video.
Array [ string ]
reference_image_urlsarray可选maxItems 10Up to 10 images for all-purpose reference generation.
Array [ string ]
reference_video_urlsarray可选maxItems 5Up to 5 reference videos. Each clip is 1-15 seconds and the combined duration is at most 15 seconds.
Array [ string ]
callbackobject可选
终态通知配置;为空则不回调,由调用方自行查询。详见下方回调说明。
创建任务时提供 callback.url,任务终态时 HiAPI 主动 POST 通知你的服务,可免去轮询。回调请求体与任务详情数据结构同构;签名校验、投递重试与幂等说明见统一异步接口介绍页的回调说明。
urlstring必填callback 存在时必填;任务终态后向该 URL 发起 POST,须为合法 http(s) URL。
whenstring可选默认值: "final"当前仅支持 final,即 success / fail 均回调。
finalstoragestring可选默认值: "temp"产物存储档位:temp(默认,保留约 7 天)或 persistent(长期保存,按大小计费)。余额不足或超出存储上限会静默降级为 temp;实际生效档位见任务详情响应。
temppersistent请求示例
# 提交异步任务,成功立即返回 taskId(不等待生成完成)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {
"audio": true,
"prompt": "…",
"duration": 5,
"resolution": "1080P",
"aspect_ratio": "adaptive"
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "wan3.0-video",
input: {
"audio": true,
"prompt": "…",
"duration": 5,
"resolution": "1080P",
"aspect_ratio": "adaptive"
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "wan3.0-video",
"input": {
"audio": true,
"prompt": "…",
"duration": 5,
"resolution": "1080P",
"aspect_ratio": "adaptive"
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} 获取任务详情
https://api.hiapi.ai/v1/tasks/:id 响应字段
taskIdstring必填任务 ID,前缀固定 tk-hiapi-。
modelstring必填解析后的模型全名。用 route 参数提交的任务返回 base@线路(如 gpt-image-2/text-to-image@ext);否则与创建时传入的模型名一致。
routestring可选仅当任务用显式 route 参数提交时出现,回显提交时的原值。
statusstring必填任务状态。
queued 已入队,尚未开始。
handling 处理中。
archiving 处理完成,产物准备中。
success 终态:完成,产物可用(返回 output)。
fail 终态:失败(返回 error)。
提交后按 status 判断:success 或 fail 为终态,其余为非终态,建议按 1~3 秒间隔轮询直至终态。成功终态后从 output[].url 下载产物,并在 expireAt 前完成下载或转存;需要长期保留时在创建任务时使用 storage: "persistent"。
creatednumber必填任务创建时间(Unix 秒)。
completednumber必填进入终态的 Unix 秒;非终态固定为 0。
outputarray可选
仅 status == success 时出现。产物列表,始终为数组,同一任务可能同时返回多个 type(如 video + first_frame)。
Array [ object ]
数组元素
urlstring必填资源 URL,可直接下载。
typestring必填当前可能值:video、image、audio、first_frame、last_frame、thumbnail,后续可能会扩展。
expireAtnumber必填资源可访问截止时间(Unix 秒);过期前请完成下载或转存。
errorobject可选
仅 status == fail 时出现。
codestring必填业务错误码。
messagestring必填错误描述。
响应示例
成功
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} 处理中(非终态)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} 失败
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
}