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

client.Live.Sessions.Fork(ctx, sessionID, body) (*SessionForkResponse, error)
POST/live/sessions/{session_id}/fork

Fork a stored Live session onto a new WebRTC connection.

ParametersExpand Collapse
sessionID string
body SessionForkParams
ReturnsExpand Collapse
type SessionForkResponse struct{…}

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 SessionForkResponseSession

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

Transport SessionForkResponseTransport

WebRTC transport with the SDP answer.

Fork session

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/live"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Live.Sessions.Fork(
    context.TODO(),
    "session_id",
    live.SessionForkParams{
      Transport: live.SessionForkParamsTransport{
        Sdp: "x",
      },
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Session)
}
{
  "session": {
    "id": "id"
  },
  "transport": {
    "sdp": "x",
    "type": "webrtc"
  }
}
Returns Examples
{
  "session": {
    "id": "id"
  },
  "transport": {
    "sdp": "x",
    "type": "webrtc"
  }
}