Skip to main content

OpenAI Live Node

The OpenAI Live Node (OpenAI.Live) holds a full-duplex voice conversation with OpenAI GPT-Live. It streams its input to the model continuously and plays the model's audio on its output. The model handles turn-taking.

Number of inputs1 (mono)
Number of outputs1 (mono)

The node connects only while its graph runs, because GPT-Live sessions are billed by duration.

For React Native, openai-live-toolkit runs this node for you, with a provider and hooks for the session, tools and the transcript.


Transports​

webrtc (default on macOS, iOS, Android and Linux)​

The node sends a WebRTC offer to the Switchboard backend, which creates the GPT-Live session with the Switchboard app's OpenAI API key and returns OpenAI's answer. Audio and events then go directly between the device and OpenAI. The device needs no OpenAI API key.

A connection that stops answering, as when a phone loses its network, resumes when the network comes back. WebRTC gives up on it after about 30 s, and the node reconnects. A phone that leaves Wi-Fi for cellular keeps its connection: WebRTC moves it over. With standby, the node reconnects with the conversation so far. Otherwise a stored session (store) reconnects as a fork of the dropped one, which keeps the conversation once OpenAI has closed the dropped session. Until then OpenAI refuses the fork, and a new session starts. A fork that fails otherwise, as on a server error or a connection that doesn't open, is tried again every 2 s, and a new session starts after 3 such failures. The request to the backend fails after 5 s if it can't connect, and after 15 s in all. While the backend doesn't reply, as when the device is offline, it's tried every 2 s, so the session is back within seconds of the network; these tries don't count toward the 3.

A new session the backend refuses, as for an app without an OpenAI API key, is reported with one error event, and so is any session refused for a wrong appID or appSecret or a rejected OpenAI API key. The node then requests no other session until the graph is started again, startSession or resetSession is called, or instructions, voice, delegation or store changes. Its sessionDisconnected event has reconnecting false.

Requirements:

  • The SDK is initialized with your own Switchboard app's appID and appSecret. Register one to get them. See Credentials and billing.
  • macOS, iOS, Android or Linux. The webrtc transport isn't available on Windows yet; use websocket there.

websocket (default on Windows)​

The node connects directly to OpenAI with an OpenAI API key, set with apiKey or at extension initialization.

iOS​

The OpenAI extension requires iOS 14.0 or later; the rest of the SDK supports iOS 13.0. The extension has no x86_64 iOS simulator slice, so it runs in the simulator only on Apple silicon Macs.

Credentials and billing​

With the webrtc transport, the Switchboard backend creates each session with an OpenAI key held for your Switchboard app, so you can start without an OpenAI account.

  • Register your own app. GPT-Live needs your own Switchboard app: register at console.switchboard.audio/register and initialize the SDK with the app's appID and appSecret. GPT-Live works on a new app with no further setup.
  • Production apps. Before you ship, email hello@synervoz.com to put your Switchboard app on your own OpenAI key. See Your own OpenAI key.

When a limit is reached​

The backend refuses new sessions. The node emits one error event with type insufficient_quota and code project_spend_limit_exceeded, and requests no other session, as for any refused session. If your app reaches its limit, email hello@synervoz.com.

What counts toward the limit​

GPT-Live is metered per second of session, including silence and time the app spends in the background. End the session when the conversation is over, or set idleTimeoutMs so the node closes it during silences and reopens it when the user speaks. See Idle mode. Over webrtc, standbyTimeoutMs bills short silences at a lower rate. See Standby.

Your own OpenAI key​

Self-serve keys are coming soon in the console. Until then there are two ways to run on your own OpenAI account:

  • On your Switchboard app. We set your key on the backend, and the app keeps using webrtc and holds no OpenAI key. Email hello@synervoz.com to ask.
  • With the websocket transport. Set transport to websocket and pass apiKey. The session goes straight to OpenAI and is billed to your account. The key ships inside the app, where anyone with the app can extract it, so this suits development and internal builds.

Configuration​

transport (Optional)​

Type: String

"webrtc" or "websocket". Default: "webrtc" on macOS, iOS and Android, "websocket" elsewhere.

apiKey (Optional)​

Type: String

The OpenAI API key for the websocket transport. If not provided, the API key set at extension initialization is used. Ignored, with a warning, over webrtc.

