Realtime Text-to-Speech API

Streaming TTS, built for developers

A WebSocket API that streams natural-sounding speech as it's generated — the same engine that powers ReadAloud AI, now available for your own apps.

Low-latency streaming

Audio starts streaming back over WebSocket as it’s generated — no waiting for the full clip to render.

Natural voices

Powered by Kokoro-82M, the same model behind ReadAloud AI’s app-store-rated voice quality.

Simple key-based auth

Generate a key from your dashboard, pass it as a query param, start streaming. No OAuth dance.

Three lines to your first audio chunk

A plain WebSocket connection. Use it from Node, the browser, or any language with a WS client.

// Step 1: authorize your key. This checks your billing/free-tier status
// and returns a short-lived token plus the actual worker URL to connect to.
const { token, url } = await fetch("https://api.readaloudai.org/tts/authorize", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ key: "YOUR_API_KEY" }),
}).then((r) => r.json())

// Step 2: connect DIRECTLY to the worker with that token — this is the
// fast path, no extra relay hop, comparable latency to going straight to
// the GPU worker itself.
const ws = new WebSocket(`${url}?token=${token}`)

ws.onopen = () => {
  ws.send(JSON.stringify({
    type: "synthesize",
    text: "Hello, this is realtime text to speech.",
    voice: "af_heart",
    speed: 1.0,
  }))
}

// Server alternates: a JSON "chunk_meta" frame, immediately followed by
// one binary PCM16LE mono 24kHz audio frame — repeated until "done".
ws.onmessage = (event) => {
  if (typeof event.data === "string") {
    const msg = JSON.parse(event.data)
    if (msg.type === "done") console.log("synthesis complete")
    if (msg.type === "error") console.error(msg.message)
    // msg.type === "chunk_meta" -> next binary frame is this chunk's audio
  } else {
    // binary PCM16LE mono 24kHz frame — queue it for playback
    playAudioChunk(event.data)
  }
}

// The token expires 60 seconds after issuance — call /tts/authorize again
// for each new session rather than trying to reuse one.

Note: the GPU backend is provisioned on demand and can take up to ~5 minutes to spin up after being idle, then stays warm for 15 minutes after your last request.

Simple API pricing

Start free. Pay only for what you stream.

Free

For testing and small projects

$0to start
  • 10,000 free characters, no card required
  • Realtime WebSocket streaming
  • Kokoro-82M voice model
  • Upgrade to pay-as-you-go anytime
Get a free key

Pay as you go

Scales with your app, no plan to manage

$0.01per 1,000 characters
  • Everything in Free, no limit
  • Priority GPU warm-up
  • Multiple concurrent connections
  • Key-based usage tracking
  • Revoke/rotate keys anytime
Add a payment method

Get your API key

Sign in and generate a key. It's ready to use immediately.

Developer / API Access

Loading…