Video Generation
Omni video generation with Kling O1. Combine prompts, images, Elements, and videos in one API. Async task API: submit a request, receive a task ID, then poll for status to get the result.
Unified omni video generation with Kling O1. Combine text prompts, first/last frames, reference images, Elements, feature videos, and base videos in a single request. Supports 720p / 1080p resolution and 3–10 second duration.
This is an async task-based API: submit a request to receive a task id, poll for status, then download the video when complete.
Only Kling O1 is supported.
Base URL
https://api.autorouter.top— Production
Authentication
BearerAuth: http (bearer)
Authenticate using a Bearer Token.
Format: Authorization: Bearer sk-xxxxxx
Endpoints
POST /kling/omni-video/kling-o1
Create Video Generation Task
Create an omni video generation task from a contents collection (prompts, images, Elements, videos, etc.).
Headers
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
Content-Type | string | Yes | application/json | Data exchange format |
Authorization | string | Yes | - | Auth header. Format: Bearer sk-xxxxxx |
Request Body
Content-Type: application/json
Example:
{
"contents": [
{
"type": "prompt",
"text": "A girl sat on the train, looking out the window with a melancholic expression, her head swaying with the train."
},
{
"type": "first_frame",
"url": "https://example.com/first.png",
"id": "image_1"
},
{
"type": "refer_image",
"url": "https://example.com/refer.png",
"id": "image_2"
}
],
"settings": {
"resolution": "1080p",
"duration": 3,
"audio": "off"
},
"options": {
"callback_url": "https://xxx/callback",
"external_task_id": "",
"watermark_info": {
"enabled": false
}
}
}Properties:
| Name | Type | Required | Default | Enum | Description |
|---|---|---|---|---|---|
contents | array | Yes | - | - | Reference input collection (prompts, images, Elements, videos, etc.) |
contents[].type | string | Yes | - | prompt, first_frame, last_frame, refer_image, feature_video, base_video, element | Input type |
settings | object | No | - | - | Output config such as resolution and duration |
settings.audio | string | No | off | original, off | Whether to generate audio for the video |
settings.resolution | string | No | 720p | 720p, 1080p | Resolution of the generated video |
settings.aspect_ratio | string | No | 16:9 | 16:9, 9:16, 1:1 | Aspect ratio (width:height) of generated frames |
settings.duration | int | No | 5 | 3–10 | Video duration in seconds |
options | object | No | - | - | General config such as callback URL and watermark |
options.callback_url | string | No | - | - | Callback URL for task status change notifications |
options.external_task_id | string | No | - | - | Custom task ID |
options.watermark_info | object | No | - | - | Whether to also generate a watermarked result |
contentsarray(Required)
Reference input collection. Format:
[
{
"type": "prompt",
"text": "string"
},
{
"type": "first_frame",
"url": "string",
"id": "string"
},
{
"type": "last_frame",
"url": "string",
"id": "string"
},
{
"type": "refer_image",
"url": "string",
"id": "string"
},
{
"type": "feature_video",
"url": "string",
"id": "string"
},
{
"type": "base_video",
"url": "string",
"id": "string"
},
{
"type": "element",
"element_id": "string",
"id": "string"
}
]Input type:
prompt: Text promptfirst_frame: First-frame imagelast_frame: Last-frame imagerefer_image: Reference image (scene, style, etc.)feature_video: Feature reference videobase_video: Base video to editelement: Element (multi-image Elements only; video Elements are not yet supported)
{
"type": "prompt",
"text": "string"
}text: Text prompt with positive/negative descriptions. Max 2500 characters- Reference an image, Element, or video in the prompt with
@xxx, e.g.@image_1,@Zhang,@video_1 - Avoid Element names that are substrings of each other (e.g.
@Zhangand@ZhangSan) - Avoid Element names that overlap with prompt text (e.g. do not use
@gmailif the prompt contains an email address) - For more guidance, see the Kling O1 Model User Guide
{
"type": "first_frame",
"url": "string",
"id": "string"
}url: Image URL or Base64 (required)id: Input index ID for use in the prompt; must be unique within the same task (optional)- Formats:
.jpg,.jpeg,.png - Size: max 50MB
- Dimensions: width and height ≥ 300px; aspect ratio between
1:2.5and2.5:1
Quantity limits:
- No reference video + multi-image Elements: reference images + multi-image Elements ≤ 7
- With a reference video + multi-image Elements: reference images + multi-image Elements ≤ 4
First / last frame rules:
- Only “first frame only” and “first + last frame” are supported; “last frame only” is not supported
- When using both first and last frames, no additional reference images can be added
{
"type": "feature_video",
"url": "string",
"id": "string"
}url: Video URL (required)id: Input index ID for use in the prompt; must be unique within the same task (optional)- Formats:
.mp4,.mov - Size: max 200MB
- Duration: 3–10 seconds (inclusive)
- Dimensions: width and height between 700px and 2160px (inclusive)
- Frame rate: 24–60 fps (generated video is 24 fps)
- At most one reference video per task
feature_video: only supports defining the first frame of the video, not the last framebase_video(video to edit): does not support defining first or last frames
{
"type": "element",
"element_id": "string",
"id": "string"
}element_id: Element ID returned by the Element Management API (required)id: Input index ID for use in the prompt; must be unique within the same task (required)- Currently only multi-image Elements are supported; video Elements are not yet supported
- Using first + last frames: Elements are not supported
- No reference video: reference images + Elements ≤ 7
- With reference video: reference images + Elements ≤ 4
settingsobject(Optional)
Output configuration such as resolution and duration.
Whether to generate audio for the video. Default off.
original: Keep the original sound of the reference videooff: No audio
Output video resolution. Default 720p.
720p: 720P output1080p: 1080P output
Aspect ratio of generated video frames. Default 16:9.
Options: 16:9, 9:16, 1:1
Required when there is no first frame and no reference video.
Video duration in seconds. Default 5.
Options: 3, 4, 5, 6, 7, 8, 9, 10
When using a first frame with no other reference images (refer_image) or videos (feature_video / base_video), only 5-second or 10-second videos can be generated.
optionsobject(Optional)
General configurations such as callback URL and watermark.
{
"callback_url": "https://example.com/cb",
"external_task_id": "string",
"watermark_info": {
"enabled": false
}
}Callback URL for task result notifications. If set, the server sends a notification when the task status changes.
Custom task ID. Does not overwrite the system-generated task ID and can be used for querying. Must be unique within the account.
Whether to also generate a watermarked result, controlled by enabled:
{
"enabled": false
}true: Include watermarked resultfalse(default): No watermark
Custom watermarks are not supported.
Responses
200: Task created successfully
Content-Type: application/json
Request Example
curl -X POST "https://api.autorouter.top/kling/omni-video/kling-o1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-d '{
"contents": [
{
"type": "prompt",
"text": "A girl sat on the train, looking out the window with a melancholic expression, her head swaying with the train."
},
{
"type": "first_frame",
"url": "https://example.com/first.png",
"id": "image_1"
},
{
"type": "refer_image",
"url": "https://example.com/refer.png",
"id": "image_2"
}
],
"settings": {
"resolution": "1080p",
"duration": 3,
"audio": "off"
},
"options": {
"callback_url": "https://xxx/callback",
"watermark_info": {
"enabled": false
}
}
}'Response Example
{
"code": 0,
"message": "string",
"request_id": "string",
"data": {
"id": "string",
"status": "submitted",
"create_time": 1781080778802,
"update_time": 1781080794151,
"external_id": "string"
}
}Response fields:
| Name | Type | Description |
|---|---|---|
code | integer | Error code; 0 means success |
message | string | Error message |
request_id | string | Request ID generated by the system |
data.id | string | System-generated task ID |
data.status | string | Task status: submitted, processing, succeeded, failed |
data.create_time | integer | Task creation time, Unix timestamp (ms) |
data.update_time | integer | Task update time, Unix timestamp (ms) |
data.external_id | string | Custom task ID, if any |
More Scenario Examples
First frame & refer_image
curl -X POST "https://api.autorouter.top/kling/omni-video/kling-o1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-d '{
"contents": [
{
"type": "prompt",
"text": "A girl sat on the train, looking out the window with a melancholic expression, her head swaying with the train."
},
{
"type": "first_frame",
"url": "https://example.com/first.png",
"id": "image_1"
},
{
"type": "refer_image",
"url": "https://example.com/refer.png",
"id": "image_2"
}
],
"settings": {
"resolution": "1080p",
"duration": 3,
"audio": "off"
}
}'First frame & Element & feature_video
curl -X POST "https://api.autorouter.top/kling/omni-video/kling-o1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-d '{
"contents": [
{
"type": "prompt",
"text": "Change the color of the parrot'\''s feathers to match the reference image. Keep all other elements of the video unchanged."
},
{
"type": "element",
"element_id": "161",
"id": "element_1"
},
{
"type": "first_frame",
"url": "https://example.com/first.png",
"id": "image_1"
},
{
"type": "feature_video",
"url": "https://example.com/feature.mp4",
"id": "video_1"
}
],
"settings": {
"resolution": "1080p",
"aspect_ratio": "16:9",
"audio": "off"
}
}'Base video & refer_image
curl -X POST "https://api.autorouter.top/kling/omni-video/kling-o1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-d '{
"contents": [
{
"type": "prompt",
"text": "Change the color of the parrot'\''s feathers to match the reference image. Keep all other elements of the video unchanged."
},
{
"type": "refer_image",
"url": "https://example.com/refer.png",
"id": "image_1"
},
{
"type": "base_video",
"url": "https://example.com/base.mp4",
"id": "video_1"
}
],
"settings": {
"resolution": "1080p",
"aspect_ratio": "16:9",
"audio": "off"
}
}'GET /kling/tasks
Query Video Generation Task
Query async task status and results by task ID or custom task ID.
- Use either
task_idsorexternal_task_ids, not both - Batch queries are supported; separate multiple IDs with
, - Generated results are cleared after about 30 days; save them promptly
Query Params
| Name | Type | Required | Description |
|---|---|---|---|
task_ids | string | No | System-generated task IDs, comma-separated |
external_task_ids | string | No | Custom task IDs, comma-separated |
Responses
200: Task queried successfully
Content-Type: application/json
Request Example
curl -X GET "https://api.autorouter.top/kling/tasks?task_ids={id}" \
-H "Authorization: Bearer sk-xxxxxx"Response Example
Full response schema for reference. Fields under each
outputsitem differ bytype(video/image/audio/voice/element). Video generation success typically returns only atype=videoitem.
{
"code": 0,
"message": "string",
"request_id": "string",
"data": [
{
"id": "893605946402811985",
"status": "succeeded",
"message": "string",
"create_time": 1781080778802,
"update_time": 1781080794151,
"external_id": "string",
"outputs": [
{
"type": "video",
"id": "string",
"url": "string",
"watermark_url": "string",
"duration": "string"
},
{
"type": "image",
"url": "string",
"watermark_url": "string",
"group_id": "string"
},
{
"type": "audio",
"id": "string",
"mp3_url": "string",
"wav_url": "string",
"mp3_duration": "string",
"wav_duration": "string"
},
{
"type": "voice",
"id": "string",
"name": "string",
"url": "string",
"owned_by": "string",
"status": "succeeded"
},
{
"type": "element",
"id": "string",
"name": "string",
"description": "string",
"element_type": "string",
"references": [
{
"type": "image",
"role": "string",
"url": "string"
},
{
"type": "video",
"role": "refer",
"url": "string"
},
{
"type": "voice",
"role": "refer",
"url": "string",
"id": "string",
"name": "string",
"owned_by": "string"
}
],
"owned_by": "string",
"status": "string",
"tags": [
{
"id": 1,
"name": "string",
"description": "string"
}
]
}
],
"billing": [
{
"charge_type": "string",
"cash_type": "string",
"amount": "string",
"package_type": "string",
"list_price": "string"
}
]
}
]
}Response fields:
| Name | Type | Description |
|---|---|---|
code | integer | Error code; 0 means success |
message | string | Error information |
request_id | string | Request ID generated by the system, used for tracing and troubleshooting |
data | object[] | Task list |
data[].id | string | Task ID being queried |
data[].status | string | Task status: submitted, processing, succeeded, failed |
data[].message | string | Status message; failure reason when failed (e.g. content risk control) |
data[].create_time | integer | Task creation time, Unix timestamp (ms) |
data[].update_time | integer | Task update time, Unix timestamp (ms) |
data[].external_id | string | Custom task ID, if any |
data[].outputs | object[] | Generated results; fields vary by type, see below |
data[].outputs[].type | string | Result type: image, video, audio, element, voice |
data[].billing | object[] | Billing details, see below |
data[].billing[].charge_type | string | Consumption account type: cash (balance), unit (resource package) |
data[].billing[].cash_type | string | Balance type when charge_type=cash: balance, test_balance |
data[].billing[].amount | string | Deduction amount; discounted price for balance, units for resource package |
data[].billing[].package_type | string | Resource package type when charge_type=unit: video, image, audio |
data[].billing[].list_price | string | Balance list price when charge_type=cash |
statusstring
Task status:
submitted: Submittedprocessing: Processingsucceeded: Succeededfailed: Failed
Recommended poll interval: 3–5 seconds until status is succeeded or failed.
outputsobject[]
Generated results. Fields depend on type. Possible values: image, video, audio, element, voice. Video generation success typically returns type=video.
| Name | Type | Description |
|---|---|---|
type | string | Always video |
id | string | Video ID generated by the system |
url | string | Result URL (hotlink-protected; cleared after ~30 days, save promptly) |
watermark_url | string | Watermarked result URL (hotlink-protected) |
duration | string | Generated video duration in seconds |
| Name | Type | Description |
|---|---|---|
type | string | Always image |
url | string | Result URL (hotlink-protected; cleared after ~30 days) |
watermark_url | string | Watermarked image download URL (hotlink-protected) |
group_id | string | Appears only for grouped images, marks grouping relationship |
| Name | Type | Description |
|---|---|---|
type | string | Always audio |
id | string | Audio ID generated by the system |
mp3_url | string | MP3 result URL (hotlink-protected; cleared after ~30 days) |
wav_url | string | WAV result URL (hotlink-protected; cleared after ~30 days) |
mp3_duration | string | MP3 duration in seconds |
wav_duration | string | WAV duration in seconds |
| Name | Type | Description |
|---|---|---|
type | string | Always voice |
id | string | Audio ID generated by the system |
name | string | Audio name |
url | string | Material download link |
owned_by | string | Voice source: kling for official library, numbers for creator IDs |
status | string | Status: succeeded, deleted |
| Name | Type | Description |
|---|---|---|
type | string | Always element |
id | string | Element ID generated by the system |
name | string | Element name |
description | string | Element description |
element_type | string | Element type: video_character_elements, multi_image_elements |
references | object[] | Related materials |
references[].type | string | Material type: image, video, voice |
references[].role | string | Role; image: frontal / reference; video and voice: refer |
references[].url | string | Material download link |
references[].id | string | Voice ID (when type=voice) |
references[].name | string | Voice name (when type=voice) |
references[].owned_by | string | Voice source (when type=voice) |
owned_by | string | Element source: kling for official library, numbers for creator IDs |
status | string | Status: succeeded, deleted |
tags | object[] | Element tags |
tags[].id | integer | Tag ID |
tags[].name | string | Tag name |
tags[].description | string | Tag description |
billingobject[]
Billing details.
Consumption account type:
cash: Balance deductionunit: Resource package deduction
Balance type, only when charge_type=cash:
balance: Official quotatest_balance: Test quota
Deduction amount. For charge_type=cash, discounted balance price; for charge_type=unit, resource package units deducted (decimal string).
Resource package type, only when charge_type=unit. Fixed enum: video, image, audio.
Balance list price, only when charge_type=cash.
Error Handling
HTTP 400 Parameter Errors
| Scenario | Suggestion |
|---|---|
Missing contents | Provide the required field |
Invalid contents[].type | Use documented enum values |
| First + last frames with extra reference images | Do not add refer_image when using both frames |
Missing aspect_ratio without first frame / reference video | Set settings.aspect_ratio |
Invalid duration / resolution | Use documented enum values |
HTTP 401 / 403 Auth Errors
401 Unauthorized: Invalid or expired API Key403 Forbidden: API Key is not allowed to access this model
HTTP 402 Insufficient Balance
Insufficient balance. Please top up in the AutoRouter console.
Task failed Status
| Cause | Suggestion |
|---|---|
| Content moderation failed | Adjust the prompt and avoid sensitive content |
| Invalid parameter combination | Follow the Request Body rules |
When a task fails, AutoRouter automatically refunds your account.
Omni
Unified Omni video generation with Kling 3.0 Omni. Combine prompts, images, Elements, and reference videos. Async task API: submit, poll, then download.
Multimodal Video Generation
Generate videos with MiniMax-H3 multimodal content arrays (text / image / video / audio). Supports text-to-video, image-to-video (first/last frame), and multimodal reference-to-video with 2K output. Async task API: submit to receive task_id, then poll for status.