Skip to main content
Use Kling’s text-to-video or image-to-video operation. Choose the generation version in model_name; the routing group binds the public billing model.

Operations and limits

Use only operations available in Model Square. Multi-image, Turbo, Omni, extension, motion-control, voice, avatar and asset APIs are separate, unreviewed contracts here. Use a complete allowed configuration from the selected offering. Do not send the display model ID in a model field. Frame images accept HTTPS URLs or raw base64 JPEG/PNG, at most 10 MiB per embedded image. Base64 data-URL prefixes and multipart uploads are unsupported. Text-to-video rejects frame images. Resolution is undocumented by this contract.

Submit

For image-to-video, use /kling/v1/videos/image2video and add "image":"https://example.com/first-frame.png". Replace the URL with your accessible image.

Poll and download

Check code: 0 and keep data.task_id as TASK_ID. Poll the same action used for submission:
For image-to-video tasks, use the corresponding /image2video/$TASK_ID path. Pending states are submitted and processing; terminal states are succeed and failed.
Read results from data.task_result.videos. After succeed, download with authentication:

Errors and billing

Inspect code even after HTTP 200 and task_status_msg on failure. Invalid version/mode/duration/sound combinations return 400. Unfinished downloads return 400, expired results 410. Keep the original task after a timeout or submission_uncertain; see shared video errors. V2 uses the selected completed-request price. V3 uses verified output seconds. V4 bills requested output seconds plus the greater of rounded-up reference seconds and requested output seconds when a reference is present:
Without a reference, v4 bills requested output seconds alone. A three-second output with a 3.041-second reference bills seven seconds. Total billed seconds must not exceed 3,600. Codec padding does not increase the output charge. Follow-ups retain the original group and price; confirmed failures release reservations, while missing final usage can leave settlement pending.