Fish Audio Docs
API ReferenceText to Speech

Fish Audio Compatible TTS

Use the fish.audio-style POST /v1/tts contract with Fish Audio API keys for clients such as RikkaHub.

Fish Audio Compatible TTS

Use this endpoint when a client hard-codes the fish.audio POST /v1/tts request shape. It maps that payload into the Fish Audio Open TTS pipeline while keeping API key auth, quota, and billing on your Fish Audio account.

For a native Open API integration, prefer Sync HTTP. For OpenAI POST /v1/audio/speech clients, use OpenAI-Compatible TTS.

Endpoint

POST /v1/tts
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
model: s2.1-pro

Full URL:

https://fishaudio.org/v1/tts

If the third-party app asks for a Fish Audio API base such as https://api.fish.audio, set it to https://fishaudio.org and leave the path as /v1/tts.

Keep the API key in the client's protected credential field. Create a dedicated key for each app so you can monitor or revoke it independently.

Request

{
  "text": "Hello from Fish Audio.",
  "reference_id": "00a1b221-6137-4b73-ad62-b0cbce134167",
  "format": "mp3",
  "temperature": 0.7,
  "top_p": 0.7,
  "normalize": true,
  "prosody": {
    "speed": 1
  }
}
Field / headerTypeRequiredNotes
model headerstringNofish.audio engine label such as s2.1-pro, s2.1-pro-flash, or s2-pro
textstringYesText to synthesize
reference_idstringYesFish Audio Voice ID; the server does not silently pick a default voice
formatstringNomp3, wav, or pcm; unsupported values such as opus fall back to mp3
prosody.speednumberNoSpeaking speed from 0.5 to 2; speed at the top level is also accepted
temperaturenumberNoMapped to Fish Audio stability (0.51.5)
top_pnumberNoMapped to Fish Audio similarity (0.51.5)
normalizebooleanNoMapped to text normalization
chunk_lengthnumberNoAccepted for client compatibility and ignored
latencystringNoAccepted for client compatibility and ignored

Model header mapping

model header valueFish Audio engine model id
s2.1-profishaudio-s21pro
s2.1-pro-freefishaudio-s21pro-free
s2.1-flashfishaudio-s21-flash
s2.1-pro-flashfishaudio-s21pro-flash
s2-profishaudio-s2pro
s1 / s1-minifishaudio-s1
speech-1.5 / 1.6fishaudio-s1

Unknown header values are ignored and the server default engine applies. You can also send a native engine id such as fishaudio-s21pro-flash in the header.

Get Voice IDs from GET /api/open/v1/voices. For a quick connection test, use the public system voice 00a1b221-6137-4b73-ad62-b0cbce134167.

Response

A successful request returns binary audio:

HTTP/1.1 200 OK
Content-Type: audio/mpeg
X-OpenAPI-Quota-Remaining: 987988
X-OpenAPI-Credits-Used: 12

<binary audio data>

Errors are JSON and share authentication, quota, and generation behavior with Sync HTTP.

curl Example

curl -X POST "https://fishaudio.org/v1/tts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "model: s2.1-pro" \
  -d '{
    "text": "Hello from Fish Audio.",
    "reference_id": "00a1b221-6137-4b73-ad62-b0cbce134167",
    "format": "mp3",
    "prosody": { "speed": 1 }
  }' \
  --output speech.mp3

Connect RikkaHub

For API key, Base URL, model, and voice setup in RikkaHub, follow the dedicated RikkaHub setup guide.

Errors

StatusMeaningAction
400Invalid text, missing reference_id, or bad JSONCorrect the request before retrying
401API key is missing or invalidCheck or replace the integration key
402API quota is insufficientAdd quota before generating more audio
429Request rate limit exceededRetry with exponential backoff
500TTS generation failedRetry only with duplicate-charge awareness