Skip to main content
POST
/
v3
/
avatar-realtime
Create Avatar Realtime Session
curl --request POST \
  --url https://api.heygen.com/v3/avatar-realtime \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "type": "<string>",
  "avatar_id": "<string>",
  "text": "<string>",
  "voice_id": "<string>"
}
'
{
  "data": {
    "stream_id": "<string>"
  }
}

Authorizations

x-api-key
string
header
required

HeyGen API key. Obtain from your HeyGen dashboard.

Body

application/json

Create a stream with text-to-speech audio.

type
string
required

Audio source type: text-to-speech.

Allowed value: "tts"
avatar_id
string
required

HeyGen photo avatar or motion avatar look ID.

text
string
required

Text script for the avatar to speak.

Minimum string length: 1
voice_id
string
required

Voice ID for text-to-speech.

Response

Created.

data
CreateAvatarRealtimeResponse · object

Response data for POST /v3/avatar-realtime.