Wan 3.0 reference-to-video
Model ID alibaba/wan-3.0/reference-to-video
概览
重要: Duration -1 enables smart duration. Media inputs must be public HTTP/HTTPS URLs.
重要: At most 20 references in total. Optional extra.enable_thinking controls document/webpage parsing; extra.file and extra.link are mutually exclusive and require thinking enabled.
重要: Thinking is disabled by default.
接口
POST /v1/video/generations
认证
Authorization: Bearer <AIAPIAIAPI_API_KEY>
请求体
| 参数 | 类型 | 必填 | 可空 | 默认值 | 约束 | 说明 |
|---|---|---|---|---|---|---|
model | string | 是 | 否 | - | values: alibaba/wan-3.0/reference-to-video | 用于路由请求的模型 ID。 |
prompt | string | 是 | 否 | - | - | Required prompt, up to 20000 characters. |
images | array | 否 | 否 | - | max_count: 20; accepts: HTTP/HTTPS URL | 参考图片列表,每项支持 HTTPS URL 或 Base64 data URL。 |
videos | array | 否 | 否 | - | max_count: 20; accepts: HTTP/HTTPS URL | 参考视频列表,每项支持 HTTPS URL 或 Base64 data URL。 |
audios | array | 否 | 否 | - | max_count: 20; accepts: HTTP/HTTPS URL | 参考音频列表,每项支持 HTTPS URL 或 Base64 data URL。 |
audio_enable | boolean | 否 | 否 | `true` | - | 是否同时生成视频音频。 |
duration | integer | 否 | 否 | `5` | range: 2-30; also allows: -1 | 生成视频的时长,单位为秒。 |
resolution | string | 否 | 否 | `1080p` | values: 1080p, 720p, 480p, 720p-esr, 1080p-esr, 1440p-esr, 4k-esr | 输出视频分辨率。 |
aspect_ratio | string | 否 | 否 | `adaptive` | values: adaptive, 16:9, 4:3, 1:1, 3:4, 9:16 | 输出视频宽高比。 |
seed | integer | 否 | 否 | - | min: -1 | 随机种子;使用 -1 可获得随机结果。 |
model
类型:string · 必填:是 · 可空:否
用于路由请求的模型 ID。
prompt
类型:string · 必填:是 · 可空:否
Required prompt, up to 20000 characters.
images
类型:array · 必填:否 · 可空:否
参考图片列表,每项支持 HTTPS URL 或 Base64 data URL。
videos
类型:array · 必填:否 · 可空:否
参考视频列表,每项支持 HTTPS URL 或 Base64 data URL。
audios
类型:array · 必填:否 · 可空:否
参考音频列表,每项支持 HTTPS URL 或 Base64 data URL。
audio_enable
类型:boolean · 必填:否 · 可空:否
是否同时生成视频音频。
duration
类型:integer · 必填:否 · 可空:否
生成视频的时长,单位为秒。
resolution
类型:string · 必填:否 · 可空:否
输出视频分辨率。
aspect_ratio
类型:string · 必填:否 · 可空:否
输出视频宽高比。
seed
类型:integer · 必填:否 · 可空:否
随机种子;使用 -1 可获得随机结果。
请求示例
curl --request POST \
--url https://aiapiaiapi.com/v1/video/generations \
--header 'Authorization: Bearer $AIAPIAIAPI_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "alibaba/wan-3.0/reference-to-video",
"prompt": "A cinematic camera movement through a forest",
"images": ["https://example.com/reference.jpg"],
"duration": 5,
"resolution": "1080p"
}'JSON
{
"model": "alibaba/wan-3.0/reference-to-video",
"prompt": "A cinematic camera movement through a forest",
"images": ["https://example.com/reference.jpg"],
"duration": 5,
"resolution": "1080p"
}响应
{
"id": "vid_01K2ABC123",
"object": "video.generation",
"model": "alibaba/wan-3.0/reference-to-video",
"status": "queued",
"progress": null,
"outputs": [],
"created_at": 1786960800,
"started_at": null,
"completed_at": null,
"error": null
}任务状态
使用创建响应中的 id 作为 task_id:
GET /v1/video/generations/{task_id}
{
"id": "vid_01K2ABC123",
"object": "video.generation",
"model": "alibaba/wan-3.0/reference-to-video",
"status": "completed",
"progress": 100,
"outputs": [
{ "type": "video", "url": "https://cdn.example.com/videos/vid_01K2ABC123.mp4" }
],
"created_at": 1786960800,
"started_at": 1786960805,
"completed_at": 1786960900,
"error": null
}错误响应
参数校验错误返回 HTTP 400,并包含稳定的错误代码。
{
"error": {
"type": "invalid_request_error",
"code": "unsupported_value",
"message": "The parameter value is not supported by this model.",
"param": "duration"
}
}文档索引
获取完整文档索引:
https://aiapiaiapi.com/llms.txt
使用该文件发现所有可用的 API 文档。