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
Theme

Fork session

client.live.sessions.fork(sessionID, body, options?): SessionForkResponse { session, transport }
POST
/live/sessions/{session_id}/fork

Fork a stored Live session onto a new WebRTC connection.

Parameters
sessionID: string
body: SessionForkParams { transport, session }
Returns
SessionForkResponse { 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.

Fork session

import OpenAI from 'openai';

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

const response = await client.live.sessions.fork('session_id', {
  transport: { sdp: 'x', type: 'webrtc' },
});

console.log(response.session);
201 — Example
{
  "session": {
    "id": "id"
  },
  "transport": {
    "sdp": "x",
    "type": "webrtc"
  }
}
Returns Examples
201 — Example
{
  "session": {
    "id": "id"
  },
  "transport": {
    "sdp": "x",
    "type": "webrtc"
  }
}