Skip to main content

Overview

This guide will walk you through generating your first text-to-speech audio with Fish Audio. By the end, you’ll have converted text into natural-sounding speech using our API.

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.
Get free API credits by verifying your phone number.

Your First TTS Request

Choose your preferred method to generate speech:
  • cURL
  • Python
1

Set your API key

Store your API key as an environment variable (recommended approach):
export FISH_API_KEY="replace_me"
2

Make the TTS request

Run this cURL command to generate your first speech:
curl -X POST https://api.fish.audio/v1/tts \
  -H "Authorization: Bearer $FISH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "model: s1" \
  -d '{
    "text": "Hello! Welcome to Fish Audio. \
This is my first AI-generated voice.",
    "format": "mp3"
  }' \
  --output welcome.mp3
3

Play your audio

The audio has been saved as welcome.mp3. You can play it by:
  • Double-clicking the file or opening it in any media player
  • Or using the command line:
# On macOS
afplay welcome.mp3

# On Linux
mpg123 welcome.mp3

# On Windows
start welcome.mp3

Support

Need help? Check out these resources:
I