> ## Documentation Index
> Fetch the complete documentation index at: https://rimelabs-docs-coda-websocket-reference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Choose a WebSocket API

> Choose the Coda JSON or Protobuf WebSocket API, or find the existing Mist WebSocket references.

Use Coda WebSocket v1 for new Coda integrations. For Mist, select an endpoint from the support table below.

## Choose a model and protocol

| Model   | Endpoint                     | Reference                                               |
| ------- | ---------------------------- | ------------------------------------------------------- |
| Coda    | `wss://api.rime.ai/coda/ws`  | [Coda WebSocket API](/api-reference/coda/websockets)    |
| Mist v3 | `wss://users-ws.rime.ai/ws3` | [JSON reference](/api-reference/mistv3/websockets-json) |
| Mist v2 | `wss://users-ws.rime.ai/ws2` | [JSON reference](/api-reference/mistv2/websockets-json) |

Mist v1 and Mist v2 also support `/ws3`. For all Mist JSON and raw-audio options, see the [Mist endpoint support table](#mist-endpoint-support).

## Authenticate from your server

Your server sends `Authorization: Bearer YOUR_API_KEY` during the WebSocket upgrade. Create a key on the [API Tokens page](https://app.rime.ai/tokens).

Keep credentials on the server. A browser's `WebSocket` object cannot set this header, so browser applications need a backend bridge that connects to Rime. See [API authentication](/docs/api-authentication).

## Choose a Coda client

Both encodings support streaming text, persistent connections, context IDs, and cancellation. Neither supplies word timestamps.

| Client                        | Encoding                                    | Start here                                                    |
| ----------------------------- | ------------------------------------------- | ------------------------------------------------------------- |
| Standard WebSocket client     | JSON messages with base64 audio             | [JSON quickstart](/api-reference/coda/websockets-json)        |
| Client with Protobuf bindings | Protobuf messages with an audio bytes field | [Protobuf quickstart](/api-reference/coda/websockets-binary)  |
| LiveKit agent                 | Binary by default; JSON also supported      | [LiveKit integration](/api-reference/coda/websockets-livekit) |

Binary avoids base64 encoding. Decode its Protobuf envelope before playing audio. Use the [Coda WebSocket API reference](/api-reference/coda/websockets) for parameters, lifecycle, and errors.

## Mist endpoint support

Mist uses `wss://users-ws.rime.ai` with the paths below. Use `/ws3` for new Mist integrations. Existing Mist v1 and Mist v2 clients can continue to use `/ws2`.

| Model or feature                       | `/ws3` | `/ws2` | `/ws`            |
| -------------------------------------- | ------ | ------ | ---------------- |
| Message format                         | JSON   | JSON   | Raw binary audio |
| Mist v1                                | ✅      | ✅      | ✅                |
| Mist v2                                | ✅      | ✅      | ✅                |
| Mist v3                                | ✅      | ❌      | ✅                |
| Word-level timestamps                  | ✅      | ✅      | ❌                |
| Context IDs                            | ✅      | ✅      | ❌                |
| Active time-to-first-byte optimization | ✅      | ❌      | ❌                |

The [Mist v3 JSON reference](/api-reference/mistv3/websockets-json) documents `/ws3`. The [Mist v2 JSON reference](/api-reference/mistv2/websockets-json) documents `/ws2`; Mist v2 also supports `/ws3` with the same JSON message format. `/ws2` does not receive new model support.

For raw audio, see the [Mist v3 raw WebSocket reference](/api-reference/mistv3/websockets) or [Mist v2 raw WebSocket reference](/api-reference/mistv2/websockets). The `/ws` endpoint returns audio bytes without JSON framing, word timestamps, context IDs, or structured error events.

For text buffering and the `flush`, `clear`, and `eos` operations on the Mist JSON endpoints, see the [segmentation guide](/docs/websockets-segment).
