HeyGen Video 1.0 API 调用参考
用文字生成 5–15 秒带声音的片段,也可以从照片生成最高 2K 的画面,或用混合参考素材生成
用一个 PopNow API 密钥,就能在自己的代码里调用 HeyGen Video 1.0。下面列出要填的调用名、这个型号接受的每个输入字段、每次请求花多少美元(USD),以及一段可以直接粘进终端运行的请求。
参数说明直接取自型号的输入 schema,暂时只有英文。
一览
- 出品方
- HeyGen
- 产出
- 视频
- 起价
- $0.028 USD 每秒成片
价格以 USD 显示,从你的 PopNow 余额扣款。任务受理时预留可能的最高费用,完成后按实际用量结算并释放余款;失败任务不收费。运行前可调用 POST /api/v1/jobs/quote 获取准确报价。
生成视频
heygen/video-1/text-to-video
价格
| 选项 | USD |
|---|---|
480p | $0.028 每秒成片 |
768p | $0.051 每秒成片 |
参数
| 字段 | 类型 | 默认值 | 取值范围 | 作用 |
|---|---|---|---|---|
prompt必填 | string | — | 最多 32000 个字符 | Describe the subject, setting, action, camera and the sound you want, up to 32,000 characters. Put spoken lines in double quotes. |
aspect_ratio可选 | string | 16:9 | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9 | Frame shape: 16:9 (default), 9:16, 1:1, 4:3, 3:4 or 21:9. |
resolution可选 | string | 768p | 480p, 768p | Output size class: 480p or 768p (default). 480p costs less per second. |
duration_seconds可选 | integer | 5 | 5 到 15 | Clip length in whole seconds, 5 to 15. Billed per requested second. |
prompt_optimization_mode可选 | string | disabled | disabled, turbo, quality | Optional prompt rewrite before generation: disabled keeps your text as written, turbo is the quick rewrite, quality the more thorough one. Free. |
seed可选 | integer | — | 0 到 2147483647 | Optional random seed for one-change-at-a-time comparisons. Omit it for a random result. |
请求示例
这段请求原样就能运行,没写的字段都用默认值。运行前先把密钥放进环境变量 POPNOW_API_KEY。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "heygen/video-1/text-to-video",
"input": {
"prompt": "A paper boat drifts down a rain-soaked street at dusk, neon signs reflecting in the water, slow tracking shot at ground level",
"duration_seconds": 5,
"resolution": "768p"
}
}'响应里会立刻带回 taskId。之后用 GET /api/v1/jobs/recordInfo 取结果,或者在请求里加上 callBackUrl 等通知。
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"图生视频
heygen/video-1/image-to-video
价格
| 选项 | USD |
|---|---|
480p | $0.028 每秒成片 |
768p | $0.051 每秒成片 |
1080p | $0.135 每秒成片 |
2k | $0.135 每秒成片 |
参数
| 字段 | 类型 | 默认值 | 取值范围 | 作用 |
|---|---|---|---|---|
prompt必填 | string | — | 最多 32000 个字符 | Describe what happens after the opening frame: motion, camera, spoken lines in double quotes and the sound, up to 32,000 characters. |
image_url必填 | string (uri) | — | — | Opening frame. The clip starts exactly on this picture and keeps its proportions at every resolution. |
resolution可选 | string | 768p | 480p, 768p, 1080p, 2k | Output size class: 480p, 768p (default), 1080p or 2k. 1080p and 2k share a higher per-second rate. |
duration_seconds可选 | integer | 5 | 5 到 15 | Clip length in whole seconds, 5 to 15. Billed per requested second. |
prompt_optimization_mode可选 | string | disabled | disabled, turbo, quality | Optional prompt rewrite before generation: disabled keeps your text as written, turbo is the quick rewrite, quality the more thorough one. Free. |
seed可选 | integer | — | 0 到 2147483647 | Optional random seed for one-change-at-a-time comparisons. Omit it for a random result. |
请求示例
这段请求原样就能运行,没写的字段都用默认值。运行前先把密钥放进环境变量 POPNOW_API_KEY。
示例里的 image_url 用的是 PopNow 的示例素材,换成你自己的公开 HTTPS 链接、上传文件或已保存的素材即可。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "heygen/video-1/image-to-video",
"input": {
"prompt": "He lands softly on the rooftop, laughs and turns toward the camera while the balloons sway in the evening breeze; slow push-in",
"image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
"duration_seconds": 5,
"resolution": "768p"
}
}'响应里会立刻带回 taskId。之后用 GET /api/v1/jobs/recordInfo 取结果,或者在请求里加上 callBackUrl 等通知。
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"参考生视频
heygen/video-1/reference-to-video
价格
| 选项 | USD |
|---|---|
480p | $0.096 每秒成片 |
768p | $0.135 每秒成片 |
参数
| 字段 | 类型 | 默认值 | 取值范围 | 作用 |
|---|---|---|---|---|
prompt必填 | string | — | 最多 32000 个字符 | Describe the new scene and point at each reference with its label: <Picture 1>, <Video 1>, <Audio 1>. Images, videos and audio are numbered separately, in upload order. |
reference_image_urls可选 | array<string (uri)> | — | 最多 9 项 | Up to nine pictures of people, products or places, named <Picture 1>, <Picture 2> and so on. The first two are included; each further image adds a charge. |
reference_video_urls可选 | array<string (uri)> | — | 最多 3 项 | Up to three clips for motion or a setting, named <Video 1> and so on, 15 seconds in total. Every uploaded second is billed like an output second. |
reference_audio_urls可选 | array<string (uri)> | — | 最多 3 项 | Up to three voice or sound clips, named <Audio 1> and so on. Needs at least one picture or video beside it. Free. |
aspect_ratio可选 | string | 16:9 | 16:9, 9:16 | Frame shape: 16:9 (default) or 9:16. |
resolution可选 | string | 768p | 480p, 768p | Output size class: 480p or 768p (default). 480p costs less per second. |
duration_seconds可选 | integer | 5 | 5 到 15 | Clip length in whole seconds, 5 to 15. Billed per requested second. |
prompt_optimization_mode可选 | string | disabled | disabled, turbo, quality | Optional prompt rewrite before generation: disabled keeps your text as written, turbo is the quick rewrite, quality the more thorough one. Free. |
seed可选 | integer | — | 0 到 2147483647 | Optional random seed for one-change-at-a-time comparisons. Omit it for a random result. |
请求示例
这段请求原样就能运行,没写的字段都用默认值。运行前先把密钥放进环境变量 POPNOW_API_KEY。
示例里的 reference_image_urls 用的是 PopNow 的示例素材,换成你自己的公开 HTTPS 链接、上传文件或已保存的素材即可。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "heygen/video-1/reference-to-video",
"input": {
"prompt": "The man from the reference image jogs across a sunlit rooftop at golden hour and smiles at the camera; smooth tracking shot",
"reference_image_urls": [
"https://media.popnow.ai/influencer/examples/ava.webp"
],
"duration_seconds": 5,
"resolution": "768p"
}
}'响应里会立刻带回 taskId。之后用 GET /api/v1/jobs/recordInfo 取结果,或者在请求里加上 callBackUrl 等通知。
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
