SpyBara
Go Premium

Documentation 2026-10-13 23:00 UTC to 2026-10-14 23:59 UTC

10 files changed +311 −32. View all changes and history on the product overview
2026
Mon 19 06:01 Sun 18 23:00 Sat 17 22:57 Fri 16 23:02 Thu 15 23:00 Wed 14 23:59 Tue 13 23:00 Sun 11 23:59 Sat 10 23:58 Fri 9 22:57 Thu 8 23:01 Wed 7 23:57 Tue 6 22:58 Mon 5 22:59 Sun 4 22:58 Fri 2 23:58 Thu 1 22:59

guides/live.md +8 −3

Details

38 38 

39GPT-Live voice sessions are billed by duration, per second. See the [model pricing](https://developers.openai.com/api/docs/models/gpt-live-1) for the current rate. Backend model and tool usage is billed separately. See [Cost optimization](https://developers.openai.com/api/docs/guides/voice-latency-cost?api=live) for usage accounting and ways to reduce costs.39GPT-Live voice sessions are billed by duration, per second. See the [model pricing](https://developers.openai.com/api/docs/models/gpt-live-1) for the current rate. Backend model and tool usage is billed separately. See [Cost optimization](https://developers.openai.com/api/docs/guides/voice-latency-cost?api=live) for usage accounting and ways to reduce costs.

40 40 

41## Sample apps and client SDKs

42 

43- **[OpenAI Live Console](https://github.com/openai/openai-live-console)** is a local sample app for exploring GPT-Live conversations, delegation, and backend tool activity.

44- **[Switchboard OpenAI Live Toolkit](https://github.com/switchboard-sdk/openai-live-toolkit)** is a third-party React Native SDK for building GPT-Live applications on iOS.

45 

41## Choose a connection46## Choose a connection

42 47 

43- **[WebRTC](https://developers.openai.com/api/docs/guides/voice-webrtc?api=live)** for browser voice applications. It carries microphone and speaker audio on media tracks and JSON events on a data channel.48- **[WebRTC](https://developers.openai.com/api/docs/guides/voice-webrtc?api=live)** is recommended for audio connections in browser, mobile, and server applications. It carries audio on media tracks and JSON events on a data channel.

44- **[WebSockets](https://developers.openai.com/api/docs/guides/voice-websockets?api=live)** for server-side audio integrations. One connection carries audio and control events.49- **[WebSockets](https://developers.openai.com/api/docs/guides/voice-websockets?api=live)** are a supported alternative. One connection carries audio and control events.

45- **[Telephony and SIP](https://developers.openai.com/api/docs/guides/voice-sip?api=live)** for connecting phone calls.50- **[Telephony and SIP](https://developers.openai.com/api/docs/guides/voice-sip?api=live)** for connecting phone calls.

46 51 

47To monitor or control an existing session from your backend, add a [server-side connection](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live). This additional WebSocket is called a **sideband**; audio continues through the session’s primary connection.52To monitor or control an existing session from your backend, add a [server-side connection](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live). This additional WebSocket is called a **sideband**; audio continues through the session’s primary connection.

48 53 

49## Partner integrations54## Partner integrations

50 55 

51If your application already uses **LiveKit**, **Twilio**, **Telnyx**, or **Daily/Pipecat**, follow the [partner integration overview](https://developers.openai.com/api/docs/guides/live-partner-integrations) to connect its existing calls or audio streams to GPT-Live.56If your application already uses **LiveKit**, **Twilio**, **Telnyx**, **Bandwidth**, or **Daily/Pipecat**, follow the [partner integration overview](https://developers.openai.com/api/docs/guides/live-partner-integrations) to connect its existing calls or audio streams to GPT-Live.

52 57 

53## Continue building58## Continue building

54 59 

Details

71 71 

72Set `delegation.responses.parallel_tool_calls` to `true` to allow multiple tool calls in a response, or `false` for sequential calls. Your application executes custom functions and checks their dependencies and required approvals. These settings apply after GPT-Live delegates; use the [live prompt](https://developers.openai.com/api/docs/guides/live-prompting#delegation) to guide when it should delegate.72Set `delegation.responses.parallel_tool_calls` to `true` to allow multiple tool calls in a response, or `false` for sequential calls. Your application executes custom functions and checks their dependencies and required approvals. These settings apply after GPT-Live delegates; use the [live prompt](https://developers.openai.com/api/docs/guides/live-prompting#delegation) to guide when it should delegate.

73 73 

74The Responses configuration requires a backend `model` at creation. It supports `function` definitions and `web_search` entries in `tools`. It also exposes `max_output_tokens` (at least 16 when set), `service_tier`, and the `reasoning` and `text` settings supported by the selected backend model. See [Reduce backend latency](#reduce-backend-latency) for settings you can tune.74The Responses configuration requires a backend `model` at creation. In addition to the tools below, it exposes `max_output_tokens` (at least 16 when set), `service_tier`, and the `reasoning` and `text` settings supported by the selected backend model. See [Reduce backend latency](#reduce-backend-latency) for settings you can tune.

75 75 

76If [Fast mode](https://developers.openai.com/api/docs/guides/fast-mode) is available for your model and project, consider it for latency-sensitive calls. For GPT-Live, select it with `delegation.responses.service_tier: "priority"`.76If [Fast mode](https://developers.openai.com/api/docs/guides/fast-mode) is available for your model and project, consider it for latency-sensitive calls. For GPT-Live, select it with `delegation.responses.service_tier: "priority"`.

77 77 


81 81 

82These settings use familiar Responses concepts, but Live supports a subset of the standalone Responses API. Live supplies conversation context and initiates delegated work. Configure the backend through the session; the Live `response.create` command uses that configuration and does not accept a standalone Responses request body.82These settings use familiar Responses concepts, but Live supports a subset of the standalone Responses API. Live supplies conversation context and initiates delegated work. Configure the backend through the session; the Live `response.create` command uses that configuration and does not accept a standalone Responses request body.

83 83 

84### Add hosted tools

85 

86Add [web search](https://developers.openai.com/api/docs/guides/tools-web-search), [file search](https://developers.openai.com/api/docs/guides/tools-file-search), [Code Interpreter](https://developers.openai.com/api/docs/guides/tools-code-interpreter), [hosted shell](https://developers.openai.com/api/docs/guides/tools-shell), or [image generation](https://developers.openai.com/api/docs/guides/tools-image-generation) to `delegation.responses.tools`. Follow the linked guides for configuration, model support, and required resources. Responses runs these tools and returns their results automatically.

87 

88For shell, use a hosted container, optionally with [Skills](https://developers.openai.com/api/docs/guides/tools-skills). Local shell requires your application to run calls. Live does not support shell `domain_secrets`.

89 

90### Add MCP and other tools

91 

92Responses delegation also supports [MCP](https://developers.openai.com/api/docs/guides/tools-connectors-mcp), [tool search](https://developers.openai.com/api/docs/guides/tools-tool-search), [programmatic tool calling](https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling), [functions and custom tools](https://developers.openai.com/api/docs/guides/function-calling), [computer use](https://developers.openai.com/api/docs/guides/tools-computer-use), [local shell](https://developers.openai.com/api/docs/guides/tools-shell#local-shell-mode), and [apply patch](https://developers.openai.com/api/docs/guides/tools-apply-patch). Use the linked guides for setup. Return application results and approval decisions through the [Live continuation flow](#return-tool-results-and-approvals).

93 

94Live passes the MCP `authorization` and `headers` you provide to Responses, but doesn't include those values in the session configuration it sends back to your application. You don't need to resend them when updating other settings, such as instructions. If you replace `delegation.responses.tools`, include the MCP credentials again.

95 

96### Handle configuration errors

97 

98Live validates Responses settings asynchronously after startup and when the settings change. `session.started` and `session.updated` do not wait for this validation. Listen for an `error` with code `responses_validation_failed` and check its message for the unsupported setting or inaccessible resource. The session stays open and the settings are not rolled back; correct them with `session.update`.

99 

100Validation does not guarantee later tool execution. Resource access and tool availability can change, so continue handling backend errors during delegated work. Configuring hosted tools can initialize resources such as containers during validation.

101 

84## Steer the live conversation from your application102## Steer the live conversation from your application

85 103 

86Responses delegation manages the backend workflow, but your application can still send context directly to the GPT-Live model. If you monitor the call through a sideband WebSocket or the main event connection, you can use `session.instructions.append`, `session.thinking.append`, or `session.commentary.append` with `delegation_id: null`. For example, a transcript-based guardrail can append an instruction to redirect the conversation. This steers the live model; it does not change the Responses backend prompt or cancel work already in progress.104Responses delegation manages the backend workflow, but your application can still send context directly to the GPT-Live model. If you monitor the call through a sideband WebSocket or the main event connection, you can use `session.instructions.append`, `session.thinking.append`, or `session.commentary.append` with `delegation_id: null`. For example, a transcript-based guardrail can append an instruction to redirect the conversation. This steers the live model; it does not change the Responses backend prompt or cancel work already in progress.


108 126 

109When the top-level event type is `response.event`, dispatch on `envelope.event.type`. Save the outer `delegation_id` to associate the backend event with its delegation. Your handler may also receive nested Responses lifecycle events beyond those shown here.127When the top-level event type is `response.event`, dispatch on `envelope.event.type`. Save the outer `delegation_id` to associate the backend event with its delegation. Your handler may also receive nested Responses lifecycle events beyond those shown here.

110 128 

129Hosted tool progress, citations, files, and generated images arrive in these nested events. Read individual output-item and partial-image events to collect results; the forwarded lifecycle snapshots omit their output arrays. Use the corresponding Responses file or container APIs to download files. For large image or artifact events, use a WebSocket or sideband connection because a WebRTC data channel's message limit can be smaller.

130 

111Live speech and delegated work continue independently. A completed backend response does not itself mean the user heard the answer. Use the Live output transcript and audio for the spoken part of the interaction.131Live speech and delegated work continue independently. A completed backend response does not itself mean the user heard the answer. Use the Live output transcript and audio for the spoken part of the interaction.

112 132 

133### Return tool results and approvals

134 

135For tools that need application input, collect completed calls from nested `response.output_item.done` events. Perform the authorized action or approval check, then send the matching item with `response.item.create`:

136 

137| Received item | Result item |

138| --------------------------------------------- | ---------------------------------------------------------------------- |

139| `function_call` | `function_call_output` |

140| `custom_tool_call` | `custom_tool_call_output` |

141| `computer_call` | `computer_call_output` |

142| Local `shell_call` | `shell_call_output` |

143| `apply_patch_call` | `apply_patch_call_output` |

144| `tool_search_call` with `execution: "client"` | `tool_search_output` with `execution: "client"` and discovered `tools` |

145| `mcp_approval_request` | `mcp_approval_response` |

146 

147Match results to calls with `call_id`. For MCP approval decisions, instead set `approval_request_id` to the approval request's `id`, and set `approve` to `true` or `false`. A completed `mcp_call` does not itself require a client result. Follow each tool's result schema, including `caller` metadata for programmatic function calls and any required computer safety acknowledgments.

148 

149Submit results for every pending call, then send `response.create`. Appending an item alone does not resume the backend. Missing results produce `tool_outputs_required`, or `function_call_outputs_required` when only function results are missing. Duplicate results and mismatched result types are rejected.

150 

151You can submit results and request continuation before the current backend response completes. An accepted `response.create` waits for that completion; do not resend it. If the backend emits more calls afterward, submit their results and send another `response.create`.

152 

113 153 

114 154 

115 155 


301 341 

302Keep large structured payloads, lengthy tool output, and Markdown intended for display in the backend. Give GPT-Live the relevant facts and let it choose how to say them. A concise tool result doesn't need an additional model call to rewrite it for speech.342Keep large structured payloads, lengthy tool output, and Markdown intended for display in the backend. Give GPT-Live the relevant facts and let it choose how to say them. A concise tool result doesn't need an additional model call to rewrite it for speech.

303 343 

304With client delegation, [return the result directly to GPT-Live](https://developers.openai.com/api/docs/guides/live-delegation?delegation-mode=client#receive-a-client-delegation). With Responses delegation, follow the [function-result flow](https://developers.openai.com/api/docs/guides/live-delegation?delegation-mode=responses#complete-a-client-actionable-function-call) to continue backend work.344With client delegation, [return the result directly to GPT-Live](https://developers.openai.com/api/docs/guides/live-delegation?delegation-mode=client#receive-a-client-delegation). With Responses delegation, [return any required tool results or approvals](https://developers.openai.com/api/docs/guides/live-delegation?delegation-mode=responses#return-tool-results-and-approvals) to continue backend work. Hosted tools continue without application-supplied results.

305 345 

306## Send the right kind of update346## Send the right kind of update

307 347 


522 562

523 563 

524 564 

525With Responses delegation, configure a vision-capable backend model. Queue a supported Responses image input item with `response.item.create`, then send `response.create` to run or resume backend work. Return all required pending function results before continuing. See [Handle Responses delegation](https://developers.openai.com/api/docs/guides/live-delegation?delegation-mode=responses#handle-responses-delegation).565With Responses delegation, configure a vision-capable backend model. Queue a supported Responses image input item with `response.item.create`, then send `response.create` to run or resume backend work. Return all required pending tool results and approvals before continuing. See [Handle Responses delegation](https://developers.openai.com/api/docs/guides/live-delegation?delegation-mode=responses#handle-responses-delegation).

526 566 

527 567

528 568 

Details

79 79 

80### Split conversation and backend instructions80### Split conversation and backend instructions

81 81 

82Move conversation style and delegation guidance into `session.instructions`. Move business rules and tool-use instructions into `delegation.responses.instructions`. For a backend you run yourself, keep those rules in its existing prompt.82When migrating a Realtime assistant to GPT-Live, start with your existing prompt. Move speaking style and turn-taking instructions into the Live prompt, and add rules for when to delegate. Keep task instructions and tool-use procedures in the backend prompt.

83 83 

84**Before: one Realtime prompt**84If you're adding voice to a text agent, [reuse its existing backend prompt](https://developers.openai.com/api/docs/guides/live-delegation#start-with-your-existing-backend-prompt) and write a Live prompt for the spoken interaction.

85 

86#### Keep the experience consistent

87 

88Keep your assistant’s role, audience, and purpose, and preserve the details that shape the conversation:

89 

90- Greetings, introductions, and spoken disclosures, including any required wording or order.

91- Language and pronunciation requirements, such as “Speak English.”

92- Personality, warmth, empathy, formality, and pacing.

93- The level of detail in spoken answers and examples that show the intended style.

94- How it acknowledges the user, pauses to listen, and responds to interruptions.

95 

96A short Live prompt can still ask for detailed spoken answers.

97 

98#### Write the Live prompt

99 

100Use the [recommended prompt structure](https://developers.openai.com/api/docs/guides/live-prompting#recommended-prompt-structure) for the assistant's identity, speaking style, and conversational behavior. Keep `Backchannel policy` and `Interruption policy` to describe listening acknowledgments and how the assistant responds when someone speaks over it.

101 

102Live needs to know what the backend can do so it can delegate accurately. Describe those capabilities in plain language. Function names and tool schemas belong in the backend, which handles tool calls.

103 

104Under `Delegation policy`, adapt these sections to your application:

105 

106- **`Backend tools`:** List the capabilities your application supports, using the same terms as your existing prompt. For example: “Check appointment availability and schedule callbacks.”

107- **`Delegate to the backend when`:** State when to use those capabilities, such as “Delegate when the user asks to schedule a callback.” Include corrections, confirmations, and new details needed for work already in progress.

108- **`Do not delegate to the backend when`:** Describe what Live can handle directly, such as a greeting, a brief clarification, or repeating information from the conversation or a still-current backend result.

109 

110Describe how Live should communicate progress, ask the backend's next question, or relay a verified result.

111 

112If your assistant ends calls, give Live instructions for the farewell and for delegating the end-call request. Put the actual end-call tool and sequence in the backend. For example, a procedure might require the application to finish playing the farewell, disconnect, cancel pending calculations, and block further saves. Live handles the farewell and delegation; the backend and application handle those remaining steps.

113 

114#### Adapt your backend prompt

115 

116Use your original prompt as the starting point. Keep its wording, order, examples, and structure wherever they still apply. If it mainly describes tasks, most of it can stay as written.

117 

118Keep instructions here for:

119 

120- Interpreting the user's request, applying corrections, collecting missing information, and tracking task progress.

121- Using domain facts, checking eligibility, and consulting the records or services that establish the answer.

122- Following procedures for searches, updates, confirmations, routing, transfers, callbacks, and other supported actions.

123- Applying safety, privacy, and authorization rules, handling failures, and restricting actions after a transfer or call end.

124- Preparing accurate facts, task status, and the next question for Live to communicate.

125 

126Move instructions for voice, greetings, turn-taking, and when to delegate into the Live prompt. Adapt instructions that assume the backend speaks directly to the user so it returns information for Live instead. Keep safety and privacy limits in both prompts wherever they affect what that model may say, ask, or do.

127 

128Keep function names, argument requirements, and tool-use procedures in backend instructions. Put tool definitions in your backend's tool configuration. Your application executes its tools and enforces permissions, argument validation, and required confirmations against the current task state.

129 

130Use the backend model to understand requests, corrections, and confirmations from the conversation. Regular expressions, keyword lists, and exact-phrase rules miss meaning that depends on earlier speech or a correction. For example, “yes” may confirm a slot, acknowledge a question, or refer to an earlier suggestion.

131 

132Preserve the rules for work already running when the caller interrupts or the call is transferred or ended. Stopping speech leaves backend work running. If the caller asks to cancel, the backend and application need to handle that cancellation and report its outcome to Live.

133 

134#### Resolve conflicting instructions

135 

136Review the original prompt and both new prompts for instructions that disagree. Combine repeated instructions, and keep specific conditions and exceptions alongside the rules they qualify. Check permissions, question limits, confirmations, and what may happen after a call ends.

137 

138Separate what the user wants from what has happened. If a caller changes Friday to Thursday, the latest request tells the backend to work on Thursday. The booking record tells it whether Friday was already booked. Your existing confirmation and authorization rules determine which changes it can make next.

139 

140Resolve product choices with the people responsible for them before using the prompts. For example, if one instruction says to continue a booking and another says to stop all work when the caller interrupts, decide which behavior the application should provide. Record the agreed behavior in the prompts and the application logic that enforces it.

141 

142Check that each required action has an implementation. Ending a call requires an end-call capability; a spoken goodbye alone leaves the connection open. If a capability is missing, decide whether to implement it or agree on a supported alternative with the team that owns the workflow.

143 

144#### Review both prompts

145 

146Compare both prompts with the original and check that every required behavior has a place:

147 

148- The Live prompt preserves the assistant's identity, vocabulary, speaking style, disclosures, and interruption behavior.

149- The backend prompt preserves the task procedures, facts, conditions, examples, permissions, and failure handling.

150- Delegation covers new requests, corrections, confirmations, and requests that combine conversation with task information.

151- The two prompts agree on question limits, when an action is confirmed, and how to handle continuing work, cancellation, transfers, and call ending.

152 

153Put the Live prompt in `session.instructions`. For Responses delegation, put the backend prompt in `session.delegation.responses.instructions`; for client delegation, keep it in your existing agent's configuration. Keep tool definitions with the backend. See [Delegation and tools](https://developers.openai.com/api/docs/guides/live-delegation) for configuration and result handling.

154 

155<details>

156<summary>Example: split an appointment prompt</summary>

157 

158This appointment assistant already has `check_availability` and `book_appointment` tools. Its original prompt combines speaking style with a booking procedure. The split keeps the same greeting, confirmation requirements, and correction handling.

159 

160**Original prompt**

85 161 

86```text162```text

87Help callers book appointments. Speak briefly. Check availability with the tool,163You are Rowan, the appointment assistant for Northstar Repairs.

88ask the caller to confirm a slot, then book it. Never claim an unverified booking.164Speak English, calmly and briefly. Greet the caller once with:

165"Hello, this is Rowan from Northstar Repairs. How can I help?"

166Use brief listening acknowledgments. Stop speaking when interrupted.

167 

168Help callers find and book appointments. Ask for the preferred date

169and time zone if missing, then use check_availability.

170Offer only returned slots. Ask the caller to confirm the exact slot

171before calling book_appointment.

172If the caller changes the date, time zone, or slot, discard the earlier

173confirmation and check availability again.

174Report a booking only after the tool confirms success. If the outcome

175is unclear, say it is unconfirmed and do not retry automatically.

89```176```

90 177 

91**After: GPT-Live conversation instructions**178**Live prompt**

92 179 

93```text180```text

94Help callers book appointments. Keep spoken replies brief. Delegate availability181You are Rowan, the appointment assistant for Northstar Repairs.

95checks and booking requests. Ask the caller to confirm the proposed slot.182Speak English, calmly and briefly. Greet the caller once with:

96Only announce a booking when the backend reports that it succeeded.183"Hello, this is Rowan from Northstar Repairs. How can I help?"

184 

185Backchannel policy: Use brief listening acknowledgments.

186 

187Interruption policy: Stop speaking when interrupted and listen.

188 

189Delegation policy:

190Backend tools:

191- Appointments: check available times and book appointments.

192 

193Delegate to the backend when:

194- The caller wants to find or book an appointment.

195- The caller supplies or corrects a date, time zone, or slot, or

196 answers a booking question, including confirming a slot.

197 

198Do not delegate to the backend when:

199- The caller greets you or asks you to repeat a still-current result.

200- You need a brief clarification to understand what they are asking.

201 

202Relay the backend's questions and results. Offer only slots it returns.

203Do not claim a booking is complete until the backend confirms success.

204If the backend reports an unclear outcome, say it is unconfirmed.

97```205```

98 206 

99**After: backend instructions**207**Backend prompt**

100 208 

101```text209```text

102Use the appointment tools to check current availability. Before booking, verify210Help callers find and book appointments for Northstar Repairs.

103that the caller confirmed the exact slot and still has permission to book it.211Ask for the preferred date and time zone if missing, then use

104Apply the latest correction. Return verified availability, booking, or failure212check_availability. Offer only returned slots.

105status with the date, time, and time zone.213Ask the caller to confirm the exact slot before calling book_appointment.

214If the caller changes the date, time zone, or slot, discard the earlier

215confirmation and check availability again.

216Report a booking only after the tool confirms success. If the outcome

217is unclear, report it as unconfirmed and do not retry automatically.

218 

219Return the available slots, booking outcome, or next question for the

220voice assistant to communicate. Interpret the caller's latest answers

221and corrections using the conversation and current task state.

106```222```

107 223 

108Enforce confirmation and permission checks in your application before executing a tool. Prompt instructions guide the models; they do not enforce those checks. See [Prompting voice models](https://developers.openai.com/api/docs/guides/live-prompting) for prompt design.224</details>

109 225 

110### Adapt your function handlers226### Adapt your function handlers

111 227 

Details

11| [LiveKit](https://docs.livekit.io/agents/models/realtime/plugins/gpt-live) | Build GPT-Live voice agents with LiveKit’s OpenAI plugin. |11| [LiveKit](https://docs.livekit.io/agents/models/realtime/plugins/gpt-live) | Build GPT-Live voice agents with LiveKit’s OpenAI plugin. |

12| [Twilio](https://www.twilio.com/en-us/blog/developers/twilio-openai-gpt-live-1-api-resources) | Connect incoming and outgoing phone calls to GPT-Live with Twilio Agent Connect. |12| [Twilio](https://www.twilio.com/en-us/blog/developers/twilio-openai-gpt-live-1-api-resources) | Connect incoming and outgoing phone calls to GPT-Live with Twilio Agent Connect. |

13| [Telnyx](https://developers.telnyx.com/docs/voice/sip-trunking/gpt-live-configuration-guide) | Build outbound calling experiences with GPT-Live and the Telnyx Voice API. |13| [Telnyx](https://developers.telnyx.com/docs/voice/sip-trunking/gpt-live-configuration-guide) | Build outbound calling experiences with GPT-Live and the Telnyx Voice API. |

14| [Bandwidth](https://dev.bandwidth.com/docs/voice/integrations/openai/live/sip/) | Connect incoming calls to GPT-Live over SIP with Bandwidth Universal Platform. |

14| [Daily/Pipecat](https://docs.pipecat.ai/api-reference/server/services/s2s/openai-live) | Add GPT-Live to your application with Pipecat’s OpenAI Live service. |15| [Daily/Pipecat](https://docs.pipecat.ai/api-reference/server/services/s2s/openai-live) | Add GPT-Live to your application with Pipecat’s OpenAI Live service. |

15 16 

16## Integration checklist17## Integration checklist

17 18 

18Follow the partner guide for installation, credentials, and a package version that supports `gpt-live-1`. Check how it handles audio formats, interruptions, session events, backend delegation, and call termination. A Realtime integration is not automatically compatible with GPT-Live.19Follow the partner guide for installation, credentials, and a package version that supports `gpt-live-1`. Check how it handles audio formats, interruptions, session events, backend delegation, and call termination. A Realtime integration is not automatically compatible with GPT-Live.

19 20 

20For direct browser connections, follow [WebRTC](https://developers.openai.com/api/docs/guides/voice-webrtc?api=live). For server audio, follow [WebSockets](https://developers.openai.com/api/docs/guides/voice-websockets?api=live). For phone calls, read [Telephony and SIP](https://developers.openai.com/api/docs/guides/voice-sip?api=live).21For direct audio connections to GPT-Live, we recommend [WebRTC](https://developers.openai.com/api/docs/guides/voice-webrtc?api=live), including from a server. [WebSockets](https://developers.openai.com/api/docs/guides/voice-websockets?api=live) are also supported. For phone calls, read [Telephony and SIP](https://developers.openai.com/api/docs/guides/voice-sip?api=live).

Details

10 10 

11Your application checks permissions and required confirmations before executing an action.11Your application checks permissions and required confirmations before executing an action.

12 12 

13To adapt an existing Realtime prompt, follow [Split conversation and backend instructions](https://developers.openai.com/api/docs/guides/live-migration?migration-path=realtime#split-conversation-and-backend-instructions).

14 

13## Recommended prompt structure15## Recommended prompt structure

14 16 

15Start with this template and add instructions as needed. See [session configuration](https://developers.openai.com/api/docs/guides/live-conversations#configuration-fields) for field limits.17Start with this template and add instructions as needed. See [session configuration](https://developers.openai.com/api/docs/guides/live-conversations#configuration-fields) for field limits.

guides/promptfoo-codex.md +110 −0 created

Details

1# Get started with Promptfoo

2 

3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 

5Use [Promptfoo](https://www.promptfoo.dev/), an open-source library, to evaluate and red-team AI applications and agents. Define test cases and checks to measure application behavior, compare prompts or models, and investigate failures. You can also probe applications with adversarial inputs to uncover security risks.

6 

7Promptfoo is part of OpenAI.

8 

9This guide starts with a small eval: run a translation example in your terminal, or ask Codex to set up an eval for your application.

10 

11## Start in the CLI

12 

13With [Node.js 22.22.0 or newer installed](https://www.promptfoo.dev/docs/installation/), choose how to run Promptfoo's example. It compares translations from different models against test cases:

14 

15 

16 

17

18 

19 

20```bash

21npx promptfoo@latest init --example getting-started

22cd getting-started

23```

24 

25

26 

27

28 

29 

30Use an active Python 3.10+ virtual environment. The [pip wrapper](https://github.com/promptfoo/promptfoo-python) also requires Node.js 22.22.0 or newer.

31 

32```bash

33pip install promptfoo

34promptfoo init --example getting-started

35cd getting-started

36```

37 

38

39 

40 

41 

42 

43The example creates `promptfooconfig.yaml` with a translation prompt, model providers, and test cases. Each test includes an assertion that checks the output for an expected phrase. Set your OpenAI API key in your terminal, replacing the placeholder with your key:

44 

45```bash

46export OPENAI_API_KEY="<your-api-key>"

47```

48 

49Run the eval, then open the results viewer. The eval makes model calls that incur API charges.

50 

51 

52 

53

54 

55 

56```bash

57npx promptfoo@latest eval

58npx promptfoo@latest view

59```

60 

61

62 

63

64 

65 

66```bash

67promptfoo eval

68promptfoo view

69```

70 

71

72 

73 

74 

75 

76Open the local URL to compare the models' outputs and see which assertions passed or failed. Inspect the outputs as well: a passing assertion checks a specific condition, not the overall quality of a response. Edit the prompt or test cases in `promptfooconfig.yaml`, then run the eval again.

77 

78![Promptfoo results comparing GPT-6.1 Sol at medium reasoning and GPT-6 Luna at high reasoning across 12 coding tasks, with correctness and latency checks.](https://developers.openai.com/images/platform/guides/promptfoo-codex/evaluation-results.webp)

79 

80A separate Codex app-server eval compares `gpt-6.1-sol` (medium reasoning) and `gpt-6-luna` (high reasoning) across 12 coding tasks. Each result combines executable correctness checks with a 30-second time budget. All implementations passed the code checks; red results missed the time budget.

81 

82## Start in the Codex app

83 

84Use the [Promptfoo plugin](codex://plugins/install/promptfoo?marketplace=promptfoo) to give Codex skills for setting up and running evals.

85 

86Select **Open in Codex** to start a task, or **Copy prompt** to paste the prompt into an existing task.

87 

88 

89 

90**Starter prompt:**

91 

92```text

93Use Promptfoo to evaluate and improve an important AI workflow in this application.

94 

95Read the repository instructions and reuse any existing eval setup. Choose a user-facing behavior to test, asking me if the goal is unclear. Build test cases based on the application's inputs, covering common requests, edge cases, and adversarial inputs. Define success with assertions that check the expected behavior.

96 

97Run a baseline, inspect the failures, and test one targeted change to the prompt or configuration. Compare both versions using the same cases and assertions. Report improvements and regressions, including latency and cost when available. Keep the assertions fixed so the comparison stays meaningful.

98 

99Open the results with charts. Show a few concrete before-and-after examples and recommend which version to keep. If the change does not improve the results, say so.

100```

101 

102Codex may need your help with credentials or setup permissions. Evals that call a model can incur API charges.

103 

104## Next steps

105 

106Continue with Promptfoo's documentation:

107 

108- **Configure evals:** Set up prompts, models, and test cases with the [configuration guide](https://www.promptfoo.dev/docs/configuration/guide/).

109- **Check outputs:** Choose checks and scoring methods with [assertions and metrics](https://www.promptfoo.dev/docs/configuration/expected-outputs/).

110- **Test for security risks:** Probe your application with adversarial inputs using the [red-teaming guide](https://www.promptfoo.dev/docs/red-team/).

Details

365 365 

366### Attribute filtering366### Attribute filtering

367 367 

368Attribute filtering helps narrow down results by applying criteria, such as restricting searches to a specific date range. You can define and combine criteria in `attribute_filter` to target files based on their attributes before performing semantic search.368Attribute filtering helps narrow down results by applying criteria, such as restricting searches to a specific date range. You can define and combine criteria in `filters` to target files based on their attributes before performing semantic search.

369 369 

370Use **comparison filters** to compare a specific `key` in a file's `attributes` with a given `value`, and **compound filters** to combine multiple filters using `and` and `or`.370Use **comparison filters** to compare a specific `key` in a file's `attributes` with a given `value`, and **compound filters** to combine multiple filters using `and` and `or`.

371 371 


392 392 

393Below are some example filters.393Below are some example filters.

394 394 

395The filename examples below match a custom `filename` attribute, which you must explicitly set on each vector store file, such as `{"filename": "example.txt"}`. They don't automatically match the uploaded file's name.

396 

395 397 

396 398 

397Region399Region


445```json447```json

446{448{

447 "type": "in",449 "type": "in",

448 "property": "filename",450 "key": "filename",

449 "value": ["example.txt", "example2.txt"]451 "value": ["example.txt", "example2.txt"]

450}452}

451```453```


462```json464```json

463{465{

464 "type": "nin",466 "type": "nin",

465 "property": "filename",467 "key": "filename",

466 "value": ["draft.txt", "internal_notes.md"]468 "value": ["draft.txt", "internal_notes.md"]

467}469}

468```470```

Details

11A phone call can reach GPT-Live through a SIP trunk or through an application that relays audio. Choose the path that fits your existing phone system and where your application needs to process audio.11A phone call can reach GPT-Live through a SIP trunk or through an application that relays audio. Choose the path that fits your existing phone system and where your application needs to process audio.

12 12 

13| Connection | Audio and application responsibilities |13| Connection | Audio and application responsibilities |

14| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |14| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

15| Direct SIP | The provider exchanges call audio with OpenAI. Your application handles webhooks, session configuration, call decisions, and business logic. |15| Direct SIP | The provider exchanges call audio with OpenAI. Your application handles webhooks, session configuration, call decisions, and business logic. |

16| Server audio bridge | Your application relays provider or room audio to GPT-Live over WebSocket. It manages both connections, event translation, playback, and call lifecycle. |16| Server audio bridge | Your application relays provider or room audio to GPT-Live over WebRTC or WebSocket. It manages both connections, event translation, playback, and call lifecycle. |

17 17 

18A provider's connection to your application and your application's connection to OpenAI are separate. For example, a caller can join a room through SIP while an agent in that room connects to GPT-Live over WebSocket.18A provider's connection to your application and your application's connection to OpenAI are separate. For example, a caller can join a room through SIP while an agent in that room connects to GPT-Live over WebRTC.

19 19 

20Using Twilio, Telnyx, LiveKit, or Daily/Pipecat? See [GPT-Live partner integrations](https://developers.openai.com/api/docs/guides/live-partner-integrations) for provider-specific guides.20Using Twilio, Telnyx, Bandwidth, LiveKit, or Daily/Pipecat? See [GPT-Live partner integrations](https://developers.openai.com/api/docs/guides/live-partner-integrations) for provider-specific guides.

21 21 

22### Direct SIP22### Direct SIP

23 23 


173 173 

174### Server audio bridges174### Server audio bridges

175 175 

176Use the [GPT-Live WebSocket connection](https://developers.openai.com/api/docs/guides/voice-websockets?api=live) when your application receives an audio stream from a phone provider or an agent framework. The application authenticates both connections, translates their event envelopes, and relays audio in both directions.176We recommend [WebRTC](https://developers.openai.com/api/docs/guides/voice-webrtc?api=live) for the connection from your audio bridge to GPT-Live. [WebSockets](https://developers.openai.com/api/docs/guides/voice-websockets?api=live) are also supported. Your application authenticates both connections, handles their events, and relays audio in both directions.

177 177 

178GPT-Live supports raw G.711 μ-law and A-law audio at 8 kHz over WebSocket. When the provider stream uses the same codec, sample rate, and channel count, your application can forward the raw audio bytes without converting them to PCM. Preserve audio order and wrap the audio bytes in the message format required by each connection.178GPT-Live supports raw G.711 μ-law and A-law audio at 8 kHz over WebSocket. When the provider stream uses the same codec, sample rate, and channel count, your application can forward the raw audio bytes without converting them to PCM. Preserve audio order and wrap the audio bytes in the message format required by each connection.

179 179 


183 183 

184## Next steps with GPT-Live184## Next steps with GPT-Live

185 185 

186- [WebSockets](https://developers.openai.com/api/docs/guides/voice-websockets?api=live): connect a server audio stream to GPT-Live.186- [WebRTC](https://developers.openai.com/api/docs/guides/voice-webrtc?api=live): use the recommended audio connection to GPT-Live.

187- [WebSockets](https://developers.openai.com/api/docs/guides/voice-websockets?api=live): stream audio over a supported alternative.

187- [Webhooks and server-side controls](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live): manage a session from your backend.188- [Webhooks and server-side controls](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live): manage a session from your backend.

188- [Delegation and tools](https://developers.openai.com/api/docs/guides/live-delegation): connect speech to your reasoning and tool backend.189- [Delegation and tools](https://developers.openai.com/api/docs/guides/live-delegation): connect speech to your reasoning and tool backend.

189- [Managing sessions](https://developers.openai.com/api/docs/guides/live-conversations): handle transcripts, session state, and close.190- [Managing sessions](https://developers.openai.com/api/docs/guides/live-conversations): handle transcripts, session state, and close.

Details

8 8 

9## Connect a browser to GPT-Live9## Connect a browser to GPT-Live

10 10 

11Use WebRTC for browser voice applications. Microphone input and generated speech travel on negotiated media tracks. A data channel carries JSON events for transcripts, session updates, and delegated work.11We recommend WebRTC for GPT-Live audio connections in browser, mobile, and server applications. This guide walks through a browser example. Microphone input and generated speech travel on negotiated media tracks. A data channel carries JSON events for transcripts, session updates, and delegated work.

12 12 

13Your browser creates a Session Description Protocol (SDP) offer. Your application server exchanges it for an answer with `POST /v1/live/sessions`, using the project API key. Keep the key and session configuration on your trusted server.13Your browser creates a Session Description Protocol (SDP) offer. Your application server exchanges it for an answer with `POST /v1/live/sessions`, using the project API key. Keep the key and session configuration on your trusted server.

14 14 

Details

8 8 

9## Connect a server to GPT-Live9## Connect a server to GPT-Live

10 10 

11Use a primary WebSocket when your server captures audio or relays an audio stream for a client. It carries audio and JSON events in both directions. Keep the project API key on that trusted server. For browser and mobile applications, start with [WebRTC](https://developers.openai.com/api/docs/guides/voice-webrtc?api=live).11We recommend [WebRTC](https://developers.openai.com/api/docs/guides/voice-webrtc?api=live) for GPT-Live audio connections, including server-to-server integrations.

12 

13WebSockets are also supported. A primary WebSocket carries audio and JSON events in both directions. Keep the project API key on your trusted server.

12 14 

13This guide covers streaming audio to GPT-Live. To monitor or control an existing session, see [Server-side controls](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live). To connect a reasoning and tool backend to the Responses API, see [Responses WebSocket mode](https://developers.openai.com/api/docs/guides/websocket-mode).15This guide covers streaming audio to GPT-Live. To monitor or control an existing session, see [Server-side controls](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live). To connect a reasoning and tool backend to the Responses API, see [Responses WebSocket mode](https://developers.openai.com/api/docs/guides/websocket-mode).

14 16