Kling 4.0 Flash API reference
Check Kling 4.0 Flash availability, inputs, parameters, file requirements, credit pricing, and request examples for Rivya Public API v1. Model ID: kling-4-0-flash.
kling-4-0-flash
text, file
Required for reference modes
Credit rate: 17 per second of output The final cost is rounded up to whole credits.
Video
METERED
8000 characters
Request fields
Set model at the top level. Put model-specific controls and reference inputs in params, using the format documented for this model.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | kling-4-0-flash | Set model to kling-4-0-flash. |
| prompt | string | Yes | - | Maximum 8000 characters for this model. |
| params | object | No | - | The model-specific params object. Use the documented keys and reference-file format for this model. |
| client_request_id | string | No | - | Optional ID for tracing this request in your system. It does not replace Idempotency-Key. |
Model parameters
| Key | Type | Required | Default | Range | Options | Description |
|---|---|---|---|---|---|---|
| kling4_scene | select | No | keyframe | - | keyframe, reference | Input mode |
| resolution | select | No | 720p | - | 720p | Resolution |
| duration | number | No | 5 | min 3 / max 20 / step 1 | - | Duration (seconds) |
| aspect_ratio | select | No | 16:9 | - | 16:9, 9:16, 1:1, 21:9 | Aspect ratio |
Upload policy
Upload reference files through Files API first. Keep the original URLs, verified metadata, and tokens. Follow this model's request example: some models use params.referenceMediaItems, while others use different fields.
Reference images: Choose Keyframe for text or one first-frame image, or Reference for text or up to 10 reference images. Generate 3–20 seconds at 720p. Use @first_frame or @image_1, @image_2 to mention supplied images. Reference videos, named subjects, voices, and middle/last frames are unavailable here.
10
image
When duration verification is required, use duration_token from /api/v1/files as durationToken in the request. Keep any additional signed metadata this model requires.
| kind | Max size | MIME types |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
Minimal request
{
"model": "kling-4-0-flash",
"prompt": "A camera slowly circles a product bottle on a studio table.",
"params": {
"kling4_scene": "keyframe",
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9"
}
}Reference-file request
{
"model": "kling-4-0-flash",
"prompt": "A camera slowly circles a product bottle on a studio table.",
"params": {
"kling4_scene": "keyframe",
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png",
"width": 1024,
"height": 1024,
"sizeBytes": 1048576,
"imageDimensionsToken": "image_dimensions_token_from_original_files_api_upload_response"
}
]
}
}Example response
An accepted generation request returns a task ID. Poll the status endpoint until the task succeeds or fails. A status request failure does not mean generation failed.
{
"id": "task_kling_4_0_flash_example",
"status": "queued",
"model": "kling-4-0-flash",
"reserved_credits": 85,
"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
}Common errors
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
Some modes require Files API reference uploads.
