API reference · Text to speech
Text to speech
Turn text into speech in any of 12 languages.
POST
/v1/text-to-speech
Returns the audio itself; its type matches output_format.
| Field | Type | Description |
|---|---|---|
textrequired | string | What to say. Up to the model's character limit (see Models and voices). |
language_coderequired | string | The language to speak, e.g. en-IN, hi-IN, ta-IN. |
voice_id | string | A voice, e.g. voice:shubh. Default: the model's default voice. |
model_id | string | Default tts-v1, or the voice's own model when you give a voice. |
output_format | string | mp3 (default), wav, opus, flac, aac, mulaw, alaw. |
sample_rate | number | 8000 to 48000 Hz. mulaw and alaw are for phone audio (8000). |
pace | number | Speaking speed: 0.5 to 2 on tts-v1, 0.3 to 3 on tts-v1-classic. 1 is normal. |
Response headers
| Header | Type | Description |
|---|---|---|
x-request-id | string | Quote it when reporting a problem. |
x-model-id | string | The model that spoke. |
x-voice-id | string | The voice used. |
x-character-count | number | Characters charged. |
x-credits-remaining | number | The workspace's credits after this request. |
Example
curl -X POST https://lipivo.com/v1/text-to-speech \
-H "x-api-key: $LIPIVO_API_KEY" \
-H "content-type: application/json" \
-d '{"text": "Hello! Your order arrives tomorrow.", "language_code": "en-IN", "voice_id": "voice:shubh"}' \
-o reply.mp3Text is checked against our usage policy: text that scripts a known scam (asking for an OTP, KYC threats) is refused with 400 CONTENT_BLOCKED.