curl --request POST \
--url https://api.aihubmax.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-o3-text-to-video",
"prompt": "A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon",
"resolution": "1080p",
"generate_audio": true,
"aspect_ratio": "16:9",
"duration": 5
}
'import requests
url = "https://api.aihubmax.com/v1/videos/generations"
payload = {
"model": "kling-o3-text-to-video",
"prompt": "A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon",
"resolution": "1080p",
"generate_audio": True,
"aspect_ratio": "16:9",
"duration": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'kling-o3-text-to-video',
prompt: 'A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon',
resolution: '1080p',
generate_audio: true,
aspect_ratio: '16:9',
duration: 5
})
};
fetch('https://api.aihubmax.com/v1/videos/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aihubmax.com/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'kling-o3-text-to-video',
'prompt' => 'A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon',
'resolution' => '1080p',
'generate_audio' => true,
'aspect_ratio' => '16:9',
'duration' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"kling-o3-text-to-video\",\n \"prompt\": \"A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aihubmax.com/v1/videos/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kling-o3-text-to-video\",\n \"prompt\": \"A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"kling-o3-text-to-video\",\n \"prompt\": \"A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "video"
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}{
"error": {
"message": "Insufficient balance",
"type": "insufficient_quota"
}
}{
"error": {
"message": "Parameter validation failed",
"type": "validation_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"message": "Service temporarily unavailable, please try again later",
"type": "service_unavailable"
}
}Kling-O3 Text to Video
- Kling O3 text-to-video model
- Supports
720p/1080p/4k;4kis a separate native 4K tier - Optional accompanying audio generation
- Async processing mode — use the returned task ID to check task status
- Generated video links are valid for 24 hours; please save them promptly
curl --request POST \
--url https://api.aihubmax.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-o3-text-to-video",
"prompt": "A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon",
"resolution": "1080p",
"generate_audio": true,
"aspect_ratio": "16:9",
"duration": 5
}
'import requests
url = "https://api.aihubmax.com/v1/videos/generations"
payload = {
"model": "kling-o3-text-to-video",
"prompt": "A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon",
"resolution": "1080p",
"generate_audio": True,
"aspect_ratio": "16:9",
"duration": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'kling-o3-text-to-video',
prompt: 'A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon',
resolution: '1080p',
generate_audio: true,
aspect_ratio: '16:9',
duration: 5
})
};
fetch('https://api.aihubmax.com/v1/videos/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aihubmax.com/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'kling-o3-text-to-video',
'prompt' => 'A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon',
'resolution' => '1080p',
'generate_audio' => true,
'aspect_ratio' => '16:9',
'duration' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"kling-o3-text-to-video\",\n \"prompt\": \"A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aihubmax.com/v1/videos/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kling-o3-text-to-video\",\n \"prompt\": \"A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"kling-o3-text-to-video\",\n \"prompt\": \"A seaside pier at sunset, golden light shimmering on the sparkling waves, a couple walking side by side toward the horizon\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "video"
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}{
"error": {
"message": "Insufficient balance",
"type": "insufficient_quota"
}
}{
"error": {
"message": "Parameter validation failed",
"type": "validation_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"message": "Service temporarily unavailable, please try again later",
"type": "service_unavailable"
}
}Authorizations
All APIs require Bearer Token authentication
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
kling-o3-text-to-video: Pure text driven video generation, supports 720p / 1080p / 4k
"kling-o3-text-to-video"
Text prompt
Notes:
- Maximum 2500 characters
- Mutually exclusive with
multi_prompt
2500"A seaside pier at sunset, golden light shimmering on the waves"
Output resolution
Options:
720p— 720P SD1080p— 1080P HD4k— Native 4K UHD (independent tier, billing not affected bygenerate_audio)
"720p"
Whether to generate accompanying audio
false
Output video aspect ratio
Available values:
16:9— Landscape (default)9:16— Portrait1:1— Square
"16:9"
Output video duration (seconds), 3-15
5
Multi-shot segmentation mode, currently fixed to customize
Do not pass this parameter unless necessary.
"customize"
Multi-prompt sequence
Notes:
- Mutually exclusive with
prompt - The sum of all segment
durationvalues should equal the totalduration
Do not pass this parameter unless necessary.
Show child attributes
Show child attributes
Response
Task created successfully
Task creation timestamp
1757165031
Task ID
"task-unified-1757165031-uyujaw3d"
Actual model name used
Specific task type
video.generation.task Task progress percentage (0-100)
0 <= x <= 1000
Task status
pending, processing, completed, failed "pending"
Async task information
Show child attributes
Show child attributes
Task output type
video "video"