Skip to main content
In this quickstart, you’ll run a Prism voice agent on your computer, give it your own instructions, and talk to it through your microphone and speakers. You’ll set up two parts. The server is your agent, built with our SDK. A page in your browser acts as the caller’s phone. It captures your voice, plays the replies, and cancels the echo of Prism’s voice, so laptop speakers work and you can interrupt Prism at any time.

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
When it’s done, your coding agent tells you the command to run and the address to open.

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:
3

Start the server

Start the server with uv. The first run installs the SDK.
The server prints the page’s address:
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:
  1. Keep the instructions, or paste your own system prompt.
  2. Choose a voice. Prism has four: aurora, wawona, brando, and astra.
  3. Press Start, and allow the microphone when the browser asks.
  4. Ask “What’s on the menu?” in English.
  5. While Prism lists the menu, ask “What time do you close?” Prism stops and answers the new question.
You should hear each answer, and the page shows a transcript like this one:
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:
  • 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 the talk function in server.py and server.mjs:
The SDK connects to 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.
The two adapters are yours: 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 source and a playback adapter 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:
Here’s the output from one run:
The recording, 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:
  1. Record your question in English.
  2. Convert the recording with FFmpeg. This command reads recording.mp3 and writes recording.wav:
  3. Run the check with your file: uv run check.py recording.wav or node check.mjs recording.wav. The check’s instructions cover only the cafe’s hours, so change them for other questions.
Record the question without long pauses: Prism finds the end of the turn by itself, so a long pause can end the turn early. The check then stops after the first part, or fails with Reply cancelled: turn_detected.

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: