Create a new agent in your browser using this model
Overview
Fish Audio text-to-speech is available in LiveKit Agents through LiveKit Inference and the Fish Audio plugin. With LiveKit Inference, your agent runs on LiveKit's infrastructure to minimize latency. No separate provider API key is required, and usage and rate limits are managed through LiveKit Cloud. Use the plugin instead if you want to manage your own billing and rate limits. Pricing for LiveKit Inference is available on the pricing page .
This plugin allows you to use Fish Audio as a TTS provider for your voice agents.
LiveKit Inference
Use LiveKit Inference to access Fish Audio TTS without a separate Fish Audio API key.
| Model name | Model ID | Languages |
|---|---|---|
S2 Pro | fishaudio/s2-pro | enzhjadefreskoarrunlitplpt |
S2.1 Pro | fishaudio/s2.1-pro | enzhjadefreskoarrunlitplpt |
S2.1 Pro Free | fishaudio/s2.1-pro-free | enzhjadefreskoarrunlitplpt |
Usage
To use Fish Audio, use the TTS class from the inference module:
from livekit.agents import AgentSession, inferencesession = AgentSession(tts=inference.TTS(model="fishaudio/s2.1-pro",voice="b347db033a6549378b48d00acb0d06cd",language="en",extra_kwargs={"speed": 1.5,"volume": 1.2,}),# ... tts, stt, vad, turn_handling, etc.)
import { AgentSession, inference } from '@livekit/agents';session = new AgentSession({tts: new inference.TTS({model: "fishaudio/s2.1-pro",voice: "b347db033a6549378b48d00acb0d06cd",language: "en",modelOptions: {speed: 1.5,volume: 1.2,}}),// ... tts, stt, vad, turnHandling, etc.});
Parameters
modelstringThe model ID from the models list.
voicestringSee voices for guidance on selecting a voice.
languageLanguageCodeLanguage code for the input text. If not set, the model default applies.
extra_kwargsdictAdditional parameters to pass to the Fish Audio TTS API. See model parameters for supported fields.
In Node.js this parameter is called modelOptions.
Model parameters
Pass the following parameters inside extra_kwargs (Python) or modelOptions (Node.js):
| Parameter | Type | Default | Notes |
|---|---|---|---|
latency | "low" | "normal" | "balanced" | "balanced" | Latency-quality trade-off. normal: best quality, balanced: reduced latency, low: lowest latency. |
temperature | float | 0.7 | Sampling temperature that controls the randomness of the model's output. Higher values make the output more random, while lower values make it more focused and deterministic. Range of valid values can vary by model. Valid values are between0.0 and 1.0. |
top_p | float | 0.7 | Nucleus sampling probability mass. Valid range: 0.0 to 1.0. |
speed | float | 1.0 | Speaking rate multiplier. Valid range: 0.5 to 2.0. 1.0 = normal speed, 0.5 = half speed, 2.0 = double speed. Useful for adjusting pacing without regenerating audio. |
volume | float | 0.0 | Volume adjustment in decibels (dB). 0 = no change, positive values = louder, negative values = quieter. |
normalize | boolean | True | Normalizes text for numbers, dates and currency. Only available on English and Chinese. |
chunk_length | int | 300 | Maximum number of characters per chunk for long text. Text longer than this will be split into multiple chunks and synthesized separately. |
Voices
LiveKit Inference supports all of the default "Fish Audio Voices" available in the Fish Audio API. You can explore the available voices in the Fish Audio voice library (free account required), and use the voice by copying its ID into your LiveKit agent session.
Pre-existing custom Fish Audio voices are not available through LiveKit Inference. To use these, create your own Fish Audio account and use the Fish Audio plugin. To create a new custom voice through LiveKit, see Custom voices.
The following is a small sample of the Fish Audio voices available in LiveKit Inference.
String descriptors
As a shortcut, you can also pass a descriptor with the model ID and voice directly to the tts argument in your AgentSession:
from livekit.agents import AgentSessionsession = AgentSession(tts="fishaudio/s2.1-pro:b347db033a6549378b48d00acb0d06cd",# ... llm, stt, vad, turn_handling, etc.)
import { AgentSession } from '@livekit/agents';session = new AgentSession({tts: "fishaudio/s2.1-pro:b347db033a6549378b48d00acb0d06cd",// ... llm, stt, vad, turnHandling, etc.});
Plugin
LiveKit's plugin support for Fish Audio lets you connect directly to Fish Audio's TTS API with your own API key.
Installation
Install the plugin from PyPI:
uv add "livekit-agents[fishaudio]~=1.6"
Authentication
The Fish Audio plugin requires an API key from Fish Audio .
Set FISH_API_KEY in your .env.local file.
Usage
Use Fish Audio TTS within an AgentSession or as a standalone speech generator. For example, you can use this TTS in the Voice AI quickstart.
from livekit.plugins import fishaudiosession = AgentSession(tts=fishaudio.TTS(model="s2.1-pro",voice_id="933563129e564b19a115bedd57b7406a",),# ... llm, stt, etc.)
Voices
Fish Audio identifies each voice by a reference ID. Browse the Fish Audio playground to find a voice, or create your own custom voice model, then copy its ID into the voice_id parameter.
Parameters
This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.
modelstringDefault: s2.1-proFish Audio TTS model to use. Set to s1, s2-pro, or s2.1-pro.
voice_idstringID of the voice (reference ID) to use. Defaults to a built-in voice. See Voices to find or create voice IDs.
output_formatstringDefault: wavAudio output format. Set to wav, pcm, mp3, or opus.
latency_modestringDefault: balancedTradeoff between synthesis latency and quality. Set to normal, balanced, or low.
speedfloatSpeaking rate multiplier from 0.5 to 2.0, where 1.0 is normal. Lower values slow speech down and higher values speed it up. When unset, the voice uses its natural pace.
volumefloatLoudness adjustment in decibels from -20 to 20, where 0 is the voice's natural level. Positive values make speech louder and negative values make it quieter. When unset, the level stays the same.
temperaturefloatDefault: 0.7Sampling temperature from 0 to 1. Higher values produce more varied, expressive speech and lower values are more stable and consistent.
top_pfloatDefault: 0.7Nucleus sampling probability mass from 0 to 1. Lower values keep the output to the most likely results and higher values allow more variety.
normalizebooleanDefault: TrueWhether to normalize written-form text such as numbers, dates, and abbreviations into spoken form before synthesis.
Additional resources
The following resources provide more information about using Fish Audio with LiveKit Agents.