tryAGI.AssemblyAI 1.0.1-dev.32

Prefix Reserved
This is a prerelease version of tryAGI.AssemblyAI.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package tryAGI.AssemblyAI --version 1.0.1-dev.32
                    
NuGet\Install-Package tryAGI.AssemblyAI -Version 1.0.1-dev.32
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="tryAGI.AssemblyAI" Version="1.0.1-dev.32" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="tryAGI.AssemblyAI" Version="1.0.1-dev.32" />
                    
Directory.Packages.props
<PackageReference Include="tryAGI.AssemblyAI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add tryAGI.AssemblyAI --version 1.0.1-dev.32
                    
#r "nuget: tryAGI.AssemblyAI, 1.0.1-dev.32"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package tryAGI.AssemblyAI@1.0.1-dev.32
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=tryAGI.AssemblyAI&version=1.0.1-dev.32&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=tryAGI.AssemblyAI&version=1.0.1-dev.32&prerelease
                    
Install as a Cake Tool

AssemblyAI

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official AssemblyAI OpenAPI specification using OpenApiGenerator
  • Same day update to support new features
  • Updated and supported automatically if there are no breaking changes
  • All modern .NET features - nullability, trimming, NativeAOT, etc.
  • Support .Net Framework/.Net Standard 2.0
  • Microsoft.Extensions.AI ISpeechToTextClient support

Usage

using AssemblyAI;

using var api = new AssemblyAIClient(apiKey);

var fileUrl = "https://github.com/AssemblyAI-Community/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3";

//// You can also transcribe a local file by passing in a file path
// var filePath = "./path/to/file.mp3";
// var uploadedFile = await api.Files.UploadAsync(await File.ReadAllBytesAsync(filePath));
// fileUrl = uploadedFile.UploadUrl;

var queued = await api.Transcripts.SubmitAsync(
    TranscriptParams.FromUrl(
        fileUrl,
        new TranscriptOptionalParams
        {
            SpeechModels = [SpeechModel2.Universal35Pro],
            LanguageDetection = true, // Enables native code-switching routing.
            SpeakerLabels = true, // Speaker diarization.
            Prompt = "Canadian wildfire news interview with air quality and public health terms.",
            KeytermsPrompt = ["Peter DeCarlo", "Johns Hopkins", "particulate matter"],
        }));

Transcript transcript;
do
{
    await Task.Delay(TimeSpan.FromSeconds(2));
    transcript = await api.Transcripts.GetAsync(queued.Id.ToString());
}
while (transcript.Status is TranscriptStatus.Queued or TranscriptStatus.Processing);

transcript.EnsureStatusCompleted();

Console.WriteLine(transcript);

Microsoft.Extensions.AI

The SDK implements ISpeechToTextClient:

using AssemblyAI;
using Microsoft.Extensions.AI;

ISpeechToTextClient speechClient = new AssemblyAIClient(apiKey);

await using var audioStream = File.OpenRead("recording.wav");
var response = await speechClient.GetTextAsync(audioStream);

Console.WriteLine(response.Text);

Transcribe

using var client = GetAuthenticatedApi();

var fileUrl = "https://github.com/AssemblyAI-Community/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3";

// You can also transcribe a local file by passing in a file path
// var filePath = "./path/to/file.mp3";
// var uploadedFile = await client.Files.UploadAsync(await File.ReadAllBytesAsync(filePath));
// fileUrl = uploadedFile.UploadUrl;

var queued = await client.Transcripts.SubmitAsync(
    TranscriptParams.FromUrl(
        fileUrl,
        new TranscriptOptionalParams
        {
            SpeechModels = [SpeechModel2.Universal35Pro],
            LanguageDetection = true,
            SpeakerLabels = true,
            AutoHighlights = true,
        }));

var transcript = await PollUntilTerminalAsync(client, queued.Id);

transcript.EnsureStatusCompleted();

Console.WriteLine(transcript);

