API reference

Turn text into speech.

Pocket TTS accepts JSON and returns a WAV file directly. These examples use https://pocket-tts.corbia.net as the server.

POST

/tts

Generate speech using one of the loaded voices.

JSON body

voice string · required

A voice name returned by GET /voices.

text string · required

The text to synthesize, from 1 to 4,000 characters.

speed number · optional

Speech speed from 0.50 to 1.50. Lower values are slower. Defaults to 0.85 when omitted.

Example request

curl https://pocket-tts.corbia.net/tts \
  -H "Content-Type: application/json" \
  -d '{"voice":"georgia","text":"Hello from Pocket TTS.","speed":0.85}' \
  --output speech.wav

Response

The response body is a audio/wav file. The response also includes X-Voice, X-Audio-Duration, X-Generation-Time, and X-Speech-Speed headers. Speed adjustment preserves the voice's pitch.

GET

/voices

Return the voice names currently loaded by the server.

Example request

curl https://pocket-tts.corbia.net/voices

Example response

{
  "voices": ["alistair", "anastasia", "audrey", "georgia"]
}
GET

/health

Check whether the model and voices are ready.

Example request

curl https://pocket-tts.corbia.net/health

Example response

{
  "status": "ready",
  "language": "english",
  "sample_rate": 24000,
  "voice_count": 19,
  "default_speech_speed": 0.85
}