Skip to main content
Dialog-RSN-1 is a real-time voice model. You stream the caller’s audio over one WebSocket and the model decides when the caller has finished speaking. The API speaks the reply and streams its transcript, or sends the reply as text for your own text-to-speech. The wire format is the OpenAI Realtime API (GA schema). A stock OpenAI Realtime client works by changing the base URL and the key, and any WebSocket client in any language can speak the protocol. The current model is dialog-rsn-1.1, and dialog-rsn-1 is an alias for the latest version.

Limits and pricing

Concurrency, session duration, context window, audio formats, languages and the connected-minute rate.

Dialog-RSN-1 docs

The overview, quickstart, prompting pages and integration guides.

OpenAI Realtime reference

Field-level documentation for every event. This page lists what we accept and where we differ.

Connect

Connect to wss://api.studio.poly.ai/v1/realtime with an API key from studio.poly.ai. Sign up or log in there and create the key in the API Keys tab. The quickstart has the steps.
Enterprise accounts on studio.us.poly.ai connect to wss://api.us.poly.ai/v1/realtime instead, with a key from that Studio. A key only works on the host that matches the Studio that issued it, and a mismatch returns 401. Self-serve keys run in the US only. UK and EU workspaces are served from our EU region (Ireland) via api.uk.poly.ai and api.eu.poly.ai, available on request.
Open a connection and read the first event. The server sends session.created with the default session, and you don’t need to send anything to open the conversation. The OpenAI SDK appends /realtime to the base URL and sends your key as a bearer token.
The optional query parameter session_id ([A-Za-z0-9_.-], up to 128 characters) names the session for your own logs. It comes back as session.poly_session_id. The model query parameter that OpenAI clients send is accepted and ignored. The server pings every 20 seconds, which keeps a quiet connection open. A connection whose client sends no event for 5 minutes is closed with code 4408. A client that keeps streaming audio stays open.

Authenticate

Send your API key from studio.poly.ai in either header. They are equivalent.
There is no query-string key and no WebSocket subprotocol credential. Browsers cannot set either header on a WebSocket, so keep the key on your own server and put a relay in front of browser clients, as the browser guide does. A refused handshake usually answers with an HTTP status and a JSON body. Sometimes the server accepts the WebSocket and closes it straight away with the close code in the table instead, so handle both. A client library that can’t read the HTTP response sees a failed handshake, not a close code.

Configure the session

Send session.update after session.created. A partial update deep-merges onto the current session, so updating instructions doesn’t wipe tools. A rejected update applies nothing and sends no session.updated, so what comes back in session.updated is exactly what is in effect. A new session speaks its replies. This update keeps that default, so replies arrive as audio and a transcript:
session.update
To speak replies with your own text-to-speech, set output_modalities to ["text"]. Replies then arrive as text, and you send playback reports as you play them.
session.update

Honored

poly_speech and poly_spoken go on a tool, not on the session. See PolyAI extensions.

Accepted and ignored

The server accepts and ignores these fields, which stock clients send by default. Most are left out of session.updated. audio.input.transcription and parallel_tool_calls are echoed back but change nothing.
  • model (the session reports the current model, dialog-rsn-1.1), tracing, truncation, include
  • audio.input.noise_reduction
  • audio.input.transcription. Transcripts are always sent, and a transcription session reads language.
  • Turn-detection timing: threshold, silence_duration_ms (honored on a transcription session), prefix_padding_ms, eagerness. type: "semantic_vad" is reported back as server_vad.
  • turn_detection.interrupt_response: true, which is already how the service behaves
  • audio.output.voice set to an OpenAI voice name (alloy, marin and the rest): the deployment’s default voice speaks instead. audio.output.speed.
  • parallel_tool_calls (the model makes one call per turn)

Refused

Fields that would change what you get if silently ignored are refused with an error naming the field in param. The whole update is dropped, so a good field sent alongside a bad one doesn’t take effect either.

Audio in

