Skip to main content
POST
Create session
Do not call this endpoint directly. Use the official LiveKit or Pipecat SDK instead to ensure proper session lifecycle management.
To upload an avatar image file directly, switch the request body content type to multipart/form-data below.

Authorizations

X-API-Key
string
header
required

Your LemonSlice API token.

Body

The properties used to create a self-managed session. Use application/json to reference an agent_id or agent_image_url, or multipart/form-data to upload an image file directly.

Input to create an agent session. Exactly one of agent_id or agent_image_url must be provided.

agent_image_url
string<uri>
required

A URL to an agent image to use. The image should be 368x560 pixels. LemonSlice will automatically center-crop your image to the target aspect ratio if the dimensions do not match the expected values. Provide either agent_image_url or agent_id, but not both.

Example:

"https://example.com/custom_agent.png"

transport_type
enum<string>
required

The interface type for how the audio is sent and how the A/V is returned.

Available options:
livekit,
daily
agent_prompt
string
default:a person talking

A high-level system prompt that subtly influences the avatar's movements, expressions, and emotional demeanor. This prompt is best used to suggest general affect or demeanor (for example, 'feel excited' or 'look sad') rather than precise or deterministic 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.

idle_timeout
integer
default:60

Idle timeout in seconds. If a negative number is provided, the session will have no idle timeout.

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 in a timely manner. This parameter enables detection of response completion when such events are missing or delayed. This parameter can also be used to ensure proper conversation flow with multi-message LLMs (e.g. gpt-realtime-2).

aspect_ratio
enum<string>
default:2x3

Output aspect ratio for the avatar video.

Available options:
2x3,
9x16,
1x1
model
enum<string> | null
default: null

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

Available options:
lite,
flash,
pro,
null
simulcast
boolean
default:false

Enable WebRTC simulcast, which publishes multiple resolutions of the avatar video so subscribers receive the best quality their bandwidth allows. LiveKit transport only.

properties
LiveKit · object

Additional properties needed to connect to the transport layer.

Example:

Response

Session created successfully.

session_id
string
required

The ID of the session.

Example:

"3f7c2b91-9e1f-4a6a-8e9d-2c7c3e7d9b5a"