Skip to main content

Prerequisites

Sign up for a free Fish Audio account to get started with our API.
  1. Go to fish.audio/auth/signup
  2. Fill in your details to create an account, complete steps to verify your account.
  3. Log in to your account and navigate to the API section
Once you have an account, you’ll need an API key to authenticate your requests.
  1. Log in to your Fish Audio Dashboard
  2. Navigate to the API Keys section
  3. Click “Create New Key” and give it a descriptive name, set a expiration if desired
  4. Copy your key and store it securely
Keep your API key secret! Never commit it to version control or share it publicly.

Basic Usage

Generate speech from text:

Using Voice Models

Specify a voice model for consistent voice generation:

Getting Model IDs

The reference_id is the model ID from the URL when viewing a model on Fish Audio:
  • Model URL: https://fish.audio/m/802e3bc2b27e49c2995d23ef70e6ac89
  • Reference ID: 802e3bc2b27e49c2995d23ef70e6ac89
You can also get model IDs programmatically:

Emotions

Add emotional expressions to your text:
Common emotions: (happy), (sad), (angry), (excited), (calm), (surprised), (whispering), (shouting), (laughing), (sighing) For more advanced control over speech generation, including phoneme-level control and additional paralanguage features, see Fine-grained Control.

Audio Formats

Choose output format based on your needs:

Prosody Control

Adjust speech speed and volume:

Advanced Parameters

Fine-tune generation:

Choosing Backend

Our state-of-the-art S1 model is the default backend model for TTS. Optionally specify the model via the second argument (backend: Backends).

Streaming

For real-time streaming, see the WebSocket guide.

Error Handling

Handle common errors:

Request Parameters

Next Steps