Kling O1 Video 2 Video Reference Serverless API
Kling Omni Video O1 generates visually coherent videos from references, ensuring identity preservation in every frame.
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) 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
https://api.segmind.com/v1/kling-o1-video-to-video-referenceParameters
promptrequiredstringDescribe the video continuation or modification. Use @Video1 to reference input video
video_urlrequiredstring (uri)URL of the reference video
aspect_ratiooptionalstringSets frame dimensions. Use 'auto' for automatic detection
"auto""auto""16:9""9:16""1:1"durationoptionalintegerVideo duration in seconds
5510elementsoptionalstringList of elements with frontal and reference images. Each element should have 'frontal_image_url' (str) and 'reference_image_urls' (list)
nullimage_urlsoptionalstring[]List of reference image URLs
keep_audiooptionalbooleanKeep the original audio from the input video
falseResponse Type
Returns: Video
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out