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.

~89.43s
$0.630 - $5.25 per generation
 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

POSThttps://api.segmind.com/v1/kling-o3-text2video

Parameters

promptrequired
string

Describe the video content.

aspect_ratiooptional
string

Set the aspect ratio for the output video.

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

Prompt adherence strength.

Default: 0.5Range: 0 - 1
durationoptional
string

Length of the output video in seconds.

Default: "5"
Allowed values (13 total):
"3""4""5""6""7""8""9""10""11""12"+3 more
generate_audiooptional
boolean

Enable to generate synchronized audio with the video.

Default: false
modeoptional
string

Select quality mode. Standard for faster generation, Pro for higher quality.

Default: "pro"
Allowed values :
Standard"std"
Pro"pro"
multi_promptoptional
object[]

Array of prompts with durations for multi-segment video.

Array items:
promptoptional
string
durationoptional
string
negative_promptoptional
string

Specify elements to avoid.

Default: "blur, distort, and low quality"
shot_typeoptional
string

Camera shot type for the video.

Default: "customize"
voice_idsoptional
string[]

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.

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