He counts on his fingers on 'dez vezes', shrugs, then grins at the camera.
HeyGen Avatar 6 API
heygen/avatar-6/image-to-videoHeyGen Avatar 6 API 把一张人物照片和 2–60 秒语音变成口型同步的说话视频,支持 1080p 和 2K。唇形、表情和手势跟随音频,画面保留照片的构图,可选的提示词还能把手势安排在指定的词上。
拖拽文件、粘贴剪贴板素材,或输入 URL。 必填。1 张人物照片(JPEG、PNG 或 WebP)。
1/1 个素材
拖拽文件、粘贴剪贴板素材,或输入 URL。 必填。2–60 秒语音,最大 15 MB。
1/1 个素材
示例
REST API
快速开始
三步完成第一个 HeyGen Avatar 6 Image to Video 请求。
接入 Vidgo API
创建 API Key,保存在服务端,以 Bearer Token 放在 Authorization 请求头里。
- 接口地址
- POST
https://api.vidgo.ai/api/generate/submit - 鉴权
- Authorization: Bearer VIDGO_API_KEY
提交生成任务
运行示例请求。
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "heygen/avatar-6/image-to-video",
"input": {
"image_urls": [
"https://cdn.vidgo.ai/apis/models/heygen/avatar-6/image-to-video/v2/01/input-photo.png"
],
"audio_url": "https://cdn.vidgo.ai/apis/models/heygen/avatar-6/image-to-video/v2/01/input-audio.mp3",
"prompt": "He glances out at the sea, then turns back to the camera with a slow smile and a small nod on 'calme'.",
"resolution": "2K"
}
}'等待结果
用返回的 task_id 查询,直到 finished 或 failed;成功后读取 data.files[].file_url。
查询状态
GET https://api.vidgo.ai/api/generate/status/{task_id}状态为 not_started 或 running 时约每 2 秒查询一次;finished 或 failed 时停止,成功后读取 data.files[].file_url。也可以在提交时加 callback_url 异步接收结果。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "TASK_ID",
"status": "not_started",
"created_time": "2026-11-19T08:00:00"
}
}{
"code": 200,
"data": {
"task_id": "TASK_ID",
"status": "finished",
"files": [
{
"file_url": "https://cdn.vidgo.ai/.../output.mp4",
"file_type": "video"
}
],
"created_time": "2026-11-19T08:00:00",
"error_message": null,
"progress": 100
}
}完整可运行示例
把提交、轮询、终态处理和取结果放在一个脚本里。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "heygen/avatar-6/image-to-video",
"input": {
"image_urls": [
"https://cdn.vidgo.ai/apis/models/heygen/avatar-6/image-to-video/v2/01/input-photo.png"
],
"audio_url": "https://cdn.vidgo.ai/apis/models/heygen/avatar-6/image-to-video/v2/01/input-audio.mp3",
"prompt": "He glances out at the sea, then turns back to the camera with a slow smile and a small nod on 'calme'.",
"resolution": "2K"
}
}
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')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
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')
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 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数
model 和 callback_url 放在请求根级,生成参数放在 input 里。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| model | string | 是 | — | 固定为 heygen/avatar-6/image-to-video。 |
| callback_url | string (URL) | 否 | — | 接收任务完成通知的公开 HTTP(S) 地址。 |
| input | object | 是 | — | 生成参数。 |
| input.image_urls | string[] | 是 | — | 恰好 1 个公开 HTTP(S) 照片地址,即要说话的人物。 |
| input.audio_url | string | 是 | — | 公开 HTTP(S) 语音地址,2–60 秒,最大 15 MB;视频时长与音频一致。 |
| input.prompt | string | 否 | — | 手势、表情、姿态的动作提示,最多 1,200 个字符。 |
| input.resolution | string | 否 | 1080p | 1080p 或 2K。 |
响应字段
提交后立即返回任务信息;查询状态时会随进度返回进度、输出文件或失败原因。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务结果码,成功为 0 或 200。 |
| message | string | 响应或错误信息。 |
| data.task_id | string | 任务 ID,用于查询状态。 |
| data.status | string | not_started、running、finished 或 failed。 |
| data.created_time | string | 任务创建时间。 |
| data.progress | number | 完成百分比(有进度时返回)。 |
| data.files[].file_url | string | 生成视频的公开地址。 |
| data.files[].file_type | string | 文件类型,此处为 video。 |
| data.error_message | string | null | 失败时的原因。 |
任务生命周期
not_started 和 running 为进行中;finished 和 failed 为终态,收到即停止轮询。
not_started任务已受理,排队等待开始。
running视频生成中,继续轮询。
finished已完成,从 data.files[].file_url 读取视频。
failed生成失败,查看 data.error_message。
轮询与错误
- 鉴权401 表示 API Key 缺失或无效,请在控制台检查。
- 参数校验400 表示参数有误,请对照上方参数表检查字段和时长。
- 轮询间隔每 2 秒查询一次,长任务可逐步延长到 5 秒。
- 终态收到 finished 或 failed 即停止轮询。
- 回调提供 callback_url,完成时自动通知。
模型规格
| 规格 | 取值 | 说明 |
|---|---|---|
| 模型 | heygen/avatar-6/image-to-video | HeyGen Avatar 6 异步视频生成的模型 ID。 |
| 分辨率 | 1080p / 2K | 默认 1080p。 |
| 音频 | 2–60 秒,≤15 MB | 有音频时视频时长跟随音频。 |
| 价格 | 每秒 20 / 29 积分 | 1080p / 2K |
HeyGen Avatar 6 API 常见问题
HeyGen Avatar 6 API 的照片生成模式是什么?
HeyGen Avatar 6 是 HeyGen 于 2026 年 11 月 17 日发布的说话数字人模型。HeyGen Avatar 6 API 的照片生成模式把一张人物照片和 2–60 秒语音变成口型同步的说话视频,支持 1080p 和 2K,表情和手势跟随音频。照片决定人物外观和构图,最多 1,200 个字符的提示词可以把手势安排在指定的词上。调用时使用模型 ID heygen/avatar-6/image-to-video,也可以在上方体验区直接试用。
HeyGen Avatar 6 API 怎么收费?
HeyGen Avatar 6 价格为1080p 每秒 20 积分($0.10),2K 每秒 29 积分($0.145),按音频时长向上取整到整秒计费;1080p 的 10 秒视频为 200 积分($1.00)。
HeyGen Avatar 6 API 支持多长的音频?
2 到 60 秒,最大 15 MB,视频时长与音频一致。
什么样的照片适合 HeyGen Avatar 6 API?
清晰、光线均匀、面部和嘴部完整可见的单人照片;输出保留照片比例。
HeyGen Avatar 6 API 的提示词能控制什么?
手势、表情和姿态。把动作对应到某个词,例如在 'great' 上竖大拇指,数字人就会在那个词上完成。
HeyGen Avatar 6 和 HeyGen Avatar 6 Turbo 有什么区别?
HeyGen Avatar 6 是 HeyGen 的 Quality 档位;HeyGen Avatar 6 Turbo 参数相同,运行在低延迟推理栈上,1080p 价格减半。
如何调用 HeyGen Avatar 6 API?
向 https://api.vidgo.ai/api/generate/submit 发送 POST 请求,model 填 heygen/avatar-6/image-to-video,带上 image_urls 和 audio_url,再轮询 /api/generate/status/{task_id} 或设置 callback_url。
