SpyBara
Go Premium

Documentation 2026-09-25 23:58 UTC to 2026-09-26 23:59 UTC

13 files changed +109 −16. View all changes and history on the product overview
2026
Tue 29 22:57 Mon 28 22:57 Sat 26 23:59 Fri 25 23:58 Thu 24 23:58 Wed 23 23:58 Tue 22 23:57 Mon 21 23:00 Sat 19 23:00 Fri 18 22:59 Thu 17 10:04 Wed 16 20:58 Tue 15 22:59 Mon 14 22:58 Sun 13 15:02 Fri 11 20:00 Thu 10 18:01 Wed 9 23:59 Sat 5 17:01 Fri 4 23:59 Thu 3 23:00 Wed 2 22:59
Details

13 13 

14Your application can start compute after creating a session. Use your [provider's SDK or API](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted#sandbox-providers), then [connect the executor](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) with the session's environment ID and an environment key.14Your application can start compute after creating a session. Use your [provider's SDK or API](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted#sandbox-providers), then [connect the executor](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) with the session's environment ID and an environment key.

15 15 

16See the [application-managed sandbox examples](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed) in the OpenAI Cookbook.16See the [application-managed sandbox examples](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes) in the OpenAI Cookbook.

17 17 

18<picture>18<picture>

19 <source19 <source


39 39 

40You can also wait until input needs an environment connection. The API emits `agent.session.action_required` with `required_action.type: "environment_connection"` before waiting for the executor. Your webhook handler starts or reconnects the environment.40You can also wait until input needs an environment connection. The API emits `agent.session.action_required` with `required_action.type: "environment_connection"` before waiting for the executor. Your webhook handler starts or reconnects the environment.

41 41 

42See the [webhook-managed sandbox examples](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/webhook_managed) in the OpenAI Cookbook.42See the [webhook-managed sandbox examples](https://github.com/openai/openai-cookbook/blob/main/examples/agents_api/sandboxes/webhook_managed.md) in the OpenAI Cookbook.

43 43 

44<picture>44<picture>

45 <source45 <source

Details

2 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.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 4 

5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/blaxel) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/webhook_managed/blaxel) examples in the OpenAI Cookbook.5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/blaxel/application_managed) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/blaxel/webhook_managed) examples in the OpenAI Cookbook.

6 6 

7See [Self-hosted sandboxes](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) for executor setup and connection requirements.7See [Self-hosted sandboxes](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) for executor setup and connection requirements.

8 8 

Details

4 4 

5This guide uses **webhook-managed provisioning** with Cloudflare's reference Worker.5This guide uses **webhook-managed provisioning** with Cloudflare's reference Worker.

6 6 

7See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/cloudflare) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/webhook_managed/cloudflare) examples in the OpenAI Cookbook.7See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/cloudflare/application_managed) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/cloudflare/webhook_managed) examples in the OpenAI Cookbook.

8 8 

9## How it works9## How it works

10 10 

Details

2 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.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 4 

5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/daytona) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/webhook_managed/daytona) examples in the OpenAI Cookbook.5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/daytona/application_managed) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/daytona/webhook_managed) examples in the OpenAI Cookbook.

6 6 

7See [Self-hosted sandboxes](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) for executor setup and connection requirements.7See [Self-hosted sandboxes](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) for executor setup and connection requirements.

8 8 

Details

2 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.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 4 

5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/digitalocean) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/webhook_managed/digitalocean) examples in the OpenAI Cookbook.5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/digitalocean/application_managed) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/digitalocean/webhook_managed) examples in the OpenAI Cookbook.

6 6 

7## How it works7## How it works

8 8 

Details

2 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.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 4 

5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/e2b) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/webhook_managed/e2b) examples in the OpenAI Cookbook.5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/e2b/application_managed) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/e2b/webhook_managed) examples in the OpenAI Cookbook.

6 6 

7Choose a provisioning mode:7Choose a provisioning mode:

8 8 

Details

2 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.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 4 

