Skip to main content
POST
The model name for Kling 4.0 in AIReiter is kling_v4. Use type to select the generation mode. Different modes accept different assets, see Mode Parameter Comparison below.The generated video always includes a stereo audio track, which cannot be turned off. 4K, negative_prompt, and seed are not supported.

Authorizations

string
required
All endpoints require authentication using a Bearer Token.Get API Key:Visit the API Key Management page to get your API Key.When using, add it to the request header:

Body

string
required
Model name, fixed to kling_v4.
object
required
Model parameter object.
string
required
Caller task ID.User-defined task identifier, required. Supports only letters, digits, underscores, and hyphens, with a length of 1-64 characters. This ID can be used later to query task status and results.

Response

string
Initiator task ID, which can be used to query results.
string
Initial status, usually "pending".
string
Creation time, ISO format.

Query Task

Kling 4.0 is an asynchronous video generation model. After submitting a task, please use out_task_id to query the task status. You can also refer to Get Task Status.
string
required
The originator task ID passed when submitting the task.
Once the query succeeds and is completed, the output array in the response will contain the generated video, with elements containing the video field. Generation time varies depending on the mode and duration: a 1080p 5-second text-to-video task takes approximately 4.5 minutes in actual testing. The longer the duration and the more assets involved, the longer it will take. Please continue polling and do not resubmit.

模式参数对照

When frame mode is missing the first frame, or edit / extend mode is missing the original video, the task will end in failure. Please provide all required assets according to the table above.

使用说明

  • When passing only prompts, it operates as text-to-video; when any reference material is provided, it is processed as reference-based generation. When aspect_ratio is set to auto, it follows the aspect ratio of the reference material.
  • Video extension returns a single complete file: the original video comes first, followed by the newly added segment. In actual testing, extending a 5-second original video by 5 seconds returns a 10.0-second video with the same resolution as the original video and no noticeable seam at the transition.
  • Video extension preserves the audio of the original video portion and automatically generates audio for the newly added segment; if the original video has no audio, that portion remains silent.
  • Video editing preserves the original video audio by default; when new audio is required, pass audio_setting: "auto".

Request Examples