> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API cheat sheet

> Base URLs and bearer authentication for every Rime API, including speech-to-text and Prism, plus runnable examples for text-to-speech, voice, vocabulary, and text-normalization endpoints.

Create a key on the [API Tokens page](https://app.rime.ai/tokens) before running the authenticated examples below.

## Hosts and authentication

| What | Where |
| - | - |
| TTS over HTTP | `https://coda.api.rime.ai/` (Coda), `https://mist.api.rime.ai/` (Mist v3) |
| Coda WebSocket v1 | `wss://coda.api.rime.ai/ws` |
| Speech-to-text | `wss://stt.api.rime.ai/ws` ([WebSocket](https://docs.rime.ai/api-reference/stt/websockets.md)), `stt.api.rime.ai:443` ([gRPC](https://docs.rime.ai/api-reference/stt/grpc.md)) |
| Prism (speech to speech) | `wss://prism.api.rime.ai/v1/realtime` ([WebSocket](https://docs.rime.ai/api-reference/prism/websocket.md)) |
| Voices and coverage | `https://users.rime.ai` |
| Legacy WebSocket endpoints (`/ws`, `/ws2`, `/ws3`) | `wss://users-ws.rime.ai` |
| Text normalization | `https://optimize.rime.ai` |
| Docs (this site, plus `/llms.txt` and per-page `.md` exports) | `https://docs.rime.ai` |

> [!WARNING]
>
> * Send HTTP TTS requests to the model's host: `coda.api.rime.ai` or `mist.api.rime.ai`. The host selects the model, so the body needs no `modelId`.
> * Connect to Coda WebSocket v1 at `wss://coda.api.rime.ai/ws`. The legacy `/ws`, `/ws2`, and `/ws3` endpoints stay on `users-ws.rime.ai`.
> * Authenticate with `Authorization: Bearer YOUR_API_KEY`. On WebSocket connections, send the same value as a connection header.
> * Keep the key on a server. Browser `WebSocket` objects cannot set the required header, so browser applications need a server-side bridge.

Rime publishes Python [`rime-api`](https://pypi.org/project/rime-api/) and JavaScript [`@rimelabs/api`](https://www.npmjs.com/package/@rimelabs/api) for generated TTS message definitions and schemas. These packages cover the [standalone engine protocol](https://docs.rime.ai/docs/on-prem/protocols.md#python-and-javascript-packages). Your application still manages connections and authentication. The cloud examples below use standard HTTP and WebSocket clients.

The [Coda Protobuf quickstart](https://docs.rime.ai/api-reference/coda/websocket-v1-protobuf.md) uses `rime-api` message definitions with a standard WebSocket client.

## Synthesize speech (HTTP)

`POST https://coda.api.rime.ai/` returns audio bytes in the format named by your `Accept` header (`audio/mpeg`, `audio/wav`, `audio/webm;codecs=opus`, `audio/ogg;codecs=opus`, `audio/L16`, `audio/PCMU`):

```bash theme={null}
curl -X POST https://coda.api.rime.ai/ \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Accept: audio/mpeg' \
  --output hello.mp3 \
  -d '{"text": "Hello from Rime.", "speaker": "astra"}'
```

Full parameters and streaming variants: [Coda HTTP reference](https://docs.rime.ai/api-reference/coda/http.md) · [Streaming guide](https://docs.rime.ai/docs/streaming.md)

## Stream Coda speech over WebSocket

Connect to `wss://coda.api.rime.ai/ws` with `rime.v1.json` and wait for `ready`. Send these messages separately to stream a sentence as PCM audio:

```json theme={null}
{"contextId":"turn-1","start":{"speaker":"lyra","language":"en","audioParameters":{"audioFormat":"audio/pcm","samplingRate":24000}}}
{"contextId":"turn-1","text":"Hello from Coda. "}
{"contextId":"turn-1","end":{}}
```

Decode base64 `audio` values as they arrive. Read until `done`, which leaves the socket open. To interrupt, stop playback and send `{"contextId":"turn-1","cancel":{}}`.

Use the [JSON quickstart](https://docs.rime.ai/api-reference/coda/websocket-v1-json.md) for a runnable client and the [Coda WebSocket API reference](https://docs.rime.ai/api-reference/coda/websocket-v1.md) for parameters, events, and binary encoding.

For Mist, use the [model-specific WebSocket reference](https://docs.rime.ai/docs/websockets.md).

## List voices

Both voice endpoints are public and require no API key.

```bash theme={null}
# Voice names, keyed by modelId then ISO 639-2 language code
curl https://users.rime.ai/data/voices/all-v2.json

# Full metadata per voice (gender, age, dialect, language, flagship flag, …)
curl https://users.rime.ai/data/voices/voice_details.json
```

Choosing a voice: [Voices guide](https://docs.rime.ai/docs/voices.md) · Reference: [List All Voices](https://docs.rime.ai/api-reference/data/voices-v2.md) · [List Voice Details](https://docs.rime.ai/api-reference/data/voice-details.md)

## Check vocabulary coverage (`/oov`)

Returns the input words that are **not** in Rime's pronunciation dictionary:

```bash theme={null}
curl -X POST https://users.rime.ai/oov \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"text": "hello kubectl blorbify"}'
# → ["kubectl","blorbify"]
```

Out-of-dictionary words still get a best-effort pronunciation. To control them, send a custom lexicon on Coda, as [Phoneme control](https://docs.rime.ai/platform/phoneme-control) describes, or use [Custom pronunciation](https://docs.rime.ai/docs/custom-pronunciation) on English Mist v3. Reference: [Vocabulary Coverage](https://docs.rime.ai/api-reference/other/oov.md)

## Normalize text (`/textnorm`)

Preview exactly how numbers, dates, and phone numbers will be spoken. Note the host: `optimize.rime.ai`.

```bash theme={null}
curl -X POST https://optimize.rime.ai/textnorm \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"text": "Call 1-800-444-4141 on 3/4/2026"}'
# → {"normalized":"Call one, eight hundred, four four four, four one four one on march fourth twenty twenty six"}
```

Guide: [Text normalization](https://docs.rime.ai/docs/text-normalization.md) · Reference: [Text Normalization](https://docs.rime.ai/api-reference/other/textnorm.md)

## HTTP and legacy WebSocket parameters

This table covers HTTP and the legacy WebSocket endpoints. For Coda WebSocket v1, use `language` and `audioParameters` inside `start`. See the [Coda WebSocket parameters](https://docs.rime.ai/api-reference/coda/websocket-v1.md#synthesis-parameters) for the full list.

| Parameter | Values | Notes |
| - | - | - |
| `speaker` | See [voices](https://docs.rime.ai/docs/voices.md) | Set it to pick the voice, and match it to the model and language. Over HTTP on the model hosts, a request without it still works: Coda picks a random voice, and Mist v3 uses a default voice. |
| `modelId` (legacy WS) | `coda` (flagship), `mistv3` | Legacy WebSocket endpoints only. Set it explicitly. Without it, or with an unrecognized value, Mist v3 serves the request. On the model hosts, the host selects the model. |
| `text` | string | Up to 1,000 characters per request (HTTP returns `400` "text is too long" beyond that). |
| `lang` | `en`/`eng`, `es`/`spa`, `fr`/`fra`, `pt`/`por`, `de`/`ger`, `it`/`ita`, `ja`/`jpn`, `ar`/`ara`, `hi`/`hin` | Must match the speaker's language. |
| `audioFormat` (WS) | `wav`, `mp3`, `ogg`, `webm`, `pcm`, `mulaw` | HTTP uses the `Accept` header instead. |
| `segment` (WS) | `bySentence` (default), `immediate`, `never` | Controls when synthesis starts. See [Segmentation](https://docs.rime.ai/docs/websockets-segment.md). |
| `samplingRate` | `8000`–`96000`, default `24000` | Values above 24000 are upsampling. |

## Where to go deeper

* [API reference index](https://docs.rime.ai/docs/api-reference.md): every endpoint across every model
* [WebSocket API overview](https://docs.rime.ai/docs/websockets.md): endpoint comparison, timestamps, interruption handling
* [Build a voice agent](https://docs.rime.ai/docs/voice-agent-nextjs.md): complete apps in Next.js, Vite, Express, plain Node, and FastAPI
* [Rime CLI](https://docs.rime.ai/docs/quickstart-cli.md) and the [hosted MCP server](https://docs.rime.ai/docs/mcp.md): tooling around this same API


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.