5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/modal) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/webhook_managed/modal) examples in the OpenAI Cookbook.5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/modal/application_managed) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/modal/webhook_managed) examples in the OpenAI Cookbook.

6 6 

7See [Self-hosted sandboxes](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) for executor setup and connection requirements.7See [Self-hosted sandboxes](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) for executor setup and connection requirements.

8 8 

Details

4 4 

5This guide follows Oracle's beta Python example and uses **application-managed provisioning**: your application creates and deletes both the Agents API session and the OCI sandbox.5This guide follows Oracle's beta Python example and uses **application-managed provisioning**: your application creates and deletes both the Agents API session and the OCI sandbox.

6 6 

7See the [application-managed example](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/oci) in the OpenAI Cookbook.7See the [application-managed example](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/oci/application_managed) in the OpenAI Cookbook.

8 8 

9See [Sandbox lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle) for the provisioning modes and connection behavior.9See [Sandbox lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle) for the provisioning modes and connection behavior.

10 10 

Details

2 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.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 4 

5See the [application-managed example](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/runloop) in the OpenAI Cookbook.5See the [application-managed example](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/runloop/application_managed) in the OpenAI Cookbook.

6 6 

7This guide uses **application-managed** provisioning: your application starts the Devbox, connects its executor, and shuts it down when finished. See [Sandbox lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle) for the lifecycle behavior.7This guide uses **application-managed** provisioning: your application starts the Devbox, connects its executor, and shuts it down when finished. See [Sandbox lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle) for the lifecycle behavior.

8 8 

Details

2 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.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 4 

5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/application_managed/vercel) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/webhook_managed/vercel) examples in the OpenAI Cookbook.5See the [application-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/vercel/application_managed) and [webhook-managed](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/vercel/webhook_managed) examples in the OpenAI Cookbook.

6 6 

7See [Self-hosted sandboxes](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) for executor setup and connection requirements.7See [Self-hosted sandboxes](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted) for executor setup and connection requirements.

8 8 

Details

57 "delegation": {57 "delegation": {

58 "type": "responses",58 "type": "responses",

59 "responses": {59 "responses": {

60 "model": "gpt-5.6-terra",60 "model": "gpt-6-luna",

61 "instructions": "[Your backend prompt]",61 "instructions": "[Your backend prompt]",

62 },62 },

63 },63 },


65```65```

66 66 

67 67 

