MaasUnionMaasUnion
API Reference
AI Model APIVideoKling Video

Kling Omni Video

Channel type: Kling Omni Video (63) Gateway path: POST https://maasunion.com/kling/v1/omni/videos · GET https://maasunion.com/kling/v1/omni/videos/{task_id} Official upstream: https://api-beijing.klingai.com (/v1/videos/omni-video)


Overview

The Omni models can combine a Prompt with images, subjects, videos, and other content to achieve multiple capabilities, including:

  • Text-to-Video, Image-to-Video, first & last frame to video
  • Image/subject reference to video
  • Instruction transform (video editing)
  • Video reference (camera motion/style/generate next shot)
  • Multi-shot video (kling-v3-omni)
  • Sound generation (kling-v3-omni, sound: on)

Reference materials in the prompt using <<<>>>, for example:

  • <<<image_1>>> — the 1st reference image (corresponds to image_list[0])
  • <<<element_1>>> — the 1st subject (corresponds to element_list[0])
  • <<<video_1>>> — the 1st reference video (corresponds to video_list[0])

This gateway keeps the request/response format identical to the official Kling OmniVideo API; the request body is passed through to the upstream as-is.

Supported Models

model_nameDescription
kling-video-o1Omni O1, primarily single-shot
kling-v3-omniOmni V3, supports multi-shot, sound generation, etc.

Authentication

HeaderRequiredDescription
AuthorizationYesBearer {your_api_token}
Content-TypeRequired for POSTapplication/json

The upstream channel side uses official Kling authentication, handled automatically by the gateway; the client does not need to and should not pass the upstream key.


Prompt Reference Syntax

  • The prompt must not exceed 2,500 characters
  • Specify subjects, images, or videos using the <<<>>> format:
    • <<<image_1>>>, <<<image_2>>> — reference the images at the corresponding index in image_list
    • <<<element_1>>>, <<<element_2>>> — reference the subjects at the corresponding index in element_list
    • <<<video_1>>> — reference the video at the corresponding index in video_list
  • Different model versions and video modes support different ranges; see the Kling Capability Map

Create Task

POST https://maasunion.com/kling/v1/omni/videos

Submit a video generation task. On success it returns a task ID, which you can use to poll the result via the Query Task endpoint.

Request Body Parameters

ParameterTypeRequiredDefaultDescription
model_namestringYesModel name: kling-video-o1, kling-v3-omni
multi_shotbooleanNofalseWhether multi-shot. When true, prompt is invalid; when false, shot_type and multi_prompt are invalid
shot_typestringConditionalShot mode: customize (custom), intelligence (smart). Required when multi_shot=true
promptstringConditionalText prompt, ≤ 2500 characters. Must not be empty when multi_shot=false, or multi_shot=true and shot_type=intelligence
multi_promptarrayConditionalShot list, see multi_prompt Description. Must not be empty when multi_shot=true and shot_type=customize
image_listarrayNoReference image list, see image_list Description
element_listarrayNoSubject reference list, see element_list Description
video_listarrayNoReference video list, see video_list Description
soundstringNooffWhether to generate sound: on / off. When there is a reference video, it can only be off
modestringNoproGeneration mode: std (720P), pro (1080P), 4k (4K)
aspect_ratiostringConditionalAspect ratio: 16:9, 9:16, 1:1. Usually required when not using a first frame or video editing
durationstringNo5Video duration (seconds), enum 315; in some scenarios 310
watermark_infoobjectNoWatermark configuration, e.g. {"enabled": false}
callback_urlstringNoCallback URL for task status changes
external_task_idstringNoCustom task ID (unique on the user side, saved by the upstream)

multi_prompt Description

Define the index, prompt, and duration of each shot via index, prompt, and duration:

  • At most 6 shots, at least 1
  • Each shot prompt ≤ 512 characters
  • Each shot duration ≥ 1 second and ≤ the total task duration
  • The sum of all shot durations equals the total task duration
"multi_prompt": [
  { "index": 1, "prompt": "string", "duration": "5" },
  { "index": 2, "prompt": "string", "duration": "5" }
]

image_list Description

Reference image list, including subjects, scenes, style reference images, etc.; can also be used as the first or last frame to generate video.

ParameterTypeRequiredDescription
image_urlstringYesImage URL or Base64 (supports the data:image/...;base64, prefix; the gateway normalizes it automatically)
typestringNofirst_frame (first frame), end_frame (last frame). When there is a last frame, a first frame must also be present

Image requirements:

ItemLimit
Format.jpg / .jpeg / .png
File size≤ 10 MB
DimensionsWidth and height both ≥ 300 px
Aspect ratio1:2.5 ~ 2.5:1

