Skip to main content
Rime speech-to-text accepts three recognition settings: language, mode, and context terms. When you know the speaker’s language, set language on the request. On the direct WebSocket (revised hypotheses) and gRPC APIs, you can also omit language or send und to let the model detect it.

Transcription modes

The mode tells the model what form of text to write. Modes steer the model rather than guaranteeing exact token-level output, so test each mode on recordings representative of your traffic. Here is how the three modes format the same spoken turn:

Word-for-word mode

The quickstart transcribed the same synthesized call in written and verbatim modes: Verbatim mode kept “Uh”, “um”, and the spoken “two four seven”. Written mode wrote 247, and on this recording it also left out both fillers. When callers read out digit sequences such as ZIP codes, phone numbers, or account numbers over phone audio, test verbatim mode against written mode on your recordings. Verbatim mode is available in every supported language except Indonesian (id). Set verbatim mode in the SDK stream call:

Tagged mode

Tagged mode produces a verbatim transcript with inline tags for nonverbal sounds and span tags around speech delivered in a particular way. Tags come back inline inside the transcript string as the model writes them, with no separate structured field. Tagged mode is supported in six languages: Dutch (nl), English (en), French (fr), German (de), Italian (it), and Spanish (es). Requesting tagged mode in another language fails with invalid_input over WebSocket or INVALID_ARGUMENT over gRPC. If you combine tagged mode with automatic language detection and the model detects a language outside those six, the request fails once the language locks or finishes. Tagged mode is available over the direct WebSocket and gRPC APIs. The current published Rime SDK releases expose written and verbatim modes only. This WebSocket start message enables tagged mode for English:
Set mode in the WebSocket start message, or in the gRPC config or options:
  • TRANSCRIPTION_MODE_WRITTEN (default). Omitting mode or sending TRANSCRIPTION_MODE_UNSPECIFIED selects written mode.
  • TRANSCRIPTION_MODE_VERBATIM. Supported in all catalog languages except id.
  • TRANSCRIPTION_MODE_TAGGED (enum value 3). Supported in de, en, es, fr, it, and nl.
An unknown mode, or a mode that the selected or detected language does not allow, fails with invalid_input over WebSocket or INVALID_ARGUMENT over gRPC.

Language

Rime speech-to-text serves 13 languages. Pass the canonical BCP 47 tag from the table below, or pass a regional or script variant that resolves to it (for example, en-US resolves to en and es-MX resolves to es). For Mandarin, zh with any region or script subtag (such as zh-CN, zh-TW, zh-HK, zh-Hant, or zh-cmn) resolves to Mandarin and is reported as cmn. Cantonese (yue, zh-yue) and other Chinese extended language tags are not supported. When you already know the speaker’s language (for example, from an IVR menu or account settings), pass language explicitly. On revised-hypotheses streams, selecting the language starts 1-second decodes and sliding-window context management immediately (for non-CJK languages), and validates language and mode compatibility before you send audio. If speech arrives in a language different from the one you selected, the service transcribes in the selected language and returns a poor transcript rather than an error.

Automatic language detection

On the direct WebSocket and gRPC APIs, omit language or send a BCP 47 tag whose primary subtag is und (such as und or und-Latn) to let the model detect the spoken language: When detection is active on a streaming session:
  1. started.accepted (WebSocket) and accepted (gRPC) omit language.
  2. While detecting, the service decodes every 2 seconds and keeps all audio in context so early partials remain fully revisable.
  3. The session locks the language on the first decode of at least 8 seconds of audio whose text has at least three letters, or else on the final decode when the utterance ends. After locking, later decodes condition on that language and non-CJK languages switch to 1-second decodes with a sliding window.
  4. done.language (and TranscriptionResponse.language for unary Transcribe) reports the canonical tag with source set to LANGUAGE_SOURCE_DETECTED. If the utterance contained no recognizable speech, language is omitted.
  5. If the detected language is outside the 13-language catalog, or does not allow the requested mode, the stream ends with invalid_input (WebSocket) or INVALID_ARGUMENT (gRPC) once detection locks or finishes.
The service checks a selected tag before it accepts audio. Each of these cases fails with invalid_input over WebSocket or INVALID_ARGUMENT over gRPC:The SDKs send language without changes, and the service validates it against the 13-language catalog.When you select a language, the direct API confirms its canonical tag in started.accepted.language (WebSocket) or accepted.language (gRPC) and repeats it in the final language field, with source set to LANGUAGE_SOURCE_SELECTED. When the model detects the language, accepted.language is omitted and the final language field carries source: LANGUAGE_SOURCE_DETECTED (or is omitted when no speech was heard).

Context terms

Context terms tell the model which names and phrases to expect in this utterance. For example, an agent for flight changes can send the caller’s surname from the booking, such as Okonkwo, along with airline and fare names such as Northwind Air and FlexPlus. Terms are hints without weights, so they make a match more likely without forcing one. Add the terms to the stream call:
Keep the list short and relevant to the current utterance. Sending unrelated terms from other calls can hurt accuracy, and terms share the model’s context with the audio. Test terms on your own recordings, and keep only the ones that improve the transcript.
  • If you omit the list or send an empty list, the service adds no hints. A term that is empty or contains only whitespace fails with invalid_input.
  • The service trims surrounding whitespace from each term, keeps their order and any internal spaces or commas, and joins them with , .
  • The trimmed, joined list, including its , separators, must fit in the limit of 1,024 UTF-8 bytes, not characters. There is no limit on the number of terms.
  • A term cannot contain reserved model control markers, such as <|...|> or <asr_text>. A term that contains or reconstructs a control marker fails with invalid_input.
  • The service rejects input that exceeds the byte limit with invalid_input. It never truncates the list.

Field names in the direct APIs

Direct API calls use these fields for the three settings: The STT SDK reference lists the SDK options and their defaults. The docs for each SDK are in the rime-sdk repository: Python, Node.js, Go, and Rust.