model (Optional)​

Type: String

GPT-Live model ID. Default: "gpt-live-1.1".


Properties​

Changing instructions, voice or delegation starts a new session, which drops the conversation's context. The Responses delegation properties update the live session.

instructions​

Type: String

System instructions. Changing it starts a new session, dropping the conversation. Use the appendThinking action to tell a live session something without dropping it.

With short instructions, gpt-live-1.1 sometimes speaks before the user does, or reads out what appendThinking told it. Say that such context is background, not to be read out or spoken about unless the user asks.

voice​

Type: String

Output voice. Default: "marin".

delegation​

Type: String

Who does delegated work: "responses" (default), a Responses model, with function tools returned as toolCall events; or "client", the app, through delegationCreated events. tools need "responses": with "client" they aren't sent, and the node logs a warning.

responsesModel​

Type: String

Responses delegation model. Default: "gpt-5.5".

responsesInstructions​

Type: String

Responses delegation instructions.

tools​

Type: Array

Responses delegation tools: function tool definitions and hosted tools (e.g. web_search). Only sent with "responses" delegation. A call to a function tool also emits an event named after the tool, with the call's arguments as data. The model waits for each call's result; for a tool with "autoResult": true, the node sends {"ok": true} as the result after that event, so the app doesn't call submitToolResult. See Tool events.

toolChoice​

Type: String

Tool choice mode for Responses delegation: "auto" (default), "none" or "required".

store​

Type: Bool

Store the session with OpenAI so startSession can fork it later. Default: false. Changing it starts a new session.

Standby is available on new sessions only, so a fork has none.

forkSessionId​

Type: String

A stored session for the next graph start to continue, by the id from its sessionStarted event, so the conversation carries over when the graph is stopped and started again. That start waits for the session to finish closing, and clears this. If the fork is refused, a new session starts; if it fails otherwise, it's tried again, up to 3 times.

preRollMs​

Type: Int

Input from before startSession that a session started after endSession hears. Cover the time it takes to notice the user speaking. Default: 500, up to 3000.

catchUpRate​

Type: Float

How many times faster than realtime a session started after endSession gets the input it missed, until it's caught up. Default: 3, from 1.5 to 5. Over WebRTC, where audio goes out in real time, the input is sped up instead, with its pitch kept, at most 2x.

idleTimeoutMs​

Type: Int

Idle mode: closes the session after this long without conversation, and reopens it on speechStarted, continuing the conversation. Default: 0, off. See Idle mode.

wakeGraceMs​

Type: Int

Idle mode: the countdown of a woken session until the model replies or delegates, so a noise that woke it closes it again soon. Default: 5000, at most idleTimeoutMs; 0 uses idleTimeoutMs.

toolCallTimeoutMs​

Type: Int

Idle mode: how long it waits for the app to answer a tool call before closing the session anyway, logging a warning while it waits. Default: 60000; 0 waits as long as it takes.

standbyTimeoutMs​

Type: Int

Standby, over webrtc: OpenAI pauses inference after this long without conversation, billing less while paused, and resumes it when the user speaks, without reconnecting. In whole seconds, from 5000 to 60000. Default: 0, off. Turned on during a conversation, it applies from the next one. See Standby.

saveConversation​

Type: Bool

With standby: also save the conversation in a file in the SDK's temporary directory, so a start that forks one of its sessions continues it with standby after the app restarted too. There's one per app, so turn it on for one node. Default: false. See The saved conversation.

savedConversationMaxAgeMs​

Type: Int

How old a conversation saveConversation saved may get: an older one is deleted instead of continued, and a start that forks one of its sessions forks it. Default: 86400000 (24 h); 0 keeps it until a new conversation starts.

maxHeldContext​

Type: Int

Idle mode: how many appendInstructions, appendThinking and appendCommentary calls made while the session is closed are kept for the next session. Past that, the oldest are dropped, with a warning logged. Default: 100; 0 keeps none, so they fail while it's closed.

Inherits properties from its parent, SingleBusAudioProcessorNode.


Actions​

appendInstructions​

Appends trusted instructions to the live session. GPT-Live forgets the conversation so far when instructions are appended. To add context and keep the conversation, use appendThinking.

