HeyGen
HeyGen is a Generative AI service that generates talking avatars. You can select one of the available avatars and provide a script or text. HeyGen will then generate a video of the avatar speaking the text.
The HeyGen provider allows you to generate assets using the Create API and includes the following services:
- Text to Avatar: Generate a talking avatar who will narrate the provided text.
Setup
Sign up for a free account with HeyGen to get started and then follow the HeyGen documentation to create an API key. If you have a free account you can use the trial key. Note that HeyGen refers to the API keys as a token.
Adding credentials
Login to the dashboard and navigate to the integrations page, find the HeyGen integration under Generative AI and click configure.
Enter the HeyGen API key (token) as shown below. You can add different keys for each Shotstack environment; sandbox and v1 (production).
Services
The HeyGen provider includes is a single service:
Text to avatar
Generate a talking avatar video using a provided script.
Using the Create API the following payload can be used to generate a video file:
{
"provider": "heygen",
"options": {
"type": "text-to-avatar",
"avatar": "Angela",
"voice": "Abbi - Natural",
"text": "Hi, I'm Angela and I'm a talking avatar generated by HeyGen using the Shotstack Create API"
}
}
This will generate an mp4 video file using the Angela
avatar and the Abbi - Natural
voice and the text provided. For
the full list of avatars and voices refer to the HeyGen
options in the API reference documentation.
Additional options
You can configure the video using additional parameters:
{
"provider": "heygen",
"options": {
"type": "text-to-avatar",
"avatar": "Angela",
"voice": "Abbi - Natural",
"text": "Hi, I'm Angela and I'm a talking avatar generated by HeyGen using the Shotstack Create API",
"avatarStyle": "circle",
"background": "#ffffff",
"ratio": "16:9",
"test": false
}
}
This example includes an avatarStyle (normal or circle), background colour (any hex string), aspect ratio (16:9 or 9:16) and test mode.
This will generate an mp4 video file using the Angela
avatar and the Abbi - Natural
voice and the text provided. The
avatar will be displayed in a circle with a white background and the video will be rendered in 16:9 aspect ratio.