Tích hợp API Kling 3.0
Dùng Kling 3.0 qua Rivya Public API v1 với model id kling-3-0, input được hỗ trợ, tham số, quy tắc Files API, tín dụng và ví dụ response.
kling-3-0
text, file
Bắt buộc cho reference modes
90
Video
FIXED
2000 ký tự
Hợp đồng yêu cầu
Gửi model id ở top level. Điều khiển riêng của mô hình nằm trong params.
| Key | Type | Bắt buộc | Default | Mô tả |
|---|---|---|---|---|
| model | string | Có | kling-3-0 | Dùng API model id kling-3-0. |
| prompt | string | Có | - | Tối đa 2000 ký tự cho mô hình này. |
| params | object | Không | - | Object 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 | - | Client-side id tùy chọn để trace request trong hệ thống của bạn. |
Tham số mô hình
| Key | Type | Bắt buộc | Default | Range | Options | Mô tả |
|---|---|---|---|---|---|---|
| mode | select | Không | pro | - | std, pro | Chế độ tạo |
| multi_shots | select | Không | false | - | false, true | Chế độ cảnh |
| duration | select | Không | 5 | - | 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 | Thời lượng |
| sound | select | Không | false | - | false, true | Tạo âm thanh |
| aspect_ratio | select | Không | 16:9 | - | 16:9, 9:16, 1:1 | Tỷ lệ khung hình |
Chính sách tải lên
Upload reference files trước, rồi đặt URL và duration token được trả về vào params.referenceMediaItems.
Media tham chiếu: Tải lên tổng cộng tối đa 2 tệp ảnh cho các dự án chuyển ảnh thành video.
2
image
Tham chiếu video và audio nên mang durationToken từ /api/v1/files khi cần xác minh duration.
| kind | Kích thước tối đa | MIME types |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
Yêu cầu tối thiểu
{
"model": "kling-3-0",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"mode": "pro",
"multi_shots": "false",
"duration": "5",
"sound": "false",
"aspect_ratio": "16:9"
}
}Yêu cầu có tệp tham chiếu
{
"model": "kling-3-0",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"mode": "pro",
"multi_shots": "false",
"duration": "5",
"sound": "false",
"aspect_ratio": "16:9",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png"
}
]
}
}Phản hồi tạo
Create endpoint trả về public task id. Poll status endpoint cho đến khi task succeeded hoặc failed.
{
"id": "task_kling_3_0_example",
"status": "queued",
"model": "kling-3-0",
"reserved_credits": 90,
"final_credits": 0,
"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ố mode cần Files API reference uploads.