Skip to content

FishAudio

.NET SDK for Fish Audio generation APIs with generated REST coverage and Microsoft.Extensions.AI tool adapters.

Nuget package dotnet License: MIT Discord

Generated API coverage

Built from the Fish Audio OpenAPI definition so the SDK stays aligned with the published API.

MEAI tools

Expose common operations as AIFunction tools for use with any compatible IChatClient.

Modern .NET

Generated with AutoSDK and shaped for trimming, NativeAOT awareness, nullability, and current .NET conventions.

Usage

Installation

1
dotnet add package FishAudio

Client

1
2
3
using FishAudio;

using var client = new FishAudioClient(apiKey);

CLI

1
2
dotnet tool install --global FishAudio.CLI --prerelease
fish-audio api --help

MEAI Tools

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
using FishAudio;
using Microsoft.Extensions.AI;

var fishAudio = new FishAudioClient(apiKey);
var tools = new[]
{
    fishAudio.AsTextToSpeechTool(referenceId: "your-voice-model-id"),
    fishAudio.AsListModelsTool(),
    fishAudio.AsGetModelTool(),
};
Guides first. See the authentication and MEAI guides in the docs nav for provider-specific setup before running examples.

Latest Text to Speech

Select a voice model and synthesize audio with Fish Audio S2.1 Pro.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
using var client = new FishAudioClient(apiKey);

var models = await client.Model.GetModelAsync(pageSize: 1);
var voice = models.Items.FirstOrDefault();
if (voice is null)
{
    throw new AssertInconclusiveException("No Fish Audio voice model is available to this account.");
}

ITextToSpeechClient speech = client;
var response = await speech.GetAudioAsync(
    "Hello from the latest Fish Audio speech model.",
    new TextToSpeechOptions
    {
        ModelId = FishAudioModels.S21ProFree,
        VoiceId = voice.Id,
        AudioFormat = "mp3",
    });

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

Bugs

Open an issue in tryAGI/FishAudio.

Ideas and questions

Use GitHub Discussions for feedback and design discussion.

Community

Join the tryAGI Discord for broader SDK discussion.

Acknowledgments

JetBrains logo

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