Overview
Rime AI provides two TTS service implementations:RimeTTSService (WebSocket-based) with word-level timing and interruption support, and RimeHttpTTSService (HTTP-based) for simpler use cases. RimeTTSService is recommended for real-time interactive applications.
Rime TTS API Reference
Pipecat’s API methods for Rime TTS integration
Example Implementation
Complete example with word timestamps
Rime Documentation
Official Rime WebSocket and HTTP API documentation
Voice Models
Explore available voice models and features
Installation
To use Rime services, install the required dependencies:Prerequisites
Rime Account Setup
Before using Rime TTS services, you need:- Rime Account: Sign up at Rime AI
- API Key: Generate an API key from your account dashboard
- Voice Selection: Choose from available voice models
Required Environment Variables
RIME_API_KEY: Your Rime API key for authentication
Configuration
RimeTTSService
str
required
Rime API key for authentication.
str
required
deprecated
ID of the voice to use for synthesis. Deprecated in v0.0.105. Use
settings=RimeTTSService.Settings(voice=...) instead.str
default:"wss://users-ws.rime.ai/ws3"
Rime WebSocket API endpoint.
str
default:"coda"
deprecated
Model ID to use for synthesis. Deprecated in v0.0.105. Use
settings=RimeTTSService.Settings(model=...) instead.int
default:"None"
Output audio sample rate in Hz. When
None, uses the pipeline’s configured
sample rate.TextAggregationMode
default:"TextAggregationMode.SENTENCE"
Controls how incoming text is aggregated before synthesis.
SENTENCE
(default) buffers text until sentence boundaries, producing more natural
speech. TOKEN streams tokens directly for lower latency. Import from
pipecat.services.tts_service.bool
default:"None"
Deprecated in v0.0.104. Use
text_aggregation_mode instead.InputParams
default:"None"
deprecated
Deprecated in v0.0.105. Use
settings=RimeTTSService.Settings(...) instead.RimeTTSService.Settings
default:"None"
Runtime-configurable settings. See RimeTTSService
Settings below.
RimeHttpTTSService
str
required
Rime API key for authentication.
str
required
deprecated
ID of the voice to use for synthesis. Deprecated in v0.0.105. Use
settings=RimeHttpTTSService.Settings(voice=...) instead.aiohttp.ClientSession
required
An aiohttp session for HTTP requests.
str
default:"coda"
deprecated
Model ID to use for synthesis. Deprecated in v0.0.105. Use
settings=RimeHttpTTSService.Settings(model=...) instead.int
default:"None"
Output audio sample rate in Hz. When
None, uses the pipeline’s configured
sample rate.InputParams
default:"None"
deprecated
Deprecated in v0.0.105. Use
settings=RimeHttpTTSService.Settings(...)
instead.RimeHttpTTSService.Settings
default:"None"
Runtime-configurable settings. See RimeTTSService
Settings below.
RimeNonJsonTTSService
A deprecated non-JSON WebSocket service that uses plain-text messages and raw audio responses. UseRimeTTSService for current integrations.
str
required
Rime API key for authentication.
str
required
deprecated
ID of the voice to use for synthesis. Deprecated in v0.0.105. Use
settings=RimeNonJsonTTSService.Settings(voice=...) instead.str
default:"wss://users.rime.ai/ws"
Rime WebSocket API endpoint.
str
default:"coda"
deprecated
Model ID to use for synthesis. Deprecated in v0.0.105. Use
settings=RimeNonJsonTTSService.Settings(model=...) instead.str
default:"pcm"
Audio output format.
int
default:"None"
Output audio sample rate in Hz. When
None, uses the pipeline’s configured
sample rate.TextAggregationMode
default:"TextAggregationMode.SENTENCE"
Controls how incoming text is aggregated before synthesis.
SENTENCE
(default) buffers text until sentence boundaries. TOKEN streams tokens
directly for lower latency. Import from pipecat.services.tts_service.bool
default:"None"
deprecated
Deprecated in v0.0.104. Use
text_aggregation_mode instead.InputParams
default:"None"
deprecated
Deprecated in v0.0.105. Use
settings=RimeNonJsonTTSService.Settings(...)
instead.RimeNonJsonTTSService.Settings
default:"None"
Runtime-configurable settings. See RimeNonJsonTTSService
Settings below.
RimeTTSService Settings
Runtime-configurable settings passed via thesettings constructor argument using RimeTTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. See Service Settings for details.
RimeNonJsonTTSService Settings
Runtime-configurable settings passed via thesettings constructor argument using RimeNonJsonTTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. See Service Settings for details.
Usage
Basic Setup (WebSocket)
With Customization (WebSocket)
HTTP Service
Non-JSON WebSocket
Customizing Speech
RimeTTSService provides a set of helper methods for implementing Rime-specific customizations, meant to be used as part of text transformers. These include methods for spelling out text, adjusting speech rate, and modifying pitch. See the Text Transformers for TTS section in the Text-to-Speech guide for usage examples.
RimeTTSService.SPELL(text: str) -> str
Static method that implements Rime’s spell function to spell out text character by character. Call this method on the class, not on an instance.RimeTTSService.PAUSE_TAG(seconds: float) -> str
Static method that implements Rime’s custom pause functionality to generate a properly formatted pause tag you can insert into the text. Call this method on the class, not on an instance.PRONOUNCE(text: str, word: str, phoneme: str) -> str
Instance method that implements Rime’s custom pronunciations feature. It replacesword in text with the phoneme tag. Unlike SPELL and PAUSE_TAG, call it on the service instance, not on the class. Its three arguments do not match the (text, aggregation_type) transform shape, so wrap it in a function.
PRONOUNCE turns on bracket phonemization for the next message only. If any
message may contain a phoneme, set phonemizeBetweenBrackets=True in
Settings (as above) so it stays on for the whole session.INLINE_SPEED(text: str, speed: float) -> str
Instance method that implements Rime’s inline speed adjustment feature. It wrapstext in [] and adds speed to the inlineSpeedAlpha request field. Like PRONOUNCE, call it on the service instance, not on the class.
Notes
- Word-level timestamps:
RimeTTSServiceprovides word-level timing information, enabling synchronized text highlighting. - WebSocket vs HTTP: The WebSocket service supports word-level timestamps, interruption handling, and maintains context across messages within a turn. The HTTP service is simpler but lacks these features.
- Non-JSON WebSocket:
RimeNonJsonTTSServiceis the deprecated plain-text and raw-audio WebSocket implementation. It does not support word-level timestamps.