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"
