Streaming Audio
Stream realtime speech with sonus-tts using chunked transfer and 16kHz PCM frames.
POST https://api.sagea.space/v1/audio/stream
Authentication
Send Authorization: Bearer $SAGEA_API_KEY on every request. Get a key
Parameters
Send a JSON body with the following fields.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Always sonus-tts for streaming synthesis. |
input | string | Yes | Text to stream, max 4096 characters per request. |
voice | string | No | One of nova, atlas, or a cloned voice_id. |
emotion | string | No | One of neutral, friendly, professional, excited, calm, or warm. |
speed | number | No | Playback speed from 0.5 to 2.0. Default is 1.0. |
format | string | No | Frame encoding. Use pcm16 for 16kHz PCM frames. |
language | string | No | BCP-47 hint such as ne-NP, hi-IN, en-US, or es-ES. |
Example request
Stream Welcome to SAGEA with a ne-NP greeting in realtime.
First audio byte arrives in under 200ms for responsive voice agents.
Response
The API returns chunked 16kHz PCM frames, not a single JSON object.
Buffer frames client-side and play continuously for realtime output.
Errors
| Status | Code | Fix |
|---|---|---|
400 | text_too_long | Split input into chunks under 4096 characters. |
401 | unauthorized | Re-export a valid SAGEA_API_KEY value. |
422 | voice_not_found | Use nova, atlas, or a valid vox_ voice ID. |
429 | rate_limit_exceeded | Back off and retry with exponential delay. |
500 | internal_error | Reconnect once, then report request ID. |
Limits
Audio streaming allows 50 requests per minute on Starter and 500 requests per minute on Pro.
