Kling O3 Image To Video
Kling O3 transforms static images into cinematic videos with precise motion control, multi-segment prompts, and optional synchronized audio.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-o3-image2video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "The mountain slowly comes alive as clouds drift past the summit, gentle wind blows through the peaks, cinematic motion, breathtaking",
12 "image_url": "https://segmind-resources.s3.amazonaws.com/input/kling-o3-i2v-input.png",
13 "duration": "5",
14 "mode": "pro",
15 "generate_audio": false,
16 "shot_type": "customize"
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-o3-image2video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "The mountain slowly comes alive as clouds drift past the summit, gentle wind blows through the peaks, cinematic motion, breathtaking",
12 "image_url": "https://segmind-resources.s3.amazonaws.com/input/kling-o3-i2v-input.png",
13 "duration": "5",
14 "mode": "pro",
15 "generate_audio": false,
16 "shot_type": "customize"
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text)API Endpoint
https://api.segmind.com/v1/kling-o3-image2videoParameters
image_urlrequiredstring (uri)The starting image to animate. This will be the first frame.
promptrequiredstringDescribe the motion and animation to create from the image.
durationoptionalstringLength of the output video in seconds.
"5""3""4""5""6""7""8""9""10""11""12"+3 moreend_image_urloptionalstring (uri)The ending image. Animation will transition from start to end.
generate_audiooptionalbooleanEnable to generate synchronized audio with the video.
falsemodeoptionalstringSelect quality mode. Standard for faster generation, Pro for higher quality.
"pro""std""pro"multi_promptoptionalobject[]Array of prompts with durations for multi-segment video.
promptoptionalstringPrompt for this segment.
durationoptionalstringDuration for this segment in seconds.
shot_typeoptionalstringCamera shot type for the video.
"customize"Response 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