Skip to content
English

Kling 4.0 Image to Video API

POST Base URL: https://api.hiapi.ai /v1/tasks

Image, video, and audio models are called through theUnified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).

Model summary

Model kling-4.0/image-to-video
Type Video generation (image to video)
Endpoint POST /v1/tasks
Price See HiAPI pricing

Kling 4.0 image-to-video API by Kuaishou Kling. Animate one first-frame image into a 3–30 second clip with synchronized audio. Leave the aspect ratio out and the output keeps the source framing, at 720p or 1080p.

Production guidance

Production notes
  • image_urls must be publicly reachable by the generation service. For private buckets, hand over a signed URL or copy the file somewhere public first.
  • Without aspect_ratio the output follows the first frame ratio, so portrait images stay portrait. Set the field only when you want to override it.
  • Send callback.url in the request body in production so HiAPI pushes the terminal state instead of you polling.

Best suited for

Bring existing images to life

Product shots, portraits and illustrations become the first frame; the image owns composition and identity, the prompt only describes motion.

image_urlsprompt
Keep the original framing

Omitting aspect_ratio makes the output follow the source ratio, so vertical assets need no extra handling.

aspect_ratio
Short clips with sound

Audio is generated with the picture, so waves, wind or footsteps can be written into the prompt.

prompt
Length you control

Any whole duration from 3 to 30 seconds, billed per second with no minimum, suited to batch production.

durationresolution

Request parameters

model string required

Always kling-4.0/image-to-video.

example kling-4.0/image-to-video
input object required

Business parameters. All Kling 4.0 image-to-video options live here.

image_urls string[] required

Array with exactly one publicly reachable first-frame image URL in jpg, jpeg or png.

example ["https://static.hiapi.ai/admin-assets/kling-4-0/2026/10/23/1792768230745-7143f510a8f7c77f-face-input.jpg"]
prompt string optional

Motion, camera and mood, up to 2500 characters. Optional: leave it out and let the image move on its own. Put the sound you want here too.

resolution enum optional

Output resolution. Higher resolution costs more per second and renders noticeably slower.

default 720p enum: 720p1080p
duration integer optional

Clip length in seconds, any whole number from 3 to 30. Billed per output second with no minimum.

default 5
aspect_ratio enum optional

Framing of the output. This field has no default: when omitted, the clip follows the source image ratio.

enum: 16:99:161:121:9
callback object optional

Optional callback. When set, HiAPI notifies your service as soon as the task reaches a terminal state, so you can poll less.

url string required

Required when callback is present: the HTTPS endpoint that receives the terminal-state notification.

example https://your-domain.com/hiapi/callback
when enum optional

When to fire the callback. Keep it at final for now.

default final enum: final

Example requests

A coastal portrait starts moving

720p / 5s with no aspect ratio, checking hair and fabric motion, a slow push-in and wave ambience.

Request body
{
  "model": "kling-4.0/image-to-video",
  "input": {
    "image_urls": [
      "https://static.hiapi.ai/admin-assets/kling-4-0/2026/10/23/1792768230745-7143f510a8f7c77f-face-input.jpg"
    ],
    "prompt": "She turns her head further toward the camera, hair and jacket moving in the wind, camera slowly pushes in, waves crashing on the rocks below, natural ambient sound",
    "resolution": "720p",
    "duration": 5
  }
}
Force a vertical frame

1080p / 9:16 / 8s, overriding the source ratio for vertical placements.

Request body
{
  "model": "kling-4.0/image-to-video",
  "input": {
    "image_urls": [
      "https://static.hiapi.ai/admin-assets/kling-4-0/2026/10/23/1792768230745-7143f510a8f7c77f-face-input.jpg"
    ],
    "prompt": "Slow orbit around the product, soft studio reflections, subtle camera push-in",
    "resolution": "1080p",
    "duration": 8,
    "aspect_ratio": "9:16"
  }
}

Getting the result

  1. The create call returns a taskId immediately; generation continues in the background.
  2. In production, wait for the callback.url notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status is success, download the video from output[].url.
  4. When status is fail, fix the request based on the returned error instead of retrying the same invalid payload.

FAQ

What does the first-frame image need to be?

One publicly reachable jpg, jpeg or png URL inside image_urls; the array holds exactly one image and that image becomes the opening frame.

What happens if I omit aspect_ratio?

The output follows the source image ratio, so a portrait image stays portrait. Set the field only when you want to override it.

Is the prompt required?

No. The image alone can drive the clip; the prompt describes motion, camera and mood. Because the image already carries composition and style, shorter prompts often work better.

How do I retrieve the finished video?

The create call returns a taskId immediately. Once the task reaches a terminal state, download the video from output[].url. In production send callback.url so HiAPI pushes the terminal state.

Next steps