Kling O3 Text-to-Video
Generate cinematic AI videos up to 15 seconds with native audio, multi-shot control, and physics-accurate motion via API.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-o3-text2video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A majestic golden eagle soaring over snow-capped mountain peaks at sunrise, cinematic wide angle shot, breathtaking natural scenery, ultra detailed",
12 "mode": "pro",
13 "duration": "5",
14 "cfg_scale": 0.5,
15 "aspect_ratio": "16:9",
16 "generate_audio": false,
17 "negative_prompt": "blur, distort, and low quality"
18}
19
20response = requests.post(url, headers=headers, json=data)
21
22if response.status_code == 200:
23 result = response.json()
24 print(json.dumps(result, indent=2))
25else:
26 print(f"Error: {response.status_code}")
27 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-o3-text2video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A majestic golden eagle soaring over snow-capped mountain peaks at sunrise, cinematic wide angle shot, breathtaking natural scenery, ultra detailed",
12 "mode": "pro",
13 "duration": "5",
14 "cfg_scale": 0.5,
15 "aspect_ratio": "16:9",
16 "generate_audio": false,
17 "negative_prompt": "blur, distort, and low quality"
18}
19
20response = requests.post(url, headers=headers, json=data)
21
22if response.status_code == 200:
23 result = response.json()
24 print(json.dumps(result, indent=2))
25else:
26 print(f"Error: {response.status_code}")
27 print(response.text)API Endpoint
https://api.segmind.com/v1/kling-o3-text2videoParameters
promptrequiredstringDescribe the video content.
aspect_ratiooptionalstringSet the aspect ratio for the output video.
"16:9""16:9""9:16""1:1"cfg_scaleoptionalnumberPrompt adherence strength.
0.5Range: 0 - 1durationoptionalstringLength of the output video in seconds.
"5""3""4""5""6""7""8""9""10""11""12"+3 moregenerate_audiooptionalbooleanEnable to generate synchronized audio with the video.
falsemodeoptionalstringSelect quality mode. Standard for faster generation, Pro for higher quality.
"pro""std""pro"multi_promptoptionalobject[]Array of prompts with durations for multi-segment video.
promptoptionalstringdurationoptionalstringnegative_promptoptionalstringSpecify elements to avoid.
"blur, distort, and low quality"shot_typeoptionalstringCamera shot type for the video.
"customize"voice_idsoptionalstring[]Voice IDs for audio.
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