Skip to content

Create Session Token

Creates a Compose session token for WebRTC avatar streaming.

This example assumes using Simli; is in scope and apiKey contains your Simli API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using var client = new SimliClient(apiKey);

// Get available faces first
var faces = await client.GetFacesAsync();

var faceId = faces[0].Id.ToString();

// Create a Compose session token for realtime avatar streaming
var response = await client.StartAudioToVideoSessionComposeTokenPostAsync(
    faceId: faceId);

Console.WriteLine($"Session token: {response.SessionToken}");