D-ID API - Live Streaming

D-ID AI Video Platform
23 Mar 202304:09

TLDRThe D-ID API presentation showcases the developer-centric approach of their technology, focusing on the live streaming capabilities. Viewers are guided through the process of integrating with the D-ID API, from generating an API key to setting up a live streaming demo on GitHub. The tutorial covers creating a session, establishing a peer-to-peer connection, and generating animated content using a script and audio file. The final result is a real-time, AI-generated streaming experience, demonstrating the power of D-ID's technology for building advanced communication solutions.


  • 🔑 Generate an API key from D-ID's account settings to access their live streaming API.
  • 📚 Visit the GitHub repository for a live streaming demo to find examples and instructions on using the D-ID API.
  • 📝 Paste the API key into the 'api.json' file to authenticate your requests to the D-ID API.
  • 🖼️ Use a public URL for the image you want to animate, ensuring D-ID can fetch it.
  • 🔗 Initiate a session by posting to D-ID's backend with the API key and source image URL.
  • 🆔 Parse the response to obtain the unique ID, WebRTC offer, and session ID for server stickiness.
  • 🤝 Establish a local peer-to-peer connection and pass the answer back to D-ID's servers with the stream ID and session ID.
  • 🎬 Press the 'start' button to generate content, including parameters for script type and audio file URL.
  • 🔄 Use the 'stitch' configuration to combine the generated content seamlessly.
  • 🌐 WebRTC enables real-time communication capabilities for applications, supporting video, voice, and data transfer between peers.
  • 👏 Check out D-ID's repository for the example to build powerful voice and video communication solutions.

Q & A

  • What is the main purpose of the D-ID API for live streaming?

    -The main purpose of the D-ID API for live streaming is to enable developers to easily integrate with the D-ID technology for creating live streaming applications that utilize deepfake technology to animate images in real-time.

  • How can one access the D-ID API for live streaming?

    -To access the D-ID API for live streaming, one needs to go to studio.did.com, navigate to account settings, generate an API key, and then visit the live streaming demo repository on GitHub for step-by-step instructions on installation and usage.

  • What is the role of the API key in the integration process?

    -The API key is essential for authentication and authorization when integrating with the D-ID API. It is used to initiate session requests and communicate with D-ID's backend services.

  • What is the source URL in the context of the D-ID API integration?

    -The source URL is the public URL of the image that developers want to animate using the D-ID API. It must be publicly accessible so that the D-ID service can fetch it for the animation process.

  • What does the phrase 'webrtc offer' refer to in the script?

    -The 'webrtc offer' refers to the process of setting up a WebRTC (Web Real-Time Communications) connection, which is a browser-based protocol that enables peer-to-peer communication for applications requiring real-time functionality such as voice and video.

  • How is the session ID used in the D-ID API integration?

    -The session ID is used as stickiness information for the server, ensuring that the same server that initiated the request handles subsequent communications, maintaining consistency and performance.

  • What parameters are included when defining what will be generated in the D-ID API?

    -Parameters such as the script type (audio or text), the audiophile URL (which must be HTTPS and publicly available), and the session ID are included to define the content generation process in the D-ID API.

  • What is the significance of the 'Stitch' configuration in the final result?

    -The 'Stitch' configuration is used to combine the generated content seamlessly. When set to true, it ensures that the animation and audio are stitched together to create a coherent final output.

  • How can developers test the live streaming integration with the D-ID API?

    -Developers can test the integration by running the application locally, which will be accessible on port 3000 at localhost. They can then press 'connect' to initiate the connection and 'start' to begin streaming.

  • What capabilities does WebRTC offer for developers building real-time communication solutions?

    -WebRTC offers capabilities for real-time communication, including video, voice, and generic data transmission between peers. It is built on open standards, allowing developers to create powerful voice and video communication solutions.

  • Where can developers find the example and repository mentioned in the script?

    -Developers can find the example and repository on GitHub, where D-ID provides a step-by-step guide and example code for integrating the live streaming API.



🚀 Introduction to DIDs API Integration

The speaker begins by expressing gratitude to Gail and highlighting the importance of technology in meeting developers' needs. The focus is on API-first and developer-first approaches. The speaker then introduces the process of integrating with the DIDs (Decentralized Identifiers) API for live streaming. The audience is guided through generating an API key from studio.did.com, accessing the GitHub repository for a live streaming demo, and understanding the provided example and instructions. The speaker outlines the steps to install and use the DIDs API, including pasting the API key in a JSON file and setting up HTML and JavaScript files for API invocation.

🔗 Setting Up Live Streaming with DIDs API