Audio travels as base64 inside input_audio_buffer.append. Binary WebSocket frames are refused.
  • Send about 20 ms per frame (640 bytes at 16 kHz, 960 at 24 kHz). One frame may not exceed 256 KiB, and a larger frame closes the connection with code 1009.
  • Keep streaming during silence. The server decides where the turn ends from the audio, so a client that stops sending looks idle. With push-to-talk, append only while the caller holds the button, because silence you send becomes part of the turn.
  • One turn may hold up to 300 seconds of audio. Anything longer is dropped.
  • Audio in conversation.item.create is refused with unsupported_item_type. Stream caller audio, and use conversation.item.create for text, tool results and history.

Run a turn

With create_response: true the sequence for one caller turn is:
  1. You stream input_audio_buffer.append frames.
  2. input_audio_buffer.speech_started when the caller starts talking, then input_audio_buffer.speech_stopped and input_audio_buffer.committed once Dialog-RSN-1 judges the caller has finished.
  3. conversation.item.added and conversation.item.done for the caller’s turn.
  4. response.created, response.output_item.added and response.content_part.added. Then response.output_audio_transcript.delta frames carry the reply’s words and response.output_audio.delta frames carry its sound, as base64 PCM16 mono at 24 kHz sent at the pace it plays. response.output_audio.done, response.output_audio_transcript.done, response.content_part.done and response.output_item.done close the reply, and response.done arrives once it has finished playing.
  5. conversation.item.input_audio_transcription.delta and .completed, carrying what the model heard, arrive during the reply. See Caller transcripts.
On a text session, step 4 streams response.output_text.delta frames until response.output_text.done, with no audio events. With create_response: false, step 2 follows the first pause, or your input_audio_buffer.commit. Step 4 starts when you send response.create. With turn_detection: null (push-to-talk), step 2 is only input_audio_buffer.committed, sent when you send input_audio_buffer.commit. Step 4 starts when you send response.create. These samples stream a WAV file, print what the model heard and the reply’s transcript, and save the spoken reply. For a text session, add "output_modalities": ["text"] to the session.update and read response.output_text.delta instead.

Turn-taking and barge-in

With create_response: true, Dialog-RSN-1 decides when the caller has finished, and tells you with two events.
  • input_audio_buffer.speech_started arrives when the caller starts talking, and names the item id the turn will become. While a reply is playing, it arrives once Dialog-RSN-1 has judged the sound to be the caller.
  • input_audio_buffer.speech_stopped arrives when Dialog-RSN-1 judges the caller has finished, and the reply follows straight away. A pause mid-sentence doesn’t end the turn. A sound that turns out not to be the caller is dropped, so a speech_started can arrive with no speech_stopped after it.
You shape turn-taking in instructions. The timing fields of turn_detection are accepted and ignored (see Accepted and ignored). Setting create_response: false turns off Dialog-RSN-1’s judgment of when the caller has finished. A turn ends at the first pause, or when you send input_audio_buffer.commit, and nothing answers it until you send response.create. A pause mid-sentence splits the caller’s speech into two items in history. A confirmed barge-in cancels the reply. If the caller starts talking while a response is still streaming, Dialog-RSN-1 confirms it’s the caller, then cancels the response as if you had sent response.cancel. There’s no separate event for this: the response ends with response.done and status cancelled, right after a speech_started. interrupt_response can’t be turned off. With push-to-talk nothing barges in, so send response.cancel to stop a reply. When the server speaks the reply, it knows what the caller has heard. When you speak it yourself, send playback reports so barge-in follows your real playback and history keeps the words the caller heard.

Spoken or text replies

  • output_modalities: ["audio"], the default. The server speaks the reply. The sound streams as response.output_audio.delta, base64 PCM16 mono at 24 kHz, sent at the pace it plays. The words stream as response.output_audio_transcript.delta. Pick the voice with audio.output.voice, a Cartesia voice id, or leave it unset for the default voice. response.done arrives once the reply has finished playing.
  • output_modalities: ["text"], for your own text-to-speech. The reply streams as response.output_text.delta, with no audio events, and you speak it however you like. Use it when you want your own voice or vendor, control over playback, or a place to log the reply and run your guardrails before a caller hears it. Then send playback reports. Streaming to your TTS walks through it.
