Skip to content
Console

API reference

Text to speech

Copy page

Speech generation.

When and why to call these: the text to speech guide.

POST /v1/tts

Synthesize speech from text with the chosen model and voice. Returns complete audio as WAV, or a chunked stream when stream: true (pcm only).

curl
curl -X POST "https://api.lumavox.ai/v1/tts" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"..."}'

Request body (application/json)

FieldTypeRequiredDescription
voice_idstringAn id from GET /v1/voices — the built-in voice, a platform voice, or one your organisation uploaded. Default "default".
modelstringWhich model speaks: one of the voice’s models in GET /v1/voices — eleven_flash_v2_5 (the fastest, and the default), eleven_multilingual_v2 or eleven_v3. A model the voice does not list is refused. Default "eleven_flash_v2_5".
provider_optionsProviderVoiceSettings or nullThe provider’s voice settings, on top of the ones the voice was registered with. Unset takes theirs.
provider_options.stabilitynumber or nullLow is more expressive and less consistent between generations; high is flatter and more repeatable. 0–1.
provider_options.similarity_boostnumber or nullHow closely to cling to the original voice. High can reproduce artefacts in the source. 0–1.
provider_options.stylenumber or nullStyle exaggeration. Costs latency; leave unset on anything conversational. 0–1.
provider_options.use_speaker_boostboolean or nullSimilarity at the cost of latency.
provider_options.speednumber or null1.0 is the voice’s own pace. 0.7–1.2.
format"wav", "pcm"Output audio format Default "wav".
sample_rate8000, 16000, 22050, 24000, 44100 or nullHz of the returned audio — one of 8000, 16000, 22050, 24000, 44100, each served natively by the provider. Unset means 24000. POST /v1/tts says what it produced in the X-Sample-Rate header. Queued speech (POST /v1/audio) does not take it: each of its formats has its own rate.
textstringRequired1–2000 characters.
streambooleanStream audio as it is generated. Only the pcm format can stream. Default false.

Responses

Status Description
200 audio/wav, audio/pcm — The generated audio — a complete WAV, or a chunked audio/pcm stream when stream was set. Timing headers describe the generation
400 The request could not be read: malformed JSON
401 Missing or invalid credentials
402 Out of credits, or the organisation is suspended — nothing was charged
403 The key is valid but its scopes do not cover this capability — a key limited to tts gets this from /v1/images rather than a 401
404 Unknown voice_id
422 The request failed validation
429 Rate limit exceeded
502 The provider failed; the message says why
503 Speech is not configured on this platform, or the voice could not be looked up — the message says which