Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Create session

live.create(**kwargs) -> LiveCreateResponse { session, transport }
POST/live/sessions

Create a Live WebRTC session. Start with the Live prompting guide.

ParametersExpand Collapse
session: MediaSessionConfig { model, audio, client, 4 more }

Startup configuration for the Live session.

transport: Transport{ sdp, type}

WebRTC transport with the browser’s SDP offer.

ReturnsExpand Collapse
class LiveCreateResponse { session, transport }

The created Live session identifier and WebRTC answer. Apply transport.sdp as the peer’s remote answer and wait for session.started on the data channel before sending commands.

session: Session{ id}

The newly created Live session. Use its ID for session controls and sideband connections.

transport: Transport{ sdp, type}

WebRTC transport with the SDP answer.

Create session

require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

live = openai.live.create(session: {model: :"gpt-live-1"}, transport: {sdp: "x", type: :webrtc})

puts(live)
{
  "session": {
    "id": "live_123"
  },
  "transport": {
    "type": "webrtc",
    "sdp": "<SDP answer>"
  }
}
Returns Examples
{
  "session": {
    "id": "live_123"
  },
  "transport": {
    "type": "webrtc",
    "sdp": "<SDP answer>"
  }
}