> ## 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 speech-to-text plugin in a Zero Runtime pipeline. Setup and usage in Python.

Fish Audio is a **speech-to-text** plugin. It runs realtime transcription with server-side turn detection that tells the user apart from noise and backchannels.

## 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 `stt` slot.

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

stt = FishAudioSTT()

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

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

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

## Parameters

*Constructor parameters for `FishAudioSTT`.*

| 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` | `"transcribe-stream-1"` | Realtime transcription model. "transcribe-stream-1" (Preview) is the only one. |
| `turn_detection` | `Literal['auto', 'vad', 'manual']` | `"auto"` | How a turn ends: "auto" lets Fish Audio judge when the user has finished, "vad" ends it on fixed silence, "manual" only on flush. |
| `silence_timeout_ms` | `int \| None` | `None` | Silence that ends a turn, in milliseconds. Leave unset for the mode's default: 5000 in auto (a safety net), 700 in vad, 60000 in manual. |
| `terms` | `list[str] \| None` | `None` | Up to 100 names, products and jargon terms (32 characters each) to recognize, e.g. \["Fish Audio"]. |
| `enable_preemptive_generation` | `bool` | `False` | Start the reply on Fish Audio's eager end-of-turn signal, about half a second before the turn is committed. Auto mode only; set False to wait for the committed transcript. |
| `input_sample_rate` | `int \| None` | `None` | Override the detected input sample rate. Leave unset in normal use. |
| `input_channels` | `int \| None` | `None` | Override the detected input channel count. Leave unset in normal use. |
| `base_url` | `str` | `"wss://api.fish.audio/v1/asr/realtime"` | WebSocket endpoint of Fish Audio realtime speech-to-text. Change only for a proxy. |
| `interim_results` | `bool` | `False` | Set to True to also send live partial transcripts to the client. |

## Import paths

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

Transcribed text passes to the [LLM](https://docs.zeroruntime.ai/runtime-sdk/plugins/overview.md) once [turn detection](https://docs.zeroruntime.ai/runtime-sdk/plugins/turn-detection.md) decides the caller has finished speaking.

## 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 `FishAudioSTT` from `zeroruntime.inference` instead of `zeroruntime.plugins`.


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