4Z API

Omni-Video

Endpoint: POST https://4zapi.com/kling/v1/videos/omni-video

Kling Omni unified video generation: text-to-video, image reference, first/last frame, video edit, subject reference, and multi-shot.

Parameters

  • Content-Type (header, string): Request body Content-Type, usually application/json
  • Authorization (header, string): Bearer API Key

Request body (application/json)

  • model_name (string, required): Omni model name, required. o1 does not support sound/4k/multi_shot; v3-omni is fully functional; kling-video-v4-flash is 720P only and does not support sound/4k/multi_shot/video editing. ["kling-video-o1", "kling-v3-omni", "kling-video-v4-flash"]
  • aspect_ratio (string): Aspect ratio. It is recommended that this field be required when the first frame is not used and is not used for video editing. 21:9 and adaptive are only for kling-video-v4-flash. ["16:9", "9:16", "1:1", "21:9", "adaptive"]
  • callback_url (string): Task completion callback address must be reachable by the public network
  • duration: Video duration (seconds). o1: 5/10; v3-omni: 3~15; kling-video-v4-flash: integer 3~30, default 5; when refer_type=base, it is covered by video detection and does not need to be transmitted.
  • element_list (array<object>): List of subject references. Up to 7 for kling-video-v4-flash; reference them in the prompt with @element_1 etc.
  • external_task_id (string): Caller external task ID, used for business correlation
  • image_list (array<object>): Reference figure list. Used for subject/scene/style reference or first and last frames. Up to 10 for kling-video-v4-flash; reference them in the prompt with @image_1 etc.
  • mode (string): Generate schema. The default gateway is pro; 4k only kling-v3-omni; kling-video-v4-flash accepts only std or omitted (720P), pro returns 400. ["std", "pro", "4k"]
  • multi_prompt (array<object>): Customized storyboard list. Required when shot_type=customize, up to 6 shots.
  • multi_shot (boolean): Whether to use multiple lenses, default false. Only kling-v3-omni can be true.
  • prompt (string): Text prompt word, ≤2500 characters. Required when multi_shot=false; invalid when multi_shot=true. Required for kling-video-v4-flash.
  • shot_type (string): Storyboarding method. Required when multi_shot=true; customize must match multi_prompt. ["customize"]
  • sound (string): Audible switch. on only kling-v3-omni; passing on from o1 or kling-video-v4-flash will result in 400. ["on", "off"]
  • video_list (array<object>): Reference video list. Maximum 1 for o1 / v3-omni; up to 5 for kling-video-v4-flash, refer_type=feature only, each at least 3 s and 30 s in total at most.
  • voice_list (array<object>): Voice list, kling-video-v4-flash only, up to 3. Reference in the prompt with @ + id (position starting from 1 when id is omitted).
  • watermark_info (object): Watermark configuration, gateway transparent transmission

Request example

{
  "duration": 5,
  "image_list": [
    {
      "image_url": "{{image_url_1}}"
    }
  ],
  "model_name": "kling-video-v4-flash",
  "prompt": "参考 @video_1 的运镜轨迹与镜头节奏,主体替换为 @image_1",
  "video_list": [
    {
      "refer_type": "feature",
      "video_url": "{{video_url}}"
    }
  ]
}