OpenAI-Compatible TTS
Connect Tavo and other OpenAI-compatible speech clients to Kitta 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 Kitta Audio integration with the full request contract, use Sync HTTP.
Endpoint
POST /v1/audio/speech
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonFull URL:
https://fishaudio.org/v1/audio/speechKeep 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 Kitta Audio.",
"voice": "00a1b221-6137-4b73-ad62-b0cbce134167",
"response_format": "mp3",
"speed": 1
}| Field | Type | Required | Notes |
|---|---|---|---|
model | string | Yes | Kitta Audio engine model id, such as fishaudio-s21pro-flash |
input | string | Yes | Text to synthesize |
voice | string or object | Yes | Voice id string, or an object such as { "id": "00a1b221-6137-4b73-ad62-b0cbce134167" } |
response_format | string | No | mp3, wav, or pcm; defaults to mp3 |
speed | number | No | Speaking 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 Kitta Audio TTS model id; OpenAI model names such as tts-1 are not aliases for Kitta 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_KEYUse 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 Kitta Audio.",
"voice": "00a1b221-6137-4b73-ad62-b0cbce134167",
"response_format": "mp3",
"speed": 1
}' \
--output speech.mp3Connect Tavo
For API key, Base URL, model, voice, and character binding setup, follow the dedicated Kitta Audio TTS for Tavo guide.
Errors
| Status | Meaning | Action |
|---|---|---|
400 | Invalid input, voice, model, format, or speed | Correct the request before retrying |
401 | API key is missing or invalid | Check or replace the integration key |
402 | API quota is insufficient | Add quota before generating more audio |
429 | Request rate limit exceeded | Retry with exponential backoff |
500 | TTS generation failed | Retry only with duplicate-charge awareness |