Rivya AI Docs
หน้า API ของโมเดล

การเชื่อมต่อ API ของ Kling V2.1 Master

ใช้ Kling V2.1 Master ผ่าน Rivya Public API v1 ด้วย model id kling-v2-1-master, input ที่รองรับ, พารามิเตอร์, กฎ Files API, เครดิต และตัวอย่าง response

พร้อมใช้งานผ่าน APIText หรือ URL พร้อม; โหมด reference ใช้ Files APIวิดีโอ
ID โมเดล API

kling-v2-1-master

Input

text, file

Files API

จำเป็นสำหรับโหมด reference

เครดิตพื้นฐาน

160

ความสามารถ

วิดีโอ

Billing

FIXED

ขีดจำกัดพรอมต์

5000 อักขระ

contract ของ request

ส่ง model id ที่ระดับบนสุด control เฉพาะโมเดลอยู่ใน params

KeyTypeจำเป็นค่าเริ่มต้นคำอธิบาย
modelstringใช่kling-v2-1-masterใช้ API model id kling-v2-1-master
promptstringใช่-สูงสุด 5000 อักขระสำหรับโมเดลนี้
paramsobjectไม่ใช่-object พารามิเตอร์เฉพาะโมเดล ใช้แถวด้านล่างสำหรับ key ที่อนุญาต
client_request_idstringไม่ใช่-client-side id แบบเลือกได้สำหรับ trace คำขอในระบบของคุณ

พารามิเตอร์โมเดล

KeyTypeจำเป็นค่าเริ่มต้นช่วงตัวเลือกคำอธิบาย
durationselectไม่ใช่5-5, 10ระยะเวลา
aspect_ratioselectไม่ใช่16:9-16:9, 9:16, 1:1อัตราส่วนภาพ
negative_prompttextไม่ใช่---พรอมป์เชิงลบ
cfg_scalenumberไม่ใช่0.5min 0 / max 1-ควบคุมว่าผลลัพธ์ควรตามพรอมป์ของคุณแน่นแค่ไหน ค่าสูงมักอยู่ใกล้พรอมป์มากขึ้น แต่ก็อาจทำให้การเคลื่อนไหวหรือองค์ประกอบดูแข็งขึ้นได้

policy การอัปโหลด

อัปโหลดไฟล์ reference ก่อน จากนั้นใส่ URL และ duration token ที่ได้กลับมาไว้ใน params.referenceMediaItems

กฎ reference

ภาพอ้างอิง: อัปโหลดภาพหนึ่งภาพแบบไม่บังคับเพื่อสลับเข้าสู่โหมด image-to-video หรือปล่อยว่างไว้เพื่ออยู่ในโหมดข้อความ

ไฟล์สูงสุด

1

ชนิดไฟล์ที่รับ

image

Duration token

reference วิดีโอและเสียงควรมี durationToken จาก /api/v1/files เมื่อจำเป็นต้องตรวจ duration

kindขนาดสูงสุดMIME type
image10 MBimage/jpeg, image/png, image/webp

request ขั้นต่ำ

{
  "model": "kling-v2-1-master",
  "prompt": "A cinematic product reveal with smooth camera movement",
  "params": {
    "duration": "5",
    "aspect_ratio": "16:9",
    "negative_prompt": "อธิบายสิ่งที่วิดีโอควรหลีกเลี่ยง",
    "cfg_scale": 0.5
  }
}

request แบบไฟล์ reference

{
  "model": "kling-v2-1-master",
  "prompt": "A cinematic product reveal with smooth camera movement",
  "params": {
    "duration": "5",
    "aspect_ratio": "16:9",
    "negative_prompt": "อธิบายสิ่งที่วิดีโอควรหลีกเลี่ยง",
    "cfg_scale": 0.5,
    "referenceMediaItems": [
      {
        "url": "https://cdn.example.com/reference-image.png",
        "kind": "image",
        "name": "reference-image.png",
        "mimeType": "image/png"
      }
    ]
  }
}

response จากการสร้าง

endpoint create ส่ง public task id กลับมา poll endpoint สถานะจนกว่างานจะสำเร็จหรือล้มเหลว

{
  "id": "task_kling_v2_1_master_example",
  "status": "queued",
  "model": "kling-v2-1-master",
  "reserved_credits": 160,
  "final_credits": 0,
  "created_at": "2026-05-11T00:00:00.000Z",
  "updated_at": "2026-05-11T00:00:00.000Z",
  "result": null,
  "error": null
}

error ทั่วไป

validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found

บางโหมดต้องใช้การอัปโหลด reference ผ่าน Files API