PopNowAPI Docs
Main content

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

OptionCredits (per second of output)US dollars
720p216$0.216
1080p324$0.324

Parameters

FieldTypeDefaultAllowedWhat it does
promptRequiredstring——Describe the scene, the action, the camera and the sound. Put spoken lines in quotes.
aspect_ratioOptionalstring16:916:9, 9:16, 1:1, 21:9Output aspect ratio, including 21:9 ultrawide.
resolutionOptionalstring720p720p, 1080pOutput resolution. 1080p costs more per second.
duration_secondsOptionalinteger53 to 30Output 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.

POST /api/v1/jobs/createTask
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.

GET /api/v1/jobs/recordInfo
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

OptionCredits (per second of output)US dollars
720p216$0.216
1080p324$0.324

Parameters

FieldTypeDefaultAllowedWhat it does
image_urlRequiredstring (uri)——Opening frame (JPEG or PNG). The clip starts from this image.
promptOptionalstring——Optional: describe what happens after the opening frame - the action, the camera and the sound.
last_image_urlOptionalstring (uri)——Optional closing frame the clip should end on.
keyframe_image_urlsOptionalarray<string (uri)>—up to 8 itemsOptional 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_ratioOptionalstringautoauto, 16:9, 9:16, 1:1, 21:9Output aspect ratio; auto follows the opening frame.
resolutionOptionalstring720p720p, 1080pOutput resolution. 1080p costs more per second.
duration_secondsOptionalinteger53 to 30Output 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.

POST /api/v1/jobs/createTask
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.

GET /api/v1/jobs/recordInfo
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

OptionCredits (per second of output)US dollars
720p216$0.216
1080p324$0.324

Parameters

FieldTypeDefaultAllowedWhat it does
promptRequiredstring——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_urlsOptionalarray<string (uri)>—up to 10 itemsReference images for characters, objects, outfits or places, up to 10. Refer to them as @Image1, @Image2 and so on.
reference_video_urlsOptionalarray<string (uri)>—up to 5 itemsOptional 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_urlsOptionalarray<string (uri)>—up to 3 itemsOptional 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_ratioOptionalstringautoauto, 16:9, 9:16, 1:1, 21:9Output aspect ratio; auto follows the reference images or video.
resolutionOptionalstring720p720p, 1080pOutput resolution. 1080p costs more per second.
keep_original_audioOptionalbooleanfalse—Keep the reference video's own sound instead of generating new audio. Only used with a reference video.
duration_secondsOptionalinteger53 to 30Output 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.

POST /api/v1/jobs/createTask
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.

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Next steps

On this page