// If you want to summarize the transcript, you can use the Lemur API
// LemurTaskResponse response = await client.LeMUR.LemurTaskAsync(LemurTaskParams.FromPrompt(
//     prompt: "Provide a brief summary of the transcript.",
//     @params: new LemurBaseParams
//     {
//         TranscriptIds = [transcript.Id],
//         FinalModel = LemurModel.AnthropicClaude35Sonnet
//     }));
//
// Console.WriteLine(response.String?.Value1?.Response ?? "No response found.");
// Console.WriteLine($"Input tokens: {response.String?.Value2?.Usage.InputTokens}");
// Console.WriteLine($"Input tokens: {response.String?.Value2?.Usage.OutputTokens}");

Transcribe Live

using var client = GetAuthenticatedApi();

// - You need to have `sox` installed on your system. If not, run:
//   macOS: brew install sox (macOS)
//   Linux: sudo apt-get install sox libsox-fmt-all
//   Windows: manually download and install sox, and add sox to your PATH environment variable.
//            https://sourceforge.net/projects/sox/

// Set up the cancellation token, so we can stop the program with Ctrl+C
var cts = new CancellationTokenSource();
var ct = cts.Token;
Console.CancelKeyPress += (sender, e) => cts.Cancel();

// Set up the realtime transcriber
// await using var transcriber = new RealtimeTranscriber(new RealtimeTranscriberOptions
// {
//     SampleRate = 16_000
// });
//
// transcriber.PartialTranscriptReceived.Subscribe(transcript =>
// {
//     if (transcript.Text == "") return;
//     Console.WriteLine($"Partial transcript: {transcript.Text}");
// });
// transcriber.FinalTranscriptReceived.Subscribe(transcript =>
// {
//     Console.WriteLine($"Final transcript: {transcript.Text}");
// });

//await transcriber.ConnectAsync();

var soxArguments = string.Join(' ', [
    // --default-device doesn't work on Windows
    OperatingSystem.IsWindows() ? "-t waveaudio default" : "--default-device",
    "--no-show-progress",
    "--rate 16000",
    "--channels 1",
    "--encoding signed-integer",
    "--bits 16",
    "--type wav",
    "-" // pipe
]);
Console.WriteLine($"sox {soxArguments}");
using var soxProcess = new Process();
soxProcess.StartInfo = new ProcessStartInfo
{
    FileName = "sox",
    Arguments = soxArguments,
    RedirectStandardOutput = true,
    RedirectStandardError = true,
    UseShellExecute = false,
    CreateNoWindow = true
};

soxProcess.Start();
soxProcess.BeginErrorReadLine();
var soxOutputStream = soxProcess.StandardOutput.BaseStream;
var buffer = new Memory<byte>(new byte[4096]);
while (await soxOutputStream.ReadAsync(buffer, ct) > 0)
{
    if (ct.IsCancellationRequested) break;
    //await transcriber.SendAudioAsync(buffer);
}

soxProcess.Kill();
//await transcriber.CloseAsync();

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.

Support

Priority place for bugs: https://github.com/tryAGI/AssemblyAI/issues
Priority place for ideas and general questions: https://github.com/tryAGI/AssemblyAI/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1-dev.42 0 9/28/2026
1.0.1-dev.41 22 9/27/2026
1.0.1-dev.40 26 9/27/2026
1.0.1-dev.39 33 9/25/2026
1.0.1-dev.38 44 9/22/2026
1.0.1-dev.37 53 9/21/2026
1.0.1-dev.36 54 9/19/2026
1.0.1-dev.35 65 9/12/2026
1.0.1-dev.34 71 9/9/2026
1.0.1-dev.33 80 9/9/2026
1.0.1-dev.32 70 9/6/2026
1.0.1-dev.31 75 9/5/2026
1.0.1-dev.30 123 9/2/2026
1.0.1-dev.28 70 8/30/2026
1.0.1-dev.27 74 8/29/2026
1.0.1-dev.2 92 7/8/2026
1.0.0 859 6/23/2026
0.0.0-dev.277 193 6/23/2026
0.0.0-dev.276 91 6/23/2026
0.0.0-dev.275 86 6/23/2026
Loading failed