ParameterTypeDescription
textStringUp to 500 tokens.

appendThinking​

Adds quiet context the model can use but doesn't say.

ParameterTypeDescription
textStringUp to 500 tokens.
delegationId (Optional)StringClient delegation this belongs to; omit for general context.

appendCommentary​

Adds content for the model to say aloud. The model may paraphrase it.

ParameterTypeDescription
textStringUp to 500 tokens.
delegationId (Optional)StringClient delegation this answers; omit for general context.

submitToolResult​

Returns a tool call's result. The Responses model continues once all of its calls are answered.

ParameterTypeDescription
callIdStringThe id from the toolCall event.
outputJsonStringThe result as a JSON string.

submitToolError​

Returns a tool call's error.

ParameterTypeDescription
callIdStringThe id from the toolCall event.
errorJsonStringThe error as a JSON string.

muteInput / unmuteInput​

Stops and resumes the model hearing the input. They work whenever the graph is running, with or without a session: sessions the node starts while the input is muted are muted too, and speech doesn't keep a session open or wake one idle mode closed.

speechStarted​

The user started speaking, for example from a Silero.VAD node's speechStarted. Unless the input is muted, idle mode doesn't close the session until speechEnded, and a session it closed reopens, continuing the conversation.

speechEnded​

The user stopped speaking, for example from a Silero.VAD node's speechEnded. Restarts the idle countdown, unless the input is muted.

resetSession​

Starts a new session. Fails when the graph isn't running.

forgetConversation​

Forgets the conversation, so the next session starts a new one, and deletes the one saveConversation saved. Works while the graph is stopped too, as when a user signs out.

endSession​

Closes the session without starting another, so nothing is billed while the graph keeps running. startSession opens the next one. Fails when the graph isn't running.

startSession​

Starts a new session. After endSession, it first hears the input since preRollMs before this call, sent at catchUpRate until it catches up. Fails when the graph isn't running.

ParameterTypeDescription
forkSessionId (Optional)StringThe id of a stored session (store) to continue, from its sessionStarted event. It must have closed, e.g. with endSession; forking the live session starts a new one. The fork keeps its instructions and voice, and has no standby. If it's refused, a new session starts; if it fails otherwise, it's tried again, up to 3 times.

pauseOutput / resumeOutput​

Silences and resumes playback locally. The model keeps talking while paused.

Inherits actions from its parent, SingleBusAudioProcessorNode.


Events​

EventDataDescription
sessionStartingA connection attempt began (initial start or reconnect).
sessionStartedsessionId, continued, forkedThe session is ready. continued is true when it continues a conversation: it forked a stored session (forkSessionId, startSession with a fork, an idle wake, a reconnect), or, with standby, started with the conversation so far (an idle wake, a reconnect). It's false for a new conversation, also one started after a refused fork. forked is true only for a fork, which holds everything the stored session was told; a session started with the conversation so far gets the current instructions, and only as much of the conversation as fits.
sessionClosedreasonThe server closed the session. A new one is started unless the close was requested.
usageUpdatedseconds, activeSeconds, pausedSeconds, contextUsageRatioThe session's running usage, about every 15 s: the session time billed so far, the parts of it billed while inference ran and while standby paused the session, and how full the model's context window is, from 0 to 1. Without standby, activeSeconds is all of seconds.
sessionIdlesessionIdIdle mode closed the session after idleTimeoutMs without conversation. speechStarted reopens it.
sessionWokenspeechStarted reopened the session idle mode closed, continuing it.
sessionPausedStandby paused inference after standbyTimeoutMs without conversation. The session stays connected.
sessionResumedThe user spoke, and the paused session resumed.
sessionDisconnectedreason, reconnectingThe connection dropped, or the session didn't start within 15 s (over WebRTC, also when the connection doesn't open within 5 s of the server's answer). A reconnect is scheduled; a dropped session or a failed connect is first retried right away, and a backend that doesn't reply is tried every 2 s. With standby, the reconnect carries the conversation so far; without it, a dropped stored session is forked first. A refused fork starts a new session right away; a fork that fails otherwise is tried again every 2 s, and gives way to a new session after 3 failures. A refused new session isn't tried again until the graph starts again, a session is asked for or a session property changes. reason is dropped, unreachable (the backend didn't reply, as when the device is offline), refused or unauthorized (a wrong appID or appSecret, or a rejected OpenAI API key). unreachable and unauthorized come only over webrtc: over websocket a connection that fails, also while offline, is dropped, and only a fork OpenAI refuses is refused. reconnecting is false when the node requests no other session by itself.
inputTranscriptDeltadelta, startMs, endMsFragment of what the model heard.
outputTranscriptDeltadelta, startMs, endMsFragment of what the model said.
delegationCreateddelegationId, targetThe model delegated work. For client delegation, answer with appendCommentary or appendThinking.
toolCallcallId, name, argumentsJson, delegationIdThe Responses model called a function tool; answer with submitToolResult, unless the tool has autoResult. The tool's own event follows.
errortype, code, messageOpenAI or the connection reported an error. type is OpenAI's error type, also when the backend passes on OpenAI's refusal of a session over WebRTC, and transport_error for a connection that failed otherwise.

