ElevenLabs-DotNet 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package ElevenLabs-DotNet --version 1.0.3                
NuGet\Install-Package ElevenLabs-DotNet -Version 1.0.3                
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="ElevenLabs-DotNet" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ElevenLabs-DotNet --version 1.0.3                
#r "nuget: ElevenLabs-DotNet, 1.0.3"                
#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.
// Install ElevenLabs-DotNet as a Cake Addin
#addin nuget:?package=ElevenLabs-DotNet&version=1.0.3

// Install ElevenLabs-DotNet as a Cake Tool
#tool nuget:?package=ElevenLabs-DotNet&version=1.0.3                

ElevenLabs-DotNet

Discord NuGet version (ElevenLabs-DotNet) Nuget Publish

A non-official Eleven Labs voice synthesis RESTful client.

I am not affiliated with Eleven Labs and an account with api access is required.

All copyrights, trademarks, logos, and assets are the property of their respective owners.

Getting started

Install from NuGet

Install package ElevenLabs from Nuget. Here's how via command line:

Install-Package ElevenLabs-DotNet

Looking to use ElevenLabs in the Unity Game Engine? Check out our unity package on OpenUPM:

openupm


Documentation

Table of Contents

Text to Speech

Convert text to speech.

var api = new ElevenLabsClient();
var text = "The quick brown fox jumps over the lazy dog.";
var voice = (await api.VoicesEndpoint.GetAllVoicesAsync()).FirstOrDefault();
var defaultVoiceSettings = await api.VoicesEndpoint.GetDefaultVoiceSettingsAsync();
var clipPath = await api.TextToSpeechEndpoint.TextToSpeechAsync(text, voice, defaultVoiceSettings);
Console.WriteLine(clipPath);

Voices

Access to voices created either by the user or ElevenLabs.

Get All Voices

Gets a list of all available voices.

var api = new ElevenLabsClient();
var allVoices = await api.VoicesEndpoint.GetAllVoicesAsync();

foreach (var voice in allVoices)
{
    Console.WriteLine($"{voice.Id} | {voice.Name} | similarity boost: {voice.Settings?.SimilarityBoost} | stability: {voice.Settings?.Stability}");
}
Get Default Voice Settings

Gets the global default voice settings.

var api = new ElevenLabsClient();
var result = await api.VoicesEndpoint.GetDefaultVoiceSettingsAsync();
Console.WriteLine($"stability: {result.Stability} | similarity boost: {result.SimilarityBoost}");
Get Voice
var api = new ElevenLabsClient();
var voice = await api.VoicesEndpoint.GetVoiceAsync("voiceId");
Console.WriteLine($"{voice.Id} | {voice.Name} | {voice.PreviewUrl}");
Edit Voice Settings

Edit the settings for a specific voice.

var api = new ElevenLabsClient();
var success = await api.VoicesEndpoint.EditVoiceSettingsAsync(voice, new VoiceSettings(0.7f, 0.7f));
Console.WriteLine($"Was successful? {success}");
Add Voice
var api = new ElevenLabsClient();
var labels = new Dictionary<string, string>
{
    { "accent", "american" }
};
var audioSamplePaths = new List<string>();
var voice = await api.VoicesEndpoint.AddVoiceAsync("Voice Name", audioSamplePaths, labels);
Edit Voice
var api = new ElevenLabsClient();
var labels = new Dictionary<string, string>
{
    { "age", "young" }
};
var audioSamplePaths = new List<string>();
var success = await api.VoicesEndpoint.EditVoiceAsync(voice, audioSamplePaths, labels);
Console.WriteLine($"Was successful? {success}");
Delete Voice
var api = new ElevenLabsClient();
var success = await api.VoicesEndpoint.DeleteVoiceAsync(voiceId);
Console.WriteLine($"Was successful? {success}");
Samples

Access to your samples, created by you when cloning voices.

Get Voice Sample
var api = new ElevenLabsClient();
var clipPath = await api.VoicesEndpoint.GetVoiceSampleAsync(voiceId, sampleId);
Console.WriteLine(clipPath);
Delete Voice Sample
var api = new ElevenLabsClient();
var success = await api.VoicesEndpoint.DeleteVoiceSampleAsync(voiceId, sampleId);
Console.WriteLine($"Was successful? {success}");

History

Access to your previously synthesized audio clips including its metadata.

Get History
var api = new ElevenLabsClient();
var historyItems = await api.HistoryEndpoint.GetHistoryAsync();

foreach (var historyItem in historyItems.OrderBy(historyItem => historyItem.Date))
{
    Console.WriteLine($"{historyItem.State} {historyItem.Date} | {historyItem.Id} | {historyItem.Text.Length} | {historyItem.Text}");
}
Get History Audio
var api = new ElevenLabsClient();
var clipPath = await api.HistoryEndpoint.GetHistoryAudioAsync(historyItem);
Console.WriteLine(clipPath);
Download All History
var api = new ElevenLabsClient();
var success = await api.HistoryEndpoint.DownloadHistoryItemsAsync();
Delete History Item
var api = new ElevenLabsClient();
var result = await api.HistoryEndpoint.DeleteHistoryItemAsync(historyItem);
Console.WriteLine($"Was successful? {success}");

User

Access to your user Information and subscription status.

Get User Info

Gets information about your user account with ElevenLabs.

var api = new ElevenLabsClient();
var userInfo = await api.UserEndpoint.GetUserInfoAsync();
Get Subscription Info

Gets information about your subscription with ElevenLabs.

var api = new ElevenLabsClient();
var subscriptionInfo = await api.UserEndpoint.GetSubscriptionInfoAsync();
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ElevenLabs-DotNet:

Package Downloads
FrostAura.Libraries.Intelligence.Semantic.Core

FrostAura Semantic Core provides structures and utilities to build language and hybrid applications.

ElevenLabs-DotNet-Proxy

A simple Proxy API gateway for ElevenLabs-DotNet to make authenticated requests from a front end application without exposing your API keys.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.1.0 3,019 9/14/2024
3.0.3 104 9/14/2024
3.0.2 364 9/3/2024
3.0.1 89 9/2/2024
3.0.0 190 9/2/2024
2.2.1 18,489 5/9/2024
2.2.0 186 5/6/2024
2.1.1 3,130 2/15/2024
2.1.0 2,222 11/29/2023
2.0.3 790 11/15/2023
2.0.2 161 11/14/2023
2.0.1 127 11/11/2023
2.0.0 256 10/29/2023
1.3.6 1,808 9/28/2023
1.3.5 1,388 7/14/2023
1.3.4 1,719 5/29/2023
1.3.3 558 5/21/2023
1.3.2 417 5/12/2023
1.3.0 207 5/1/2023
1.2.1 169 4/30/2023
1.2.0 164 4/30/2023
1.1.1 375 3/26/2023
1.1.0 203 3/26/2023
1.0.4 234 3/24/2023
1.0.3 235 3/13/2023
1.0.2 213 3/12/2023
1.0.1 221 3/11/2023
1.0.0 246 3/11/2023

Release 1.0.3
- Updated DownloadHistoryItemsAsync to download all items if no ids are specified
- Updated docs
Release 1.0.2
- Added VoiceGenerationEndpoint
- Added unit tests for voice design and instant voice cloning
- Updated docs
Release 1.0.1
- Updated docs
Release 1.0.0
- Initial Release!