This section delves into the technical setup for live streaming using the DIDs API. The process involves initiating a session request to the DIDs backend with the generated API key and source URL of the image to be animated. The image must be publicly accessible. The response is parsed to extract a unique ID, WebRTC offer, and session ID, which are crucial for creating a local peer-to-peer connection. This connection is then passed back to DIDs servers with additional arguments, including the locally generated answer, the stickiness session ID, and the stream ID. The speaker also mentions the importance of using HTTPS and public URLs for audio files, which are part of the content generation process when the start button is pressed.

🎨 Customizing Live Streaming Content

The speaker discusses customizing the live streaming content by defining parameters for content generation. This includes specifying the type of script to be used, such as audio, and referencing an audio file URL that must be publicly accessible over HTTPS. The speaker demonstrates how to include the session ID in the script and mentions the use of a 'Stitch' configuration to combine elements into a final result. The example provided shows the integration of a personal AI-generated image, illustrating the capabilities of the live streaming setup with DIDs API.

🌐 Conclusion and Real-time Communication Capabilities

The speaker concludes by demonstrating the final result of the live streaming setup, showing an AI-generated image of themselves. They emphasize the ease of accessing the live stream on localhost at port 3000 and the simplicity of initiating the connection and starting the stream. The speaker highlights the power of WebRTC, which enables real-time communication capabilities on top of an open standard, supporting video, voice, and generic data transfer between peers. This allows developers to create robust voice and video communication solutions. The speaker then invites the audience to explore the DIDs repository for the example and concludes the presentation by returning to Gail.




D-ID API refers to the application programming interface provided by D-ID, a company specializing in deepfake and identity-related technologies. In the video, the API is highlighted as being 'developer first,' emphasizing its ease of integration for developers. The script demonstrates how to use this API for live streaming, showcasing its capabilities and importance in the context of the video.

💡Live Streaming

Live Streaming is a method of broadcasting real-time video and audio content over the internet. The script discusses integrating the D-ID API with live streaming, indicating the process of setting up a session, connecting to D-ID's backend, and using the API to animate images in real-time, which is central to the video's demonstration.

💡API Key

An API Key is a unique code that identifies a user or a service to an API, allowing access to its functionality. In the script, the generation of an API key from D-ID's website is mentioned as the first step in the process of integrating with the D-ID API for live streaming purposes.


GitHub is a web-based platform for version control and collaboration used by developers. The script refers to GitHub as the location where the live streaming demo repository is hosted, containing examples and instructions for using the D-ID API, which is crucial for developers looking to implement the technology.


WebRTC stands for Web Real-Time Communications, an open standard for web browsers and mobile applications to enable real-time communication via audio, video, and data. The script mentions WebRTC as the technology used for real-time streaming, allowing developers to add powerful voice and video communication solutions to their applications.

💡Session Request

A session request is a process where a user or system initiates a connection with a service. In the context of the video, a session request is sent to D-ID's backend to start a live streaming session, including the API key and source URL of the image to be animated.

💡Unique ID

A Unique ID is a specific identifier used to distinguish one item or entity from another. The script explains that after sending a session request, the response from D-ID's backend includes a unique ID, which is essential for establishing a local peer-to-peer connection.

💡Peer-to-Peer Connection

A peer-to-peer connection is a network architecture where each node communicates directly with other nodes. In the script, creating a local peer-to-peer connection is part of the process to facilitate the live streaming of the animated image using the D-ID API.


SDP stands for Session Description Protocol, a protocol for describing multimedia sessions in multimedia conférencing applications. The script mentions SDP in the context of passing the answer back to D-ID's servers, which is part of the process of setting up the live streaming session.


Stitching, in the context of multimedia, refers to the process of combining different media elements into a single output. The script describes using a 'config of Stitch' with a setting to true, indicating that the generated content should be combined seamlessly.


Localhost is a hostname that refers to the local machine where a service is running. In the script, the final result of the live streaming setup is accessed on port 3000 at localhost, demonstrating the local testing and running of the application.


D-ID technology showcased with a focus on developer needs and API-first approach.

Demonstration of integrating with D-ID's news API for live streaming.

Instructions to generate an API key from studio.did.com and access the live streaming demo repository on GitHub.

Explanation of the step-by-step process to install and use the D-ID API.

Details on how to paste the API key in api.json and prepare HTML and JavaScript files.

Programming a session request to D-ID's backend with the API key and image source URL.

The importance of using a public image URL for D-ID to fetch.

Parsing the response for Unique ID, WebRTC offer, and session ID.

Creating a local peer-to-peer connection and passing the answer back to D-ID's servers.

Generating content with parameters to define what will be generated.

Using a script with type audio for the generation process.

Requirement for the audiophile URL to be HTTPS and publicly available.

Inclusion of session ID in the generation process for consistency.

Stitching the results using a config set to true.

Final result demonstration with an AI-generated image of the presenter.

Instructions to run the app on localhost at port 3000.

WebRTC's capabilities for real-time communication in applications.

Encouragement to check out D-ID's repository for the example.