Create session
Create a Live WebRTC session or place an outbound SIP call. Start with the Live prompting guide for session configuration and Telephony and SIP for trunk setup and call monitoring.
Set transport.type to webrtc and supply an SDP offer, or set it to sip
and supply an E.164 destination and trunk credentials. Outbound SIP calling
must be enabled for your organization.
Ringing is limited to 3 minutes and connected calls to 2 hours; these limits
are not configurable in the request.
Returns 201 Created after session initialization. WebRTC responses include an
SDP answer. SIP responses do not wait for the callee to answer. Attach a
sideband connection using session.id to monitor SIP call progress.
Each SIP request creates a new call. If a request times out or the connection fails, retry with caution: the original request may have succeeded, and a retry can place another call.
Body ParametersJSON
Startup configuration for the Live session.
Startup configuration for the Live session.
model: string or "gpt-live-1"The Live model. Required in the session configuration for every transport; do not pass it as a URL query parameter.
The Live model. Required in the session configuration for every transport; do not pass it as a URL query parameter.
audio: optional object { output } Startup audio configuration. WebRTC and SIP negotiate their audio format on the media transport.
Startup audio configuration. WebRTC and SIP negotiate their audio format on the media transport.
output: optional object { voice } Settings for speech generated by the Live model. Choose the voice before starting the session.
Settings for speech generated by the Live model. Choose the voice before starting the session.
The voice used for Live speech, as a built-in voice name or a custom voice object containing its ID. Defaults to marin and cannot change after startup.
The voice used for Live speech, as a built-in voice name or a custom voice object containing its ID. Defaults to marin and cannot change after startup.
Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected.
Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected.
Client and server event permissions for the WebRTC frontend data channel.
Client and server event permissions for the WebRTC frontend data channel.
allowed_client_events: optional "all" or array of stringClient event types that the frontend data channel may send. Use ‘all’ to allow every client event; an empty array allows none. Omission preserves the existing allow-all behavior.
Client event types that the frontend data channel may send. Use ‘all’ to allow every client event; an empty array allows none. Omission preserves the existing allow-all behavior.
Server events that may be sent to the frontend data channel. Use ‘all’ to allow every server event; an empty array allows none. Omission preserves the existing allow-all behavior. Responses events use an object with type ‘response.event’ and a response_event selector.
Server events that may be sent to the frontend data channel. Use ‘all’ to allow every server event; an empty array allows none. Omission preserves the existing allow-all behavior. Responses events use an object with type ‘response.event’ and a response_event selector.
array of ServerEventSelector { type, response_event }
delegation: optional ClientDelegation { type, acknowledgement_delay_ms } or Responses { responses, type, acknowledgement_delay_ms } or Decisions { decisions, type, acknowledgement_delay_ms } or nullWho handles tasks delegated by the Live model. Omitted or null selects your application; use responses or decisions to delegate to the corresponding API.
Who handles tasks delegated by the Live model. Omitted or null selects your application; use responses or decisions to delegate to the corresponding API.
ClientDelegation object { type, acknowledgement_delay_ms } Delegate tasks to your application. The Live session emits delegation events that your backend handles.
Delegate tasks to your application. The Live session emits delegation events that your backend handles.
Milliseconds to wait before requesting an automatic spoken acknowledgement for a delegation. The model may still speak before this delay. Any commentary or thinking appended to the session cancels all pending acknowledgements, including those for other delegations. Defaults to 400 for Decisions sessions and 0 (request immediately) for other sessions. Omission in a session update preserves the current value. Updates apply to subsequent delegations.
Responses object { responses, type, acknowledgement_delay_ms } Delegate tasks to a Responses model managed by the Live session.
Delegate tasks to a Responses model managed by the Live session.
Backend model, prompt, and tools used when the Live session delegates a task to Responses.
Backend model, prompt, and tools used when the Live session delegates a task to Responses.
Instructions for the delegated Responses model, separate from Live instructions. See backend prompting.
Maximum number of output tokens for each delegated response.
Whether the delegated Responses model may request multiple tool calls in a single response.
reasoning: optional object { effort, summary } or nullReasoning settings passed to each delegated Responses request.
Reasoning settings passed to each delegated Responses request.
service_tier: optional "auto" or "default" or "fast_tier_temp_pilot" or 3 more or nullService tier for delegated Responses requests.
Service tier for delegated Responses requests.
text: optional object { verbosity } or nullText generation settings passed to each delegated Responses request.
Text generation settings passed to each delegated Responses request.
tool_choice: optional "auto" or "none" or "required" or Function { name, type } or Mcp { server_label, type, name } or 11 moreControls which tool the Responses backend uses when handling a task delegated by the Live model.
Controls which tool the Responses backend uses when handling a task delegated by the Live model.
ApplyPatch object { type } Forces the model to call the apply_patch tool when executing a tool call.
Forces the model to call the apply_patch tool when executing a tool call.
LiveAllowedToolsChoiceParam object { tools, type, mode }
tools: array of Function { name, type } or Mcp { server_label, type, name } or FileSearch { type } or 9 moreThe tools that the delegated Responses model may call.
The tools that the delegated Responses model may call.
tools: optional array of FunctionTool { name, type, description, 2 more } or WebSearch { type } or FileSearch { type } or 10 moreTools available to the Responses backend while it handles tasks delegated by the Live model.
Tools available to the Responses backend while it handles tasks delegated by the Live model.
FunctionTool object { name, type, description, 2 more } A function tool available to the Responses backend when the Live model delegates a task.
A function tool available to the Responses backend when the Live model delegates a task.
Shell object { type, environment } A Responses shell tool. Use a hosted container or return local shell results with response.item.create. Domain secrets are not supported.
A Responses shell tool. Use a hosted container or return local shell results with response.item.create. Domain secrets are not supported.
environment: optional ContainerAuto { type, file_ids, memory_limit, 2 more } or ContainerReference { container_id, type } or Local { type, skills } or null
ContainerAuto object { type, file_ids, memory_limit, 2 more }
An optional list of uploaded files to make available to your code.
network_policy: optional Disabled { type } or Allowlist { allowed_domains, type } or nullNetwork access policy for the container.
Network access policy for the container.
skills: optional array of SkillReference { skill_id, type, version } or Inline { description, name, source, type } or nullAn optional list of skills referenced by id or inline data.
An optional list of skills referenced by id or inline data.
Milliseconds to wait before requesting an automatic spoken acknowledgement for a delegation. The model may still speak before this delay. Any commentary or thinking appended to the session cancels all pending acknowledgements, including those for other delegations. Defaults to 400 for Decisions sessions and 0 (request immediately) for other sessions. Omission in a session update preserves the current value. Updates apply to subsequent delegations.
Decisions object { decisions, type, acknowledgement_delay_ms }
questions: array of Choice { choices, instructions, type, name } or Predicate { instructions, type, name } or Score { instructions, levels, type, name } Native Decision API questions evaluated together, in order.
Native Decision API questions evaluated together, in order.
Milliseconds to wait before requesting an automatic spoken acknowledgement for a delegation. The model may still speak before this delay. Any commentary or thinking appended to the session cancels all pending acknowledgements, including those for other delegations. Defaults to 400. Updates apply to subsequent delegations.
Ordered text-only history supplied before startup. Supports developer, user, and assistant messages with one text part each; at most 128 messages and a configured rendered-token limit (8,192 by default).
Ordered text-only history supplied before startup. Supports developer, user, and assistant messages with one text part each; at most 128 messages and a configured rendered-token limit (8,192 by default).
Developer object { content, role, id, 2 more } A developer message included in the initial text history of a Live session.
A developer message included in the initial text history of a Live session.
content: array of object { text, type } The message content. Supply exactly one text part for the initial Live conversation history.
The message content. Supply exactly one text part for the initial Live conversation history.
An optional identifier for the supplied history message. Live uses the message’s role and text to initialize the conversation.
User object { content, role, id, 2 more } A user message included in the initial text history of a Live session.
A user message included in the initial text history of a Live session.
content: array of object { text, type } The message content. Supply exactly one text part for the initial Live conversation history.
The message content. Supply exactly one text part for the initial Live conversation history.
An optional identifier for the supplied history message. Live uses the message’s role and text to initialize the conversation.
Assistant object { content, role, id, 2 more } An assistant message included in the initial text history of a Live session.
An assistant message included in the initial text history of a Live session.
content: array of Text { text, type } or OutputText { text, type } The message content. Supply exactly one text part for the initial Live conversation history.
The message content. Supply exactly one text part for the initial Live conversation history.
An optional identifier for the supplied history message. Live uses the message’s role and text to initialize the conversation.
Frontend instructions for voice, conversation, interruptions, and when to delegate. Start with the Live prompting guide; put business rules and tool workflows in a separate backend prompt. Limited to 16,384 client-supplied tokens. Omitted or blank instructions use server defaults. Immutable after startup.
Whether to store the session for later forking and recording download. Defaults to false for new sessions.
At most one Decisions trigger per transcript event type. Triggers run independently of delegation. On update, omit triggers to keep the current configuration, send a list to replace it, or send an empty list to disable triggers.
At most one Decisions trigger per transcript event type. Triggers run independently of delegation. On update, omit triggers to keep the current configuration, send a list to replace it, or send an empty list to disable triggers.
decisions: object { questions } Questions evaluated using the current transcript and the session’s shared Decision items.
Questions evaluated using the current transcript and the session’s shared Decision items.
questions: array of Choice { choices, instructions, type, name } or Predicate { instructions, type, name } or Score { instructions, levels, type, name } Native Decision API questions evaluated together, in order.
Native Decision API questions evaluated together, in order.
transport: Webrtc { sdp, type } or Sip { destination, trunk, type } WebRTC transport with an SDP offer, or SIP transport with a destination and per-call trunk credentials.
WebRTC transport with an SDP offer, or SIP transport with a destination and per-call trunk credentials.
Webrtc object { sdp, type } WebRTC transport carrying the offer SDP in a creation request or answer SDP in its response.
WebRTC transport carrying the offer SDP in a creation request or answer SDP in its response.
Sip object { destination, trunk, type } Place an outbound SIP call using your provider’s trunk. Outbound SIP calling must be enabled for your organization. The trunk must support TLS signaling, Opus audio, and SDES-SRTP media. See Telephony and SIP.
Place an outbound SIP call using your provider’s trunk. Outbound SIP calling must be enabled for your organization. The trunk must support TLS signaling, Opus audio, and SDES-SRTP media. See Telephony and SIP.
trunk: object { auth, caller_number, provider_url } SIP trunk configuration supplied for this call. Keep trunk credentials on your server. The creation response does not return this configuration.
SIP trunk configuration supplied for this call. Keep trunk credentials on your server. The creation response does not return this configuration.
auth: object { password, type, username } Credentials for SIP Digest authentication with your trunk provider.
Credentials for SIP Digest authentication with your trunk provider.
Provider endpoint in the form sips:host[:port][;transport=tcp]. The default port is 5061. IPv6 addresses must be bracketed. TLS signaling is required; plaintext SIP is not supported. Do not include userinfo, a path, URI headers, or other URI parameters. Local hostnames and literal private, loopback, link-local, unspecified, multicast, and broadcast IP addresses are rejected.
Returns
session: object { id } The newly created Live session. Use its ID for session controls and sideband connections.
The newly created Live session. Use its ID for session controls and sideband connections.
transport: Webrtc { sdp, type } or Sip { type } WebRTC transport with an SDP answer, or SIP transport without SDP or trunk credentials. For SIP, attach a sideband using session.id to receive transport.ringing, transport.answered, and transport.failed notifications.
WebRTC transport with an SDP answer, or SIP transport without SDP or trunk credentials. For SIP, attach a sideband using session.id to receive transport.ringing, transport.answered, and transport.failed notifications.
Create session
curl https://api.tpg-oai.studydeckedu.com/v1/live/sessions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"session":{"model":"gpt-live-1","instructions":"Be concise. Ask for clarification when needed."},"transport":{"type":"webrtc","sdp":"<SDP offer>"}}'{"session":{"id":"live_123"},"transport":{"type":"webrtc","sdp":"<SDP answer>"}}Create session
# Export SIP_USERNAME and SIP_PASSWORD in your environment first.
jq -n '{
"session": {
"model": "gpt-live-1",
"instructions": "Help the user schedule an appointment.",
"audio": { "output": { "voice": "marin" } },
"delegation": { "type": "client" }
},
"transport": {
"type": "sip",
"destination": "+14155550123",
"trunk": {
"provider_url": "sips:sip.example.com:5061",
"auth": {
"type": "digest",
"username": env.SIP_USERNAME,
"password": env.SIP_PASSWORD
},
"caller_number": "+14155550100"
}
}
}' | curl https://api.tpg-oai.studydeckedu.com/v1/live/sessions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @-{"session":{"id":"live_123"},"transport":{"type":"sip"}}Returns Examples
{
"session": {
"id": "live_123"
},
"transport": {
"type": "webrtc",
"sdp": "<SDP answer>"
}
}{
"session": {
"id": "live_123"
},
"transport": {
"type": "sip"
}
}