Animate this exact single garden snail in one continuous five-second natural-history macro shot. Its TWO upper eyestalks slowly extend forward and slightly upward from their existing positions; the two short lower feelers remain small. The snail's soft foot creeps forward just a few millimeters along the moss, carrying the same spiral shell without changing its shape. Keep the snail attached to the twig, the shell markings and damp moss stable. Locked macro camera, shallow depth of field, very small believable movement. No added tentacles, no second animal, no scene changes or text.
Kling 2.5 Turbo Pro Image to Video API
kwaivgi/kling-v2.5-turbo-pro/image-to-videoKling 2.5 Turbo Pro Image to Video 使用图片和文本提示词生成视频,支持仅首帧、仅尾帧或首尾帧同时引导,提供 5 秒与 10 秒时长。可在提示词中描述主体动作、环境变化及镜头运动。
622/2,500
拖拽文件、粘贴剪贴板素材,或输入 URL。
1/1 个素材
拖拽文件、粘贴剪贴板素材,或输入 URL。
请提供起始帧、结束帧或同时提供两者。
示例
REST API 参考
快速上手
提交任务并查询状态。example.com 和 your-domain.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/image-to-video
REQUEST_BODY=$(cat <<'JSON'
{
"model": "kwaivgi/kling-v2.5-turbo-pro/image-to-video",
"input": {
"prompt": "A slow camera pan across a sunlit garden.",
"duration": 5,
"start_image_url": "https://example.com/start-frame.png"
}
}
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/image-to-video",
"input": {
"prompt": "A slow camera pan across a sunlit garden.",
"duration": 5,
"start_image_url": "https://example.com/start-frame.png"
}
}
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 字符。 |
| start_image_url | string | 至少提供一个 | - | 首帧公网 HTTP(S) 地址,去除前后空格且不得包含凭据。可提供起始帧、结束帧或同时提供两者。不使用时可省略;空字符串或 null 将被校验拦截。 |
| end_image_url | string | 至少提供一个 | - | 尾帧公网 HTTP(S) 地址,去除前后空格且不得包含凭据。可提供起始帧、结束帧或同时提供两者。不使用时可省略;空字符串或 null 将被校验拦截。 |
| 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生成失败
轮询与异常处理
- 轮询频率建议建议提交任务后前 10 秒每隔 2-3 秒轮询一次,之后可适度放缓至 5 秒一次。
- 网络容错设计遇到临时网络抖动或网关 5xx 错误时不要重新提交任务,应使用原 task_id 继续轮询重试。
- 回调机制(Webhook)在提交任务时传入 callback_url,可在任务完成时自动接收系统推送的最终结果。
技术规格
| 规格项 | 参数值 | 说明 |
|---|---|---|
| 模型标识 | kwaivgi/kling-v2.5-turbo-pro/image-to-video | |
| 视频时长 | 5 / 10 秒 | 时长仅支持整数值 5 或 10,省略时默认 5 秒。5.0 和 10.0 按整数值处理;字符串、布尔值、非整数小数和 null 会被拒绝。 |
Kling 2.5 Turbo Pro Image to Video API 常见问题
Kling 2.5 Turbo Pro Image to Video API 是什么?
Kling 2.5 Turbo Pro Image to Video 使用图片和文本提示词生成视频,支持仅首帧、仅尾帧或首尾帧同时引导,提供 5 秒与 10 秒时长。可在提示词中描述主体动作、环境变化及镜头运动。您可以在上方体验区试用,或通过 REST API 提交任务。
Kling 2.5 Turbo Pro Image to Video 一次能生成多长时间?
Kling 2.5 Turbo Pro Image to Video 支持 5 秒与 10 秒两种成片时长。您可以在请求参数中使用 duration 字段指定整数值 5 或 10;若未显式指定,系统默认生成 5 秒视频。
Kling 2.5 Turbo Pro Image to Video 支持首尾双关键帧控制吗?
支持。同时提供 start_image_url 和 end_image_url,可以分别用首帧与尾帧引导视频生成;prompt 仍为必填。
Kling 2.5 Turbo Pro Image to Video 可以只传入单张图片吗?
可以仅提供 start_image_url,也可以仅提供 end_image_url。两种方式都需要填写 prompt;仅尾帧表示用结束画面引导生成,并不等同于倒放视频。
Kling 2.5 Turbo Pro Image to Video 对输入图片格式有什么要求?
图片须通过公开可访问的 HTTP(S) URL 提供,不能包含凭据或空白。接口文档未列出支持的图片格式、大小或分辨率限制,因此不将特定格式声明为已确认支持。
Kling 2.5 Turbo Pro Image to Video 如何计费?
该模型按视频生成次计费:5 秒视频单次消耗 42 积分($0.210),10 秒视频单次消耗 84 积分($0.420)。若生成过程因系统或服务异常中断,已扣减的积分将全额自动退回用户账户。
如何用参考图片引导 Kling 2.5 Turbo Pro Image to Video?
使用 start_image_url 引导首帧,使用 end_image_url 引导尾帧,或同时提供两者。通过 prompt 描述希望发生的动作,并在生成后检查主体与画面的表现。
在什么场景下应该优先选择 Kling 2.5 Turbo Pro Image to Video?
当您已有产品图片、人物肖像或分镜参考图,并希望配合文本提示词生成 5 秒或 10 秒视频时,可选择此端点。它支持仅首帧、仅尾帧或双帧输入,并按所选时长计费。