Skip to content
API reference

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.

FieldTypeDescription
textrequiredstringWhat to say. Up to the model's character limit (see Models and voices).
language_coderequiredstringThe language to speak, e.g. en-IN, hi-IN, ta-IN.
voice_idstringA voice, e.g. voice:shubh. Default: the model's default voice.
model_idstringDefault tts-v1, or the voice's own model when you give a voice.
output_formatstringmp3 (default), wav, opus, flac, aac, mulaw, alaw.
sample_ratenumber8000 to 48000 Hz. mulaw and alaw are for phone audio (8000).
pacenumberSpeaking speed: 0.5 to 2 on tts-v1, 0.3 to 3 on tts-v1-classic. 1 is normal.

Response headers

HeaderTypeDescription
x-request-idstringQuote it when reporting a problem.
x-model-idstringThe model that spoke.
x-voice-idstringThe voice used.
x-character-countnumberCharacters charged.
x-credits-remainingnumberThe 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.mp3

Text is checked against our usage policy: text that scripts a known scam (asking for an OTP, KYC threats) is refused with 400 CONTENT_BLOCKED.