Generate speech
Converts complete text to WAV or raw PCM audio. Set stream: true for progressive delivery.
The JSON body must fit within 64 KiB. Unknown fields, explicit null values, and
incorrect field types return 400. Omit optional fields to use their defaults.
Authentication
Request
Complete text. Surrounding whitespace is removed before validation, synthesis and usage measurement. The trimmed text must contain 1–2,048 Unicode code points; otherwise the request returns 400 INVALID_SPEECH_REQUEST. Split longer text at sentence boundaries.
Use normal capitalization and punctuation; all-lowercase or unpunctuated text can severely degrade speech quality.
Case-sensitive voice ID from List voices for the same model. The selected voice determines the language.
Use auto or omit to use the voice’s language. An explicit code, such as en or es,
must match the selected voice’s language. This does not translate the input.
Send a different seed to request another variation. The seed used is returned in x-nari-seed.
false returns audio after generation finishes; true sends audio as it is generated.
Send the complete text in one request in either mode.
wav includes a WAV header; pcm returns raw audio samples.
Both formats support streaming.
Response headers
Response
Binary audio containing 24 kHz, signed 16-bit little-endian, mono samples.
The content type is audio/wav for WAV or audio/pcm for raw PCM.
See Streaming audio for playback and interrupted-stream handling.