Skip to main content

Rime API

Generated message definitions for Rime text-to-speech and speech-to-text. Python and JavaScript packages use the same schema and release version.

Python

uv add rime-api
from rime_api import text_to_speech_pb2 as proto

request = proto.WebSocketRequest(context_id='turn-42', text='Hello.')
encoded = request.SerializeToString()

Python 3.10 or newer is required. The package includes type stubs. Runtime dependencies are protobuf>=5.29.6 and googleapis-common-protos>=1.70.0. It does not require gRPC.

JavaScript and TypeScript

npm install @rimelabs/api @bufbuild/protobuf@^2.11.0
import { create, toBinary } from "@bufbuild/protobuf";
import { WebSocketRequestSchema } from "@rimelabs/api";
import type { WebSocketRequest } from "@rimelabs/api";

const request: WebSocketRequest = create(WebSocketRequestSchema, {
  contextId: "turn-42",
  payload: { case: "text", value: "Hello." },
});
const encoded = toBinary(WebSocketRequestSchema, request);

The package supports ESM and CommonJS and includes TypeScript declarations. Consumers that import @bufbuild/protobuf directly should declare it as a direct dependency too. Use its fromJson and toJson functions for the Rime JSON protocol. JSON.stringify does not implement the protobuf JSON mapping.

Speech-to-text

Python uses a separate module for STT:

from rime_api import speech_to_text_pb2 as proto

request = proto.SpeechWebSocketRequest(
    start=proto.StreamingConfig(
        output_contract=proto.STREAMING_OUTPUT_CONTRACT_REVISED_HYPOTHESES,
        language="en",
    )
)
encoded = request.SerializeToString()

JavaScript and TypeScript export STT definitions from the same package:

import { create, toBinary } from "@bufbuild/protobuf";
import {
  SpeechWebSocketRequestSchema,
  StreamingOutputContract,
} from "@rimelabs/api";

const request = create(SpeechWebSocketRequestSchema, {
  payload: {
    case: "start",
    value: {
      outputContract: StreamingOutputContract.REVISED_HYPOTHESES,
      language: "en",
    },
  },
});
const encoded = toBinary(SpeechWebSocketRequestSchema, request);

The STT schema includes whole-utterance transcription, bidirectional streaming, and WebSocket messages. See schema/rime/speech_to_text.proto and schema/speech_to_text.asyncapi.yaml in the package for the full contract.

Scope and compatibility

These packages contain the full public TTS and STT schemas, including synthesis, normalization, language and speaker queries, transcription, and WebSocket envelopes. Framework adapters own connections, authentication, cancellation, and audio I/O. Service descriptors are included; gRPC client stubs are not included.

The protobuf package remains rime. The Python generator uses a virtual source paths, rime_api/text_to_speech.proto and rime_api/speech_to_text.proto, to obtain the Python import names. This changes the Python descriptor file names, but preserves message names, service names, field numbers, and both wire formats. Do not load independently generated definitions of these same rime messages in one Python process.

The Python wheel, source archive, and npm archive include the exact Protobuf and AsyncAPI definitions. The schemas map in SOURCE.json records each public definition's path and SHA-256 hash. In the wheel, the definitions are under rime_api/schema/. The other archives use schema/. Generated code is part of the distribution; installation requires no protobuf compiler or access to the Rime repository.

License

Copyright 2026 Rime. Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE included in each distribution.

This license covers the public Protobuf and AsyncAPI definitions and the Rime-owned generated code and documentation in these distributions. It does not apply to other Rime monorepo components. Dependencies retain their own licenses.

Metadata

Release files for rime-api 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rime-api 0.4.1
File Size Uploaded Provenance Actions
rime_api-0.4.1.tar.gz 33.6 kB Without provenance Details for rime_api-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rime-api 0.4.1
File Interpreter ABI Platform Actions
rime_api-0.4.1-py3-none-any.whl Python 3 none any Details for rime_api-0.4.1-py3-none-any.whl

Total release size: 77.1 kB

Release files / rime_api-0.4.1.tar.gz

Download URL rime_api-0.4.1.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a85b3bdcd1e2626a9c001122e10ab8bb9246ae4896a15243174a659dc8eade22
BLAKE2b-256 checksum
How to use checksums
0e3acde7310e7751106b6b39e6a6a700710a55aa87f4da08d4025da070240d8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / rime_api-0.4.1-py3-none-any.whl

Download URL rime_api-0.4.1-py3-none-any.whl
Size 43.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95db5d93bb2b8b0d7e5204e026a426be449aa6e04f5e50a8e1a8ba99c4493d70
BLAKE2b-256 checksum
How to use checksums
3668940c7b5a4be182ff02b5a75d3bda7cb758d6b9c196a63af75ff40072ac05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for rime-api 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page