> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fish Audio

> Use the Fish Audio text-to-speech plugin in a Zero Runtime pipeline. Setup and usage in Python.

Fish Audio is a **text-to-speech** plugin. It streams Fish Audio S2 voices: expressive speech in 80+ languages with \[bracket] emotion cues and cloned voices.

## Setup

Set your Fish Audio API key in the worker environment. Generate a key from the [Fish Audio site](https://fish.audio/):

```bash theme={null}
export FISH_API_KEY=<key>
```

## Usage

Import the plugin and pass it to the pipeline's `tts` slot.

```python Python theme={null}
from zeroruntime.plugins import FishAudioTTS

tts = FishAudioTTS()

# Pipeline(tts=tts, ...)
```

> [!NOTE]
>
> `FishAudioTTS` ships in the Python SDK only. The Node JS SDK does not include this plugin yet.

> [!NOTE]
>
> `FishAudioTTS` requires a `zeroruntime` release newer than 0.1.9.

## Parameters

*Constructor parameters for `FishAudioTTS`.*

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str` | `None` | Fish Audio API key. Falls back to the `FISH_API_KEY` environment variable when unset. |
| `model` | `str` | `"s2.1-pro"` | TTS model: "s2.1-pro", "s2.1-pro-free" (same model, no latency guarantees), "s2-pro" or "drama-3". "s1" is deprecated. |
| `reference_id` | `str` | `"933563129e564b19a115bedd57b7406a"` | Fish Audio voice model ID, from the voice library or your own clones. |
| `latency` | `Literal['low', 'balanced', 'normal']` | `"low"` | Latency against stability: "low" for the lowest latency, "balanced" for slightly steadier output, "normal" for the most stable output at about a second more to first audio. |
| `temperature` | `float \| None` | `None` | Expressiveness from 0 to 1. Higher is more varied, lower is more consistent. Leave unset for Fish Audio's default. |
| `top_p` | `float \| None` | `None` | Nucleus-sampling diversity from 0 to 1. Leave unset for Fish Audio's default. |
| `prosody` | `dict \| None` | `None` | Delivery controls such as `{"speed": 1.1, "volume": 0, "normalize_loudness": true}`. Speed 0.5 to 2.0, volume in dB from -20 to 20; only the keys you set are sent. |
| `normalize` | `bool \| None` | `None` | Spell out numbers, dates and units as words before synthesis. Leave unset for Fish Audio's default (on). |
| `chunk_length` | `int \| None` | `None` | Text segment size from 100 to 300 characters. Leave unset for Fish Audio's default. |
| `language` | `str \| None` | `None` | Language tag of the text, e.g. "en" or "es-MX", used only to spell out numbers and dates. Leave unset to detect it. |
| `base_url` | `str` | `"wss://api.fish.audio/v1/tts/live"` | WebSocket endpoint of Fish Audio streaming text-to-speech. Change only for a proxy. |

## Import paths

| SDK | Import | Constructor |
| - | - | - |
| Python | `from zeroruntime.plugins import FishAudioTTS` | `FishAudioTTS()` |

Synthesized audio is streamed back to the caller after the [LLM](https://docs.zeroruntime.ai/runtime-sdk/plugins/overview.md) produces a response.

## Inference

This provider also runs through the [Inference Gateway](https://docs.zeroruntime.ai/runtime-sdk/plugins/inference/zero-runtime.md) on your Zero Runtime auth token, with no Fish Audio API key. Import `FishAudioTTS` from `zeroruntime.inference` instead of `zeroruntime.plugins`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.