68Start with [GPT-5.6 Terra](https://developers.openai.com/api/docs/models/gpt-5.6-terra), or try [GPT-5.6 Luna](https://developers.openai.com/api/docs/models/gpt-5.6-luna) for cost-sensitive workloads. Compare answer quality and latency on your tasks before choosing a backend model.68Start with [`gpt-6-luna`](https://developers.openai.com/api/docs/models/gpt-6-luna), or try [`gpt-6-sol`](https://developers.openai.com/api/docs/models/gpt-6-sol) for more complex backend tasks. Compare answer quality and latency on your tasks before choosing a backend model.

69 69 

70Register supported tools in `delegation.responses.tools`. Set `delegation.responses.tool_choice` to `"auto"` to let the backend choose a tool, `"required"` to require a tool call, or `"none"` to disable tool calls. You can also select a named function.70Register supported tools in `delegation.responses.tools`. Set `delegation.responses.tool_choice` to `"auto"` to let the backend choose a tool, `"required"` to require a tool call, or `"none"` to disable tool calls. You can also select a named function.

71 71 

Details

22 22 

23### Attach to the existing session23### Attach to the existing session

24 24 

251. Save the ID of the session your backend will control. For WebRTC, use `session.id` from the JSON response to `POST /v1/live/sessions`. For SIP, [accept the incoming call](https://developers.openai.com/api/docs/guides/voice-sip?api=live#accept-or-reject-the-call) first, then use `data.session_id` from its webhook. Keep the ID alongside the application's user and conversation record.251. Save the ID of the session your backend will control. For WebRTC or an [outbound SIP call](https://developers.openai.com/api/docs/guides/voice-sip?api=live#place-an-outbound-call), use `session.id` from the JSON response to `POST /v1/live/sessions`. For inbound SIP, [accept the incoming call](https://developers.openai.com/api/docs/guides/voice-sip?api=live#accept-or-reject-the-call) first, then use `data.session_id` from its webhook. Keep the ID alongside the application's user and conversation record.

262. Open a WebSocket from your server at the following URL, substituting the saved ID unchanged. Authenticate with `Authorization: Bearer $OPENAI_API_KEY` using the project authentication that created or accepted the session. Include the same connection headers required when creating the session.262. Open a WebSocket from your server at the following URL, substituting the saved ID unchanged. Authenticate with `Authorization: Bearer $OPENAI_API_KEY` using the project authentication that created or accepted the session. Include the same connection headers required when creating the session.

27 27 

28```text28```text

Details

25 25 

26Use a [sideband connection](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live) when your backend needs to receive session events or send commands. It attaches to the existing conversation while SIP carries the audio. Assign one handler to each action so that duplicate webhook deliveries or events observed on multiple connections don't execute tools twice.26Use a [sideband connection](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live) when your backend needs to receive session events or send commands. It attaches to the existing conversation while SIP carries the audio. Assign one handler to each action so that duplicate webhook deliveries or events observed on multiple connections don't execute tools twice.

27 27 

28### Handle the call lifecycle28### Handle an inbound call

29 29 

30Confirm that GPT-Live SIP support is enabled for your project and that your30Confirm that GPT-Live SIP support is enabled for your project and that your

31 provider's SIP trunk is routed to that project before using this flow.31 provider's SIP trunk is routed to that project before using this flow.


76 76 

77Keep the sideband open until `session.closed` supplies final usage, then release application resources. If the connection drops first, record finalization as incomplete. See [Usage and graceful close](https://developers.openai.com/api/docs/guides/live-conversations#usage-and-graceful-close) for finalization and close reasons.77Keep the sideband open until `session.closed` supplies final usage, then release application resources. If the connection drops first, record finalization as incomplete. See [Usage and graceful close](https://developers.openai.com/api/docs/guides/live-conversations#usage-and-graceful-close) for finalization and close reasons.

78 78 

79This flow accepts inbound calls. Creating an outbound SIP call through `POST /v1/live/sessions` is not supported; use the relevant [partner integration](https://developers.openai.com/api/docs/guides/live-partner-integrations) for provider-owned outbound calling.79### Place an outbound call

80 

81Call a phone number through your SIP provider with [Create session](https://developers.openai.com/api/reference/resources/live/methods/create). Your provider handles the phone network connection while GPT-Live carries the conversation.

82 

83Outbound SIP calling must be enabled for your organization. It is available

84 through the Live API, not the Realtime API call-creation endpoint.

85 

86#### Configure your trunk

87 

88Use a trunk that supports TLS signaling, Opus audio, and SDES-SRTP media. Enable Opus and SRTP in your provider's settings before placing a call.

89 

90Supply the trunk configuration with each request:

91 

92| Field | Value |

93| ------------------------------- | ------------------------------------------------------------------------------------------------------------------ |

94| `transport.destination` | The phone number to call, in E.164 format, such as `+14155550123`. SIP URI destinations aren't supported. |

95| `transport.trunk.provider_url` | A provider endpoint such as `sips:sip.example.com:5061`. The default port is `5061`; `;transport=tcp` is optional. |

96| `transport.trunk.auth.type` | `digest` for SIP Digest authentication. |

97| `transport.trunk.auth.username` | Your provider's SIP username. |

98| `transport.trunk.auth.password` | Your provider's SIP password. |

99| `transport.trunk.caller_number` | The caller phone number to send to your provider, in E.164 format. |

100 

101The provider endpoint must use `sips:` for TLS signaling. Don't include credentials, paths, URI headers, or other URI parameters in the URL. Local hostnames and literal private or local IP addresses are rejected. Keep your OpenAI API key and SIP credentials on your server.

102 

103#### Create the session

104 

105Send `POST /v1/live/sessions` with your session configuration and `transport.type: "sip"`. Choose the voice and delegation mode when creating the session. Omit `audio.format` because SIP negotiates the audio format.

106 

107This example uses `curl` and `jq`. Set `OPENAI_API_KEY`, `SIP_USERNAME`, and `SIP_PASSWORD` in your server environment, and replace the example provider endpoint and phone numbers with your own values. The example selects client delegation; your backend must handle [delegated work](https://developers.openai.com/api/docs/guides/live-delegation).

108 

109```bash

110jq -n \

111 --arg username "$SIP_USERNAME" \

112 --arg password "$SIP_PASSWORD" \

113 '{

114 "session": {

115 "model": "gpt-live-1",

116 "instructions": "Help the user schedule an appointment.",

117 "audio": { "output": { "voice": "marin" } },

118 "delegation": { "type": "client" }

119 },

120 "transport": {

121 "type": "sip",

122 "destination": "+14155550123",

123 "trunk": {

124 "provider_url": "sips:sip.example.com:5061",

125 "auth": {

126 "type": "digest",

127 "username": $username,

128 "password": $password

129 },

130 "caller_number": "+14155550100"

131 }

132 }

133 }' | curl https://api.openai.com/v1/live/sessions \

134 -H "Authorization: Bearer $OPENAI_API_KEY" \

135 -H "Content-Type: application/json" \

136 --data-binary @-

137```

138 

139The request returns `200 OK` after the session initializes:

140 

141```json

142{

143 "session": { "id": "live_123" },

144 "transport": { "type": "sip" }

145}

146```

147 

148This response doesn't mean the call has been answered. It contains no SDP or trunk credentials. Preserve `session.id` unchanged for the sideband connection and call controls. You don't need an incoming-call webhook or an accept request for an outbound call.

149 

150#### Monitor and end the call

151 

152Attach your backend to `wss://api.openai.com/v1/live/sessions/{session_id}/attach` using your OpenAI API key. Don't send `session.start` again. The [sideband connection](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live) carries conversation events, delegated work, and call progress while SIP carries the audio.

153 

154| Event | Meaning |

155| -------------------- | ----------------------------------------------------------------------------------------- |

156| `transport.ringing` | The provider reports ringing or early media. |

157| `transport.answered` | The call has been answered and media is established. |

158| `transport.failed` | Call setup failed after session initialization. Inspect `error.code` and `error.message`. |

159 

160Each call-progress event includes `event_id` and `session_id`. Attach immediately after creation: the sideband only replays events from the preceding 3 seconds, so a later attachment can miss earlier call progress. Replayed events retain their original event IDs. Deduplicate events by `event_id`.

161 

162Use the same [transfer](#transfer-or-end-the-call) and [hangup](https://developers.openai.com/api/reference/resources/live/subresources/sessions/methods/hangup) actions as for inbound calls. Keep the sideband open for `session.closed` and final usage as described in [Usage and graceful close](https://developers.openai.com/api/docs/guides/live-conversations#usage-and-graceful-close).

163 

164#### Handle limits and errors

165 

166Outbound SIP requests have a 1 MiB body limit. Ringing is limited to 3 minutes, and a connected call is limited to 2 hours. These limits aren't configurable in the creation request.

167 

168A `403` response with `outbound_sip_not_enabled` means outbound calling isn't enabled for your organization. Invalid session configuration is returned on the creation request. Transport setup failures can return `502`, and initialization timeouts return `504`. After creation succeeds, monitor `transport.failed` for asynchronous setup failures.

169 

170Each creation request places a new call. `X-Client-Request-Id` doesn't

171 deduplicate requests. Don't automatically retry after an ambiguous timeout or

172 connection failure: a retry can place another call.

80 173 

81### Server audio bridges174### Server audio bridges

82 175