注册

文生视频

POST https://api.quickrouter.ai/kling/v1/videos/text2video 在线调试 →
Authorization

在 Header 添加参数 Authorization,其值为 Bearer 之后拼接 Token

示例: Authorization: Bearer ********************

请求参数

Header 参数
Content-Type string
可选
示例: application/json
Authorization string
可选
示例: Bearer {{YOUR_API_KEY}}
Body 参数 application/json
model_name string
必需
prompt string
可选
multi_shot string
必需
shot_type string
可选
multi_prompt string
可选
negative_prompt string
可选
cfg_scale string
可选
mode string
必需
sound string
可选
camera_control object
可选
aspect_ratio string
可选
duration string
可选
watermark_info object
可选
callback_url string
可选
external_task_id string
可选
示例
{
    "model_name": "kling-v1",
    "prompt": "示例提示词",
    "multi_shot": "false",
    "mode": "high",
    "camera_control": {
        "type": "normal",
        "config": "示例配置"
    }
}

请求示例代码

curl --location --request POST 'https://api.quickrouter.ai/kling/v1/videos/text2video' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
    "model_name": "kling-v1",
    "prompt": "示例提示词",
    "multi_shot": "false",
    "mode": "high"
}'
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer YOUR_API_KEY");

var raw = JSON.stringify({
  "model_name": "kling-v1",
  "prompt": "示例提示词",
  "multi_shot": "false",
  "mode": "high"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.quickrouter.ai/kling/v1/videos/text2video", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
import http.client
import json

conn = http.client.HTTPSConnection("api.quickrouter.ai")
payload = json.dumps({
  "model_name": "kling-v1",
  "prompt": "示例提示词",
  "multi_shot": "false",
  "mode": "high"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_API_KEY'
}
conn.request("POST", "/kling/v1/videos/text2video", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

返回响应

响应参数 application/json
object string
可选
code string
可选
message string
可选
request_id string
可选
task_id string
可选
task_status string
可选
task_info string
可选
created_at string
可选
updated_at string
可选
示例
{
    "object": "chat.completion",
    "code": "success",
    "message": "",
    "request_id": "c0c2ac8bd2a9406f9e2a2f20b05b3e9a",
    "task_id": "01J9M6GK9YF7PNBGPQ0XEFJVM",
    "task_status": "submitted",
    "task_info": {},
    "created_at": 1722769557708,
    "updated_at": 1722769557708
}