Docs Rivya AI
Trang API mô hình

Tích hợp API Kling 2.6

Dùng Kling 2.6 qua Rivya Public API v1 với model id kling-2-6, input được hỗ trợ, tham số, quy tắc Files API, tín dụng và ví dụ response.

Khả dụng qua APIText hoặc URL sẵn sàng; reference modes dùng Files APIVideo
ID mô hình API

kling-2-6

Input

text, file

Files API

Bắt buộc cho reference modes

Tín dụng cơ bản

55

Năng lực

Video

Thanh toán

FIXED

Giới hạn prompt

1000 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.

KeyTypeBắt buộcDefaultMô tả
modelstringkling-2-6Dùng API model id kling-2-6.
promptstring-Tối đa 1000 ký tự cho mô hình này.
paramsobjectKhô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_idstringKhông-Client-side id tùy chọn để trace request trong hệ thống của bạn.

Tham số mô hình

KeyTypeBắt buộcDefaultRangeOptionsMô tả
durationselectKhông5-5, 10Thời lượng
soundselectKhôngfalse-false, trueTạo âm thanh
aspect_ratioselectKhông1:1-1:1, 16:9, 9:16Tỷ 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.

Quy tắc tham chiếu

Ảnh tham chiếu: Tải lên tối đa 1 tệp ảnh cho các dự án hình ảnh.

Số file tối đa

1

Loại file được chấp nhận

image

Token thời lượng

Tham chiếu video và audio nên mang durationToken từ /api/v1/files khi cần xác minh duration.

kindKích thước tối đaMIME types
image10 MBimage/jpeg, image/png, image/webp

Yêu cầu tối thiểu

{
  "model": "kling-2-6",
  "prompt": "A cinematic product reveal with smooth camera movement",
  "params": {
    "duration": "5",
    "sound": "false",
    "aspect_ratio": "1:1"
  }
}

Yêu cầu có tệp tham chiếu

{
  "model": "kling-2-6",
  "prompt": "A cinematic product reveal with smooth camera movement",
  "params": {
    "duration": "5",
    "sound": "false",
    "aspect_ratio": "1:1",
    "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_2_6_example",
  "status": "queued",
  "model": "kling-2-6",
  "reserved_credits": 55,
  "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.