Skip to main content
POST
Create Agora session
Do not call this endpoint directly from your app. Configure LemonSlice in Agora’s join request via the Agora integration (vendor: "generic"). Agora’s backend calls this endpoint to open the avatar session.

Authorizations

X-API-Key
string
header
required

Your LemonSlice API token.

Body

application/json

Body for starting a LemonSlice Agora session. Exactly one of agent_id, agent_image_url, or agent_image_base64 must be provided.

video_encoding
enum<string>
required

Video codec used for the avatar stream. H264 provides the widest client compatibility.

Available options:
H264,
VP8,
AV1
agora_settings
object
required

Agora RTC connection settings for the LemonSlice avatar participant. Populated by Agora when using the generic avatar vendor.

avatar_id
string

Pass in lemonslice for this field. The avatar's appearance is taken from agent_id, agent_image_url, or agent_image_base64.

Example:

"lemonslice"

agent_id
string

The ID of a LemonSlice agent. Exactly one of agent_id, agent_image_url, or agent_image_base64 is required.

Example:

"agent_abc123"

agent_image_url
string<uri>

A publicly accessible URL to the avatar image. Exactly one of agent_id, agent_image_url, or agent_image_base64 is required.

Example:

"https://cdn.lemonslice.com/agents/custom_agent.png"

agent_image_base64
string

Base64-encoded avatar image bytes. Exactly one of agent_id, agent_image_url, or agent_image_base64 is required.

activity_idle_timeout
number
default:120

Seconds of inactivity before the session is automatically terminated. Set to 0 to disable the idle timeout. If no idle timeout is configured, you must terminate the call explicitly.

agent_prompt
string
default:a person talking

A high-level system prompt that subtly influences the avatar's movements, expressions, and emotional demeanor while speaking. Best used for general affect (for example, "feel excited" or "look sad") rather than precise actions.

agent_idle_prompt
string
default:a serious person

A high-level system prompt that influences the avatar's movements, expressions, and emotional demeanor during the idle state.

model
enum<string> | null
default: null

Model variant. Leave unset to use the normal flagship model.

Available options:
lite,
flash,
pro,
null
aspect_ratio
enum<string>
default:2x3

Output aspect ratio for the avatar video.

Available options:
2x3,
9x16,
1x1
response_done_timeout
number | null
default: null

Time in seconds to wait without receiving new audio bytes before marking the response as complete. Some TTS models do not send an end-response event, or do not send it promptly. This parameter enables completion detection when such events are missing or delayed.

Response

Session started successfully.

session_id
string
required

Unique identifier for this LemonSlice session.

websocket_address
string
required

WebSocket URL Agora uses for the avatar audio/video tunnel.

session_token
string
required

Token used to authenticate the WebSocket tunnel and session stop requests.