Kling 2.5 Turbo Serverless API

Kling AI 2.5 Turbo generates fluid, cinematic videos from text and images, enhancing content creation and storytelling.

~134.32s
$0.440 - $0.880 per generation
 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

POSThttps://api.segmind.com/v1/kling-2.5-turbo

Parameters

promptrequired
string

Enter desired video effects like 'smooth zoom'. For creativity, try 'vibrant kaleidoscope'.

Default: "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_ratiooptional
string

Set 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.

Default: "16:9"
Allowed values :
"16:9""9:16""1:1"
cfg_scaleoptional
number

Control effect sharpness, 0.7 for balance. Increase to 0.8 for more emphasis.

Default: 0.7Range: 0 - 1
durationoptional
integer

Choose how long the video plays. '10' for a detailed experience, '5' for a brief preview.

Default: 10
Allowed values :
510
image_urloptional
string (uri)

Provide a URL for video background. High-quality URLs enhance visual appeal.

Default: null
modeoptional
string

Select quality mode. 'Pro' offers highest definition for professional output.

Default: "pro"
Allowed values :
"pro"
negative_promptoptional
string

Mention effects to exclude, like 'no blur' for clarity. Try 'no dark colors'.

Default: "no dark tones, no blur, no distort"
tail_image_urloptional
string (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.

Default: null

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