# Kling 2.5 Turbo > Kling AI 2.5 Turbo generates fluid, cinematic videos from text and images, enhancing content creation and storytelling. ## Overview - **Endpoint**: `https://api.segmind.com/v1/kling-2.5-turbo` - **Model ID**: `kling-2.5-turbo` - **Category**: Image-to-Video Generation - **Type**: Synchronous (Direct response) - **Average Cost**: $0.6207142857142858 ## Pricing | mode | duration | cost | | --- | --- | --- | | pro | 5 | 0.44 | | pro | 10 | 0.88 | ## API Information This model uses a **synchronous response pattern**: 1. Make a POST request with your parameters 2. Receive the output directly in the response (binary for images/videos/audio, JSON for text) 3. No polling required - response is immediate ### Input Schema The API accepts the following input parameters: - **`image_url`** (`File (URL)`, _optional_): Image uRL Provide a URL for video background. High-quality URLs enhance visual appeal. - **`tail_image_url`** (`File (URL)`, _optional_): Tail image uRL 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. - **`prompt`** (`string`, _required_): Prompt 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."` - **`negative_prompt`** (`string | null`, _optional_): Negative prompt Mention effects to exclude, like 'no blur' for clarity. Try 'no dark colors'. - Default: `"no dark tones, no blur, no distort"` - **`cfg_scale`** (`number | null`, _optional_): CFG scale Control effect sharpness, 0.7 for balance. Increase to 0.8 for more emphasis. - Default: `0.7` - Range: 0 to 1 - **`duration`** (`integer | null`, _optional_): Duration Choose how long the video plays. '10' for a detailed experience, '5' for a brief preview. - Default: `10` - Options: "5" (5), "10" (10) - **`mode`** (`string | null`, _optional_): Mode Select quality mode. 'Pro' offers highest definition for professional output. - Default: `"pro"` - Options: "pro" (pro) - **`aspect_ratio`** (`string | null`, _optional_): Aspect ratio 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"` - Options: "16:9" (16:9), "9:16" (9:16), "1:1" (1:1) **Required Parameters Example**: ```json { "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." } ``` **Full Example**: ```json { "image_url": null, "tail_image_url": 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" } ``` ### Output Schema The API returns a synchronous response based on the model type: **For Image/Video/Audio Models**: - Response contains binary data (image/png, video/mp4, audio/mp3) - Content-Type header indicates the media type - Save the response body directly to a file **For Text Models**: - Response is JSON with the generated text - Structure varies by model **HTTP Response Codes**: - **200 - OK**: Request successful, output in response body - **400 - Bad Request**: Invalid parameters - **401 - Unauthorized**: Invalid or missing API key - **404 - Not Found**: Model not found - **406 - Not Acceptable**: Insufficient credits - **429 - Too Many Requests**: Rate limit exceeded - **500 - Server Error**: Internal server error ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/kling-2.5-turbo" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "image_url": null, "tail_image_url": 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" }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/kling-2.5-turbo" data = { "image_url": null, "tail_image_url": 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" } response = requests.post( url, json=data, headers={ 'x-api-key': api_key, 'Content-Type': 'application/json' } ) if response.status_code == 200: # For image/video/audio models, response.content contains the binary data with open('output.png', 'wb') as f: f.write(response.content) print('Generation complete, saved to output.png') else: print(f"Error: {response.status_code}") print(response.text) ``` ### JavaScript ```javascript const apiKey = 'YOUR_API_KEY'; const url = 'https://api.segmind.com/v1/kling-2.5-turbo'; const data = { "image_url": null, "tail_image_url": 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" }; const response = await fetch(url, { method: 'POST', headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json', }, body: JSON.stringify(data), }); if (response.ok) { // For image/video/audio models, response contains binary data const blob = await response.blob(); const downloadUrl = URL.createObjectURL(blob); // Create download link const a = document.createElement('a'); a.href = downloadUrl; a.download = 'output.png'; a.click(); console.log('Generation complete'); } ``` ## Additional Resources ### Documentation - [Model Playground](https://www.segmind.com/models/kling-2.5-turbo) - [API Documentation](https://www.segmind.com/models/kling-2.5-turbo/api) - [Pricing Details](https://www.segmind.com/models/kling-2.5-turbo/pricing) - [Platform Documentation](https://docs.segmind.com/) ### Tags No tags available