Streaming Avatars API
HeyGen's Streaming Avatars API allows developers to seamlessly integrate dynamic digital avatars into their applications for immersive and interactive user experiences. With this API, you can create virtual assistants, real-time training simulations, and more with a focus on real-time, low-latency communication between users and avatars with power of WebRTC.
You can test the Streaming Avatars API with your Trial token.
Quick Start
For a quick start, you can use our Streaming Avatar Demo GitHub repo.
-
Clone the repository to your local machine:
git clone https://github.com/HeyGen-Official/StreamingAvatar.git
-
Open the
index.js
file and replace'YourApiKey'
with your API key:"apiKey": "YourApiKey";
-
(optional) Open the
server.js
file and set your OpenAI API key to use talk mode:const openai = new OpenAI({ apiKey: "<your openai api key>", });
-
Open a terminal in the project folder and install the necessary dependencies and start the server:
npm install node server.js
Open your web browser and navigate to localhost:3000 and there it is, our demo is working. You can read the Use the Demo section for further information.
Quick Guide
Use Streaming Avatars in 5 Steps! For a more detailed Realtime API demonstration, you can take a look at this guide we have prepared for you:
Streaming Protocol
The Streaming Avatars API leverages the WebRTC (Web Real-Time Communication) protocol to ensure low-latency, secure communication between browsers and applications. This foundational technology offers advantages including low latency, cross-browser compatibility, data security, and scalability. For detailed information on WebRTC, visit the WebRTC website or WebRTC API page on MDN.
Conclusion
From interactive e-learning and gaming to virtual customer support and immersive entertainment, real-time avatars have the potential to transform industries.
In summary, the Streaming Avatars API empowers developers to create dynamic and interactive experiences by streaming avatar videos in real time. Whether you're building virtual assistants, customer support, or immersive training simulations, these APIs offer the tools needed to bring avatars to life within your applications, marking a significant advancement in user engagement and interactivity.
Updated about 1 month ago