Designed for fast regeneration and low-friction updates when the upstream API changes without breaking compatibility.
Modern .NET
Targets current .NET practices including nullability, trimming, NativeAOT awareness, and source-generated serialization.
Docs from examples
Examples stay in sync between the README, MkDocs site, and integration tests through the AutoSDK docs pipeline.
Usage
123
usingSimli;usingvarclient=newSimliClient(apiKey);
List Faces
Lists all available avatar faces for the authenticated user.
1 2 3 4 5 6 7 8 910
usingvarclient=newSimliClient(apiKey);// List all available avatar facesvarfaces=awaitclient.GetFacesAsync();Console.WriteLine($"Found {faces.Count} face(s)");foreach(varfaceinfaces){Console.WriteLine($" Face ID: {face.Id}, Version: {face.SimliVersion}, Created: {face.CreatedAt}");}
Create Session Token
Creates a Compose session token for WebRTC avatar streaming.
1 2 3 4 5 6 7 8 9101112
usingvarclient=newSimliClient(apiKey);// Get available faces firstvarfaces=awaitclient.GetFacesAsync();varfaceId=faces[0].Id.ToString();// Create a Compose session token for realtime avatar streamingvarresponse=awaitclient.StartAudioToVideoSessionComposeTokenPostAsync(faceId:faceId);Console.WriteLine($"Session token: {response.SessionToken}");
Session History
Retrieves session history for the authenticated user.
usingvarclient=newSimliClient(apiKey);// Check the number of currently active sessionsvarresponse=awaitclient.GetRatelimiterSessionsAsync();Console.WriteLine($"Active sessions: {response.CurrentUsage ?? 0}");
Realtime Avatar Client
Test the IRealtimeAvatarClient adapter for Simli realtime sessions.
varapiKey=Environment.GetEnvironmentVariable("SIMLI_API_KEY")is{Length:>0}key?key:thrownewAssertInconclusiveException("SIMLI_API_KEY environment variable is not found.");varfaceId=Environment.GetEnvironmentVariable("SIMLI_FACE_ID")is{Length:>0}id?id:"default";// Use default face if not specifiedvarclient=newSimliClient(apiKey);// Create and connect via the unified interfaceawaitusingvaravatar=awaitSimliRealtimeAvatarClient.ConnectAsync(client,faceId);// Verify the adapter implements IRealtimeAvatarClienttryAGI.RealtimeAvatar.IRealtimeAvatarClientrealtimeClient=avatar;// SendTextAsync should throw NotSupportedException (Simli is audio-only)Func<Task>sendText=()=>avatar.SendTextAsync("test");// Send a short PCM16 audio chunk (silence)varsilentAudio=newbyte[3200];// 100ms of silence at 16kHz mono PCM16awaitavatar.SendAudioAsync(silentAudio);// The connection should be established// Note: IsConnected checks both WebSocket and WebRTC state// WebRTC may take a moment to establish