Stream speech
Generates audio from text using Server-Sent Events (SSE) format. Audio chunks are streamed in real-time as base64-encoded audio. This endpoint is optimized for low-latency applications where audio playback should start as soon as possible.
By default each chunk is PCM F32LE (32-bit float). Send output_format to receive pcm_s16le, pcm_mulaw or pcm_alaw instead, at 8000, 16000, 22050 or 24000 Hz. The stream is always raw audio, so output_format.container must be raw. With output_format, the response also carries X-Audio-Format, X-Audio-Sample-Rate and X-Audio-Channels. See Output Formats.
The response is a stream of SSE events:
event: chunk- Contains base64-encoded audio dataevent: done- Signals completion of audio generation
Each chunk event contains:
type: “chunk”status_code: 206 (Partial Content)done: falsedata: Base64-encoded audio chunk, in theoutput_formatencoding (PCM F32LE by default)step_time: Time taken to generate this chunk in seconds
Authentication
API key for authentication. Example: raya_ABCD1234567890abcdef
Request
The text to convert to speech.
Script notes:
- Hindi (
language:hi) must be in Devanagari script. Romanized Hindi is not supported. - For English (
en-in,en-us), Indic named entities (names, places, etc.) are pronounced more accurately in Devanagari — e.g.राहुलinstead ofRahul. If text is LLM-generated, prompt it to output Indic names in Devanagari even when the rest of the content is in English.
The ID of the voice to use for synthesis. Use /v1/voices to get available voice IDs.
The voice_id must match the model you specify — standard voices only work with "model": "standard", and m1 voices only work with "model": "m1".
Language code for the text. Currently supported: hi (Hindi), mr (Marathi), te (Telugu), kn (Kannada), bn (Bengali), as (Assamese), gu (Gujarati), ne (Nepali), ml (Malayalam), ta (Tamil), en (English, used by m1 voices), en-in (Indian English), en-us (US English).
Hindi must be written in Devanagari script (Romanized Hindi is not supported). For English, Indic named entities are best written in Devanagari for accurate pronunciation. More languages are coming soon.
The synthesis model to use. Each model has its own set of voices — use /v1/voices to find voice IDs for the model you choose.
Important: standard and m1 voices are not interchangeable. Passing a standard voice ID with "model": "m1" (or vice versa) will fail.
Speech speed multiplier (0.5 to 1.5). Changes standard voices only; m1 voices ignore it.
Encoding and sample rate of the audio chunks. Only the raw container is accepted on the WebSocket.
Response headers
Only when output_format is sent. The encoding you asked for.
Only when output_format is sent. The sample rate of the audio, in Hz.
Only when output_format is sent. Always 1 (mono).

