Kling O1
Kling O1 video generation API for text, image, and video inputs.
Kling O1 uses an asynchronous task API for text, image, element, and video inputs. Submit a task, receive its ID, then query the task for status and outputs.
Create a task
| Item | Value |
|---|---|
| Method | POST |
| URL | https://api.tokenhub.belivestudios.com/omni-video/kling-o1 |
| Authentication | Header Authorization: Bearer sk-your-belive-studios-key |
| Content-Type | application/json |
curl https://api.tokenhub.belivestudios.com/omni-video/kling-o1 \
-H "Authorization: Bearer sk-your-belive-studios-key" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"type": "prompt",
"text": "Have the subject walk naturally through a city street while the camera follows smoothly"
},
{
"type": "first_frame",
"url": "https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-tob-release_note/image_25.png",
"id": "image_1"
},
{
"type": "refer_image",
"url": "https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-tob-release_note/image_25.png",
"id": "image_2"
}
],
"settings": {
"resolution": "1080p",
"duration": 5,
"aspect_ratio": "16:9",
"audio": "off"
},
"options": {
"external_task_id": "video-task-o1",
"watermark_info": {
"enabled": false
}
}
}'Request parameters
| Field | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
contents | array | Yes | - | - | Collection of prompt, image, element, and video inputs. |
contents[].type | string | Yes | - | prompt, first_frame, last_frame, refer_image, feature_video, base_video, element | Input type. |
contents[].text | string | Required for prompt | - | - | Prompt text, up to 2,500 characters. |
contents[].url | string | Required for image/video types | - | URL (Base64 for images) | Image or video content. |
contents[].id | string | No (element requires it) | - | - | Per-task asset ID, referenced as @id; must be unique. |
contents[].element_id | string | Required for element | - | - | System-generated element ID. |
settings | object | No | - | - | Output settings. |
settings.audio | string | No | off | original, off | Keep reference-video audio or disable audio. |
settings.resolution | string | No | 720p | 720p, 1080p | Output resolution. |
settings.aspect_ratio | string | Conditional | 16:9 | 16:9, 9:16, 1:1 | Must be supplied when there is no first frame and no reference video. |
settings.duration | integer | No | 5 | 3–10 | Duration in seconds. First-frame-only input without other references supports only 5 or 10 seconds. |
options | object | No | - | - | Callback, custom task ID, and watermark settings. |
options.callback_url | string | No | - | - | URL that receives task status callbacks. |
options.external_task_id | string | No | - | - | Account-unique custom task ID, also usable for queries. |
options.watermark_info | object | No | - | - | Watermark configuration. |
options.watermark_info.enabled | boolean | No | false | true, false | Whether to generate a watermarked result. Custom watermarks are not supported. |
contents input types
type | Purpose | Fields |
|---|---|---|
prompt | Prompt input | text |
first_frame | First-frame image | url; optional id |
last_frame | Last-frame image | url; optional id |
refer_image | Scene, style, or element reference image | url; optional id |
feature_video | Feature reference video | url; optional id |
base_video | Video to edit | url; optional id |
element | Previously created element | element_id, id |
Input and combination rules
- Images: JPG, JPEG, or PNG; up to 50 MB; both dimensions at least 300 px; aspect ratio
1:2.5to2.5:1. - Videos: MP4 or MOV; up to 200 MB; 3–10 seconds; 700–2160 px; 24–60 fps; at most one reference video.
first_frame,last_frame, andrefer_imageuse images. First-frame-only or first-plus-last-frame is supported; last-frame-only is not. Do not add other reference images when both first and last frames are used.feature_videosupports a first-frame definition only.base_videocannot define a first or last frame.elementsupports multi-image elements only, not video-character elements. Elements cannot be used with first/last-frame generation.- Image and element counts together must not exceed 7 without a reference video, or 4 with a reference video.
- Use
@idin the prompt to reference an image, element, or video. IDs must be unique and should not contain one another or create ambiguity with prompt text.
Create response
{
"code": 0,
"message": "string",
"request_id": "string",
"data": {
"id": "893605946402811985",
"status": "submitted",
"create_time": 1781080778802,
"update_time": 1781080794151,
"external_id": "video-task-o1"
}
}status can be submitted, processing, succeeded, or failed.
| Field | Description |
|---|---|
code | Error code; 0 indicates success. |
message | Error or status message. |
request_id | System-generated request ID for tracing. |
data.id | System-generated task ID. |
data.status | Current task status. |
data.create_time, data.update_time | Creation and update times as Unix millisecond timestamps. |
data.external_id | Custom task ID, when supplied. |
Query a task
GET https://api.tokenhub.belivestudios.com/tasks
Provide exactly one of task_ids or external_task_ids; multiple IDs can be comma-separated.
| Query parameter | Type | Required | Description |
|---|---|---|---|
task_ids | string | One of the two | System task IDs, comma-separated for a batch. |
external_task_ids | string | One of the two | Custom task IDs, comma-separated for a batch. |
curl "https://api.tokenhub.belivestudios.com/tasks?task_ids=893605946402811985" \
-H "Authorization: Bearer sk-your-belive-studios-key" \
-H "Content-Type: application/json"The response contains code, message, request_id, and data[]. Each task can include:
| Field | Description |
|---|---|
id, status, message | Task ID, state, and status message; failures include the reason. |
create_time, update_time | Creation and update times as Unix millisecond timestamps. |
external_id | Custom task ID, when supplied. |
outputs | Generated outputs. URLs are generally removed after 30 days; save them promptly. |
billing | Billing details for the task. |
{
"code": 0,
"message": "string",
"request_id": "string",
"data": [
{
"id": "893605946402811985",
"status": "succeeded",
"message": "string",
"create_time": 1781080778802,
"update_time": 1781080794151,
"external_id": "video-task-o1",
"outputs": [
{
"type": "video",
"id": "string",
"url": "string",
"watermark_url": "string",
"duration": "5"
}
],
"billing": [
{
"charge_type": "cash",
"cash_type": "balance",
"amount": "string",
"currency": "CNY",
"list_price": "string"
}
]
}
]
}outputs[] fields depend on type:
video:id,url,watermark_url,duration.image:url,watermark_url,group_id(for grouped images).audio:id,mp3_url,wav_url,mp3_duration,wav_duration.voice:id,name,url,owned_by,status.element:id,name,description,element_type,references,owned_by,status,tags.
Element references[] can contain type, role, and url; voice references can also include id, name, and owned_by. Each tags[] entry has id, name, and description.
billing[] field | Description |
|---|---|
charge_type | cash for credit or unit for a resource package. |
cash_type | balance or test_balance; present for charge_type=cash. |
amount | Deducted amount: discounted price for credit, or points for packages. |
currency | CNY or USD; present for cash charges. |
package_type | video, image, or audio; present for unit charges. |
list_price | Credit list price; present for cash charges. |
Cursor query
POST https://api.tokenhub.belivestudios.com/tasks
This endpoint only queries asynchronous, non-real-time tasks. For the first request, use a time range and filters. For subsequent pages, pass the previous response's data.next_cursor as cursor; when cursor is supplied, start_time and end_time are ignored. The request body supports start_time, end_time, cursor, limit, and filters:
| Field | Type | Default | Description |
|---|---|---|---|
start_time | string | 30 days before end_time | Unix millisecond timestamp; must be earlier than end_time. |
end_time | string | Current time | Unix millisecond timestamp. |
cursor | string | - | Previous data.next_cursor; when supplied, the time range is ignored. |
limit | integer | 100 | Number of tasks, up to 500. |
filters | array | - | Query filter collection. |
filters[].key | string | - | status or product_type. |
filters[].values | array | - | Status: submitted, processing, succeeded, failed; product type: video, image, try_on. |
curl https://api.tokenhub.belivestudios.com/tasks \
-H "Authorization: Bearer sk-your-belive-studios-key" \
-H "Content-Type: application/json" \
-d '{
"limit": 100,
"filters": [
{
"key": "status",
"values": [
"succeeded"
]
},
{
"key": "product_type",
"values": [
"video"
]
}
]
}'Results are in data.result, with data.count, data.next_cursor, and data.has_more. Each result uses the same task fields as the ID query.
To fetch the next page, pass the previous response's data.next_cursor as cursor:
{
"cursor": "data.next_cursor from the previous response",
"limit": 100,
"filters": [
{
"key": "product_type",
"values": ["video"]
}
]
}