Lyo.Typecast.Client 2.0.0

dotnet add package Lyo.Typecast.Client --version 2.0.0
                    
NuGet\Install-Package Lyo.Typecast.Client -Version 2.0.0
                    
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="Lyo.Typecast.Client" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Typecast.Client" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.Typecast.Client" />
                    
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 Lyo.Typecast.Client --version 2.0.0
                    
#r "nuget: Lyo.Typecast.Client, 2.0.0"
                    
#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 Lyo.Typecast.Client@2.0.0
                    
#: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=Lyo.Typecast.Client&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Typecast.Client&version=2.0.0
                    
Install as a Cake Tool

Lyo.Typecast.Client

HTTP client for Typecast text-to-speech and voice catalog work. TypecastClient subclasses Lyo.Api.Client.ApiClient, sets the X-API-KEY header from TypecastClientOptions, and surfaces two managers (TextToSpeech, Voices) over the REST endpoints.

Multi-targets netstandard2.0 and net10.0.

Examples

Add the client

// 1. Configuration-bound (defaults to the "TypecastClient" section)
services.AddTypecastClientFromConfiguration(builder.Configuration);

// 2. Inline configuration
services.AddTypecastClient(o => {
    o.ApiKey = "your-api-key";
    o.BaseUrl = "https://api.typecast.ai";
});

// 3. Pre-built options object
services.AddTypecastClient(new TypecastClientOptions { ApiKey = "your-api-key" });

Add the client (2)

{
  "TypecastClient": {
    "ApiKey": "your-api-key",
    "BaseUrl": "https://api.typecast.ai"
  }
}

TypecastClient

public readonly TextToSpeechManager TextToSpeech;
public readonly VoiceManager Voices;

Service registration

IServiceCollection has three DI extensions: every overload registers TypecastClient as a singleton. When the container has ILoggerFactory or HttpClient, those are used; otherwise the client falls back to sensible defaults. Example appsettings.json:

TypecastClientOptions

Subclass of ApiClientOptions, so the usual HTTP transport knobs come along (BaseUrl, timeouts, retry, etc.).

Property Notes
ApiKey Required. Transmitted as X-API-KEY.
BaseUrl Falls back to https://api.typecast.ai.
SectionName "TypecastClient". Default section for AddTypecastClientFromConfiguration.

Serialization uses snake_case names, case-insensitive reads, and WhenWritingNull ignore so it matches Typecast's API.

TypecastClient TextToSpeechManager

Method Endpoint Returns
SynthesizeAsync(TypecastTtsRequest request, ct = default) POST /v1/text-to-speech byte[] (audio as WAV or MP3).

TypecastClient VoiceManager

Method Endpoint Returns
ListVoicesAsync(VoiceListReq? request = null, ct = default) GET /v2/voices List<Voice> (empty list if none).
GetVoiceAsync(string voiceId, ct = default) GET /v2/voices/{voiceId} Voice?

Request types

  • TypecastTtsRequest. Subclasses Lyo.Tts.Models.TtsRequest. Fields: VoiceId, Text, Model (defaults to TypecastModel.SsfmV30), Language (LanguageCodeInfo, serialized as ISO 639-3), Prompt, Output, Seed, computed AudioFormat.
  • Prompt. emotion / style knobs (including the "smart" mode with optional previous_text / next_text context).
  • OutputSettings. volume / pitch / tempo / audio format.
  • VoiceListReq. optional Model, Gender, Age, UseCases filters.
  • Enums under Enums/. Gender, AgeGroup, TypecastModel.
  • Response models under Models/Voices/Response/. Voice, VoiceModel.

TypecastTtsRequestBuilder

Fluent helper that assembles a valid TTS request. Build() checks VoiceId and Text.

var request = TypecastTtsRequestBuilder
    .Create("tc_60e5426de8b95f1d3000d7b5", "Hello, world!")
    .WithModel("ssfm-v30")
    .WithLanguage("eng") // accepts ISO 639-3 or ISO 639-1
    .WithSmartPrompt(previousText: "Welcome.", nextText: "How are you?")
    .WithOutput(o => {
        o.AudioFormat = "mp3";
    })
    .WithSeed(42)
    .Build();

var audio = await client.TextToSpeech.SynthesizeAsync(request, ct);
Method Sets
New() / Create(voiceId, text) Static factories.
WithVoiceId(string) / WithText(string) Mandatory fields.
WithModel(string) e.g. "ssfm-v30", "ssfm-v21".
WithLanguage(string) Tries ISO 639-3 before ISO 639-1; leaves language unset when the code is unknown.
WithPrompt(Prompt) / WithPrompt(Action<Prompt>) Assign or configure in place.
WithSmartPrompt(previousText?, nextText?) Shortcut for "smart" emotion mode.
WithOutput(OutputSettings) / WithOutput(Action<OutputSettings>) Assign or configure in place.
WithSeed(int) Fixed-seed generation.
Build() Checks required fields, then returns the TypecastTtsRequest.

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Common.Metadata (direct, lyo)
  • Lyo.Http.Client (direct, lyo)
  • Lyo.Metrics (direct, lyo)
  • Lyo.Tts.Models (direct, lyo)
  • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.5 (direct, microsoft)
  • Microsoft.Extensions.Http 10.0.5 (direct, microsoft)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 (direct, microsoft)
  • Lyo.Common.Core (transitive, lyo)
  • Lyo.Common.Json (transitive, lyo)
  • Lyo.Configuration (transitive, lyo)
  • Lyo.Exceptions (transitive, lyo)
  • Lyo.Result (transitive, lyo)
  • AngleSharp 1.5.0 (transitive, third-party)
  • Microsoft.Bcl.AsyncInterfaces 10.0.5 (transitive, microsoft, netstandard2.0)
  • Microsoft.Extensions.Configuration.Binder 10.0.5 (transitive, microsoft)
  • System.Memory 4.6.3 (transitive, microsoft, netstandard2.0)
  • System.Text.Json 10.0.5 (transitive, microsoft, netstandard2.0)
  • System.Threading.RateLimiting 10.0.5 (transitive, microsoft)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Lyo.Typecast.Client:

Package Downloads
Lyo.Tts.Typecast

Typecast Text-to-Speech service implementation for converting text to speech using Typecast API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 85 9/9/2026
1.0.13 155 8/25/2026
1.0.11 139 8/23/2026
1.0.9 151 8/22/2026
1.0.6 141 8/20/2026
1.0.4 167 8/20/2026
1.0.3 144 8/19/2026
1.0.2 148 8/19/2026
1.0.1 142 8/18/2026
1.0.0 137 8/16/2026