Streaming Intermediate
D-ID's Streaming API creates real-time, interactive talking avatars using WebRTC. Unlike the Talks API which renders videos asynchronously, streaming delivers live video of the animated face with sub-second latency - enabling conversational applications where users interact with a digital human in real time.
How Streaming Works
- Create a stream
POST to /streams to initialize a WebRTC session. D-ID returns an SDP offer and ICE candidates.
- Establish WebRTC connection
Exchange SDP/ICE with D-ID's servers using standard WebRTC APIs in the browser.
- Send talk commands
POST text or audio to the active stream. D-ID renders the face animation in real-time and streams it over WebRTC.
- Display the video
Attach the incoming WebRTC stream to a <video> element. The user sees the avatar speaking live.
Streaming vs. Talks API
| Feature | Talks API | Streaming API |
|---|---|---|
| Latency | 30-90 seconds render | Sub-second |
| Output | MP4 file | Live WebRTC video |
| Interactivity | None (pre-rendered) | Full (real-time input) |
| Cost | Per video credit | Per minute of streaming |
| Best For | Batch content creation | Live conversations, chatbots |
Idle Behavior
While not speaking, the streaming avatar displays idle animations: natural blinking, slight head movements, and breathing. This maintains the illusion of a live presence even during pauses in conversation.
Ready to Go Deeper?
Live instructor-led courses from our partners. Affiliate disclosure.
AI & ML Courses - 30% Off
Live instructor-led AI, machine learning, data science, and cloud courses for working professionals. Use code Limited30 at checkout.
EdurekaDataCamp - AI & Data Science
Hands-on Python, machine learning, and AI courses with interactive exercises and real projects.
DataCampedX - Top AI Courses
University-level AI courses from MIT, Harvard, Stanford. Earn certificates that employers recognize.
edX