Inherits events from its parent, SingleBusAudioProcessorNode.

Tool events​

Each function tool in tools has an event named after it, emitted right after toolCall. Its data is the call's parsed arguments plus callId and delegationId. The event is listed with the tool's description and its parameters as data fields, so a data connection can drive an action straight from a tool call:

{
"dataConnections": [
{ "source": "live/events/play_station", "destination": "radio/actions/load" }
]
}

Name the tool's parameters like the action's (here url), so they reach it.

A function tool with "autoResult": true is answered by the node once the event's listeners return, with {"ok": true} and the arguments, so the Responses model carries on without submitToolResult. Use it for tools that only act, like play or pause. The model isn't told if an action the event triggers fails, since actions called by data connections only log their errors; for a tool whose failure matters, leave autoResult off and answer with submitToolResult. Arguments that aren't a JSON object are answered with {"ok": false, "error": ...}, and a call a listener answered first isn't answered again. autoResult isn't sent to OpenAI.

Listeners, and the actions data connections call, run on the session's thread before the call is answered, so they should return quickly.

A tool named like a built-in event, such as error, gets no event of its own; its calls only reach toolCall.

Tool events and autoResult come from the tools the node is created with. Setting tools later changes what the model can call, but tools added then only reach toolCall and are answered with submitToolResult.


Idle mode​

GPT-Live sessions are billed by duration, including silence. With idleTimeoutMs set, the node closes a session nobody has talked in for that long and reopens it when the user speaks, so a long drive isn't billed while nobody talks.

  • The countdown restarts when a session starts, on transcripts, on delegations, on speechEnded while the input is unmuted, and when a tool call starts or is answered.
  • It doesn't close the session while the user speaks with the input unmuted (between speechStarted and speechEnded), or while the backend works on a delegation, from its start until its response ends with no tool call left to answer.
  • A tool call the app hasn't answered is waited for up to toolCallTimeoutMs from the call, with a warning logged. After that the session closes anyway, and answering the call fails.
  • When it closes the session it emits sessionIdle. Input keeps being buffered, so the next session hears preRollMs from before the wake and catches up at catchUpRate.
  • Context added while the session is closed, with appendInstructions, appendThinking or appendCommentary, is sent to the next session when it starts, as general context, since a delegationId belongs to the closed session. Up to maxHeldContext are kept, the newest. endSession drops them.
  • speechStarted reopens the session as a fork of the one closed, emitting sessionWoken. With standby, it opens a new session with the conversation so far instead. Until the model replies or delegates, the countdown is wakeGraceMs.
  • Sessions are stored (store) while idleTimeoutMs is set, since only a stored session can be forked. With standby they aren't, unless the conversation began with a fork.
  • Changing instructions, voice or delegation, or resetSession, makes the next wake start a new session, since a fork keeps the stored session's settings.
  • endSession isn't undone by speechStarted; startSession opens the next session.

Speech comes from a voice activity detector on the input, through a splitter:

