kling-video/v4/reference-to-videoGeneration type:
image_to_videoEndpoint:
POST /api/asset_generator/
Pricing
Prices are per output. When a request asks for several outputs, the charge is this price times the number of outputs.
These prices assume no billable reference inputs. The charge goes up for each second of reference video (up to 15 seconds).
Quick start
The example uses sample media from our CDN. Swap in publicly accessible URLs for your own files.Input parameters
Send these fields ininput_params.
Reference images as @Image1, @Image2 and videos as @Video1, @Video2 in order.Maximum characters:
2500.Output duration in seconds (3-30s). Does not trim input videos.Allowed values:
"3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30".Output resolution (720p, 1080p, 2K, 4K).Allowed values:
"720p", "1080p", "2k", "4k".The aspect ratio of the generated video frame.Allowed values:
"16:9", "9:16", "1:1", "21:9".Optional first frame. Counts toward the 10 image limit.JPEG/PNG. Max file size: 30MiB, Min width: 300px, Min height: 300px, Min aspect ratio: 0.40, Max aspect ratio: 2.50, Timeout: 20.0s
Reference images, referenced as @Image1, etc. Max 10 including the start image.Maximum items:
10.Reference videos, referenced as @Video1, etc. Max 5, each 3-30s and 30s combined. MP4/MOV, max 300MiB, 3-30s, 700-4553px, aspect ratio 0.40-2.50, about 24-60 fps.Maximum items:
5.Complete JSON schema
Complete JSON schema
Response
The request returns the task withstatus: "initializing". Poll GET /api/asset_generator/{id}/ until status is done or failed, or pass a webhook_url to be notified. A finished task lists its files in assets and the credits it charged in credits_used.
