Kling O3 Video To Video Reference

Transform any video with AI — swap characters, change styles, and edit scenes using reference images and natural language prompts.

~213.36s
$0.945 - $6.30 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/kling-o3-video2video-reference"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "Transform the scene into a magical winter wonderland with snow falling, frosted trees, and a dreamy cinematic atmosphere",
12    "video_url": "https://segmind-resources.s3.amazonaws.com/input/kling-o3-v2v-input-video.mp4",
13    "mode": "pro",
14    "duration": "5",
15    "aspect_ratio": "16:9",
16    "keep_audio": false,
17    "shot_type": "customize"
18}
19
20response = requests.post(url, headers=headers, json=data)
21
22if response.status_code == 200:
23    result = response.json()
24    print(json.dumps(result, indent=2))
25else:
26    print(f"Error: {response.status_code}")
27    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/kling-o3-video2video-reference

Parameters

promptrequired
string

Describe the transformation. Use @Element1, @Element2 for elements and @Image1, @Image2 for reference images.

video_urlrequired
string (uri)

Input video to transform. Width must be 720-2160px.

aspect_ratiooptional
string

Set the aspect ratio for the output video.

Default: "16:9"
Allowed values :
"16:9""9:16""1:1"
durationoptional
string

Length of the output video in seconds.

Default: "5"
Allowed values (13 total):
"3""4""5""6""7""8""9""10""11""12"+3 more
elementsoptional
object[]

Character/object elements to include. Reference in prompt with parentheses like (element1). Max 10 elements.

Array items:
frontal_image_urloptional
string (uri)

Frontal view image of the character or object.

reference_image_urlsoptional
string[]

Up to 3 reference images for this element.

image_urlsoptional
string[]

Reference image URLs for style or scene guidance. Reference in prompt as @Image1, @Image2.

keep_audiooptional
boolean

Keep original audio from the input video.

Default: true
modeoptional
string

Select quality mode. Standard for faster generation, Pro for higher quality.

Default: "pro"
Allowed values :
Standard"std"
Pro"pro"
shot_typeoptional
string

Camera shot type for the video.

Default: "customize"

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