Quickstart
Create an API key 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 Key
Create an API key in your Fish Audio account:
The full API key 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 FISHAUDIO_API_KEY="YOUR_API_KEY"2. Choose a Voice
List voices available to your account:
curl "https://fishaudio.org/api/open/v1/voices" \
-H "Authorization: Bearer $FISHAUDIO_API_KEY"Copy the returned voice id and use it as voiceId. To test the connection immediately, use the public system test voice 00a1b221-6137-4b73-ad62-b0cbce134167, then replace it with your preferred voice later.
3. Generate Speech
curl -X POST "https://fishaudio.org/api/open/v1/speech/tts" \
-H "Authorization: Bearer $FISHAUDIO_API_KEY" \
-H "Content-Type: application/json" \
-o speech.audio \
-d '{
"text": "Hello from Fish Audio.",
"voiceId": "00a1b221-6137-4b73-ad62-b0cbce134167"
}'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 |