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:
| Parameter | Type | Required | Description |
|---|---|---|---|
voice_id | string | Required | UUID of the voice to use. Get available IDs from GET /tts/voices. |
text | string | Required | The text to convert to speech. |
format | string | Required | Output audio format. Must be supported by the selected voice. One of mp3, wav, ogg, pcm, flac. |
stream | boolean | Optional | When 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:
| Field | Type | Description |
|---|---|---|
id | string (uuid) | UUID to use as voice_id in requests. |
description | string | Human-readable voice description. |
language | string | Supported language(s). |
gender | string | Voice gender (Male, Female, Neutral). |
formats | array | Supported output audio formats. |
sample_rates | array | Supported output sample rates in Hz. |
streaming | boolean | Whether 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
| Status | Cause | Resolution |
|---|---|---|
400 | Missing or invalid parameters | Check voice_id, text, and format fields. |
400 | Unsupported format for voice | Use a format listed in the voice's formats array. |
401 | Invalid or missing API key | Check your Authorization: Bearer header. |
429 | Rate limit exceeded | Wait and retry with exponential backoff. |
500 | Internal server error | Retry the request or contact support. |
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.