What you’ll need
- A Rime API key. If you don’t have one yet, create one.
- uv for Python, or Node.js 22 or later.
- A browser and a microphone.
Set up with your coding agent
To build this agent backend and test page in your project, paste this prompt into Claude Code, Codex, or Cursor:Prompt for your coding agent
Set up by hand
To run our starter instead, follow these steps.1
Get the starter
Clone the starter from the rime-sdk repository, at a tag that holds both the Python and Node.js servers:Inside, you’ll find one page and a server for each language:
For Go or Rust, see the Prism SDK reference.
2
Set your API key
Set your key in the terminal where you’ll start the server:
- macOS and Linux
- Windows PowerShell
3
Start the server
- Python
- Node.js
Start the server with uv. The first run installs the SDK.
4
Talk to your agent
Open http://localhost:3000 in your browser. The instructions box starts with a made-up cafe, so you can start talking right away:The wording changes from run to run, but the prices and closing time come from your instructions, so they’ll stay the same. While you try it:
- Keep the instructions, or paste your own system prompt.
- Choose a voice. Prism has four:
aurora,wawona,brando, andastra. - Press Start, and allow the microphone when the browser asks.
- Ask “What’s on the menu?” in English.
- While Prism lists the menu, ask “What time do you close?” Prism stops and answers the new question.
- To change the voice or instructions: press Stop, make the change, and press Start. Each start is a new conversation.
- If the page shows an error: look up its code in Errors and limits. If the server stops right away and asks for
RIME_API_KEY, set it in the terminal that runs the server. - If port 3000 is in use: start the server with
PORT=3001, and open http://localhost:3001.
How the starter works
The server is the part you keep and build on: Your whole agent is three parts: one connect call, the SDK’s conversation runner, and two audio adapters. Here are the first two, simplified from thetalk function in server.py and server.mjs:
- Python
- Node.js
wss://prism.api.rime.ai/v1/realtime. Then the runner handles the work that every Prism conversation needs:
- It sends the microphone audio the whole time, even while Prism speaks, so Prism can hear an interruption.
- It plays each reply in order.
- It stops playback at once when the caller talks over a reply.
- It reports how much of each reply the caller heard, because Prism keeps only that part.
source brings in the caller’s audio, and playback plays each reply and measures how much the caller heard. In the starter, one Browser object is both adapters, passing audio to and from the page, and the event callback shows the transcript. Swap the adapters, and the same agent can answer phone calls or run inside your own app.
Connect real callers
When you’re ready, real callers can reach your agent in one of three ways:- Your own application: write a
sourceand aplaybackadapter for its audio, and keep the rest of the server. Live conversations explains each step. - A LiveKit room: the LiveKit quickstart builds the agent with LiveKit Agents, and the Rime plugin connects to Prism for you.
- A phone line: the phone audio goes through your server, and only the adapters change. They convert the audio for Prism and play the replies back, as Phone audio in Live conversations explains.
Test without a microphone
A server, a CI job, or a coding agent’s sandbox has no microphone, so the starter’s check sends a recorded question instead:- Python
- Node.js
question.wav, is a caller asking when the cafe closes today. The check sends it at a microphone’s pace, followed by silence, so Prism can find the end of the turn. If Prism says 4 p.m., the connection, turn detection, and instructions all worked, and you can hear the answer in reply.wav.
Use your own recording
The check reads a 16 kHz mono WAV file. To ask your own question:- Record your question in English.
-
Convert the recording with FFmpeg. This command reads
recording.mp3and writesrecording.wav: -
Run the check with your file:
uv run check.py recording.wavornode check.mjs recording.wav. The check’s instructions cover only the cafe’s hours, so change them for other questions.
Use the API without the SDK
To use a plain WebSocket client instead, for a backend in any language, follow the WebSocket quickstart.Next steps
Now that your agent answers, you can:- Write your own system prompt, starting with rules for speech.
- Give Prism tools, so it can ask your backend for data it doesn’t have, such as Saturday’s opening hours.
- Choose the voice that suits your callers from the four that Prism offers.
- Make Prism speak first with a nudge, or send it typed text.