A speaking session sends no response.output_text.delta, so a client that reads only text deltas sees an empty reply and no error. Read the transcript deltas, or set ["text"].

Caller transcripts

Dialog-RSN-1 transcribes the caller in the same generation that answers the turn. The transcript streams as conversation.item.input_audio_transcription.delta and .completed, attributed to the caller’s audio item. It can arrive after the reply has started, so don’t wait for it before handling the reply. .completed reports the audio’s duration as its usage, and the response’s tokens arrive on response.done. conversation.item.retrieve on a caller’s audio turn returns the transcript, not the audio. To transcribe without a reply, open a transcription session.

Responses

  • One response at a time. A response.create while a response is open is refused with conversation_already_has_active_response. Send response.cancel first. A response.create sent while the caller is still speaking is held and answered by the response to their turn. One sent while a reply the server speaks is still playing is held until that audio ends. Only one request is held at a time.
  • response.create may set instructions, max_output_tokens and metadata. parallel_tool_calls is ignored. Every other field must match the session or is refused with unsupported_parameter, naming response.<field>. That includes conversation: "none" (no out-of-band responses), a per-response output_modalities, tools or tool_choice, input, audio, prompt and reasoning. Change the session with session.update instead.
  • response.done always ends a response, whatever the outcome. Its response.status is completed, cancelled or failed. A canceled response closes any open output item as incomplete, so a client waiting on a matching .done isn’t left hanging.

Function calling

Declare function tools in session.tools. When the model calls one, the arguments stream as response.function_call_arguments.delta, and response.function_call_arguments.done carries the name, the full arguments and a call_id. The model makes one call per turn. Answer with conversation.item.create, an item of type: "function_call_output" with the matching call_id, then send response.create. A tool result ends no turn on its own, so nothing answers it until you ask.
A mismatched call_id is never refused. A function_call_output whose call_id doesn’t match the outstanding call is accepted and kept as an item you can retrieve, but the model doesn’t see it, and it answers as if the tool never returned. Echo the call_id from response.function_call_arguments.done exactly.
For a tool declared as get_weather(location: string):
round trip
When a tool looks like it will take a while, such as an API lookup, the model says a short line as it calls it, and it stays quiet on quick or behind-the-scenes tools. The line arrives as the response’s message: aloud on an audio session, as response.output_text.delta on a text session. To control the line, set poly_speech on the tool, or mark one string parameter with "poly_spoken": true (see PolyAI extensions). To return knowledge base results, attach poly_knowledge to the function_call_output item. Tools and knowledge covers both.

Transcription sessions

A transcription session transcribes each turn and never answers it. Use it for dictation, captions or notes, where you don’t need a reply. You pay for each turn’s audio and its transcript, with no history, instructions or reply to bill. Open one the way OpenAI’s clients do, with intent=transcription on the connection, then configure it with a session.update of type: "transcription":
session.created reports type: "transcription", with no model, instructions or tools. Each turn goes like this:
  1. You stream input_audio_buffer.append frames.
  2. The server sends input_audio_buffer.speech_started, then input_audio_buffer.speech_stopped and input_audio_buffer.committed at the next pause. With turn_detection: null you get only committed, after you send input_audio_buffer.commit.
  3. conversation.item.added and conversation.item.done arrive for the turn, without a transcript yet.
  4. conversation.item.input_audio_transcription.delta frames stream the transcript, and .completed carries all of it with its usage in tokens. A turn that can’t be transcribed ends with .failed instead.
