Skip to content
API ReferenceEndpoints

Text to speech

Turn text into speech in a cloned voice. The response is a hosted, loudness-normalized WAV file.

POST/api/v1/text-to-speech

Send the request as application/json. You're billed one character per character of text.

You can speak with any default voice (jsf_default_…) or any voice you cloned (jsf_…). See Voice IDs.

Body · application/json
textstringRequired
The text to speak, up to 50,000 characters. Long text is automatically split, generated in parallel and stitched into one continuous file.
voice_idstringRequired
A default voice from List voices, or a cloned voice from Clone a voice.
speednumberDefaults to 1
Pace from 0.5 to 2.0. 1 is natural pace; lower is slower, higher is faster.
modelstringDefaults to jsf_fi
Cloned voices only. jsf_fi or jsf_bo. Default voices ignore this field.

Models

VoiceModelOutput
Default voice (jsf_default_…)Always defaultWAV, mastered to -14 LUFS
Cloned voicejsf_fi (default)MP3, 44.1 kHz
Cloned voicejsf_boWAV

The response tells you which model and format were used.

Returns

200 OK
successboolean
Always true on success.
dataobject
The generated audio.
creditsobject
Your balance after the request.

A voice_id that doesn't exist, or a cloned voice that belongs to another account, returns 404 VOICE_NOT_FOUND. You're never charged for a failed request.

Request
curl -X POST https://www.jsflabs.io/api/v1/text-to-speech \
  -H "x-api-key: jsf_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "The quick brown fox jumps over the lazy dog.",
    "voice_id": "jsf_default_henry",
    "speed": 1
  }'
Response200 OK
Response
{
  "success": true,
  "message": "Your audio has been generated successfully.",
  "data": {
    "audio_url": "https://cdn.jsflabs.uk/voice-samples/a9b93832.wav",
    "voice_id": "jsf_default_henry",
    "model": "default",
    "format": "wav",
    "characters": 44,
    "speed": 1
  },
  "credits": { "cost": 44, "used": 44, "remaining": 49956, "total": 50000 }
}