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

client.live.create(LiveCreateParams { session, transport } body, RequestOptionsoptions?): LiveCreateResponse { session, transport }
POST/live/sessions

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

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

Startup configuration for the Live session.

transport: Transport

WebRTC transport with the browser’s SDP offer.

ReturnsExpand Collapse
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

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const live = await client.live.create({
  session: { model: 'gpt-live-1' },
  transport: { sdp: 'x', type: 'webrtc' },
});

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