Compatible with
wav and mp3 output formats.Connection
Endpoint
Authentication
Pass your API key as a query parameter:Protocol
1. Send Request
Once connected, send a JSON payload with your generation details:2. Receive Messages
The server will send a mix of JSON control messages and binary audio data. A. Started Message (JSON) Sent when processing begins.Audio Format
All binary audio chunks are streamed in a standardized format, consistent across all models (base, advanced, turbo):
Examples
Real-Time Playback
Play audio chunks as they arrive for the lowest perceived latency.Save to File
Collect all audio chunks and save a complete file when the stream ends.Other Languages & CLI
WebSocket is a bidirectional protocol — standard HTTP tools like cURL cannot be used for streaming. For CLI testing, you can use websocat, though binary audio handling is limited in terminal tools.For any language with a WebSocket client, the decoding rules are the same:
- Connect to
wss://api.audixa.ai/v3/tts/stream?api_key=YOUR_KEY - Send a JSON request, then listen for messages
- Text messages → JSON control events (
started,completed,error) - Binary messages → Raw PCM audio: float32, little-endian, 24 kHz, mono (4 bytes per sample)
WebSocket Close Codes
1003 Invalid Payload
1003 Invalid Payload
The server received data it cannot accept (e.g., malformed JSON, missing fields, or validation errors).
1008 Policy Violation
1008 Policy Violation
Authentication failed (e.g., invalid or missing API key).
1011 Internal Error
1011 Internal Error
An unexpected condition prevented the server from fulfilling the request (e.g., database or Redis connection failure).