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

Get free API credits by verifying your phone number.

Your First TTS Request

Choose your preferred method to generate speech:
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: