Fish Audio Docs
API ReferenzText-to-SpeechText-to-Speech (synchron)

Synchrones Text-to-Speech v2

HTTP-v2-Kompatibilitätsvertrag für bestehende Clients.

V2 bleibt nur für bestehende Clients. Neue Integrationen verwenden v3.

Endpoint

POST /api/open/v2/speech/tts

Vollständige URL:

https://fishaudio.org/api/open/v2/speech/tts

Authentifizierung und Request-Header

Authorization: Bearer FISHAUDIO_API_KEY
Content-Type: application/json
X-Request-Id: YOUR_STABLE_REQUEST_ID

Anfragefelder

fieldtyperequiredconstraints
textstringyes1–10,000
voiceIdstringyesmust support modelId
modelIdstringnopublic model ID
formatstringnomp3, wav, ogg; default mp3
speednumberno0.5–2; default 1
volumenumberno-20–20; default 0
pitchnumberno-12–12
stabilitynumberno0.5–1.5
similaritynumberno0.5–1.5
languagestringno1–64 characters in v3
emotionstringno1–64 characters in v3
instructionstringnoup to 1,600 characters
textNormalizationbooleannostructured-text normalization

V2 also accepts legacy engineModelId, version, qwenModel, and minimaxEmotion fields. Do not use them in new clients.

curl

curl "https://fishaudio.org/api/open/v2/speech/tts" \
  -H "Authorization: Bearer $FISHAUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Request-Id: legacy-tts-001" \
  -d '{"text":"Hello","voiceId":"00a1b221-6137-4b73-ad62-b0cbce134167","modelId":"fishaudio-s21pro-flash","format":"mp3"}' --output speech.mp3

Erfolgreiche Antwort

Erfolg liefert Audio-Bytes. Erst HTTP-Status und dann Content-Type auswerten; Fehler sind JSON.

Fehler und Wiederholungen

400 ungültige Anfrage; 401 ungültiger Schlüssel; 402 unzureichendes Kontingent; 404 Ressource fehlt; 409 Idempotenzkonflikt; 413 Anfrage zu groß; 429 Limit; 500 Generierungsfehler.

Migration

Bestehende v1/v2-Clients bleiben kompatibel. Neue Integrationen verwenden v3. Migration guide.