| Transport | Endpoint | Output | Best for |
|---|---|---|---|
| REST (sync) | POST /v1/tts | Complete audio/wav file | Short text where you want one finished file |
| HTTP streaming | POST /v1/tts/stream | Raw PCM stream | Low time-to-first-byte for a single utterance |
| WebSocket | wss://api.chariot.in/v1/tts/ws | Per-sentence audio frames | Real-time, incremental, or long-running speech |
The request
All three take the same core inputs:UUID of the voice to synthesize with. Get one from
GET /v1/voices.The text to speak. 1 to 500 characters (after trimming whitespace) for the REST and streaming endpoints. The WebSocket accepts text incrementally across messages.
Example
Response metadata
The synchronous endpoint returns audio in the body and metadata in headers:| Header | Description |
|---|---|
Inference-Id | Unique id for the generation |
Audio-Url | Persistent URL to the audio |
Credit-Utilized | Credits charged (= character count) |
Content-Disposition | Suggested download filename |
X-inference-id and X-audio-url for the same purpose.
Formats and sample rate
- Sync (
POST /v1/tts): WAV, 44.1 kHz, mono. - Streaming (
POST /v1/tts/stream): raw signed 16-bit little-endian PCM (audio/L16), 44.1 kHz, mono, no WAV header. The complete WAV is available atX-audio-urlafter the stream ends.
Cost
TTS costs 1 credit per input character. A 200-character request costs 200 credits. If a generation fails after you were charged, the credits are refunded. See Credits & pricing.Next steps
Choosing an API
REST vs. streaming vs. WebSocket, with a decision table.
WebSocket streaming
The full real-time protocol.
Voices
Browse the voice catalog.
Rate limits & concurrency
How many requests you can run at once.