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(LiveCreateParams**kwargs) -> LiveCreateResponse
POST/live/sessions

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

ParametersExpand Collapse

Startup configuration for the Live session.

transport: Transport

WebRTC transport with the browser’s SDP offer.

ReturnsExpand Collapse
class LiveCreateResponse: …

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

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

transport: Transport

WebRTC transport with the SDP answer.

Create session

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
live = client.live.create(
    session={
        "model": "gpt-live-1"
    },
    transport={
        "sdp": "x",
        "type": "webrtc",
    },
)
print(live.session)
{
  "session": {
    "id": "live_123"
  },
  "transport": {
    "type": "webrtc",
    "sdp": "<SDP answer>"
  }
}
Returns Examples
{
  "session": {
    "id": "live_123"
  },
  "transport": {
    "type": "webrtc",
    "sdp": "<SDP answer>"
  }
}