Modern .NET SDK for Nari Labs text-to-speech and realtime speech APIs, generated from the provider's OpenAPI and AsyncAPI definitions with AutoSDK.
Built from Nari Labs' OpenAPI and AsyncAPI definitions so the SDK stays close to the upstream API surface.
Designed for fast regeneration and low-friction updates when the upstream API changes without breaking compatibility.
Targets current .NET practices including nullability, trimming, NativeAOT awareness, and source-generated serialization.
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.
using NariLabs;
using var client = new NariLabsClient(
apiKey: Environment.GetEnvironmentVariable("NARI_API_KEY")!);Generate WAV audio with Nari Labs' free Qwen3-TTS model.
using var client = new NariLabsClient(apiKey);
// Voice IDs are model-specific, so discover the current catalog first.
var voices = await client.Voices.ListVoicesAsync(model: "qwen3-tts:free");
var voice = voices.Data.First();
// Generate complete WAV audio. The free model can be replaced with
// SpeechRequestModel.Qwen3Tts for the paid Standard endpoint.
var audio = await client.Speech.GenerateSpeechAsync(
model: SpeechRequestModel.Qwen3Tts_free,
input: "Hello from the Nari Labs .NET SDK!",
voice: voice.Id,
responseFormat: SpeechRequestResponseFormat.Wav);Start processing audio as Nari Labs produces it instead of buffering the entire response.
using var client = new NariLabsClient(apiKey);
var voices = await client.Voices.ListVoicesAsync(model: "qwen3-tts-fast:free");
var voice = voices.Data.First();
// GenerateSpeechAsStreamAsync exposes the response body immediately.
await using var audio = await client.Speech.GenerateSpeechAsStreamAsync(
new SpeechRequest
{
Model = SpeechRequestModel.Qwen3TtsFast_free,
Input = "This audio is delivered progressively.",
Voice = voice.Id,
Stream = true,
ResponseFormat = SpeechRequestResponseFormat.Pcm,
});
using var received = new MemoryStream();
await audio.CopyToAsync(received);NariLabs.Realtime provides a typed WebSocket client for 16 kHz mono PCM16 audio:
using NariLabs.Realtime;
await using var realtime = new NariLabsRealtimeClient(apiKey);
await realtime.ConnectAsync();
await realtime.SendSessionUpdateMessageAsync(
new RealtimeSessionUpdateMessage
{
Session = new SessionConfig
{
Model = SessionConfigModel.Qwen3AsrFast_free,
Language = SessionConfigLanguage.En,
},
});
await foreach (var update in realtime.ReceiveUpdatesAsync())
{
if (update.TryPickRealtimeCompletedTranscriptMessage(out var completed))
{
Console.WriteLine(completed.Transcript);
}
}Open an issue in tryAGI/NariLabs.
Use GitHub Discussions for design questions and usage help.
Join the tryAGI Discord for broader discussion across SDKs.
This project is supported by JetBrains through the Open Source Support Program.
