Submit Kling AI task
curl --request POST \
--url https://api.wizzx.ai/api/v1/task/submit/kling-ai \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A character walks through a forest",
"type": "text-to-video",
"quality_mode": "pro",
"duration": 5,
"model_name": "kling-v2-1-master"
}
'import requests
url = "https://api.wizzx.ai/api/v1/task/submit/kling-ai"
payload = {
"prompt": "A character walks through a forest",
"type": "text-to-video",
"quality_mode": "pro",
"duration": 5,
"model_name": "kling-v2-1-master"
}
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({
prompt: 'A character walks through a forest',
type: 'text-to-video',
quality_mode: 'pro',
duration: 5,
model_name: 'kling-v2-1-master'
})
};
fetch('https://api.wizzx.ai/api/v1/task/submit/kling-ai', 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.wizzx.ai/api/v1/task/submit/kling-ai",
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([
'prompt' => 'A character walks through a forest',
'type' => 'text-to-video',
'quality_mode' => 'pro',
'duration' => 5,
'model_name' => 'kling-v2-1-master'
]),
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.wizzx.ai/api/v1/task/submit/kling-ai"
payload := strings.NewReader("{\n \"prompt\": \"A character walks through a forest\",\n \"type\": \"text-to-video\",\n \"quality_mode\": \"pro\",\n \"duration\": 5,\n \"model_name\": \"kling-v2-1-master\"\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.wizzx.ai/api/v1/task/submit/kling-ai")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A character walks through a forest\",\n \"type\": \"text-to-video\",\n \"quality_mode\": \"pro\",\n \"duration\": 5,\n \"model_name\": \"kling-v2-1-master\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizzx.ai/api/v1/task/submit/kling-ai")
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 \"prompt\": \"A character walks through a forest\",\n \"type\": \"text-to-video\",\n \"quality_mode\": \"pro\",\n \"duration\": 5,\n \"model_name\": \"kling-v2-1-master\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_key": "<string>",
"credits_deducted": 1,
"provider_task_id": "<string>",
"provider_key": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}视频生成
提交 Kling AI 任务
POST Kling 文生视频或图生视频任务
POST
/
api
/
v1
/
task
/
submit
/
kling-ai
Submit Kling AI task
curl --request POST \
--url https://api.wizzx.ai/api/v1/task/submit/kling-ai \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A character walks through a forest",
"type": "text-to-video",
"quality_mode": "pro",
"duration": 5,
"model_name": "kling-v2-1-master"
}
'import requests
url = "https://api.wizzx.ai/api/v1/task/submit/kling-ai"
payload = {
"prompt": "A character walks through a forest",
"type": "text-to-video",
"quality_mode": "pro",
"duration": 5,
"model_name": "kling-v2-1-master"
}
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({
prompt: 'A character walks through a forest',
type: 'text-to-video',
quality_mode: 'pro',
duration: 5,
model_name: 'kling-v2-1-master'
})
};
fetch('https://api.wizzx.ai/api/v1/task/submit/kling-ai', 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.wizzx.ai/api/v1/task/submit/kling-ai",
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([
'prompt' => 'A character walks through a forest',
'type' => 'text-to-video',
'quality_mode' => 'pro',
'duration' => 5,
'model_name' => 'kling-v2-1-master'
]),
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.wizzx.ai/api/v1/task/submit/kling-ai"
payload := strings.NewReader("{\n \"prompt\": \"A character walks through a forest\",\n \"type\": \"text-to-video\",\n \"quality_mode\": \"pro\",\n \"duration\": 5,\n \"model_name\": \"kling-v2-1-master\"\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.wizzx.ai/api/v1/task/submit/kling-ai")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A character walks through a forest\",\n \"type\": \"text-to-video\",\n \"quality_mode\": \"pro\",\n \"duration\": 5,\n \"model_name\": \"kling-v2-1-master\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizzx.ai/api/v1/task/submit/kling-ai")
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 \"prompt\": \"A character walks through a forest\",\n \"type\": \"text-to-video\",\n \"quality_mode\": \"pro\",\n \"duration\": 5,\n \"model_name\": \"kling-v2-1-master\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_key": "<string>",
"credits_deducted": 1,
"provider_task_id": "<string>",
"provider_key": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}提交任务
prompt、type、quality_mode 和 duration 必填。image-to-video 必须在 image_urls 中传入恰好一个 URL;text-to-video 必须省略该字段。
curl --fail-with-body --silent --show-error \
-X POST https://api.wizzx.ai/api/v1/task/submit/kling-ai \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
--data '{
"prompt": "主角在森林中漫步",
"type": "text-to-video",
"quality_mode": "pro",
"duration": 5,
"model_name": "kling-v2-1-master"
}'
有效的 Master Key 是
kling-v2-1-master,后端不接受 kling-v2-master。aspect_ratio 和 sound 仅用于 kling-v2-6。图生视频时,image_tail、遮罩和 camera_control 互斥。授权
Wizzx API key. This is not a JWT.
请求体
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
image-to-video requires exactly one image_urls item; text-to-video must omit image_urls. image_tail, masks, and camera_control are mutually exclusive for image-to-video. aspect_ratio and sound are only valid for kling-v2-6.
可用选项:
text-to-video Required prompt. The gateway enforces a 2500-byte UTF-8 limit.
Minimum string length:
1可用选项:
std, pro 可用选项:
5, 10 Maximum array length:
1Publicly reachable HTTP(S) URL.
Pattern:
^https?://Optional negative prompt. The gateway enforces a 2500-byte UTF-8 limit.
V1.x only. Explicit 0 is currently normalized to 0.5; omit for V2.x.
必填范围:
0 <= x <= 1kling-v2-6 only; defaults to 16:9 for that model.
可用选项:
16:9, 9:16, 1:1 kling-v2-6 only; defaults to off.
可用选项:
on, off Maximum array length:
6Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
此页面对您有帮助吗?
