1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const axios = require('axios');
const fs = require('fs');
const path = require('path');
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/kling-2.5-turbo";
const data = {
"image_url": "toB64('null')",
"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.",
"negative_prompt": "no dark tones, no blur, no distort",
"cfg_scale": 0.7,
"duration": 10,
"mode": "pro",
"aspect_ratio": "16:9"
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
Provide a URL for video background. High-quality URLs enhance visual appeal.
Enter desired video effects like 'smooth zoom'. For creativity, try 'vibrant kaleidoscope'.
Mention effects to exclude, like 'no blur' for clarity. Try 'no dark colors'.
Control effect sharpness, 0.7 for balance. Increase to 0.8 for more emphasis.
min : 0,
max : 1
Choose how long the video plays. '10' for a detailed experience, '5' for a brief preview.
Allowed values:
Select quality mode. 'Pro' offers highest definition for professional output.
Allowed values:
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.
Allowed values:
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Edited by Segmind Team on September 26, 2025.
Kling AI 2.5 Turbo is a high-performance AI video generation model by Kuaishou Technology, which creates polished and professional videos from text prompts and reference images. It is primarily designed to produce cinematically rich videos by utilizing advanced AI-powered training methodologies and physics-based motion simulation, which is ideal for depicting choreographed dancing and intricate physical movements. It impeccably renders dynamic videos with smooth, lifelike movements, sporting temporal consistency of visual elements across consecutive frames.
Q: How does Kling AI 2.5 handle complex movements? A: The model uses advanced physics simulation and training techniques to create realistic, fluid motion sequences.
Q: What's the maximum video duration possible? A: The model supports two options: 5-second and 10-second videos.
Q: Can I use my own images as a reference? A: Yes, you can provide image URLs as a reference for video generation; this also helps enhance visual consistency.
Q: How does the CFG scale affect output? A: The CFG scale (0.7-0.8) impacts sharpness, with higher values creating more emphasized effects.
Q: Which aspect ratio should I choose? A: Select the aspect ratio based on your platform: 16:9 for traditional video; 9:16 for mobile-first content; and 1:1 for social media posts.