Kling 2.5 Turbo Serverless API
Kling AI 2.5 Turbo generates fluid, cinematic videos from text and images, enhancing content creation and storytelling.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-2.5-turbo"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A beloved community figure moves through a 1920s street carnival, warmly interacting with attendees. Vintage cars, dancing performers, and striped carnival tents fill the scene. Camera follows closely in a handheld cinematic style, capturing intimate smiles and connections, shallow depth of field, 4K UHD, golden warm lighting.",
12 "negative_prompt": "no dark tones, no blur, no distort",
13 "cfg_scale": 0.7,
14 "duration": "10",
15 "mode": "pro",
16 "aspect_ratio": "16:9"
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-2.5-turbo"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A beloved community figure moves through a 1920s street carnival, warmly interacting with attendees. Vintage cars, dancing performers, and striped carnival tents fill the scene. Camera follows closely in a handheld cinematic style, capturing intimate smiles and connections, shallow depth of field, 4K UHD, golden warm lighting.",
12 "negative_prompt": "no dark tones, no blur, no distort",
13 "cfg_scale": 0.7,
14 "duration": "10",
15 "mode": "pro",
16 "aspect_ratio": "16:9"
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-2.5-turboParameters
promptrequiredstringEnter desired video effects like 'smooth zoom'. For creativity, try 'vibrant kaleidoscope'.
"A beloved community figure moves through a 1920s street carnival, warmly interacting with attendees. Vintage cars, dancing performers, and striped carnival tents fill the scene. Camera follows closely in a handheld cinematic style, capturing intimate smiles and connections, shallow depth of field, 4K UHD, golden warm lighting."aspect_ratiooptionalstringSet video frame size. '16:9' for widescreens, '1:1' for social media, '9:16' for vertical. If an image input is provided, the video will follow the size or aspect ratio based on the image dimensions.
"16:9""16:9""9:16""1:1"cfg_scaleoptionalnumberControl effect sharpness, 0.7 for balance. Increase to 0.8 for more emphasis.
0.7Range: 0 - 1durationoptionalintegerChoose how long the video plays. '10' for a detailed experience, '5' for a brief preview.
10510image_urloptionalstring (uri)Provide a URL for video background. High-quality URLs enhance visual appeal.
nullmodeoptionalstringSelect quality mode. 'Pro' offers highest definition for professional output.
"pro""pro"negative_promptoptionalstringMention effects to exclude, like 'no blur' for clarity. Try 'no dark colors'.
"no dark tones, no blur, no distort"tail_image_urloptionalstring (uri)Specifies the image URL to display at the conclusion of the video. This feature is available only in Pro mode and requires image_url input to be provided.
nullResponse 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