Built from Voicebox's FastAPI OpenAPI schema, with a fallback to the checked-in docs schema, so the SDK tracks the upstream local API surface.
Auto-updated
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
1234
usingVoicebox;usingvarclient=newVoiceboxClient();// or: new VoiceboxClient(baseUri: new Uri("http://127.0.0.1:17493"));
Health
Check a running Voicebox local server.
1234567
varclient=Client;// Check whether the local Voicebox backend is available.// The SDK defaults to http://127.0.0.1:17493, matching the desktop app backend port.varhealth=awaitclient.General.HealthHealthGetAsync();Console.WriteLine($"Voicebox status: {health.Status}");
Profiles
List voice profiles configured in Voicebox.
1 2 3 4 5 6 7 8 910
varclient=Client;// List the local Voicebox voice profiles.// Profiles can be cloned voices, preset voices, or designed voices depending on the server setup.varprofiles=awaitclient.Profiles.ListProfilesProfilesGetAsync();foreach(varprofileinprofiles.Take(5)){Console.WriteLine($"{profile.Id}: {profile.Name} ({profile.Language})");}
Models
Inspect Voicebox model availability and download status.
1 2 3 4 5 6 7 8 910
varclient=Client;// Retrieve the server's model status list without loading a model.// This is useful for checking which local TTS/STT assets are downloaded.varstatus=awaitclient.Models.GetModelStatusModelsStatusGetAsync();foreach(varmodelinstatus.Models.Take(5)){Console.WriteLine($"{model.ModelName}: downloaded={model.Downloaded}, loaded={model.Loaded}");}
Voice Cloning
Create a cloned voice profile from reference audio, then optionally generate TTS with that profile.
varclient=Client;varreferenceAudio=GetReferenceAudio(requireExternalAudio:false);VoiceProfileResponse?profile=null;try{// Create a temporary cloned voice profile.// Set VOICEBOX_REFERENCE_AUDIO_PATH to use a real 2-30 second voice clip; otherwise this test uses a generated WAV only for endpoint coverage.profile=awaitclient.Profiles.CreateProfileProfilesPostAsync(name:$"tryagi-sdk-e2e-{Guid.NewGuid():N}",description:"Temporary profile created by tryAGI.Voicebox integration tests.",language:TestLanguage);// Attach reference voice audio and its transcript to the profile.varsample=awaitclient.Profiles.AddProfileSampleProfilesProfileIdSamplesPostAsync(profileId:profile.Id,file:referenceAudio.Bytes,filename:referenceAudio.Filename,referenceText:referenceAudio.ReferenceText);// Read the sample list back through the API.varsamples=awaitclient.Profiles.GetProfileSamplesProfilesProfileIdSamplesGetAsync(profile.Id);// Download the stored sample audio to verify the binary audio endpoint.varsampleAudio=awaitDownloadAudioAsync($"samples/{sample.Id}");}finally{awaitTryDeleteProfileAsync(profile?.Id);}
Voice Cloning TTS
Generate speech from a cloned voice profile created at test time.
if(!bool.TryParse(GetOptionalEnvironmentVariable("VOICEBOX_RUN_TTS_E2E"),outvarrunE2E)||!runE2E){thrownewAssertInconclusiveException("Set VOICEBOX_RUN_TTS_E2E=true and VOICEBOX_REFERENCE_AUDIO_PATH to run the full voice cloning TTS test.");}varclient=Client;varclonedVoice=awaitCreateClonedVoiceProfileAsync(requireExternalAudio:true);GenerationResponse?generation=null;try{// Generate speech using the newly-created cloned profile.// VOICEBOX_LANGUAGE defaults to ru and VOICEBOX_MODEL_SIZE defaults to 0.6B for faster local validation.generation=awaitclient.Generation.GenerateSpeechGeneratePostAsync(newGenerationRequest{ProfileId=clonedVoice.Profile.Id,Text=TestGeneratedText,Language=TestLanguage,ModelSize=TestModelSize,Seed=1,});// Voicebox generates asynchronously, so poll history until completion and then download the produced audio.varcompleted=awaitWaitForGenerationAsync(generation.Id);varaudio=awaitDownloadAudioAsync($"audio/{generation.Id}");}finally{awaitTryDeleteGenerationAsync(generation?.Id);awaitTryDeleteProfileAsync(clonedVoice.Profile.Id);}
Generate Speech
Generate speech from text using an existing Voicebox profile.
1 2 3 4 5 6 7 8 910111213141516
varclient=Client;varprofileId=GetRequiredEnvironmentVariable("VOICEBOX_PROFILE_ID");// Generate speech from text with an existing voice profile.// Set VOICEBOX_PROFILE_ID to the profile ID from your local Voicebox instance.vargeneration=awaitclient.Generation.GenerateSpeechGeneratePostAsync(newGenerationRequest{ProfileId=profileId,Text="Voicebox is running locally from a generated .NET SDK.",Language=GetOptionalEnvironmentVariable("VOICEBOX_LANGUAGE")??"en",ModelSize=GetOptionalEnvironmentVariable("VOICEBOX_MODEL_SIZE")??"1.7B",});Console.WriteLine($"Generated speech: {generation.Id}");
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.