Tích hợp API Wan 2.6
Dùng Wan 2.6 qua Rivya Public API v1 với ID mô hình wan-2-6, đầu vào được hỗ trợ, tham số, quy tắc Files API, tín dụng và ví dụ phản hồi.
wan-2-6
text, file
Bắt buộc cho chế độ tham chiếu
per_video · 720p_5=70 · 720p_10=140 · 720p_15=210 · 1080p_5=104.5 · 1080p_10=209.5 · 1080p_15=315 · ⌈total⌉
Video
FIXED
5000 ký tự
Quy ước yêu cầu
Gửi ID mô hình ở cấp trên cùng. Điều khiển riêng của mô hình nằm trong params.
| Key | Loại | Bắt buộc | Mặc định | Mô tả |
|---|---|---|---|---|
| model | string | Có | wan-2-6 | Dùng wan-2-6 làm ID mô hình API. |
| prompt | string | Có | - | Tối đa 5000 ký tự cho mô hình này. |
| params | object | Không | - | Đối tượng tham số riêng của mô hình. Dùng các dòng bên dưới để xem key được phép. |
| client_request_id | string | Không | - | ID phía client không bắt buộc để theo dõi yêu cầu trong hệ thống của bạn. |
Tham số mô hình
| Key | Loại | Bắt buộc | Mặc định | Phạm vi | Tùy chọn | Mô tả |
|---|---|---|---|---|---|---|
| resolution | select | Không | 1080p | - | 720p, 1080p | Độ phân giải |
| duration | select | Không | 5 | - | 5, 10, 15 | Thời lượng |
| multi_shots | select | Không | false | - | false, true | Chế độ cảnh |
| nsfw_checker | select | Không | true | - | false, true | Bộ lọc nội dung |
Chính sách tải lên
Trước tiên tải tệp tham chiếu lên, rồi đặt URL và duration token được trả về vào params.referenceMediaItems.
Media tham chiếu: Dùng đúng 1 ảnh JPG/PNG/WebP (tối thiểu 256×256, tối đa 10 MB) hoặc 1–3 video MP4/MOV (tối đa 10 MB mỗi tệp).
3
image, video
Tham chiếu video và audio nên mang durationToken từ /api/v1/files khi cần xác minh thời lượng.
| kind | Kích thước tối đa | Loại MIME |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
| video | 10 MB | video/mp4, video/quicktime |
Yêu cầu tối thiểu
{
"model": "wan-2-6",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"resolution": "1080p",
"duration": "5",
"multi_shots": "false",
"nsfw_checker": "true"
}
}Yêu cầu có tệp tham chiếu
{
"model": "wan-2-6",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"resolution": "1080p",
"duration": "5",
"multi_shots": "false",
"nsfw_checker": "true",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-video-1.mp4",
"kind": "video",
"name": "reference-video-1.mp4",
"mimeType": "video/mp4",
"durationSeconds": 8,
"durationToken": "video_duration_token_1_from_files_api",
"width": 1280,
"height": 720,
"sizeBytes": 8388608,
"framesPerSecond": 30,
"videoBitrateMbps": 8,
"videoMetadataToken": "video_metadata_token_1_from_files_api"
},
{
"url": "https://cdn.example.com/reference-video-2.mp4",
"kind": "video",
"name": "reference-video-2.mp4",
"mimeType": "video/mp4",
"durationSeconds": 8,
"durationToken": "video_duration_token_2_from_files_api",
"width": 1280,
"height": 720,
"sizeBytes": 8388608,
"framesPerSecond": 30,
"videoBitrateMbps": 8,
"videoMetadataToken": "video_metadata_token_2_from_files_api"
},
{
"url": "https://cdn.example.com/reference-video-3.mp4",
"kind": "video",
"name": "reference-video-3.mp4",
"mimeType": "video/mp4",
"durationSeconds": 8,
"durationToken": "video_duration_token_3_from_files_api",
"width": 1280,
"height": 720,
"sizeBytes": 8388608,
"framesPerSecond": 30,
"videoBitrateMbps": 8,
"videoMetadataToken": "video_metadata_token_3_from_files_api"
}
]
}
}Phản hồi tạo
Điểm cuối tạo trả về ID tác vụ công khai. Hãy thăm dò điểm cuối trạng thái cho đến khi tác vụ succeeded hoặc failed.
{
"id": "task_wan_2_6_example",
"status": "queued",
"model": "wan-2-6",
"reserved_credits": 105,
"final_credits": 0,
"settlement_status": "RESERVED",
"created_at": "2026-05-11T00:00:00.000Z",
"updated_at": "2026-05-11T00:00:00.000Z",
"result": null,
"error": null
}Lỗi thường gặp
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
Một số chế độ cần tải tệp tham chiếu qua Files API.
