# Rime (/en/ai/platform/models/tts/rime)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI.
> Documentation version: Preview.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-guides-v2.txt).


Rime provides high-quality text-to-speech (TTS) with low latency, supporting multiple speakers and models.

## Sample configuration

The following example shows how to configure Rime as the agent's TTS when you create or update an agent. For a complete example, see [Create an agent and start a session](/en/ai/platform/get-started/start-stop-agent#create-an-agent).

Rime supports BYOK only. It isn't available in managed mode. Store your Rime API key in a secret set, and refer to it from the agent. For details, see [Use your own provider keys](/en/ai/platform/build/use-your-own-keys).

**Python SDK**

```python
from agora_agent import Agent, RimeTTS, secret_ref

# client is your configured Agora client
agent = (
    Agent(client=client)
    .with_stt(...)  # configure your ASR vendor
    .with_llm(...)  # configure your LLM vendor
    .with_tts(
        RimeTTS(
            key=secret_ref("support_prod", "rime"),
            base_url="wss://users.rime.ai/ws2",
            speaker="cove",
            model_id="mistv2",
        )
    )
)
```

**TypeScript SDK**

```ts
import { Agent, RimeTTS, secretRef } from 'agora-agents';

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(/* configure your ASR vendor */)
  .withLlm(/* configure your LLM vendor */)
  .withTts(
    new RimeTTS({
      key: secretRef('support_prod', 'rime'),
      baseUrl: 'wss://users.rime.ai/ws2',
      speaker: 'cove',
      modelId: 'mistv2',
    }),
  );
```

**Go SDK**

```go
// client is your configured Agora client
agent := agentkit.NewAgent(client).
	WithStt( /* configure your ASR vendor */ ).
	WithLlm( /* configure your LLM vendor */ ).
	WithTts(vendors.NewRimeTTS(vendors.RimeTTSOptions{
		Key:     agentkit.SecretRef("support_prod", "rime"),
		BaseURL: "wss://users.rime.ai/ws2",
		Speaker: "cove",
		ModelID: "mistv2",
	}))
```

**REST API**

Set `credential.mode` to `byok` and `credential.fields.api_key` to a reference to your Rime API key in a secret set. In the following example, the key is stored as `rime` in the `support_prod` set:

```json
"tts": {
  "credential": {
    "mode": "byok",
    "fields": {
      "api_key": "$secrets.support_prod.rime"
    }
  },
  "vendor": "rime",
  "url": "wss://users.rime.ai/ws2",
  "params": {
    "speaker": "cove",
    "modelId": "mistv2"
  }
}
```

## Key parameters

The `tts` block takes the following fields. In the SDKs, the Rime TTS class sets them from its options.

**tts**

**`vendor` (string) required**

Set to `rime`.

**`credential` (object) required**

Set `mode` to `byok` and `fields.api_key` to a `$secrets.<set>.<key>` reference to your Rime API key.

**`url` (string) optional**

The WebSocket URL for the Rime streaming API, for example `wss://users.rime.ai/ws2`.

**`params` (object) required**

**`speaker` (string) required**

The speaker voice to use for TTS output, for example `cove`.

**`modelId` (string) required**

The Rime TTS model to use, for example `mistv2`. Different models provide different voice qualities and capabilities.

> **Caution**
>
> The parameters listed on this page are validated for use with the Conversational AI Platform. Required parameters must be provided as documented. Any additional parameters in `params` are passed through directly to Rime without validation. For a full list of supported options, refer to the Rime documentation for [Arcana](https://docs.rime.ai/api-reference/arcana/streaming-pcm) and [Mist v2](https://docs.rime.ai/api-reference/endpoint/streaming-pcm).

This integration is fully supported for use with the Conversational AI Platform. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
