万相 3.0(Wan3.0)
万相 3.0(Wan3.0)是全能参考视频生成模型(All-in-One),统一支持文生视频、图生视频(首帧/首尾帧)和参考生视频等用法,最长可生成 30 秒视频,输出帧率 30fps。视频生成耗时较长(通常 1–5 分钟),采用异步任务式调用:创建任务获取
task_id,再轮询查询任务状态与结果。task_id有效期为 24 小时,请勿重复创建任务,轮询获取即可。
接口地址
http
POST /v1/videos认证
| 方式 | 说明 |
|---|---|
| Bearer Token | 在请求头中携带 Authorization: Bearer <API_key> 用于验证账户信息。 |
请求头
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
Content-Type | string | 是 | 请求体的媒介类型,请设置为 application/json |
Authorization | string | 是 | Bearer API_key,用于验证账户信息 |
请求体
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
model | string | 是 | - | 模型名称,可用值见「支持模型列表」 |
input.prompt | string | 是 | - | 文本提示词,必填;传入媒体素材时可用 图1、视频1、音频1 指代 media 中对应顺序的素材 |
input.media | object[] | 否 | - | 媒体素材数组(选填),用于图生视频(首帧/首尾帧)、参考生视频、视频编辑等 |
parameters.resolution | string | 否 | 1080P | 分辨率档位:1080P / 720P / 480P |
parameters.ratio | string | 否 | adaptive | 宽高比:adaptive / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 |
parameters.duration | integer | 否 | 5 | 视频时长(秒)。无视频输入时取值 [2, 30];有视频输入时输入+输出总时长不超过 30;传 -1 为智能时长 |
parameters.audio | boolean | 否 | true | 输出视频是否包含音轨;开关声音价格相同 |
parameters.seed | integer | 否 | -1 | 随机种子:-1 或 [0, 2147483647] |
parameters.prompt_extend | boolean | 否 | true | 是否开启 prompt 智能改写,对较短 prompt 提升明显但增加耗时 |
parameters.watermark | boolean | 否 | false | 是否添加水印标识 |
prompt 说明
- 支持中英文,每个汉字/字母占一个字符,不超过 20000 个字符,超过部分自动截断。
- 全能参考模式下,prompt 中可用
图1、视频1、音频1指代media数组中按顺序对应的素材(图、视频、音频分别计数)。
input.media 详细参数
media 元素
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
type | string | 是 | 素材类型,枚举见下表 |
url | string | 是 | 素材 URL(公网 URL / OSS 临时 URL / Base64 编码),格式各不相同,见下述限制 |
type 枚举
| 取值 | 说明 |
|---|---|
first_frame | 首帧图像,最多 1 张,严格作为视频第一帧 |
last_frame | 尾帧图像,最多 1 张,严格作为视频最后一帧 |
reference_image | 参考图像,最多 10 张 |
reference_video | 参考视频,最多 5 段,总时长不大于 15 秒 |
reference_audio | 参考音频,最多 5 段,总时长不大于 15 秒 |
file | 文件,最多 1 个,不可与 link 同时传入 |
link | 网页链接,最多 1 个,不可与 file 同时传入 |
素材组合规则
first_frame/last_frame与reference_image/reference_video/reference_audio/file/link互斥,不能在同一请求中混用。file与link二选一,但均可与reference_image/reference_video/reference_audio组合。reference_image/reference_video/reference_audio之间可自由组合。- 视频编辑:必须包含
reference_video,prompt 含编辑意图。 - 视频延长:必须包含
reference_video,prompt 含延长意图,且ratio需设为adaptive。
url 素材限制
| 类型 | 限制 |
|---|---|
图像(first_frame / last_frame / reference_image) | 格式:JPEG / JPG / PNG(不支持透明通道)/ BMP / WEBP;单边 [240, 8000] 像素;长宽比不超过 8:1;大小不超过 20MB |
视频(reference_video) | 格式:mp4 / mov;单个 [1, 15] 秒,总时长不大于 15 秒;帧率 ≥16fps;单边 [240, 4096] 像素;长宽比不超过 8:1;大小不超过 100MB |
音频(reference_audio) | 格式:wav / mp3;单个 [1, 15] 秒,总时长不大于 15 秒;大小不超过 15MB |
文件(file) | 格式:docx / doc / xlsx / xls / pptx / ppt / pdf / txt / key / pages / numbers / md;大小不超过 100MB;页数不超过 50 页 |
网页(link) | 仅支持解析无需登录的公开网页 |
请求示例
bash
curl --location --request POST 'https://neolink.com/api/v1/videos' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
"model": "wan3.0-video",
"input": {
"prompt": "一只小猫在月光下的屋顶上奔跑,城市的霓虹灯在远处闪烁,电影级画质,流畅运镜。"
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 5,
"prompt_extend": true
}
}'bash
curl --location --request POST 'https://neolink.com/api/v1/videos' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
"model": "wan3.0-video",
"input": {
"prompt": "视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣。",
"media": [
{ "type": "reference_image", "url": "https://example.com/wan-r2v-object-girl.jpg" },
{ "type": "reference_video", "url": "https://example.com/wan-r2v-role.mp4" },
{ "type": "reference_image", "url": "https://example.com/wan-r2v-object3.png" }
]
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 5,
"prompt_extend": true
}
}'bash
curl --location --request POST 'https://neolink.com/api/v1/videos' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
"model": "wan3.0-video",
"input": {
"prompt": "一个女孩从微笑逐渐变为大笑,镜头缓缓推进。",
"media": [
{ "type": "first_frame", "url": "https://example.com/rap.png" }
]
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 5,
"prompt_extend": true
}
}'bash
curl --location --request POST 'https://neolink.com/api/v1/videos' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
"model": "wan3.0-video",
"input": {
"prompt": "一个年轻女孩从微笑逐渐变为大笑,镜头缓缓推进,背景光线从冷色调渐变为暖色调。",
"media": [
{ "type": "first_frame", "url": "https://example.com/rap.png" },
{ "type": "last_frame", "url": "https://example.com/end-frame.png" }
]
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 5,
"prompt_extend": true
}
}'bash
curl --location --request POST 'https://neolink.com/api/v1/videos' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
"model": "wan3.0-video",
"input": {
"prompt": "将整个画面转换为黏土风格",
"media": [
{ "type": "reference_video", "url": "https://example.com/input.mp4" }
]
},
"parameters": {
"resolution": "720P",
"prompt_extend": true
}
}'bash
curl --location --request POST 'https://neolink.com/api/v1/videos' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
"model": "wan3.0-video",
"input": {
"prompt": "将视频1向后延长,面包师端上刷好的面包,将刷子放到一旁,镜头跟随面包师,去斜后方的烤炉进行烤制",
"media": [
{ "type": "reference_video", "url": "https://example.com/input.mp4" }
]
},
"parameters": {
"resolution": "720P",
"ratio": "adaptive",
"prompt_extend": true
}
}'bash
curl --location --request POST 'https://neolink.com/api/v1/videos' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
"model": "wan3.0-video",
"input": {
"prompt": "根据上传的产品资料文件生成一支高端智能眼镜产品广告视频,风格极简、未来感十足",
"media": [
{ "type": "file", "url": "https://example.com/product.pptx" }
]
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 10,
"prompt_extend": true
}
}'响应体
| 参数名 | 类型 | 说明 |
|---|---|---|
code | int | 错误码;具体定义见错误码 |
message | string | 错误信息 |
request_id | string | 请求 ID,用于跟踪请求、排查问题;可用于请求明细溯源 |
data.task_id | string | 任务 ID,系统生成,有效期 24 小时 |
data.task_status | string | 任务状态:submitted / processing / succeed / failed |
data.created_at | int | 任务创建时间,Unix 时间戳,单位 ms |
响应示例
json
{
"code": 0,
"message": "string",
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx",
"data": {
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx",
"task_status": "submitted",
"created_at": 1754298357708
}
}查询任务
通过任务 ID 查询视频生成任务的状态和结果。
接口地址
http
GET /v1/videos/{task_id}请求头
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
Authorization | string | 是 | Bearer API_key,用于验证账户信息 |
路径参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
task_id | string | 是 | 视频生成任务的任务 ID |
请求示例
bash
curl --request GET \
--url 'https://neolink.com/api/v1/videos/{task_id}' \
--header 'Authorization: Bearer <API Key>'响应体
| 参数名 | 类型 | 说明 |
|---|---|---|
code | int | 错误码;具体定义见错误码 |
message | string | 错误信息 |
request_id | string | 请求 ID,用于跟踪请求、排查问题 |
data.task_id | string | 任务 ID |
data.task_status | string | 任务状态:submitted / processing / succeed / failed |
data.video_url | string | 生成视频的下载地址(任务成功后返回,有效期 24 小时,请及时保存) |
data.duration | number | 生成视频时长(秒) |
data.resolution | string | 生成视频分辨率档位 |
响应示例
json
{
"code": 0,
"message": "string",
"request_id": "78c9b768-0285-996c-b682-xxxxxx",
"data": {
"task_id": "17ed7e50-00cf-4509-aea1-xxxxxx",
"task_status": "succeed",
"video_url": "https://example.com/videos/xxx.mp4",
"duration": 5,
"resolution": "480P"
}
}轮询建议:视频生成约需数分钟,建议每 15 秒轮询一次;任务状态流转
submitted→processing→succeed/failed。视频链接仅保留 24 小时,获取后请立即下载转存。
支持模型列表
支持模型Id:
wan3.0-video:标准版(全能参考生成)
