Kling 4.0 API reference
Up to 30-second 1080p clips with keyframes; may queue when busy
Call Kling 4.0 from your own code with one PopNow API key. Below are the exact model IDs to send, every input field the model accepts, what each request costs in credits, and a request you can paste into a terminal.
At a glance
- Made by
- Kuaishou
- Output
- Video
- From
- 216 credits per second of output ($0.216)
1 credit = $0.001. A task holds the highest possible charge when it is accepted and settles the real amount when it finishes, rounded up to whole credits; failed tasks are not charged. Ask POST /api/v1/jobs/quote for the exact figure before you run.
Create Video
kling/4.0/text-to-video
Price
| Option | Credits (per second of output) | US dollars |
|---|---|---|
720p | 216 | $0.216 |
1080p | 324 | $0.324 |
Parameters
| Field | Type | Default | Allowed | What it does |
|---|---|---|---|---|
promptRequired | string | — | — | Describe the scene, the action, the camera and the sound. Put spoken lines in quotes. |
aspect_ratioOptional | string | 16:9 | 16:9, 9:16, 1:1, 21:9 | Output aspect ratio, including 21:9 ultrawide. |
resolutionOptional | string | 720p | 720p, 1080p | Output resolution. 1080p costs more per second. |
duration_secondsOptional | integer | 5 | 3 to 30 | Output length in whole seconds, from 3 to 30. Billed per second. |
Example request
This request runs as it is; any field you leave out uses its default. Put your key in POPNOW_API_KEY first.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "kling/4.0/text-to-video",
"input": {
"prompt": "A paper boat drifts down a rain-soaked street at dusk, neon signs reflecting in the water, slow tracking shot at ground level",
"duration_seconds": 5,
"resolution": "720p"
}
}'The response carries a taskId straight away. Read the result with GET /api/v1/jobs/recordInfo, or add callBackUrl to be notified.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"Image to Video
kling/4.0/image-to-video
Price
| Option | Credits (per second of output) | US dollars |
|---|---|---|
720p | 216 | $0.216 |
1080p | 324 | $0.324 |
Parameters
| Field | Type | Default | Allowed | What it does |
|---|---|---|---|---|
image_urlRequired | string (uri) | — | — | Opening frame (JPEG or PNG). The clip starts from this image. |
promptOptional | string | — | — | Optional: describe what happens after the opening frame - the action, the camera and the sound. |
last_image_urlOptional | string (uri) | — | — | Optional closing frame the clip should end on. |
keyframe_image_urlsOptional | array<string (uri)> | — | up to 8 items | Optional in-between frames, in the order they should appear, up to 8. The clip passes through each one between the opening and the closing frame. |
aspect_ratioOptional | string | auto | auto, 16:9, 9:16, 1:1, 21:9 | Output aspect ratio; auto follows the opening frame. |
resolutionOptional | string | 720p | 720p, 1080p | Output resolution. 1080p costs more per second. |
duration_secondsOptional | integer | 5 | 3 to 30 | Output length in whole seconds, from 3 to 30. Billed per second. |
Example request
This request runs as it is; any field you leave out uses its default. Put your key in POPNOW_API_KEY first.
The example uses PopNow sample files in image_url. Replace them with your own public HTTPS links, uploads or saved assets.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "kling/4.0/image-to-video",
"input": {
"prompt": "He lands softly on the rooftop, laughs and turns toward the camera while the balloons sway in the evening breeze; slow push-in",
"image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
"duration_seconds": 5,
"resolution": "720p"
}
}'The response carries a taskId straight away. Read the result with GET /api/v1/jobs/recordInfo, or add callBackUrl to be notified.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"Reference to Video
kling/4.0/reference-to-video
Price
| Option | Credits (per second of output) | US dollars |
|---|---|---|
720p | 216 | $0.216 |
1080p | 324 | $0.324 |
Parameters
| Field | Type | Default | Allowed | What it does |
|---|---|---|---|---|
promptRequired | string | — | — | Say what each reference is and what the shot should do with it. Refer to images as @Image1, @Image2, to videos as @Video1 and to audio clips as @Audio1, numbered in upload order. |
reference_image_urlsOptional | array<string (uri)> | — | up to 10 items | Reference images for characters, objects, outfits or places, up to 10. Refer to them as @Image1, @Image2 and so on. |
reference_video_urlsOptional | array<string (uri)> | — | up to 5 items | Optional reference videos for motion, camera and pacing, up to 5 and 30 seconds in total. Refer to them as @Video1, @Video2. Their seconds are billed too, at a lower rate than output seconds. |
reference_audio_urlsOptional | array<string (uri)> | — | up to 3 items | Optional reference audio for a voice or a sound, up to 3 clips of 5 to 30 seconds each. Refer to them as @Audio1, @Audio2. |
aspect_ratioOptional | string | auto | auto, 16:9, 9:16, 1:1, 21:9 | Output aspect ratio; auto follows the reference images or video. |
resolutionOptional | string | 720p | 720p, 1080p | Output resolution. 1080p costs more per second. |
keep_original_audioOptional | boolean | false | — | Keep the reference video's own sound instead of generating new audio. Only used with a reference video. |
duration_secondsOptional | integer | 5 | 3 to 30 | Output length in whole seconds, from 3 to 30. Billed per second. |
Example request
This request runs as it is; any field you leave out uses its default. Put your key in POPNOW_API_KEY first.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "kling/4.0/reference-to-video",
"input": {
"prompt": "The man from the reference image jogs across a sunlit rooftop at golden hour and smiles at the camera; smooth tracking shot",
"duration_seconds": 5,
"resolution": "720p"
}
}'The response carries a taskId straight away. Read the result with GET /api/v1/jobs/recordInfo, or add callBackUrl to be notified.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
