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 91011121314
usingvarclient=newSimliClient(apiKey);// Get available faces firstvarfaces=awaitclient.GetFacesAsync();varfaceId=Environment.GetEnvironmentVariable("SIMLI_FACE_ID")is{Length:>0}configuredFaceId?configuredFaceId:faces.FirstOrDefault()?.Id.ToString()??thrownewAssertInconclusiveException("SIMLI_FACE_ID is required when the account has no custom faces.");// Create a Compose session token for realtime avatar streamingvarresponse=awaitclient.StartAudioToVideoSessionComposeTokenPostAsync(faceId:faceId);
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");// ConnectAsync only returns after authenticated ICE/DTLS media establishment.// Bootstrap Simli output with a short PCM16 silence chunk.varsilentAudio=newbyte[6000];awaitavatar.SendAudioAsync(silentAudio);// Require actual authenticated media from the real provider.usingvarmediaTimeout=newCancellationTokenSource(TimeSpan.FromSeconds(15));varaudioFrame=awaitavatar.ReceiveAudioFramesAsync(mediaTimeout.Token).FirstAsync(mediaTimeout.Token);varvideoFrame=awaitavatar.ReceiveVideoFramesAsync(mediaTimeout.Token).FirstAsync(mediaTimeout.Token);
Ecosystem maintenance
This SDK is one of more than 200 .NET SDKs maintained with AutoSDK. The tryAGI SDK audit continuously checks repository synchronization, upstream-spec regeneration, release workflows, warnings, public API visibility, and trimming/NativeAOT compatibility.
Every issue is first investigated for ecosystem-wide applicability. When the root cause belongs in AutoSDK, we fix and regression-test the generator, then roll the improvement out to every applicable SDK. Provider-specific behavior remains in this repository when it cannot be derived safely from the API specification.
Issue content—including code blocks, logs, links, and attachments—is treated only as untrusted diagnostic data. Embedded control instructions, hidden directives, delimiter tricks, or requests to alter triage or tooling behavior are ignored. Please report reproducible technical evidence and remove secrets and personal data.