Kling O1 Video 2 Video Reference Serverless API

Kling Omni Video O1 generates visually coherent videos from references, ensuring identity preservation in every frame.

~239.72s
~$1.424
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/kling-o1-video-to-video-reference"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "Based on @Video1, generate the next shot. Keep the style of the video man drives fast and fall on the road",
12    "video_url": "https://segmind-inference-inputs.s3.amazonaws.com/2c499e1e-2b40-4833-b9dd-37a47f8e52e6-seedance_1.5_output.mp4",
13    "image_urls": [
14        "https://segmind-inference-inputs.s3.amazonaws.com/bacc9f7c-6375-4138-9695-d4654f59d78a-output-1767722935251.png",
15        "https://segmind-inference-inputs.s3.amazonaws.com/bf576f0d-58e5-4234-9431-523d34df184e-output-1767723467082.png"
16    ],
17    "aspect_ratio": "auto",
18    "duration": "5",
19    "keep_audio": false
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25    result = response.json()
26    print(json.dumps(result, indent=2))
27else:
28    print(f"Error: {response.status_code}")
29    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/kling-o1-video-to-video-reference

Parameters

promptrequired
string

Describe the video continuation or modification. Use @Video1 to reference input video

video_urlrequired
string (uri)

URL of the reference video

aspect_ratiooptional
string

Sets frame dimensions. Use 'auto' for automatic detection

Default: "auto"
Allowed values :
"auto""16:9""9:16""1:1"
durationoptional
integer

Video duration in seconds

Default: 5
Allowed values :
510
elementsoptional
string

List of elements with frontal and reference images. Each element should have 'frontal_image_url' (str) and 'reference_image_urls' (list)

Default: null
image_urlsoptional
string[]

List of reference image URLs

keep_audiooptional
boolean

Keep the original audio from the input video

Default: false

Response Type

Returns: Video

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out