Differences from a realtime session:
  • A turn ends at a pause. Nothing is answered, so the model doesn’t confirm where a turn ends, and a pause mid-sentence splits it into two items. turn_detection.silence_duration_ms sets how long that pause is (400 ms by default). A realtime session ignores this field. To decide where turns end yourself, use turn_detection: null and send input_audio_buffer.commit.
  • Each turn is transcribed on its own, without earlier turns, and transcripts complete in the order the turns were spoken.
  • Set the language with audio.input.transcription.language, as an ISO 639 code such as es or en-US. transcription.model and prompt are accepted and echoed back, but not used.
  • response.create is refused with response_create_for_transcription_session.
  • A session keeps its type. A session.update with type: "realtime" on a transcription session is refused with invalid_parameter, and so is type: "transcription" on a realtime session that has taken a turn or has one in progress. An update without type applies to the current session. A realtime session with an empty conversation can still switch to transcription.
A .completed event, for a 1.2-second question:
Most of text_tokens is billed at the cached input rate.

Playback reports

When you speak replies with your own text-to-speech, only your client knows what the caller has heard. These three client events tell the server. They have no OpenAI equivalent, and are namespaced poly. the way field extensions are namespaced poly_. On a session the server speaks, it tracks playback itself and ignores them.
Carry the response_id from response.created through every report about that reply. Send a delta every 250 ms or so. The server builds what the caller has heard from those increments, so on a barge-in it knows where to cut the reply before stopped arrives. After stopped, the reply is kept in history as spoken_text, ending in a dash if dropped_ms says it was cut off. The reports also set how long the barge-in check runs: Dialog-RSN-1 confirms an interruption for as long as the reply is audible, so a backchannel two seconds into a reply gets checked like any other interruption.
Reports are optional. A client that sends none gets an estimate instead. The server treats a reply as audible for as long as it takes to say at 15 characters a second, and after a barge-in keeps the words it estimates were heard. If your text-to-speech runs slower or starts late, sound after the estimate ends is taken as an interruption without that check. The first report you send replaces the estimate for the rest of the session.
Streaming to your TTS shows a client that sends them.

PolyAI extensions

Extensions are additive fields on existing events, all prefixed poly_. The only new events are the client-sent playback reports, and the server sends no new event types.

Open the conversation

Set poly_first_assistant_message on the session to have the assistant open the call with fixed words, like Vapi’s firstMessage. Nothing is generated, so a greeting, a recording disclosure or an outbound opener is said exactly as written, with no wait for the model:
Set before the conversation has started, it’s said straight after session.updated, as an ordinary response: response.created, the output item with its audio transcript or text events, and response.done, with zero token usage. On an audio session the server speaks it in the session’s voice and language, a caller who barges in cuts it off, and history keeps what they heard. On a text session you get the text to speak. It becomes the first assistant turn, so the model carries on from it. It’s said even if the caller has already started talking. Don’t send response.create to start it. OpenAI clients often send one straight after session.update to have the assistant speak first. Here that request is answered as soon as the opener ends, so the model adds a second assistant turn of its own right after it. It’s said once. If you send the same value again, for example when you resend your whole session, it’s accepted and does nothing. History you seed with conversation.item.create comes before it, so seed first and set it last. A different value once the conversation has a turn of its own or a response has started is refused with invalid_request_error, as is blank text. A transcription session refuses it with unsupported_parameter, like every field that shapes a reply. null clears it. An assistant message you add with conversation.item.create is history only and is never spoken, so seeding earlier turns doesn’t read them aloud.

Events

Every event is a JSON text frame with a type and an event_id. Fields follow the OpenAI Realtime reference, and this page lists only what’s specific to Dialog-RSN-1.

Client to server

The server accepts the eleven standard client events and the three playback reports. Any other type is refused with unsupported_event_type.

Server to client

Not sent: rate_limits.updated, conversation.created, MCP events. Token usage arrives on response.done as response.usage.

Errors

Almost every failure answers with an error event and keeps the connection open. The exceptions close the socket with one of the close codes below.
Branch on code, never on message. error.event_id names the client frame the error is about, where there is one. type is invalid_request_error for something you sent and server_error for something that failed on our side. A server_error that ends a response also arrives on response.done with status failed. There, status_details.error carries the code in both code and type, for example generation_failed.

Close codes

Handling a refused handshake and a timed-out session:

Differences from OpenAI Realtime

