One continuous five-second realistic portrait of a single adult female cellist seated on a plain chair in an empty wood-paneled chamber-music hall. She wears a simple dark green concert dress. The cello stands correctly between her knees with its endpin on the floor. Medium frontal three-quarter framing includes her face, both hands, complete bow and most of the cello. From the first frame the bow hair already rests across the strings between fingerboard and bridge. Her right arm draws the same straight bow slowly in ONE direction for the entire shot, maintaining contact with the strings; her left hand remains steadily on the neck. Her focused gaze follows the bow. Subtle slow camera push-in, soft warm side light and a quiet background. Preserve rigid instrument and bow geometry. No audience, no cuts, no text or logos.
Kling 2.5 Turbo Pro Text to Video API
kwaivgi/kling-v2.5-turbo-pro/text-to-videoKling 2.5 Turbo Pro Text to Video 将文本提示词转化为 5 秒或 10 秒视频。您可以描述主体、动作、光影和镜头运动,并按需填写宽高比及负向提示词。
775/2,500
示例
REST API 参考
快速接入
提交任务并查询生成状态。示例中 example.com 相关地址为占位符,实际接入请替换为您的公网可用图片和回调地址。输出文件地址仅为格式说明。
第一步:配置身份认证
在控制台创建 API Key,并在提交任务时携带 Authorization: Bearer <API_KEY> 请求头。
- 提交端点
- POST
https://api.vidgo.ai/api/generate/submit - 认证请求头
- Authorization: Bearer VIDGO_API_KEY
第二步:提交生成任务
POST /api/generate/submit:kwaivgi/kling-v2.5-turbo-pro/text-to-video
REQUEST_BODY=$(cat <<'JSON'
{
"model": "kwaivgi/kling-v2.5-turbo-pro/text-to-video",
"input": {
"prompt": "A slow camera pan across a sunlit garden.",
"duration": 5,
"aspect_ratio": "16:9"
}
}
JSON
)
RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"第三步:轮询获取生成结果
使用 task_id 轮询状态,状态为 not_started 或 running 时持续等待,直至 finished 或 failed。成功时读取 data.files[].file_url,失败时读取 data.error_message。
状态查询端点
GET https://api.vidgo.ai/api/generate/status/{task_id}使用 task_id 轮询状态,状态为 not_started 或 running 时持续等待,直至 finished 或 failed。成功时读取 data.files[].file_url,失败时读取 data.error_message。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-example",
"status": "not_started",
"created_time": "2026-09-24T00:00:00Z"
}
}{
"code": 200,
"data": {
"task_id": "task-example",
"status": "finished",
"files": [
{
"file_type": "video",
"file_url": "https://example.com/output.mp4"
}
],
"created_time": "2026-09-23T00:00:00Z"
}
}完整可运行示例代码
展开查看包含自动轮询、异常处理及超时保护的端到端调用脚本。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "kwaivgi/kling-v2.5-turbo-pro/text-to-video",
"input": {
"prompt": "A slow camera pan across a sunlit garden.",
"duration": 5,
"aspect_ratio": "16:9"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数(input 对象)
模型参数放入 input 对象内,model 和可选的 callback_url 位于请求根层级。请使用标准 JSON 格式,不支持的未声明字段将被校验拦截。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| prompt | string | 是 | - | 必填文本提示词,去除首尾空白后最多支持 2,500 个 Unicode 字符。 |
| duration | integer | 否 | 5 | 时长仅支持整数值 5 或 10,省略时默认 5 秒。5.0 和 10.0 按整数值处理;字符串、布尔值、非整数小数和 null 会被拒绝。 |
| aspect_ratio | string | 否 | - | aspect_ratio 为可选字符串,接口文档未规定具体枚举或默认值;不使用时省略。 |
| negative_prompt | string | 否 | - | negative_prompt 为可选字符串,用于描述希望避免的内容。接口文档未规定其长度上限,2,500 字符限制仅适用于 prompt。 |
响应字段(状态查询接口)
GET /api/generate/status/{task_id} 返回结果字段结构:
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务响应状态码,200 表示成功。 |
| data.task_id | string | 全局唯一的生成任务标识符。 |
| data.status | string | 任务生命周期状态:not_started、running、finished 或 failed。 |
| data.files | array | 生成完成后的产物文件列表,包含 file_url 与 file_type。 |
| data.error_message | string | null | 任务失败时的诊断错误原因说明。 |
任务状态流转
客户端应通过轮询方式查询任务状态,直至进入 finished 或 failed 终态:
not_started排队中
running生成中
finished已完成
failed生成失败
轮询与重试策略
- 轮询时间间隔建议提交任务后每隔 2 到 3 秒轮询一次,生成较长视频时可逐步将间隔放宽至 5 秒。
- 网络异常处理偶尔发生的 5xx 网络抖动并不代表任务失败,建议采用退避重试机制继续查询。
- Webhook 回调机制在提交任务时传入根层级的 callback_url,成片后系统将自动推送结果,无需高频主动轮询。
技术规格
| 规格项 | 参数值 | 说明 |
|---|---|---|
| 模型标识 | kwaivgi/kling-v2.5-turbo-pro/text-to-video | |
| 视频时长 | 5 / 10 秒 | 时长仅支持整数值 5 或 10,省略时默认 5 秒。5.0 和 10.0 按整数值处理;字符串、布尔值、非整数小数和 null 会被拒绝。 |
Kling 2.5 Turbo Pro Text to Video API 常见问题
Kling 2.5 Turbo Pro Text to Video API 是什么?
Kling 2.5 Turbo Pro Text to Video 将文本提示词转化为 5 秒或 10 秒视频。您可以描述主体、动作、光影和镜头运动,并按需填写宽高比及负向提示词。您可以在上方体验区试用,或通过 REST API 提交任务。
Kling 2.5 Turbo Pro Text to Video 一次能生成多长时间?
Kling 2.5 Turbo Pro Text to Video 支持 5 秒与 10 秒两种成片时长。您可以在请求参数中使用 duration 字段指定整数值 5 或 10;若未传入该字段,系统默认生成 5 秒视频。
Kling 2.5 Turbo Pro Text to Video 支持哪些画面比例?
aspect_ratio 为可选字符串,接口文档未规定具体枚举或默认值;不使用时省略。
Kling 2.5 Turbo Pro Text to Video 提示词长度限制是多少?
prompt 字段最多支持 2,500 个 Unicode 字符(去除首尾空白字符后计算)。充裕的字数空间能够充分容纳详细的故事情节、镜头调度说明、环境光影及特定风格修饰。
Kling 2.5 Turbo Pro Text to Video 如何使用负向提示词?
negative_prompt 为可选字符串,用于描述希望避免的内容。接口文档未规定其长度上限,2,500 字符限制仅适用于 prompt。
Kling 2.5 Turbo Pro Text to Video 的生成费用是多少?
模型按生成成片数量计费:5 秒视频每次消耗 42 积分($0.210),10 秒视频每次消耗 84 积分($0.420)。费用在提交任务时扣除,若任务因内部异常未能生成有效视频,系统会自动将扣减积分全额退回账户。
Kling 2.5 Turbo Pro Text to Video 如何查询生成结果?
提交后保存 task_id,通过 GET /api/generate/status/{task_id} 查询任务。状态为 finished 时读取 data.files 中的视频链接;状态为 failed 时停止轮询并查看错误信息。
Kling 2.5 Turbo Pro Text to Video 是否支持上传图片素材?
不支持。该端点专为纯文本提示词生成视频设计。如果您需要上传静态图片或使用首尾关键帧引导生成动态视频,请使用专门的 Kling 2.5 Turbo Pro Image to Video 端点。