The astronomer speaks calmly and thoughtfully in English, gently opens one hand toward the sky once, then rests it. Subtle wonder in her eyes and a small closing smile. Accurate lip sync, stable face and natural fingers. Preserve twilight lighting, locked camera, no cuts.
Kling Avatar 2.0 Pro API
kwaivgi/kling-video/ai-avatar/v2/proKling Avatar 2.0 Pro 将人物肖像与驱动音频转化为高保真数字人视频,支持富表现力手势、物体交互引导与逼真微动作。它能够在较长讲述镜头中稳定保持面部身份,同时细化眼神运动、颈部动态与演播级呈现质感。
拖拽文件、粘贴剪贴板素材,或输入 URL。
1/1 个素材
拖拽文件、粘贴剪贴板素材,或输入 URL。
1/1 个素材
示例
REST API
快速开始
完成鉴权,提交合法的 input 对象,然后凭 task_id 获取视频。
连接 Vidgo API
创建 API Key,仅保存在服务端,并以 Authorization: Bearer VIDGO_API_KEY 发送。
- 端点
- POST
https://api.vidgo.ai/api/generate/submit - 鉴权
- Authorization: Bearer VIDGO_API_KEY
提交一个生成任务
将示例 URL 替换为可公开访问的素材,使用模型 kwaivgi/kling-video/ai-avatar/v2/pro 提交。
REQUEST_BODY=$(cat <<'JSON'
{
"model": "kwaivgi/kling-video/ai-avatar/v2/pro",
"input": {
"image_urls": [
"https://cdn.vidgo.ai/apis/models/kwaivgi/kling-video/ai-avatar/v2/pro/v1/03/input.png"
],
"audio_url": "https://cdn.vidgo.ai/apis/models/kwaivgi/kling-video/ai-avatar/v2/pro/v1/03/audio.mp3",
"prompt": "The astronomer speaks calmly and thoughtfully in English, gently opens one hand toward the sky once, then rests it. Subtle wonder in her eyes and a small closing smile. Accurate lip sync, stable face and natural fingers. Preserve twilight lighting, locked camera, no cuts."
}
}
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。
查询状态
GET https://api.vidgo.ai/api/generate/status/{task_id}约每 2 秒轮询一次,随后逐步退避。仅在 not_started 或 running 时继续,遇到 finished 或 failed 停止。也可以在同一顶层请求契约中添加 callback_url。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "ISPBBQG0EATQ452P",
"status": "running",
"created_time": "2026-09-21T11:53:35"
}
}{
"code": 200,
"data": {
"task_id": "task-unified-...",
"status": "finished",
"files": [
{
"file_url": "https://storage.vidgo.ai/generated/video.mp4",
"file_type": "video"
}
],
"created_time": "2026-08-22T10:00:00Z",
"progress": 100,
"error_message": null
}
}完整可运行示例
展开查看完整脚本,包含 HTTP 与业务码校验、task_id 校验、轮询、终态处理与超时边界。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "kwaivgi/kling-video/ai-avatar/v2/pro",
"input": {
"image_urls": [
"https://cdn.vidgo.ai/apis/models/kwaivgi/kling-video/ai-avatar/v2/pro/v1/03/input.png"
],
"audio_url": "https://cdn.vidgo.ai/apis/models/kwaivgi/kling-video/ai-avatar/v2/pro/v1/03/audio.mp3",
"prompt": "The astronomer speaks calmly and thoughtfully in English, gently opens one hand toward the sky once, then rests it. Subtle wonder in her eyes and a small closing smile. Accurate lip sync, stable face and natural fingers. Preserve twilight lighting, locked camera, no cuts."
}
}
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 内接受的字段。请求示例展示了必需的顶层 model 字段。
| 字段 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| image_urls | array<string> | 必填 | — | 恰好一张图片,支持公开 HTTP(S) URL、图片 Data URI 或裸 Base64。 |
| audio_url | string | 必填 | — | 音频须为 2–60 秒,不超过 5 MiB。时长由服务端检测。 |
| prompt | string | null | 选填 | — | 选填文本,最多 2,500 个字符;去除首尾空白,空字符串、纯空白或 null 均按未填写处理。 |
响应字段
提交后立即返回任务标识;状态查询响应会附带进度、全部输出文件或失败信息。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 应用层结果码,成功响应为 0 或 200。 |
| message | string | 可读信息或错误详情(如有)。 |
| data.task_id | string | 用于状态查询路径中的任务 ID。 |
| data.status | string | not_started、running、finished 或 failed。 |
| data.created_time | string | 任务创建时间,date-time 格式。 |
| data.progress | integer | 服务商上报的 0–100 进度。 |
| data.files[] | array | 成功任务的全部输出文件,按响应顺序排列。 |
| data.files[].file_url | string | 生成视频的公开 URL。 |
| data.files[].file_type | string | 文件类型,例如 video。 |
| data.error_message | string | null | status 为 failed 时的失败详情。 |
任务生命周期
not_started 与 running 为非终态;finished 与 failed 为终态,轮询到任一即应停止。
not_started任务已受理,排队等待开始。
running生成进行中,请继续使用同一 task_id 轮询。
finished生成成功。从 data.files[].file_url 读取全部视频 URL。
failed生成因错误终止。读取 data.error_message 并停止轮询。
轮询与错误处理
- 鉴权401 表示 Bearer API Key 缺失或无效,请修正后再重试。
- 参数校验400 表示存在非法字段、不支持的媒体键或积分余额不足,请修正请求后再提交。
- 网络与超时传输失败不同于任务失败。判定任务失败前,请在有限超时时间内重试状态查询。
- 轮询间隔建议从约 2 秒一次开始,长任务逐步加大间隔。
- 终态仅在 not_started 或 running 时继续轮询;遇到 finished 或 failed 立即停止。
- 回调选项在请求顶层提供 callback_url 可接收最终的扁平任务对象;若回调投递失败,仍可使用轮询。
端点限制
| 规格 | 取值 | 说明 |
|---|---|---|
| 输入 | 1 张图片 + 1 份音频 | 选填文本,最多 2,500 个字符;去除首尾空白,空字符串、纯空白或 null 均按未填写处理。 |
| 音频限制 | 2–60s / 5 MiB | 音频须为 2–60 秒,不超过 5 MiB。时长由服务端检测。 |
| 价格 | 14 积分/秒 ($0.070/s) | 最终按服务端检测的音频秒数向上取整计费。 |
相关模型
Kling Avatar 2.0 Pro API 常见问题
Kling Avatar 2.0 Pro API 是什么?
Kling Avatar 2.0 Pro 是快手科技(可灵 AI)研发的高保真数字人视频生成模型,用于将人物肖像与驱动音频转化为说话视频。它可产出数字人成片,具备富表现力手势、物体交互引导以及逼真的眼神与颈部微动。基于多模态理解与级联数字人合成,它在较长旁白中保持面部身份,同时提升演播级说话表现。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
可以设置输出帧率吗?
此接口不提供帧率参数,具体帧率以生成的视频为准。
可以设置输出分辨率吗?
此接口不提供分辨率参数,具体尺寸以生成的视频为准。
Kling Avatar 2.0 Pro 如何引导手势交互?
可添加可选性能提示词,引导指向、持握或触碰产品等动作,同时仍以驱动音频作为语音时序来源。
Kling Avatar 2.0 Pro 会细化眼神微动吗?
会。Pro 强调随语句推进的视线变化与颈部动态,使主持人呈现超越基础口型同步的真实感。
Kling Avatar 2.0 Pro 接受多长的音频?
请使用时长 2–60 秒、不超过 5 MiB 的可公开访问音频。时长由服务端检测,并按向上取整整秒以 14 积分/秒计费。
什么时候该选择 Kling Avatar 2.0 Pro 交付?
当成片需要 更丰富的手势引导或商业演播级呈现,并在 Standard 迭代完成后升级交付时,选择 Pro。















