> ## 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.

# Rime SDK

> The Rime SDK is a backend client for text-to-speech and speech-to-text in Python, Node.js, Go, and Rust. This overview lists the packages and shows how to install the SDK and set your API key.

The Rime SDK is a client library for your backend. It streams text-to-speech (TTS) and speech-to-text (STT) over gRPC with TLS, and one client does both. Run the SDK on your backend, where your API key stays. Browsers and mobile apps connect to your backend, not to Rime.

The SDK manages the connection, sends your API key, converts audio, and tracks the protocol state of each stream. Your application captures audio, plays it, and decides when a speaker has finished.

Python, Node.js, Go, and Rust each have a package. All four packages are in alpha, and a new alpha release can change the API. Pin the exact version that you tested with, as the install commands below do.

## Packages and versions

This reference documents these releases. Each install tab below lists the runtime requirements for its language.

| Language | Package | Version | TTS | STT |
| - | - | - | - | - |
| [Python](https://github.com/rimelabs/rime-sdk/tree/main/python) | [`rimelabs-sdk`](https://pypi.org/project/rimelabs-sdk/) | `0.1.0a17` | ✅ | ✅ |
| [Node.js / TypeScript](https://github.com/rimelabs/rime-sdk/tree/main/typescript) | [`@rimelabs/sdk`](https://www.npmjs.com/package/@rimelabs/sdk) | `0.1.0-alpha.17` | ✅ | ✅ |
| [Go](https://github.com/rimelabs/rime-sdk/tree/main/go) | [`github.com/rimelabs/rime-sdk/go`](https://pkg.go.dev/github.com/rimelabs/rime-sdk/go) | `v0.1.0-alpha.9` | ✅ | ✅ |
| [Rust](https://github.com/rimelabs/rime-sdk/tree/main/rust) | [`rimelabs-sdk`](https://crates.io/crates/rimelabs-sdk) | `0.1.0-alpha.7` | ✅ | ✅ |

## Install

Run the command for your language in your application directory. The command pins the version from the table above. The commands use macOS or Linux shell syntax.

**Python**

You need Python 3.11 or later. Use [uv](https://docs.astral.sh/uv/) to add the package to your project:

```sh theme={null}
uv add "rimelabs-sdk==0.1.0a17"
```

**Node.js / TypeScript**

You need Node.js 22 or later. The package is ESM only and includes TypeScript types. It runs in Node.js on your backend, not in browsers.

```sh theme={null}
npm install --save-exact @rimelabs/sdk@0.1.0-alpha.17
```

**Go**

You need Go 1.24 or later. You do not need to set up cgo. Import the module as `rime "github.com/rimelabs/rime-sdk/go"`.

```sh theme={null}
go get github.com/rimelabs/rime-sdk/go@v0.1.0-alpha.9
```

**Rust**

You need Rust 1.88 or later. Import the crate as `rimelabs_sdk`.

```sh theme={null}
cargo add rimelabs-sdk@=0.1.0-alpha.7
```

Call the SDK inside a Tokio runtime that has I/O and time enabled. The crate brings its own dependencies. Add other crates only when your code uses them:

| Crate | Use it for |
| - | - |
| `futures-util` | `StreamExt::next` |
| `bytes` | STT audio chunks |
| `tokio` with the `macros` and `rt-multi-thread` features | A `#[tokio::main]` entry point |

## Set your API key

When you create the client, the SDK reads your key from `RIME_API_KEY`. If you pass a key in the client configuration, the SDK uses that key instead. The SDK does not read `.env` files.

If you do not have a key, [create one](/docs/api-authentication). Then set it in the environment that runs your backend:

```sh theme={null}
export RIME_API_KEY="your-api-key"
```

The other client settings are `model`, `endpoint`, and `timeout`. They apply only to TTS. STT always connects to `stt.api.rime.ai:443`, and you set its timeout on each `stream` call.

## Guides and examples

Start from the [Rime SDK repository](https://github.com/rimelabs/rime-sdk). Each language has a README with a quick start, and the guides and runnable examples are next to the SDK source. The reference pages here list the methods, options, defaults, and errors.

| Language | Package README | TTS | STT |
| - | - | - | - |
| Python | [`python/README.md`](https://github.com/rimelabs/rime-sdk/blob/main/python/README.md) | [Guide](https://github.com/rimelabs/rime-sdk/blob/main/python/docs/tts.md), [examples](https://github.com/rimelabs/rime-sdk/tree/main/python/examples/tts) | [Guide](https://github.com/rimelabs/rime-sdk/blob/main/python/docs/stt.md), [examples](https://github.com/rimelabs/rime-sdk/tree/main/python/examples/stt) |
| Node.js / TypeScript | [`typescript/README.md`](https://github.com/rimelabs/rime-sdk/blob/main/typescript/README.md) | [Guide](https://github.com/rimelabs/rime-sdk/blob/main/typescript/docs/tts.md), [examples](https://github.com/rimelabs/rime-sdk/tree/main/typescript/examples/tts) | [Guide](https://github.com/rimelabs/rime-sdk/blob/main/typescript/docs/stt.md), [examples](https://github.com/rimelabs/rime-sdk/tree/main/typescript/examples/stt) |
| Go | [`go/README.md`](https://github.com/rimelabs/rime-sdk/blob/main/go/README.md), [API reference](https://pkg.go.dev/github.com/rimelabs/rime-sdk/go) | [Guide](https://github.com/rimelabs/rime-sdk/blob/main/go/README.md#tts), [example](https://github.com/rimelabs/rime-sdk/blob/main/go/examples/save/main.go) | [Guide](https://github.com/rimelabs/rime-sdk/blob/main/go/README.md#stt), [example](https://github.com/rimelabs/rime-sdk/blob/main/go/examples/transcribe/main.go) |
| Rust | [`rust/README.md`](https://github.com/rimelabs/rime-sdk/blob/main/rust/README.md), [API reference](https://docs.rs/rimelabs-sdk) | [Guide](https://github.com/rimelabs/rime-sdk/blob/main/rust/README.md#tts), [example](https://github.com/rimelabs/rime-sdk/blob/main/rust/examples/save.rs) | [Guide](https://github.com/rimelabs/rime-sdk/blob/main/rust/README.md#stt), [example](https://github.com/rimelabs/rime-sdk/blob/main/rust/examples/transcribe.rs) |

To try STT on a hosted sample recording first, follow the [speech-to-text quickstart](/docs/stt/quickstart).

## SDK reference

> **[STT reference](/api-reference/sdk/stt)**
>
> The `stream` call, recognition options, audio sources, partial and final results, cancellation, limits, and errors in each language.

> **[TTS reference](/api-reference/sdk/tts)**
>
> The `stream` and `synthesize` calls, client and synthesis options, audio formats, voice discovery, and errors in each language.

To call Rime without the SDK, use the [STT WebSocket and gRPC APIs](/docs/speech-to-text#choose-how-to-connect) or the [TTS HTTP and WebSocket APIs](/docs/api-reference).


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