Skip to main content
Version: Latest

Start Session

Starts an interactive avatar session with a session token. Use livekit.url and livekit.token from the response to connect to real-time video streaming.

What is LiveKit?

LiveKit is a WebRTC-based real-time video streaming stack. After Start Session returns livekit.url, livekit.token, and room_name, the client calls something like room.connect(url, token) to join the LiveKit server. Once connected, the avatar’s video, audio, and data channels stream in real time for a conversational experience.

POST/api/v2/sessions/start

Headers

HeaderValue
AuthorizationBearer {session_token}
Content-Typeapplication/json

Body

Use these fields when customizing the avatar’s voice, LLM, background, and related behavior. If omitted, server defaults apply.

FieldTypeRequiredDescription
avatar_idstringrequiredAvatar ID to use
avatar_personaV2StartSessionDtooptionalPersona and LLM settings
max_session_durationintegeroptionalMaximum session length
lip_audio_modestringoptionalWhen set, the server does not automatically send a greeting message
greeting_textstringoptionalGreeting when the avatar loads
Right after start, the server may automatically speak a greeting message (type: first_message)

V2StartSessionDto

NameTypeDescriptionRequired
languagestringe.g. en, ko, en-USNo
llm_configurationsV2LlmConfigurationsDtoLLM provider/model settings (defaults if omitted)No

V2LlmConfigurationsDto

NameTypeDescriptionRequired
providerstringe.g. openai, anthropic, google, custom (OpenAI-compatible SSE/HTTP)No
modelstringLLM provider/model (defaults if omitted)No
temperaturenumberTemperature (when set, forwarded as Runpod llm.temperature)No
custom_settingsV2LlmCustomSettingsDtoNo

V2LlmCustomSettingsDto

NameTypeDescriptionRequired
greeting_textstringIf set, the server may automatically speak a greeting right after startNo
system_promptstringNo

Examples

curl https://ai-streamer.deepbrain.io/api/v2/sessions/start  \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${SESSION_TOKEN}"
-X POST \
-d '{
"avatar_id": "${YOUR_AVATAR_ID}"
}'

Success (code: 1000)

{
"code": 1000,
"data": {
"session_id": "${SESSION_ID}",
"voice_id": "${VOICE_ID}",
"max_session_duration": 20,
"max_session_numbers": 10,
"livekit": {
"url": "wss://your-livekit-host",
"room_name": "room-…",
"token": "${LIVEKIT_ACCESS_TOKEN}"
}
},
"message": "Session has been started"
}

Next step

After Start Session, connect to LiveKit with livekit.url and livekit.token to stream the avatar’s video and audio in real time.