Prerequisites
Create a Fish Audio account
Create a Fish Audio account
Sign up for a free Fish Audio account to get started with our API.
- Go to fish.audio/auth/signup
- Fill in your details to create an account, complete steps to verify your account.
- Log in to your account and navigate to the API section
Get your API key
Get your API key
Once you have an account, you’ll need an API key to authenticate your requests.
- Log in to your Fish Audio Dashboard
- Navigate to the API Keys section
- Click “Create New Key” and give it a descriptive name, set a expiration if desired
- 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.
Basic Usage
Generate speech from text:Using Voice Models
Specify a voice model for consistent voice generation:Getting Model IDs
Thereference_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
Emotions
Add emotional expressions to your text:(happy)
, (sad)
, (angry)
, (excited)
, (calm)
, (surprised)
, (whispering)
, (shouting)
, (laughing)
, (sighing)
Audio Formats
Choose output format based on your needs:Prosody Control
Adjust speech speed and volume:Advanced Parameters
Fine-tune generation:Streaming
Process audio in real-time:Error Handling
Handle common errors:Request Parameters
Parameter | Type | Description | Default |
---|---|---|---|
text | str | Text to convert | Required |
reference_id | str | Voice model ID | None |
references | list | Reference audio | [] |
format | str | Audio format | ”mp3” |
chunk_length | int | Chunk size (100-300) | 200 |
normalize | bool | Normalize text | True |
latency | str | Speed vs quality | ”balanced” |
prosody | Prosody | Speed/volume | None |
temperature | float | Randomness | 0.7 |
top_p | float | Token selection | 0.7 |
Next Steps
- Voice cloning for custom voices
- WebSocket streaming for real-time apps
- Best practices for production use
- API reference for direct API calls