Welcome to HeyGen! Today, we're diving into how to integrate HeyGen LiveAvatar via API, step-by-step.
Whether you're a developer, business owner, or tech enthusiast, this guide will empower you to connect seamlessly with HeyGenâs advanced avatar capabilities.  Demo LiveAvatar here , and then letâs dive into making one of your own! ďťż
Whatâs covered in this guide
In this tutorial, weâll cover:
- Setting up your API credentials
- Making your first API request
- Build video generation with templates
- Customizing with input audio
ďťż
What is HeyGen API?
The HeyGen API is offered independently of the HeyGen App and provides powerful tools like Video Generation, Video Translation, and LiveAvatar endpoints.
Every HeyGen App user receives Free Trial access to these features. Paid tiers â Creator, Team and Enterprise â are available for those who need expanded usage.
ďťż
Create HeyGen account and grab your API credentials
To get started, create a HeyGen account if you havenât already.
Once registered, youâll gain access to our API and can begin leveraging HeyGenâs AI to make professional avatar videos.
In HeyGen, click your name and then âSpace settings.â Then, click âAPI.â Youâll then need to copy your API credentials.
ďťż
Setting up your development environment
Next, ensure your development environment is set up to handle HTTP requests.
We recommend using tools like Postman or a REST client for initial testing.
ďťż
Making your first API request
Letâs make our first API call! Using your chosen tool, youâll set up a POST request to HeyGen's avatar endpoint.
In this example, we'll focus on creating a basic LiveAvatar.
In this code, replace YOUR_API_KEY with your actual key. The parameters name, voice, and interactionType are customizable. For example, choose from voice options to fit your brandâs tone or set interaction types like text-based or video-based.
ďťż
Testing your Avatar
After creating your video, you can check its status.
Use the video_status.get endpoint to monitor your videoâs progress. When itâs ready, the status will update to âcompleted.â
ďťż
Downloading the video
Once the status is marked âcompleted,â youâll get a download link. Use this to retrieve your video.
Remember, the link expires in 7 days, so be sure to download promptly.
ďťż
Bulk video generation with templates
If you need to create multiple videos, HeyGenâs Template endpoint lets you generate similar videos in bulk, perfect for scaling up your content creation.
ďťż
Customizing with input audio
For added flexibility, replace text input with an audio file using the audio_url attribute.
This lets you bring your own voice or music to avatar videos, giving you ultimate control over the sound.
ďťż
Recap
Thatâs it! Youâve now integrated HeyGen LiveAvatar via API. With HeyGen, youâre equipped to create innovative, AI-powered videos programmatically. For detailed documentation and more advanced capabilities, visit our API reference. Happy video-making!
In this tutorial, you learned:
- Setting up your API credentials
- Making your first API request
- Build video generation with templates
- Customizing with input audio
Weâre looking forward to seeing what youâll create with HeyGen!
If youâre posting your videos on social media, make sure to tag any videos you create with âat HeyGenâ so we can celebrate them with you.
ďťż