POST /v1/tts/stream synthesizes the full input text and streams the
audio bytes back as they are generated, over one HTTP response. This lowers
time-to-first-byte compared to waiting for the complete file.POST /v1/tts/generate.
Authentication, rate limits, credits, voice/language, and model_id are all
validated before streaming starts.pcm is the recommended output_format for streaming since it has no container
overhead and is ready for custom playback pipelines.application/octet-stream. Usage metadata is returned in
headers:12345X-RateLimit-Limit: 15 X-RateLimit-Remaining: 13 X-RateLimit-Reset: 1715678460 X-Characters-Used: 12 X-Audio-Duration-Seconds: 1.8
123456789with open("speech.pcm", "wb") as file: for chunk in client.tts.stream( text="வணக்கம், நான் வாக்யம் AI பேசுகிறேன்.", model_id="raaga-v1", voice="Archana", language="ta-IN", output_format="pcm", ): file.write(chunk)
stream_to_bytes:12345678910streamed = client.tts.stream_to_bytes( text="வணக்கம்.", model_id="raaga-v1", voice="Archana", language="ta-IN", ) streamed.save("speech.pcm") print(streamed.metadata.characters_used) print(streamed.metadata.duration_seconds)