FastWhisper.Client 1.0.0

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

FastWhisper.Client

A clean, minimalistic .NET client library for the FastWhisper API.

Features

  • Simple and intuitive API
  • Async/await support
  • Full coverage of FastWhisper API endpoints:
    • Health check
    • Audio transcription
    • Audio translation to English
  • Configurable timestamp granularity (chunk or word level)
  • Language detection and specification
  • Modern .NET 9.0 with nullable reference types
  • Minimal dependencies

Installation

dotnet add package FastWhisper.Client

Quick Start

using FastWhisper.Client;
using FastWhisper.Client.Models;

// Create client
using var client = new FastWhisperClient("http://127.0.0.1:8000");

// Check health
var health = await client.GetHealthAsync();
Console.WriteLine($"Status: {health.Status}, Model Loaded: {health.ModelLoaded}");

// Transcribe audio
await using var audioStream = File.OpenRead("audio.mp3");
var transcription = await client.TranscribeAsync(
    audioStream,
    "audio.mp3",
    language: "en",
    timestamp: TimestampGranularity.Chunk
);

Console.WriteLine($"Text: {transcription.Text}");
foreach (var chunk in transcription.Chunks)
{
    Console.WriteLine($"[{chunk.Timestamp[0]:F2}s - {chunk.Timestamp[1]:F2}s]: {chunk.Text}");
}

API Reference

Health Check

var health = await client.GetHealthAsync();

Transcribe Audio

Transcribes audio to text in the original language.

var transcription = await client.TranscribeAsync(
    audioStream,
    fileName: "audio.mp3",
    language: "en",                            // Optional: null for auto-detect
    timestamp: TimestampGranularity.Chunk,     // Chunk or Word
    cancellationToken: cancellationToken
);

Translate Audio

Translates audio to English text.

var translation = await client.TranslateAsync(
    audioStream,
    fileName: "audio.mp3",
    timestamp: TimestampGranularity.Word,
    cancellationToken: cancellationToken
);

Timestamp Granularity

  • TimestampGranularity.Chunk (default): Segment-level timestamps (phrases/segments)
  • TimestampGranularity.Word: Word-level timestamps (finer granularity)

Language Codes

Supported language codes (ISO 639-1): en, fr, es, de, it, pt, nl, ja, zh, etc.

Pass null to the language parameter for automatic language detection.

HttpClient Management

Default Usage

using var client = new FastWhisperClient("http://127.0.0.1:8000");

Custom HttpClient

For dependency injection or custom configuration:

var httpClient = new HttpClient
{
    BaseAddress = new Uri("http://127.0.0.1:8000"),
    Timeout = TimeSpan.FromMinutes(5)
};

var client = new FastWhisperClient(httpClient, disposeHttpClient: false);

Error Handling

try
{
    var transcription = await client.TranscribeAsync(audioStream, "audio.mp3");
}
catch (HttpRequestException ex)
{
    Console.WriteLine($"API request failed: {ex.Message}");
}
catch (InvalidOperationException ex)
{
    Console.WriteLine($"Response parsing failed: {ex.Message}");
}

License

MIT License - see LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 was computed.  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.0 74 2/28/2026