Build real-time voice experiences
Generate natural speech, build responsive voice agents, and run Rime in production.
Need a key? Create an API token in the Rime dashboard.
First request
Go from text to audio
Set RIME\_API\_KEY, run one of these examples, and play the generated hello.mp3 file.
```bash cURL theme={null}
curl --request POST \
--url https://users.rime.ai/v1/rime-tts \
--header "Authorization: Bearer $RIME_API_KEY" \
--header "Content-Type: application/json" \
--header "Accept: audio/mpeg" \
--output hello.mp3 \
--data '{
"speaker": "astra",
"text": "Hello from Rime.",
"modelId": "coda",
"lang": "en"
}'
```
```python Python theme={null}
import os
import requests
response = requests.post(
"https://users.rime.ai/v1/rime-tts",
headers={
"Authorization": f"Bearer {os.environ['RIME_API_KEY']}",
"Accept": "audio/mpeg",
},
json={
"speaker": "astra",
"text": "Hello from Rime.",
"modelId": "coda",
"lang": "en",
},
)
response.raise_for_status()
with open("hello.mp3", "wb") as audio:
audio.write(response.content)
```
```javascript JavaScript theme={null}
import { writeFile } from "node:fs/promises";
const response = await fetch("https://users.rime.ai/v1/rime-tts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RIME_API_KEY}`,
"Content-Type": "application/json",
Accept: "audio/mpeg",
},
body: JSON.stringify({
speaker: "astra",
text: "Hello from Rime.",
modelId: "coda",
lang: "en",
}),
});
if (!response.ok) throw new Error(`Rime API error: ${response.status}`);
await writeFile("hello.mp3", Buffer.from(await response.arrayBuffer()));
```
TTS in five minutes is the complete walkthrough. The Rime CLI covers the same steps from the terminal.
Choose what you're building
Start with the path that matches your application
Rime exposes one HTTP and WebSocket API surface.
Generate speech over HTTP, stream the response, and play it in your application.
Connect Rime to an STT, LLM, and audio transport for responsive conversations.
Run Rime privately with Docker Compose or Kubernetes.
Developer journey
From first audio to production
Follow the lifecycle or jump directly to the problem you're solving.
Models and voices
Choose a model and voice
Voice availability depends on the model and language, so compare models first.
Understand the tradeoffs across Coda and Mist before choosing a model ID.
Explore the voice catalog and find voices available for your model and language.
Resources
Reference and tooling
Endpoints, parameters, formats, and examples.
Common requests and endpoints on one page.
Generate and inspect audio from your terminal.
Use Rime from Claude, Codex, and compatible IDEs.
# Playing audio
Source: https://docs.rime.ai/mcp-reference/audio
How audio from synthesize_speech reaches your speakers: inline player, play URL, or MCP audio block.
[`synthesize_speech`](/mcp-reference/synthesize-speech) delivers audio three ways, so samples play regardless of the host:
## 1. Inline player
Hosts that support MCP Apps (such as Claude) render an audio player directly in the conversation. The MP3 travels outside the model's context, so playback costs no tokens. This is the default and needs no configuration.
## 2. Play URL
Rime's MCP server includes a short-lived link in every result, also available at `structuredContent.audioUrl`. Terminal and agent hosts (such as Claude Code or OpenAI Codex) can download and play it with a system audio player:
```bash theme={null}
curl -s