v1
latestOpenAPI 3.1.02026-07-13212942.9 KBStream Text To Speech
Stream synthesised speech as Server-Sent Events (SSE).
Authenticates the caller, checks quota, and delegates synthesis to the versioned handler registered in voice_registry["streaming_text_to_speech"]. Concurrency is enforced per-token via Redis before the handler is invoked.
Args: tts_request: TTS parameters (text, voice, model, format, etc.). background_tasks: FastAPI background-task queue (passed through to the handler). token_service: Injected token validation service. _request: Raw FastAPI Request object used for rate-limiting and app.state access. version: API version extracted from the version request header. x_api_key: Bearer API key from the x-api-key header.
Returns: StreamingResponse: SSE stream of audio chunks.
Raises: UsageLimitExceeded: When the token has exhausted its quota. TooManyConcurrentRequests: When the per-token concurrency cap is reached.
Headers
Request body
Example request
{
"transcript": "Hello, world!"
}Response
Successful Response