rime.SpeechToText at stt.api.rime.ai:443 from your backend, with gRPC over TLS. Send your API key in the metadata of each call, as authorization: Bearer YOUR_API_KEY. Write the key name in lowercase, because gRPC metadata keys are lowercase. For example, Python’s grpcio rejects Authorization.
The Rime SDK calls
TranscribeStreaming for you in Python, Node.js, Go, and Rust. To call a method yourself, generate a client from the schema with the protobuf tools for your language.
Transcribe
Transcribe takes a short recording as one complete WAV file and returns one transcript. The request carries the file in audio, and the language of the recording in options:
These commands need
grpcurl and the RIME_API_KEY variable. They download the schema and the sample flight recording, transcribe the recording as English, and print the response as JSON. They pass the request through stdin with -d @, which avoids the shell’s limit on argument length for base64 audio.
Transcribe returned:
The 16 MiB limit is only the transport limit, and a file runs out of model context long before it reaches 16 MiB. The recording and your context terms must fit in the context together. In practice,
Transcribe holds about as much speech as a revised-hypotheses stream (limits). Rime never returns a shortened transcript in place of an error:
For a longer recording, stream it faster than real time with append fragments over the WebSocket API.
TranscribeStreaming accepts the same contract, and Transcribe a long recording has the steps.
TranscribeStreaming
Each call transcribes one utterance. Send and read messages in this order:
Your client sets the chunk size by how many bytes it puts in each
audio payload, up to 64 KiB. It sets the pace by when it sends each payload. 100 ms of audio is 3,200 bytes, and you can send a recording faster than real time. If you cancel the call, or if either side drops, the backend work stops. A request out of order, a request with no payload, or an invalid setting fails with INVALID_ARGUMENT, as Status codes lists.
Set output_contract to one of these values. There is no default. Choose by whether your consumer can replace text that it already has (compare them).
Both contracts return the language in
done.language, with source set to LANGUAGE_SOURCE_SELECTED.
The server applies these deadlines:
The limits table has every other limit.
Status codes
Branch on the status code, not on the message text, and retry a status only when Errors and limits says to retry it. Keep the request ID when you report a failure. The server returnsx-request-id in the response headers of a successful call, and in the trailers of most failed calls.
Schema
The wire contract for both methods isspeech_to_text.proto, in the public rimelabs/rime-api repository. The same file defines the protobuf envelopes of the WebSocket endpoint.
These packages contain generated message definitions for this schema, starting with version 0.2.0:

