Kling O1 Image 2 Video Serverless API
Transforms static images into dynamic, physics-driven animations for creative storytelling.
~142.03s
~$0.912
1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-o1-image-to-video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A seamless transformation of a man driving a vehicle and crashing",
12 "start_image_url": "https://segmind-resources.s3.amazonaws.com/output/d472b3e1-2b68-406d-9d12-a690c3da4045-seedance_1.5_input.webp",
13 "end_image_url": "https://segmind-resources.s3.amazonaws.com/output/dbc484a8-bcda-4b9c-97f6-d89dca2f3815-output-1767723467082.png",
14 "duration": "5"
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20 result = response.json()
21 print(json.dumps(result, indent=2))
22else:
23 print(f"Error: {response.status_code}")
24 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-o1-image-to-video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A seamless transformation of a man driving a vehicle and crashing",
12 "start_image_url": "https://segmind-resources.s3.amazonaws.com/output/d472b3e1-2b68-406d-9d12-a690c3da4045-seedance_1.5_input.webp",
13 "end_image_url": "https://segmind-resources.s3.amazonaws.com/output/dbc484a8-bcda-4b9c-97f6-d89dca2f3815-output-1767723467082.png",
14 "duration": "5"
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20 result = response.json()
21 print(json.dumps(result, indent=2))
22else:
23 print(f"Error: {response.status_code}")
24 print(response.text)API Endpoint
POST
https://api.segmind.com/v1/kling-o1-image-to-videoParameters
promptrequiredstringDescribe the video transformation or animation between start and end images
start_image_urlrequiredstring (uri)URL of the starting frame image
durationoptionalintegerVideo duration in seconds
Default:
5Allowed values :
510end_image_urloptionalstring (uri)URL of the ending frame image (optional)
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