post https://api.heygen.com/v1/streaming.new
This endpoint is used to initiate a new streaming session.
This endpoint is used to initiate a new streaming session with an Interactive Avatar. It sets up a fresh session, allowing for real-time interactions and communication.
Request Body
Field | Type | Description |
---|---|---|
quality | string | The quality of the data to be retrieved. Can be "high", "medium", or "low". high: 2000kbps and 720p. medium: 1000kbps and 480p. low: 500kbps and 360p. |
avatar_id | string (optional) | The ID of the Interactive Avatar to use. If not provided, a default avatar will be chosen. Default: default |
voice | VoiceSetting(optional) | The settings for the Interactive Avatar's voice. |
video_encoding | string (optional) | Specifies the encoding format for streaming video. Can be "H264", "VP8". Default: VP8 . Note: Choosing "H264" may offer better compatibility with certain devices and platforms. |
knowledge_base | string (optional) | Knowledge Base prompt used for chat task type. |
version | string (optional) beta | Specifies the version to use. Currently, the only valid value is v2 .Default: Not specified (uses v1). |
knowledge_base_id | string (optional) beta | The ID of the knowledge base to use for the avatar's responses. Only applicable when version is set to v2 . |
disable_idle_timeout | boolean(optional) | By default session has a 2 minute idle timeout, setting to true disables it |
VoiceSetting
Field | Type | Description |
---|---|---|
voice_id | string (optional) | Voice for your Interactive Avatar. See the available voices by calling the List Voices endpoint. Note: Not every voice is supported in the streaming API. |
rate | float(optional) | Voice speed rate. Default is 1. |
emotion | string (optional) | Emotion to use for Emotional voices. Available emotions are Excited , Serious , Friendly , Soothing , Broadcaster |
Response Body
Field | Type | Description |
---|---|---|
code | integer | The response status code. |
message | string | The response message. |
data | object | Contains the response data. |
data.ice_servers(deprecated) | string array | Use ice_servers2 instead. |
data.ice_servers2 | ICEServer array | A list of ICE servers. |
data.sdp | object | The Session Description Protocol (SDP) data. |
data.session_id | string | The session ID. |
ICEServer
Field | Type | Description |
---|---|---|
urls | string array | The list of ICE server URLs, including STUN and TURN servers. |
username | string | The username for authentication. |
credential | string | The credential for authentication. |
SDP
Field | Type | Description |
---|---|---|
sdp | string | The Session Description Protocol (SDP) data. |
type | string | The type of SDP, which is "offer ". |