Move a WebSocket client
The code that sends audio, tool results, cancels, and playback reports stays the same. Change these four things:1
Point the client at Prism
Use Prism’s address, and send your Rime API key in the same Connect from your backend, because Prism has no ephemeral keys for browsers or phones.
Authorization header. If you don’t have a key yet, create one.2
Trim the session settings
Keep If Prism refuses a field, the error’s
instructions and tools, and choose a Prism voice. Remove the settings that Prism handles itself, such as transcription, audio formats, and temperature. Prism also finds the turns, so keep only interrupt_response and eagerness in turn_detection:param names it. The WebSocket reference says what happens to each OpenAI field.3
Send the caller's audio at 16 kHz
Prism replies at 24 kHz, as OpenAI does, but takes the caller’s audio as PCM16 at 16 kHz, mono. Resample the caller’s audio before you append it, and keep streaming it for the whole call, silence included.
4
Add a cause to the replies you start
On Prism, every Set
response.create says why it asks for a reply. The most common one is the reply after a tool result:prism_parent_response_id to the response.id of the reply that made the calls. Send it after that reply’s response.done and a conversation.item.created for each result. Typed text and greetings have their own causes, as Typed turns and nudges shows.response.text.delta instead of response.audio_transcript.delta, and take tool arguments from response.function_call_arguments.done. If your client uses OpenAI’s current event names, such as response.output_audio.delta, map them to the beta names.
Move a LiveKit agent
Prism plugs into LiveKit Agents as a realtime model, the same way OpenAI Realtime does. So the change is the model that you pass toAgentSession:
vad or turn_detection settings, because Prism finds the end of each turn. Your Agent, its instructions, and its @function_tool tools stay the same. Install the Rime plugin as the LiveKit quickstart shows.
Switch to the Rime SDK
If your backend uses OpenAI’s SDK, switch to the Rime SDK in Python, Node.js, Go, or Rust. Its conversation runner plays each reply and stops playback when the caller talks over it, so your client’s playback and interruption code goes away:Check that it works
Make one call. You should seesession.updated, then input_audio_buffer.speech_started and speech_stopped while you talk, and then Prism’s reply, ending with a response.done whose status is completed. If an error arrives, its code says what to fix, as Errors and limits explains.

