Skip to main content
This documentation is for the legacy Python SDK. Please use the new Python SDK instead. See the migration guide for help upgrading.

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

Transcribe audio to text:

Language Specification

Pass a language hint when you know the source language:
Common language codes: en (English), zh (Chinese), es (Spanish), fr (French), de (German), ja (Japanese), ko (Korean), pt (Portuguese)
The language is detected automatically whether or not you send a hint, and a hint does not force the transcript into that language.

Working with Segments

Get detailed timing for each segment:

Timestamps Control

Control timestamp generation:
Always set ignore_timestamps. The legacy SDK sends None when you leave it out, and the API rejects that with a 400 error. ignore_timestamps=False includes segment timestamps. Set it to True to skip timestamp processing for faster transcription when you only need the text.

Audio Formats

Supported audio formats:
  • MP3 (recommended)
  • WAV
  • M4A
  • OGG
  • FLAC
  • AAC
File requirements:
  • Size and duration limits depend on the model; see Speech to Text limits
  • Sample rate: 16kHz or higher recommended

Transcribing TTS Output

Transcribe generated speech:

Error Handling

Handle common errors:

Response Structure

The ASR response includes: Segment structure:

Request Parameters