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

Session Initialization

Initialize a Session with your API key to start using the Fish Audio SDK:
from fish_audio_sdk import Session

# Initialize with your API key
session = Session("your_api_key")

Using Environment Variables

For better security, store your API key in environment variables:
  • Using os
  • Using dotenv
import os
from fish_audio_sdk import Session

session = Session(os.getenv("FISH_API_KEY"))
Set the environment variable in your shell:
export FISH_API_KEY=your_api_key_here

Custom Endpoints

If you need to use a proxy or custom endpoint:
session = Session(
    apikey="your_api_key",
    base_url="https://your-proxy-domain.com"
)
I