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-speechSend 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
textstringRequiredThe text to speak, up to 50,000 characters. Long text is automatically split, generated in parallel and stitched into one continuous file.
voice_idstringRequiredA default voice from List voices, or a cloned voice from Clone a voice.
speednumberDefaults to 1Pace from
0.5 to 2.0. 1 is natural pace; lower is slower, higher is faster.modelstringDefaults to jsf_fiCloned voices only.
jsf_fi or jsf_bo. Default voices ignore this field.Models
| Voice | Model | Output |
|---|---|---|
Default voice (jsf_default_…) | Always default | WAV, mastered to -14 LUFS |
| Cloned voice | jsf_fi (default) | MP3, 44.1 kHz |
| Cloned voice | jsf_bo | WAV |
The response tells you which model and format were used.
Returns
200 OK
successbooleanAlways
true on success.dataobjectThe generated audio.
creditsobjectYour 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 }
}