The protocol is OpenAI Realtime, and these are the places a client written for OpenAI sees something different.
  • Turn timing comes from the model. Dialog-RSN-1 decides when the caller has finished, and you shape it in instructions. Only create_response is read from turn_detection. The timing fields and "type": "semantic_vad" are accepted and ignored, and idle_timeout_ms and interrupt_response: false are refused with unsupported_parameter. See Turn-taking and barge-in.
  • Truncating a text reply leaves history unchanged. On a reply you voice yourself, conversation.item.truncate validates the item and answers, but leaves history as it was, because only your text-to-speech knows which word a millisecond offset falls on. On a reply the server spoke, it cuts history as OpenAI does. Send playback reports to set history to the words heard.
  • Without playback reports, a text session estimates playback. The barge-in check and the history kept after a barge-in follow an estimate of how long the reply takes to say. Playback reports replace it with your real playback.
  • Voices are Cartesia voices. audio.output.voice takes a Cartesia voice id. An OpenAI voice name is accepted, and the deployment’s default voice speaks instead.
  • Function tools only. An MCP tool is refused with unsupported_parameter, and the model makes one call per turn, so parallel_tool_calls changes nothing.
  • One response at a time, always in the conversation. A response.create while a response is open is refused with conversation_already_has_active_response, and out-of-band responses (conversation: "none") are refused. A confirmed barge-in cancels the open response.
  • Transcription usage on a realtime session is a duration. conversation.item.input_audio_transcription.completed reports the audio’s duration, and the response’s tokens arrive on response.usage. A transcription session reports tokens.
  • History is bounded. From the tenth caller audio turn, older turns release their audio and keep their transcript. When older history is summarized or dropped to fit the context window, the first response.done after that lists the items the prompt now leaves out in poly_compacted_item_ids. The items stay in history. A conversation that still outgrows the window fails that response with context_length_exceeded, and the connection stays open.
  • No session resumption. A dropped connection has no handle to resume with. Reconnect and resend whatever context the new session needs.
  • Smaller wire details. Text and function-argument deltas can carry several tokens each, with the same concatenation. Transcription deltas are true increments. previous_item_id is set on conversation.item.* events and left off response.output_item.*. speech_started.audio_start_ms counts the audio the server has received, which can differ from wall-clock time. session.created and response.created omit optional fields that are not in effect (usage, max_output_tokens, metadata and others).

Example flows

Three conversations, event by event. Flows 1 and 2 use the default spoken replies. Flow 3 is a text session.

1. A typed question, answered on request

The session sets create_response: false, so nothing answers until you ask.
  1. Client → server: conversation.item.create, a user message: “What’s the capital of France?”
  2. Server → client: conversation.item.added, then conversation.item.done
  3. Client → server: response.create
  4. Server → client: response.created, response.output_item.added, response.content_part.added, then response.output_audio_transcript.delta and response.output_audio.delta frames, then response.output_audio.done, response.output_audio_transcript.done, response.content_part.done, response.output_item.done and response.done
Dialog-RSN-1: “The capital of France is Paris.”

2. A tool call

  1. Client → server: session.update with tools: [get_time, get_weather]
  2. The caller asks “What time is it right now?”, and the server starts a response.
  3. Server → client: response.function_call_arguments.done: get_time({}) with call_id call_000a14b52c2c4c9dae5a307369fad224, then response.done. If the tool looks slow, the model may say a short line in the same response.
  4. Client → server: conversation.item.create (function_call_output with the same call_id and the result {"time": "11:04 AM", "timezone": "CDT"}), then response.create
  5. Server → client: the spoken reply’s transcript and audio deltas, then response.done
Dialog-RSN-1: “It’s 11:04 AM.”

3. Canceling a reply

On a session with output_modalities: ["text"]:
  1. Client → server: response.create
  2. Server → client: response.created, then a few response.output_text.delta frames
  3. Client → server: response.cancel
  4. Server → client: response.done with status cancelled. Any open output item closes as incomplete.

Examples

Any OpenAI Realtime client works with this API, so there is no PolyAI SDK. Each guide has a public repo with its full example:
Last modified on November 24, 2026