Other rules:

  • If an image is not the first or last frame, do not configure the type parameter
  • Last frame only is not supported (when there is a last frame image, a first frame image must be present)
  • When generating video from a first frame or first & last frame, the video editing feature cannot be used
  • When using kling-video-o1, setting first/last frames is not supported when there are more than 2 images in the array
  • The image_url parameter value must not be empty

element_list Description

Subject reference list, configured based on the IDs of subjects in the Kling subject library.

ParameterTypeRequiredDescription
element_idlongYesThe subject ID in the subject library

Subjects are divided into video custom subjects (video character subjects) and image custom subjects (multi-image subjects), with different applicable scopes.

video_list Description

Reference videos, obtained via URL. Can be used as a feature reference video or as a video to be edited.

ParameterTypeRequiredDefaultDescription
video_urlstringYesVideo URL
refer_typestringNobasefeature (feature reference) / base (to be edited, instruction transform)
keep_original_soundstringNoKeep original sound: yes / no (also applies to the feature type)

Video requirements:

ItemLimit
FormatMP4 / MOV only
Duration≥ 3 seconds; upper limit depends on the model version
Resolution720 px ~ 2160 px (width/height dimensions)
Frame rate24 ~ 60 fps (output is 24 fps)
QuantityAt most 1 video
Size≤ 200 MB

Other rules:

  • When the reference video is a video to be edited (refer_type=base), you cannot define video first/last frames
  • When there is a reference video, the sound parameter value can only be off
  • The video_url parameter value must not be empty

mode Description

ModeOutput resolution
std720P
pro1080P
4k4K

Request Example

Image-to-Video

curl --request POST \
  --url "https://maasunion.com/kling/v1/omni/videos" \
  --header "Authorization: Bearer sk-xxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "model_name": "kling-video-o1",
    "prompt": "让<<<image_1>>>中的人物向镜头挥手",
    "image_list": [
      { "image_url": "https://example.com/reference.png" }
    ],
    "duration": "5",
    "mode": "pro",
    "aspect_ratio": "16:9"
  }'

Multi-Shot (kling-v3-omni)

curl --request POST \
  --url "https://maasunion.com/kling/v1/omni/videos" \
  --header "Authorization: Bearer sk-xxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "model_name": "kling-v3-omni",
    "multi_shot": true,
    "shot_type": "customize",
    "prompt": "",
    "multi_prompt": [
      { "index": 1, "prompt": "<<<image_1>>>A person sitting on a park bench, sunlight filtering through trees.", "duration": "2" },
      { "index": 2, "prompt": "A car speeding down a rainy street, headlights glowing.", "duration": "3" }
    ],
    "image_list": [{ "image_url": "https://example.com/frame.png" }],
    "mode": "pro",
    "sound": "on",
    "aspect_ratio": "16:9",
    "duration": "5"
  }'

Response Example (200)

{
  "code": 0,
  "message": "string",
  "request_id": "string",
  "data": {
    "task_id": "task_xxxxxxxx",
    "task_info": { "external_task_id": "string" },
    "task_status": "submitted",
    "created_at": 1722769557708,
    "updated_at": 1722769557708
  }
}
FieldDescription
codeError code; 0 means success
data.task_idGateway task ID (used for subsequent queries)
data.task_statussubmitted / processing / succeed / failed
data.created_at / updated_atUnix millisecond timestamps

Note: The response structure is identical to the official Kling one; data.task_id is the public task ID assigned by the gateway. Please save this ID for querying.


Query Task

GET https://maasunion.com/kling/v1/omni/videos/{task_id}

Path parameterTypeRequiredDescription
task_idstringYesThe data.task_id from the create task response

Request Example

curl --request GET \
  --url "https://maasunion.com/kling/v1/omni/videos/your-task-id" \
  --header "Authorization: Bearer sk-xxxxxxxx"

Response Example (Success)

{
  "code": 0,
  "message": "string",
  "request_id": "string",
  "data": {
    "task_id": "task_xxxxxxxx",
    "task_status": "succeed",
    "task_status_msg": "string",
    "watermark_info": { "enabled": false },
    "task_result": {
      "videos": [
        {
          "id": "string",
          "url": "string",
          "watermark_url": "string",
          "duration": "5"
        }
      ]
    },
    "task_info": { "external_task_id": "string" },
    "final_unit_deduction": "string",
    "created_at": 1722769557708,
    "updated_at": 1722769557708
  }
}
FieldDescription
data.task_statussubmitted / processing / succeed / failed
data.task_status_msgReason shown on failure (e.g. content moderation)
data.task_result.videos[].urlVideo download URL (valid for about 30 days; please persist in time)
data.task_result.videos[].watermark_urlWatermarked video URL
data.final_unit_deductionNumber of credits deducted by the upstream

