SDK
Text to speech
Create speech
Audio formats
HTTP and SSE streaming
WebSocket streaming

Create speech

Start with the required fields and an output format.

Python

speech = client.audio.speech.create(
    model="teen-v1",
    input="Create a Teen V1 response.",
    response_format="mp3",
)
speech.write_to_file("speech.mp3")

Required fields

FieldValue
modelteen-v1
input1–4096 characters

voice is optional and defaults to default. Supply a public or saved voice_... ID only when selecting that voice.

Output fields

FieldDefaultAccepted values
response_formatpcmpcm, mp3, wav
output_sample_rateServer default8000–48000 Hz
streamTrueTrue or False; WAV requires False
stream_formataudioaudio or sse

Generation fields

FieldDefaultPurpose
qualityfastUse expressive for the expressive generation profile
transliterateFalseConvert Romanized Hindi words to Devanagari
cfg_value2.0Guidance strength from 1.0 to 3.0
max_generate_length2000Model generation budget from 32 to 4096
loraNoneSelect a registered server-side LoRA

Enable transliteration for Hinglish. Leave it off when the text contains English words whose spelling and pronunciation should stay intact.

Python

speech = client.audio.speech.create(
    model="teen-v1",
    input="kal main office jaunga",
    transliterate=True,
    response_format="mp3",
    stream=False,
)
speech.write_to_file("speech.mp3")

Choose a voice ID or reference-audio clone for each request.