Kling V2.1 Master API integration
Rivya Public API v1 দিয়ে Kling V2.1 Master ব্যবহার করুন: model id kling-v2-1-master, supported inputs, parameters, Files API rules, credits এবং response examples সহ।
kling-v2-1-master
text, file
reference modes-এর জন্য required
160
ভিডিও
FIXED
5000 characters
Request contract
model id top level-এ পাঠান। Model-specific controls params-এ থাকবে।
| Key | Type | Required | Default | বিবরণ |
|---|---|---|---|---|
| model | string | Yes | kling-v2-1-master | kling-v2-1-master API model id ব্যবহার করুন। |
| prompt | string | Yes | - | এই model-এর জন্য maximum 5000 characters। |
| params | object | No | - | Model-specific parameter object। allowed keys-এর জন্য নিচের rows ব্যবহার করুন। |
| client_request_id | string | No | - | আপনার system-এ requests trace করার optional client-side id। |
Model parameters
| Key | Type | Required | Default | Range | Options | বিবরণ |
|---|---|---|---|---|---|---|
| duration | select | No | 5 | - | 5, 10 | সময়কাল |
| aspect_ratio | select | No | 16:9 | - | 16:9, 9:16, 1:1 | Aspect ratio |
| negative_prompt | text | No | - | - | - | Negative prompt |
| cfg_scale | number | No | 0.5 | min 0 / max 1 | - | result আপনার prompt কতটা tightভাবে follow করবে তা control করে। higher value সাধারণত prompt-এর কাছাকাছি থাকে, কিন্তু motion বা composition stiff লাগতে পারে। |
Upload policy
প্রথমে reference files upload করুন, তারপর returned URL এবং duration token params.referenceMediaItems-এর মধ্যে দিন।
Reference image: image-to-video mode-এ যেতে optionalভাবে একটি image upload করুন; text mode-এ থাকতে খালি রাখুন।
1
image
duration verification required হলে video এবং audio references /api/v1/files থেকে durationToken carry করবে।
| kind | Max size | MIME types |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
Minimal request
{
"model": "kling-v2-1-master",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"duration": "5",
"aspect_ratio": "16:9",
"negative_prompt": "video যা এড়াবে তা বর্ণনা করুন",
"cfg_scale": 0.5
}
}রেফারেন্স ফাইল রিকোয়েস্ট
{
"model": "kling-v2-1-master",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"duration": "5",
"aspect_ratio": "16:9",
"negative_prompt": "video যা এড়াবে তা বর্ণনা করুন",
"cfg_scale": 0.5,
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png"
}
]
}
}Create response
create endpoint public task id return করে। task succeeds বা fails না করা পর্যন্ত status endpoint poll করুন।
{
"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
}Common errors
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
কিছু modes-এর জন্য Files API reference uploads দরকার।