{
"nodes": [
{ "id": "vadSplitter", "type": "Switchboard.BusSplitter" },
{ "id": "vad", "type": "Silero.VAD", "config": { "threshold": 0.5, "minSilenceDurationMs": 500 } },
{ "id": "live", "type": "OpenAI.Live", "config": { "idleTimeoutMs": 15000 } }
],
"connections": [
{ "sourceNode": "inputNode", "destinationNode": "vadSplitter" },
{ "sourceNode": "vadSplitter", "sourceBusIndex": 0, "destinationNode": "live" },
{ "sourceNode": "vadSplitter", "sourceBusIndex": 1, "destinationNode": "vad" },
{ "sourceNode": "live", "destinationNode": "outputNode" }
],
"dataConnections": [
{ "source": "vad/events/speechStarted", "destination": "live/actions/speechStarted" },
{ "source": "vad/events/speechEnded", "destination": "live/actions/speechEnded" }
]
}

Any voice wakes the session, and some noises do. Echo cancellation keeps the node's own output and other audio the app plays out of the detector.

Standby​

Over webrtc, with standbyTimeoutMs set, OpenAI pauses inference after that long without a transcript, emitting sessionPaused, and resumes it about 0.5 s after the user starts speaking, emitting sessionResumed. The connection stays open, so there's no reconnect and no new session to pay for. Paused time is billed at a lower rate than active time, but it's still billed: for longer silences, use it with idle mode, with idleTimeoutMs above standbyTimeoutMs. Standby then covers the short silences, and idle mode closes the session in the long ones.

  • The session starts active, and pauses after standbyTimeoutMs without conversation. It doesn't pause while a tool call waits for its result.
  • A tool result that comes after the session paused isn't spoken, and the model doesn't bring it up later. OpenAI pauses as soon as the backend finishes, so a result finishing more than about standbyTimeoutMs after the model last spoke is lost. Set standbyTimeoutMs above the slowest tool; the node logs a warning when it pauses with nothing said since a tool result.
  • Muted input doesn't wake a paused session.
  • Standby is available on new sessions only, so idle wakes and reconnects start a new session with the conversation so far as its input: what was heard and said, each tool call, and what appendInstructions and appendThinking added. A tool call goes in without its result, since that's the app's data; what the model said about it is kept. OpenAI takes up to 128 messages within 8,192 tokens of it, so the newest are kept. The session gets the current instructions, voice and tools, and sessions needn't be stored.
  • A session with the conversation that's rejected, or that fails to start 3 times, gives way to a new session without it: the conversation is dropped, not shortened.
  • A start that forks one of the conversation's own sessions (forkSessionId, or startSession with a fork), as after a graph stop or endSession, continues it the same way, with standby, instead of forking. The node keeps the conversation in memory while standby is on, until a new conversation starts or standbyTimeoutMs is set to 0. With saveConversation it's also kept in a file, so this works after the app restarted too. See The saved conversation.
  • A fork of a session the node doesn't have the conversation of, as one from another device or older than the saved one, is a fork: it has no standby, and its wakes and reconnects fork too. The same goes for a conversation under way when standby is turned on, which the node didn't keep: standby starts with the next conversation.
  • resetSession, forgetConversation, a start without a fork, and changing instructions, voice, delegation or store start the conversation over.

The saved conversation​

With saveConversation, the node saves the conversation to OpenAI.Live/conversation.json in the SDK's temporary directory (tempDirPath) about a second after each change, and when the graph stops or endSession is called.

  • Where. By default, the app's own temporary directory: tmp/ on iOS, which backups leave out, and the cache directory on Android. Other apps can't read either, and the OS encrypts them at rest. The file isn't encrypted on top of that. Where the temporary directory is shared, as /tmp on Linux, the node makes its folder readable by the user only and creates the file for the user only, and follows no symlink there.
  • What. What was heard and said, each tool call's name and arguments without its result, and the context the app added. Arguments and context can be personal, such as places or names.
  • One per app. Every OpenAI.Live node in the process shares the file, and on Linux every process of the user does too, so turn saveConversation on for one node. A node without it leaves the file alone, except for its forgetConversation action.
  • How long. A new conversation, resetSession, forgetConversation, setting standbyTimeoutMs to 0 or turning saveConversation off deletes it, and so does savedConversationMaxAgeMs (24 h by default). Call forgetConversation when a user signs out, or, without an engine, the OpenAI extension's forgetConversation action (Switchboard.callAction("OpenAI", "forgetConversation")), and say in your privacy policy that the conversation is kept on the device if that applies to you.