Skip to main content

TTS API Reference

The Shisa TTS API exposes two endpoints: one to generate speech and one to list available voices. Both authenticate with a standard bearer token.

Authorization: Bearer YOUR_API_KEY

Endpoints

Generate speech

POST https://api.shisa.ai/tts

Converts text to speech audio. Returns binary audio data in the requested format.

List voices

GET https://api.shisa.ai/tts/voices

Returns a JSON array of all available voices with their metadata, supported formats, and streaming capabilities. See Voices for the catalogue.

Request parameters

Parameters for the POST /tts endpoint, sent as a JSON body:

ParameterTypeRequiredDescription
voice_idstringRequiredUUID of the voice to use. Get available IDs from GET /tts/voices.
textstringRequiredThe text to convert to speech.
formatstringRequiredOutput audio format. Must be supported by the selected voice. One of mp3, wav, ogg, pcm, flac.
streambooleanOptionalWhen true, returns audio as a chunked stream for real-time playback. Only available for voices with streaming: true. Default false.

Response

POST /tts — binary audio

On success, the API returns raw binary audio data with the appropriate Content-Type header (for example audio/mp3). Save the response body directly to a file:

# The response is binary audio data — save directly to file
curl -s -X POST "https://api.shisa.ai/tts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"voice_id": "61ba1141-60aa-4bc3-a3b3-be1ec20700b3", "format": "mp3", "text": "テスト"}' \
--output speech.mp3

GET /tts/voices — JSON

Returns a JSON array of available voice objects:

[
{
"id": "e3362c0a-7677-4cd8-b122-91fb093305c9",
"description": "Young male Japanese voice...",
"language": "Japanese & English",
"gender": "Male",
"formats": ["mp3", "ogg", "pcm"],
"sample_rates": [8000, 16000, 22050, 24000, 32000, 44100, 48000],
"streaming": true
}
]

Voice object fields:

FieldTypeDescription
idstring (uuid)UUID to use as voice_id in requests.
descriptionstringHuman-readable voice description.
languagestringSupported language(s).
genderstringVoice gender (Male, Female, Neutral).
formatsarraySupported output audio formats.
sample_ratesarraySupported output sample rates in Hz.
streamingbooleanWhether the voice supports real-time streaming.

Error handling

Errors are returned as JSON in the following format:

{
"context": ["..."],
"code": 104,
"name": "ErrAuthenticationFailed",
"error": "Authentication error: Invalid token"
}

Error codes

StatusCauseResolution
400Missing or invalid parametersCheck voice_id, text, and format fields.
400Unsupported format for voiceUse a format listed in the voice's formats array.
401Invalid or missing API keyCheck your Authorization: Bearer header.
429Rate limit exceededWait and retry with exponential backoff.
500Internal server errorRetry the request or contact support.
warning

A 400 is also returned when the requested format is not in the selected voice's formats array. Confirm a voice's supported formats with GET /tts/voices before generating speech.

Next steps

  • Walk through your first request in the Quickstart.
  • Browse available voices in the Voices catalogue.
  • See how usage is billed in Pricing.