Quickstart
Create an API token and generate your first speech audio.
Quickstart
This page helps you complete a real text-to-speech request quickly. Start with synchronous TTS because it returns audio directly and is the easiest path to test.
1. Create an API Token
Create an API token in your FishSpeech account:
The full token is shown only once. Store it in a server-side environment variable. Do not ship it in browser code, mobile apps, or public repositories.
export FISHSPEECH_API_TOKEN="YOUR_API_TOKEN"2. Choose a Voice
List voices available to your account:
curl "https://fishaudio.org/api/open/v1/voices" \
-H "Authorization: Bearer $FISHSPEECH_API_TOKEN"Copy the returned voice id and use it as voiceId.
3. Generate Speech
curl -X POST "https://fishaudio.org/api/open/v1/speech/tts" \
-H "Authorization: Bearer $FISHSPEECH_API_TOKEN" \
-H "Content-Type: application/json" \
-o speech.audio \
-d '{
"text": "Hello from FishSpeech.",
"voiceId": "YOUR_VOICE_ID",
"format": "mp3"
}'If the request succeeds, speech.audio is saved in your current directory. Use the response Content-Type header to choose the final file extension.
Next Steps
| Need | Read |
|---|---|
| Choose sync, async, or batch-like flows | Choose an API |
| Read endpoint contracts | API Reference |
| Understand authentication | Authentication |
| Generate speech | Text to Speech |
| Test requests in the browser | API Playground |