Create Session
Sessions
Create Session
Create and start a new avatar video session
POST
Create Session
What This Does: Creates and automatically starts a session with a video room where your avatar will appear. The session is immediately set to
started status and a server is allocated to run the avatar.Body
The avatar to use for this session. Accepts one of three formats:Recommended: An avatar ID returned by the Upload Face endpoint (e.g.
avat_01H3Z8G9YR3K2N5M6P7Q8W4T). This is the fastest and most reliable option — the avatar has already been validated, aligned and stored, so the session starts immediately.Accepted (paid plans only):- A publicly accessible image URL (e.g.
https://example.com/photo.jpg) - A base64-encoded image string (e.g.
data:image/jpeg;base64,...)
Video aspect ratio for the session. Must be one of:
4:3, 3:4 or 1:1. Defaults to 4:3 if not provided.Video room configuration object with the following fields:
platform(string, required): Room platform - must be “daily” or “livekit”url(string, required): Room URL for joiningtoken(string, required): Authentication token for the room
Optional metadata object to attach to the session. Must be a valid JSON object. Defaults to
{} if not provided.Response
Whether the session was created successfully
The created session object (See Session schema).
Current usage snapshot (minutes + concurrency) returned by usage enforcement.
Success message
Important Notes
Session Lifecycle: Creating a session automatically starts it. The session is created with
started_at set to the current timestamp and a server is immediately allocated to run the avatar. You do not need to call a separate “Start Session” endpoint.Video Room Integration: You must provide your own video room (Daily or LiveKit) configuration in the
room parameter. The API will use this configuration to connect the avatar server to your video room.Behavior
- Creates a new session using the provided avatar
- Avatar ID (
avat_...): resolved directly to its stored image — no extra processing. Avatars tagged asuser_exclusiveare restricted to the account that uploaded them - URL or base64 (paid plans only): the image is automatically processed through the Upload Face pipeline — face detection (exactly one prominent face required), face alignment, and upload to storage — before the session is created. Any validation error from this pipeline is returned as a session creation error. For best latency, call Upload Face separately in advance and pass the returned avatar ID here
- Free plan: only avatar IDs are accepted; URL and base64 inputs are rejected with a
403error - Automatically starts the session (sets
started_attimestamp) - Allocates a GPU-enabled server for avatar processing
- Calculates expiration time based on your subscription plan’s session duration limits
- Returns
session_tokenneeded for internal server authentication - Validates room platform is “daily” or “livekit”
- Defaults aspect ratio to “4:3” if not provided, validates it’s one of: “4:3”, “3:4” or “1:1”
- Metadata defaults to
{}and must be a valid JSON object - Session IDs are prefixed with
sess_ - Enforces subscription usage limits (minutes remaining, concurrent session limits)
Use Cases
- Create and start a session with your own Daily or LiveKit room
- Set up sessions with custom metadata for tracking
- Initialize avatar sessions programmatically
- Start avatar conversations with specific aspect ratios for different devices