post https://api.heygen.com/v1/video.generate
Attention: avatars created after 03/21/2024 will no longer be supported in v1 API.
This API is deprecated and will be removed in 6 months. Please migrate to Video Generation V2 . Finetuned and Studio Avatars created after 03/21/2024 will no longer be supported in v1 API.
Request Body
Field | Type | Description |
---|---|---|
background | string | The background of the whole video. Could be: - A public HTTP link of an image (jpg/jpeg/png) - A public HTTP link of a video (mp4 only). The background will loop the whole video if the background video is shorter than the whole video. - A six-bit hex color code starts with #. (e.g. #FAFAFA ) |
ratio | string | Aspect ratio of the video, should be one of - 16:9 - 9:16 |
test | bool | Set the test flag to true to use test mode. Generation in test mode will not cost your credits and will contain a watermark on your video. |
version | string | Set it to v1alpha . The version is alpha now, the API will keep the current version if there is any breaking change. |
caption_open | bool | Set it true to create video with caption. Only text input supports caption |
clips | A list of clips represents the content of the video. | |
clips[].avatar_id | string | A unique identifier of an avatar. Only one of the avatar_id and talking_photo_id appears. |
clips[].avatar_style | string | The style of the avatar should be one of - normal - circle |
clips[].input_text | string | The text content that an avatar/talking_photo speaks. Only one of the input_text and input_audio should be used. |
clips[].input_audio | string | The audio url that an avatar/talking_photo speaks. Only one of the input_text and input_audio should be used. |
clips[].scale | float | The scale of the avatar or talking photo, 1 means to scale the avatar/talking photo to the whole screen.0.5 means scale the avatar/talking photo to half of the screen |
clips[].offset | Specify the position of the avatar or talking photo. | |
clips[].offset.x | float | Horizontal position of the avatar or talking photo. - 0 means center horizontally- -0.5 means the center of the avatar (or talking photo) is on the left of the screen.- 0.5 means the center of the avatar (or talking photo) is on the right of the screen. |
clips[].offset.y | float | Vertical position of the avatar or talking photo. - 0 means center vertically. - -0.5 means the center of the avatar (or talking photo) is on the bottom of the screen.- 0.5 means the center of the avatar (or talking photo) is on the top of the screen. |
clips[].talking_photo_id | A unique identifier of a talking photo. Only one of the avatar_id and talking_photo_id appears. | |
clips[].talking_photo_style | The style of the talking photo should be one of - normal - circle |
Response
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the object. |
error | json | Optional, the error detail of the video. |
status | string | Video status, one of - processing (The video is rendering)- completed (The video render success)- failed (An error occurred when rendering video). |
video_url | string | The URL of the video after completed. The URL will be expired in a few days. |