Build with AssemblyAISDK References

C# SDK Reference

Deprecation Notice

As of April 2025, AssemblyAI C# SDK has been discontinued and will no longer be maintained. While the SDK will no longer be updated, any previously published releases will remain available.

Going forward, see the C# Pre-Recorded Audio page for information on how to integrate with our API directly.

We know this is a disruptive change. If you need help with this transition, reach out to our Support team at support@assemblyai.com and we’ll help you in any way we can.

Installation

You can find the AssemblyAI C# SDK on NuGet. Add the latest version using the .NET CLI:

$dotnet add package AssemblyAI

Then, create an AssemblyAIClient with your API key:

1using AssemblyAI;
2
3var client = new AssemblyAIClient(Environment.GetEnvironmentVariable("ASSEMBLYAI_API_KEY")!);

You can now use the client object to interact with the AssemblyAI API.

Add the AssemblyAIClient to the dependency injection container

The AssemblyAI SDK has built-in support for default .NET dependency injection container. Add the AssemblyAIClient to the service collection like this:

1using AssemblyAI;
2
3// build your services
4services.AddAssemblyAIClient();

By default, the AssemblyAIClient loads it configuration from the AssemblyAI section from the .NET configuration.

1{
2 "AssemblyAI": {
3 "ApiKey": "YOUR_ASSEMBLYAI_API_KEY"
4 }
5}

You can also configure the AssemblyAIClient other ways using the AddAssemblyAIClient overloads.

1using AssemblyAI;
2
3// build your services
4services.AddAssemblyAIClient(options =>
5{
6 options.ApiKey = Environment.GetEnvironmentVariable("ASSEMBLYAI_API_KEY")!;
7});