kling-video-v3-omni API

Generate or edit 3–15-second video at 720p, 1080p, or 4K from text, images, and reference video. Audio and multiple shots depend on the input combination. Existing subjects and supported voices can be referenced.

POST /v1/videos/generations

Generates video from text, reference image, or reference video; also allows editing existing videos

Text-to-video generation

Required parameters: model, contents

Available parameters: model, prompt, contents, settings, options, wait, nonce, idempotency_key

Request parameters

ParameterTypeRequiredDescription
modelstringYesTarget video model Options: kling-video-v3-omni
promptstringNoFill in when using V3/Turbo text-to-video; when using the contents, specify text in type=prompt.
contentsarrayYesOmni is required; required for V3/Turbo image-to-video. Image/video materials and text prompts list follow the field rules described below in parameter details.
settingsobjectNo3~15 seconds; 720p, 1080p, or 4k. Supports 16:9, 9:16, and 1:1.
optionsobjectNoOptional watermark and external business identifiers
waitbooleanNofalse: returns task ID immediately after submission; true: returns current task status after a delay
noncestringNoGenerate a new nonce upon new generation; in case of exception, reuse the original value
idempotency_keystringNoCompatibility field, not used as basis for current video deduplication
resolutionstringNocompatible field; not added if settings object is present
first_frame_urlstringNoassembles first frame when no non-empty contents; converts action control to image
reference_imagesarrayNoAssemble reference images when contents is not empty; action control is limited to one image
reference_videosarrayNoAssemble reference videos when contents is not empty; only one segment, adhering to scene constraints
durationintegerNocompatible output duration; not added if settings object is present
aspect_ratiostringNocompatible aspect ratio; only passed in for applicable scenarios
audiostringNocompatible audio field; conforms to model and material combination restrictions
generate_audiobooleanNocompatible boolean field; does not indicate model support for audio generation
last_frame_urlstringNoassembles last frame when no contents; must satisfy first and last frame combination constraints
feature_video_urlstringNoAssemble reference videos when contents is empty
base_video_urlstringNoAssemble edited videos when contents is empty
## Parameter details The prompt can have up to 3072 characters, it is recommended not to exceed 2500. If there is no first frame or reference video, fill in settings.aspect_ratio. The request body uses JSON; the dot notation below represents nested fields, for example, `settings.resolution` is written inside the `settings` object. | Field | Type | Required | Description | |---|---|---|---| | `model` | string | Yes | Target video model; optional kling-video-v3-omni | | `prompt` | string | No | Fill in when using V3/Turbo text-to-video; when using the contents, specify text in type=prompt. | | `contents` | array | Yes | Omni is required; required for V3/Turbo image-to-video. Image/video materials and text prompts list follow the field rules described below in parameter details. | | `contents[].type` | string | Yes | Select according to the current model and scene; optional prompt, first_frame, last_frame, refer_image, feature_video, base_video, element, voice | | `contents[].text` | string | No | Required when type=prompt | | `contents[].url` | string | No | Image/video type is required, public HTTPS address | | `contents[].element_id` | string | No | Required when type=element, valid subject ID already exists | | `contents[].voice_id` | string | No | type=voice is required, and an effective voice ID must already exist | | `contents[].id` | string | No | voice and action control element use a unique reference name within the task | | `settings` | object | No | 3~15 seconds; 720p, 1080p, or 4k. Supports 16:9, 9:16, and 1:1. | | `settings.resolution` | string | No | Output clarity; optional 720p, 1080p, 4k; default is "720p" | | `settings.duration` | integer | No | Output duration of 3~15 integer seconds; default is 5 | | `settings.aspect_ratio` | string | No | Fill in when there is no first frame and no reference video; example usage: 16:9.; optional 16:9, 9:16, 1:1; default is "16:9" | | `settings.audio` | string | No | Limited by material combination; optional native, original, off; default is "off" | | `settings.multi_shot` | boolean | No | Multi-shot; limited by material combination; default is true | | `options` | object | No | Optional watermark and external business identifiers | | `options.external_task_id` | string | No | Business identifier; the current site still uses the returned ID for query | | `options.watermark_info` | object | No | Watermark options | | `options.watermark_info.enabled` | boolean | No | Enable watermark | | `wait` | boolean | No | false: returns the task ID immediately after submission; true: returns the current task status after a delay. Default is false | | `nonce` | string | No | Generate a new nonce upon new generation; in case of exception, reuse the original value | | `idempotency_key` | string | No | Compatibility field, not used as basis for current video deduplication | ## Query and response `GET /v1/videos/generations/{id}` queries a single task. `GET /v1/videos/generations?limit=20&offset=0` retrieves the task list, returning `data`, `total`, `limit`, `offset` pending / submitted / processing indicates in progress; succeeded indicates successful generation; failed / timeout / canceled indicates the task has ended. | Field | Type | Required | Description | |---|---|---|---| | `id` | string | No | Original query task ID preserved exactly | | `model` | string | No | Public model | | `status` | string | No | Official status; optional values: pending, submitted, processing, succeeded, failed, timeout, canceled, unknown | | `created_at` | integer | No | Unix timestamp | | `error` | object | No | Success is typically null; failure may include code and message | | `error.code` | string | No | Error code | | `error.message` | string | No | Error message | | `request_id` | string | No | Request identifier, not the task ID | | `code` | integer | No | Model result business code | | `message` | string | No | Result description | | `data` | array | No | Final model result list; must tolerate and be compatible with object shapes | | `data[].id` | string | No | Task identifier | | `data[].status` | string | No | Model result status | | `data[].message` | string | No | Task description | | `data[].create_time` | integer | No | Unix milliseconds | | `data[].update_time` | integer | No | Unix milliseconds | | `data[].outputs` | array | No | Video result | | `data[].outputs[].type` | string | No | video | | `data[].outputs[].id` | string | No | Output identifier, not the query task ID | | `data[].outputs[].url` | string | No | Temporary video URL, save promptly | | `data[].outputs[].duration` | string | No | Output duration in seconds, may include decimals; compatible with number type | | `data[].usage` | object | No | Optional native statistics; absence does not imply 0 | | `data[].usage.prompt_tokens` | integer | No | Native input tokens; unknown if not provided | | `data[].usage.input_tokens` | integer | No | Optional native input alias, retain according to actual field | | `data[].usage.completion_tokens` | integer | No | Native output tokens; no cross-coverage value filling | | `data[].usage.output_tokens` | integer | No | Optional native output alias, retain according to actual field | | `data[].usage.total_tokens` | integer | No | Total native count, may differ from official billing total; no additional charges | | `tokenhub_usage` | object | No | Official billing and reconciliation standard; no overlap with native statistics | | `tokenhub_usage.total_tokens` | integer | No | Valid non-negative integer, including explicit 0; actual cost uses official total | | `usage` | object | No | Quota, may be an alias of official quota or native statistics, cannot be billed again | | `usage.prompt_tokens` | integer | No | Native input tokens; unknown if not provided | | `usage.input_tokens` | integer | No | Optional native input alias, retain according to actual field | | `usage.completion_tokens` | integer | No | Native output tokens; no cross-coverage value filling | | `usage.output_tokens` | integer | No | Optional native output alias, retain according to actual field | | `usage.total_tokens` | integer | No | Determined by field source, cannot be duplicated with tokenhub_usage | Top-level `usage.total_tokens` represents the total usage of the task returned, which may include input from reference video; when verifying usage, do not rely solely on output duration. `tokenhub_usage` and `data` contain raw usage details and input/output sub-items only when provided in the response; different metrics are not additive, and absence does not indicate 0. The time, identifiers, media, and token numbers in the example are all fictional data. ## Retries and new tasks When request results are unclear, first query the original task; if no task ID is obtained, check the task list. For exception recovery, retain the original request content and `nonce`, and do not change the nonce in consecutive POST requests. A new nonce must be generated if a new request is needed. `idempotency_key` is a compatibility field and does not participate in the current video deduplication at this site; it cannot replace the nonce or provide independent idempotency guarantees. After a regular task completes, deduplication mappings may be released, and thus permanent deduplication cannot be guaranteed; requests that have been closed and retained with barriers do not imply they can be regenerated again. Retain the task ID and request ID for verification. ## Common errors | HTTP status | Processing notes | |---|---| | 400 | Parameter, material, billing mode, or current capability not supported | | 401 | Invalid token | | 403 | Insufficient permissions | | 402 | Insufficient available balance or reservation failed | | 404 | Task not found or unauthorized access | | 409 | Original submission pending confirmation; nonce not changed | | 422 | Public Schema or JSON validation failed | | 429 | Request restricted; verify the original task first | | 500 | Internal error; recipient status must be verified | | 502 | Generation service error; recipient status must be verified | | 503 | Temporarily unavailable. Verify whether the submission was accepted. | Cancellation is not supported when the task is still in progress. After generation, use the returned HTTPS URL to retrieve the video. The general structure of error responses is shown in the example on the right 400; specific fields are subject to actual return values. ## Requirements for reference materials contents supports prompt, first_frame, last_frame, refer_image, feature_video, base_video, element, and voice. Use up to 1 reference videos, each 3~15.5 seconds in MP4 or MOV, no larger than 200MB, with dimensions of 700~4553 px, up to 8294400 pixels, a frame rate of 24~60, and an aspect ratio of 0.4~2. Reference images and subjects share a limit of 7 without a reference video or 4 with one. Reference images must be JPEG or PNG, no larger than 50MB, at least 300 px wide and high, with an aspect ratio of 1:2.5~2.5:1. The combination of reference materials determines the supported range of audio and multi_shot; for video editing, retain original audio with audio=original, generate native audio with native, and use off for silent audio. Up to 2 valid voice IDs can be referenced; audio cannot be off; voice and subject must use existing valid IDs When using feature_video, do not include last_frame; use audio=off and multi_shot=true. When using base_video, do not include first_frame/last_frame; use audio=original or off, and multi_shot=false ## Reference images and videos Replace the media domain with your own material address ```json { "wait": false, "model": "kling-video-v3-omni", "contents": [ { "text": "Use the image appearance and the reference motion for the paper boat.", "type": "prompt" }, { "url": "https://media.example.com/reference.png", "type": "refer_image" }, { "url": "https://media.example.com/reference-3s.mp4", "type": "feature_video" } ], "settings": { "audio": "off", "duration": 3, "multi_shot": true, "resolution": "720p", "aspect_ratio": "16:9" } } ``` ## Edit an existing video Replace the media domain with your own material address ```json { "wait": false, "model": "kling-video-v3-omni", "contents": [ { "text": "Change the paper boat to blue while keeping the scene.", "type": "prompt" }, { "url": "https://media.example.com/base-3s.mp4", "type": "base_video" } ], "settings": { "audio": "original", "duration": 3, "multi_shot": false, "resolution": "720p" } } ``` ## Official references [Official API Guide](https://www.tencentcloud.com/zh/document/product/1300/83714) · [International Version Guide](https://intl.cloud.tencent.com/zh/document/product/1300/83714) · [Official Pricing Information](https://www.tencentcloud.com/zh/document/product/1300/78937)

Request example

curl --request POST \
  'https://api.router.ai/v1/videos/generations' \
  -H "Authorization: Bearer $OPENCROW_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{
  "model": "kling-video-v3-omni",
  "contents": [
    {
      "type": "prompt",
      "text": "A small paper boat floats on a calm lake."
    }
  ],
  "settings": {
    "duration": 3,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "audio": "off"
  },
  "wait": false
}'

Endpoint reference: Aliyun Wan video generation