Fish Audio Docs
API ReferenceText to Speech

OpenAI-Compatible TTS

Connect Tavo and other OpenAI-compatible speech clients to Fish Audio TTS.

OpenAI-Compatible TTS

Use this endpoint when a client expects the OpenAI POST /v1/audio/speech contract. It is intended for integrations such as Tavo's Custom OpenAI Protocol TTS provider.

For a native Fish Audio integration with the full request contract, use Sync HTTP.

Endpoint

POST /v1/audio/speech
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Full URL:

https://fishaudio.org/v1/audio/speech

Keep the API key on a trusted server or in the third-party provider's protected API credential field. Create a separate key for each customer or integration so it can be monitored and revoked independently.

Request

{
  "model": "fishaudio-s21pro-flash",
  "input": "Hello from Fish Audio.",
  "voice": "00a1b221-6137-4b73-ad62-b0cbce134167",
  "response_format": "mp3",
  "speed": 1
}
FieldTypeRequiredNotes
modelstringYesFish Audio engine model id, such as fishaudio-s21pro-flash
inputstringYesText to synthesize
voicestring or objectYesVoice id string, or an object such as { "id": "00a1b221-6137-4b73-ad62-b0cbce134167" }
response_formatstringNomp3, wav, or pcm; defaults to mp3
speednumberNoSpeaking speed from 0.5 to 2; defaults to 1

Get voice ids from GET /api/open/v1/voices. For a quick connection test, use the public system voice 00a1b221-6137-4b73-ad62-b0cbce134167. Use a supported Fish Audio TTS model id; OpenAI model names such as tts-1 are not aliases for Fish Audio models.

Some third-party clients discover voices through an OpenAI-compatible voice list. They can call:

GET /v1/audio/voices
Authorization: Bearer YOUR_API_KEY

Use a returned voices[].id value as the voice in a speech request.

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>

The client should save or play the response according to Content-Type. Errors are JSON responses and use the same authentication, quota, and generation behavior as the native sync endpoint.

curl Example

curl -X POST "https://fishaudio.org/v1/audio/speech" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "fishaudio-s21pro-flash",
    "input": "Hello from Fish Audio.",
    "voice": "00a1b221-6137-4b73-ad62-b0cbce134167",
    "response_format": "mp3",
    "speed": 1
  }' \
  --output speech.mp3

Connect Tavo

For API key, Base URL, model, voice, and character binding setup, follow the dedicated Fish Audio TTS for Tavo guide.

Errors

StatusMeaningAction
400Invalid input, voice, model, format, or speedCorrect 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