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

Fork session

live.sessions.fork(session_id, **kwargs) -> SessionForkResponse { session, transport }
POST/live/sessions/{session_id}/fork

Fork a stored Live session onto a new WebRTC connection.

ParametersExpand Collapse
session_id: String
transport: Transport{ sdp, type}

WebRTC transport with an SDP offer for the new connection to the forked session.

session: MediaSessionForkConfig { client, delegation, store }

Optional configuration overrides for the new Live session. Omit this object or send an empty object to inherit the stored session’s settings.

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

require "openai"

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

response = openai.live.sessions.fork("session_id", transport: {sdp: "x", type: :webrtc})

puts(response)
{
  "session": {
    "id": "id"
  },
  "transport": {
    "sdp": "x",
    "type": "webrtc"
  }
}
Returns Examples
{
  "session": {
    "id": "id"
  },
  "transport": {
    "sdp": "x",
    "type": "webrtc"
  }
}