curl --request POST \
--url https://api.aihubmax.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-v3-text-to-video",
"prompt": "An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field",
"resolution": "1080p",
"generate_audio": true,
"negative_prompt": "blurry, low quality, watermark",
"aspect_ratio": "16:9",
"duration": 10
}
'import requests
url = "https://api.aihubmax.com/v1/videos/generations"
payload = {
"model": "kling-v3-text-to-video",
"prompt": "An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field",
"resolution": "1080p",
"generate_audio": True,
"negative_prompt": "blurry, low quality, watermark",
"aspect_ratio": "16:9",
"duration": 10
}
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-v3-text-to-video',
prompt: 'An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field',
resolution: '1080p',
generate_audio: true,
negative_prompt: 'blurry, low quality, watermark',
aspect_ratio: '16:9',
duration: 10
})
};
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-v3-text-to-video',
'prompt' => 'An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field',
'resolution' => '1080p',
'generate_audio' => true,
'negative_prompt' => 'blurry, low quality, watermark',
'aspect_ratio' => '16:9',
'duration' => 10
]),
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-v3-text-to-video\",\n \"prompt\": \"An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"negative_prompt\": \"blurry, low quality, watermark\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 10\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-v3-text-to-video\",\n \"prompt\": \"An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"negative_prompt\": \"blurry, low quality, watermark\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 10\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-v3-text-to-video\",\n \"prompt\": \"An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"negative_prompt\": \"blurry, low quality, watermark\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 10\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-V3 Text to Video
- Kling V3 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-v3-text-to-video",
"prompt": "An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field",
"resolution": "1080p",
"generate_audio": true,
"negative_prompt": "blurry, low quality, watermark",
"aspect_ratio": "16:9",
"duration": 10
}
'import requests
url = "https://api.aihubmax.com/v1/videos/generations"
payload = {
"model": "kling-v3-text-to-video",
"prompt": "An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field",
"resolution": "1080p",
"generate_audio": True,
"negative_prompt": "blurry, low quality, watermark",
"aspect_ratio": "16:9",
"duration": 10
}
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-v3-text-to-video',
prompt: 'An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field',
resolution: '1080p',
generate_audio: true,
negative_prompt: 'blurry, low quality, watermark',
aspect_ratio: '16:9',
duration: 10
})
};
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-v3-text-to-video',
'prompt' => 'An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field',
'resolution' => '1080p',
'generate_audio' => true,
'negative_prompt' => 'blurry, low quality, watermark',
'aspect_ratio' => '16:9',
'duration' => 10
]),
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-v3-text-to-video\",\n \"prompt\": \"An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"negative_prompt\": \"blurry, low quality, watermark\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 10\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-v3-text-to-video\",\n \"prompt\": \"An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"negative_prompt\": \"blurry, low quality, watermark\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 10\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-v3-text-to-video\",\n \"prompt\": \"An ancient Japanese courtyard, raindrops slowly falling into a pond beside a stone lantern, creating ripples. Camera slowly pushes in, cinematic quality, shallow depth of field\",\n \"resolution\": \"1080p\",\n \"generate_audio\": true,\n \"negative_prompt\": \"blurry, low quality, watermark\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 10\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-v3-text-to-video: Pure text driven video generation, supports 720p / 1080p / 4k
"kling-v3-text-to-video"
Text prompt describing the video content you want to generate
Notes:
- Maximum 2500 characters
- Supports both Chinese and English
2500"An ancient Japanese courtyard, raindrops slowly falling into a pond, creating ripples"
Output resolution
Options:
720p— 720P SD1080p— 1080P HD4k— Native 4K UHD (independent tier, billing not affected bygenerate_audio/voice_ids)
"720p"
Whether to generate accompanying audio
Notes:
- When enabled, the video will include AI-generated sound effects/music
- Disabled by default
false
Negative prompt, describing elements you don't want to appear
Notes:
- Separate multiple keywords with commas
- Common: blurry, low quality, watermark, text overlay
Do not pass this parameter unless necessary.
"blurry, low quality, watermark, text overlay"
Output video aspect ratio
Available values:
16:9— Landscape (default)9:16— Portrait1:1— Square
"16:9"
Output video duration (seconds)
Available values:
5— 5-second short video (default)10— 10-second video
5
Voice ID list for voice control
Notes:
- Maximum 2 voices
- Use
<<<voice_1>>>/<<<voice_2>>>inpromptto reference - Obtain voice_id via the
kling-video-create-voiceendpoint generate_audiomust betruewhen using this parameter
Do not pass this parameter unless necessary.
["voice_123456"]
Multi-prompt sequence
Notes:
- Each segment contains its own prompt and duration
- The sum of all segment durations should equal the total
duration
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"