Create Session

Initiates a session.

<Warning> Call this endpoint from your backend. You must not expose your API Key in your frontend code. </Warning>

Upon successful creation, the API returns a session token that can be safely used in Web SDK.

There are a few ways to process what a user says and what avatar says.

It's configured via the conversation engine. Supported types:

  • openai-realtime — Avaturn Live talks directly to OpenAI Realtime on your behalf.
  • cartesia — Cartesia Line
  • external — Avaturn Live opens a WebSocket to a URL you provide and exchanges raw audio plus segment events with it. The reference integration uses Pipecat; see the open-source pipecat-avaturn-live-demo repo for a working end-to-end example.
  • text-echo — legacy text-driven TTS playback.

Reach out to us if you want to integrate with something else.

post/api/v1/sessions

Request

  • Base URL
    https://api.avaturn.live
  • Auth
    HTTP bearer

Request body

avatar_idstring

Avatar ID

background'transparent' | 'default'

Background type for the avatar. 'transparent' removes the background, 'default' uses the avatar's default background

model'delta' | 'golf'
user_absent_timeoutinteger

Seconds to wait before terminating the session if no user is connected

max_durationinteger

Maximum session duration in seconds (max 24 hours)

Response

Successful Response

session_idstring required

Session ID

tokenstring required

Session token for Web SDK

Changes

No recorded changes to this operation across all 1 revision of this API.