Skip to main content
Chariot converts text into natural speech through three transports that share the same voices, model, and billing. They differ in latency and how you feed text in.
TransportEndpointOutputBest for
REST (sync)POST /v1/ttsComplete audio/wav fileShort text where you want one finished file
HTTP streamingPOST /v1/tts/streamRaw PCM streamLow time-to-first-byte for a single utterance
WebSocketwss://api.chariot.in/v1/tts/wsPer-sentence audio framesReal-time, incremental, or long-running speech
Not sure which to use? See Choosing an API.

The request

All three take the same core inputs:
voice_id
string
required
UUID of the voice to synthesize with. Get one from GET /v1/voices.
text
string
required
The text to speak. 1 to 500 characters (after trimming whitespace) for the REST and streaming endpoints. The WebSocket accepts text incrementally across messages.
model_type
string
default:"v0"
The TTS model. Only v0 is available today. See Models.

Example

curl -X POST https://api.chariot.in/v1/tts \
  -H "chariotai-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "voice_id": "bac7d666-094d-4698-91fa-741d60fce662",
    "text": "Chariot turns text into speech."
  }' \
  --output speech.wav

Response metadata

The synchronous endpoint returns audio in the body and metadata in headers:
HeaderDescription
Inference-IdUnique id for the generation
Audio-UrlPersistent URL to the audio
Credit-UtilizedCredits charged (= character count)
Content-DispositionSuggested download filename
The streaming endpoint uses 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 at X-audio-url after 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.