Kling AI 1.6 Image to Video
Kling AI 1.6 Image-to-Video is a powerful AI tool that transforms static images into captivating, animated videos. Create high-quality content effortlessly with Kling AI's advanced capabilities.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-1.6-image2video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/kling-1.6-i2v-ip.png",
12 "prompt": "group of people talking to each other in an office setting",
13 "negative_prompt": "No sudden movements, no fast zooms.",
14 "cfg_scale": 0.5,
15 "mode": "pro",
16 "duration": "5"
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-1.6-image2video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/kling-1.6-i2v-ip.png",
12 "prompt": "group of people talking to each other in an office setting",
13 "negative_prompt": "No sudden movements, no fast zooms.",
14 "cfg_scale": 0.5,
15 "mode": "pro",
16 "duration": "5"
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-1.6-image2videoParameters
imagerequiredstring (uri)URL of the input image to be animated
"https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/kling-1.6-i2v-ip.png"cfg_scaleoptionalnumberCFG scale to control how closely the animation matches the prompt (range 0-1)
0.5Range: 0 - 1durationoptionalintegerDuration of the animation in seconds
5510modeoptionalstringMode of generation
"pro""std""pro"negative_promptoptionalstringDescription of unwanted animation effects
"No sudden movements, no fast zooms."promptoptionalstringText prompt to describe the desired animation effect
"group of people talking to each other in an office setting"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