Scenario Examples

Image/Subject Reference

curl --location "https://maasunion.com/kling/v1/omni/videos" \
  --header "Authorization: Bearer sk-xxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "model_name": "kling-video-o1",
    "prompt": "<<<image_1>>>在东京的街头漫步,偶遇<<<element_1>>>和<<<element_2>>>,并跳到<<<element_2>>>的怀里。视频画面风格与<<<image_2>>>相同",
    "image_list": [
      { "image_url": "https://example.com/a.png" },
      { "image_url": "https://example.com/b.png" }
    ],
    "element_list": [
      { "element_id": 123456789 },
      { "element_id": 987654321 }
    ],
    "mode": "pro",
    "aspect_ratio": "1:1",
    "duration": "7"
  }'

Instruction Transform (Video Editing)

curl --location "https://maasunion.com/kling/v1/omni/videos" \
  --header "Authorization: Bearer sk-xxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "model_name": "kling-video-o1",
    "prompt": "给<<<video_1>>>中的穿蓝衣服的女孩,戴上<<<image_1>>>中的王冠",
    "image_list": [{ "image_url": "https://example.com/crown.png" }],
    "video_list": [{
      "video_url": "https://example.com/input.mp4",
      "refer_type": "base",
      "keep_original_sound": "yes"
    }],
    "mode": "pro"
  }'

Video Reference (Camera Motion/Style)

curl --location "https://maasunion.com/kling/v1/omni/videos" \
  --header "Authorization: Bearer sk-xxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "model_name": "kling-video-o1",
    "prompt": "参考<<<video_1>>>的运镜方式,生成一段视频:<<<element_1>>>和<<<element_2>>>在东京街头漫步",
    "element_list": [
      { "element_id": 123456789 },
      { "element_id": 987654321 }
    ],
    "video_list": [{
      "video_url": "https://example.com/ref.mp4",
      "refer_type": "feature",
      "keep_original_sound": "yes"
    }],
    "mode": "pro",
    "aspect_ratio": "1:1",
    "duration": "7"
  }'

First & Last Frame

curl --location "https://maasunion.com/kling/v1/omni/videos" \
  --header "Authorization: Bearer sk-xxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "model_name": "kling-video-o1",
    "prompt": "视频中的人跳舞",
    "image_list": [
      { "image_url": "https://example.com/start.png", "type": "first_frame" },
      { "image_url": "https://example.com/end.png", "type": "end_frame" }
    ],
    "mode": "pro"
  }'

Capability Matrix

Featurekling-video-o1kling-v3-omni
Text-to-Video
Image-to-Video
Multi-image reference
First & last frame
Subject reference
Instruction transform (video editing)
Video reference (next shot)
Multi-shot
Sound generation (sound)
Modekling-video-o1kling-v3-omni
std (720P)
pro (1080P)
4k

Element Count Limits

Without Reference Video

ScenarioTotal reference images + multi-image subjectsNumber of video character subjects
Multi-image subjects only≤ 7
Video character subjects only≤ 3
Both≤ 4≤ 3

With Reference Video

  • Video character subjects are not supported
  • Total reference images + multi-image subjects ≤ 4

First & Last Frame Scenarios

  • When kling-v3-omni uses first & last frames, it supports up to 3 subjects
  • When kling-video-o1 uses first & last frames, subjects are not supported

FAQ

When can duration be specified?

  • Text-to-Video, Image-to-Video (without first & last frame): 3~10 seconds optional
  • Video editing (refer_type=base): cannot be specified; aligned with the input video
  • Other scenarios (no video + images/subjects, or video + refer_type=feature): 3~10 seconds optional

When is aspect_ratio required?

  • Not supported: Instruction transform (video editing), Image-to-Video (with first & last frame)
  • Usually required: Text-to-Video, image/subject reference, video reference, etc.

Relationship between multi_shot and prompt?

  • When multi_shot=true, prompt is invalid; you must use multi_prompt (shot_type=customize) or prompt (shot_type=intelligence)
  • When multi_shot=false, shot_type and multi_prompt are invalid

Notes

  1. Asynchronous task: The create endpoint only returns a task ID; you must poll the Query Task endpoint to get the video URL.
  2. Video URL validity: Valid for about 30 days after generation (anti-leech format); please persist in time.
  3. model_name is required: The request body must include model_name.
  4. Base64 images: The gateway automatically removes the data:image/...;base64, prefix before forwarding to the upstream.
  5. With a reference video: sound can only be off.
  6. Gateway query: Use the gateway task_id from the create response to query; do not use the original upstream ID.

For more general information, see Kling Gateway Overview.

How is this guide?