This demo showcases the core features of the D-ID Agents API with Express and vanilla JavaScript. It’s meant as a starting point for your own customizations, demonstrating the API’s basic functionality in a simple, approachable way — not as a production-ready application.
- Real-time video and audio streaming with D-ID Agents
- Chat and Speak modes (Chat: D-ID’s LLM responses, Speak: repeats textbox input for custom implementations)
- New: Fluent streaming + response interruption (Agents with V3 Pro Avatars only)
- Speech-to-text example using the open-source WebSpeech API
- Modern UI with responsive design
git clone https://github.com/de-id/agents-api-demo.git
cd agents-api-demo-mainnpm installagents-streams-api.js— Application logic and D-ID Agents API integrationapp.js- HTTP Serverapi.json- API Key and Routeindex.html— Main HTML filestyle.css— Stylingpackage.json— Project configurationwebSpeechAPI.js— WebSpeech API Speech-to-text support
Fetch your API key from the D-ID Studio and paste it in the api.json file.
API Documentation - Basic Authentication
Fetch your Agent ID:
- From the D-ID Studio: Agent Embed option -
data-agent-id - From API: GET Agents Endpoint
Paste this value in the agentID variable in the agents-streams-api.js file.
node app.jsThen open http://localhost:3000 in your browser.
© D-ID. MIT License.