The requested
audio_format (wav or mp3) controls the completed file. Live
binary WebSocket chunks use the raw PCM format documented below.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. A voice must be compatible with the selected model; useGET /v3/voices?model=base or
GET /v3/voices?model=advanced to select one.
Base request
Advanced request
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 the supportedbase and advanced models:
Examples
Real-Time Playback
Play audio chunks as they arrive rather than waiting for the completed file.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).