## Fork session

`live.sessions.fork(strsession_id, SessionForkParams**kwargs)  -> SessionForkResponse`

**post** `/live/sessions/{session_id}/fork`

Fork a stored Live session onto a new WebRTC connection.

### Parameters

- `session_id: str`

- `transport: Transport`

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

  - `sdp: str`

    Session Description Protocol message for the WebRTC connection.

  - `type: Literal["webrtc"]`

    The transport used for the Live session. Always `webrtc`.

    - `"webrtc"`

- `session: Optional[MediaSessionForkConfigParam]`

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

  - `client: Optional[ClientConfig]`

    Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected.

    - `data_channel: DataChannelConfig`

      Client and server event permissions for the WebRTC frontend data channel.

      - `allowed_client_events: Optional[Union[Literal["all"], List[str], null]]`

        Client event types that the frontend data channel may send. Use 'all' to allow every client event; an empty array allows none. Omission preserves the existing allow-all behavior.

        - `Literal["all"]`

          - `"all"`

        - `List[str]`

      - `allowed_server_events: Optional[Union[Literal["all"], List[ServerEventSelector], null]]`

        Server events that may be sent to the frontend data channel. Use 'all' to allow every server event; an empty array allows none. Omission preserves the existing allow-all behavior. Responses events use an object with type 'response.event' and a response_event selector.

        - `Literal["all"]`

          - `"all"`

        - `List[ServerEventSelector]`

          - `type: str`

            The outer Live server event type. Use 'response.event' for Responses events.

          - `response_event: Optional[str]`

            The nested Responses event type. Required when type is 'response.event'; forbidden for other event types.

  - `delegation: Optional[Delegation]`

    Update the Responses backend for an existing Live session without changing delegation ownership.

    - `type: Literal["responses"]`

      The delegation owner. Always `responses` for tasks handled by the Responses API.

      - `"responses"`

    - `responses: Optional[ResponsesDelegationUpdateConfig]`

      Responses backend settings to update. Omitted settings keep their existing values.

      - `instructions: Optional[str]`

        Instructions for the delegated Responses model, separate from Live instructions. See [backend prompting](/api/docs/guides/live-delegation#start-with-your-existing-backend-prompt).

      - `max_output_tokens: Optional[int]`

        Maximum number of output tokens for each delegated response.

      - `model: Optional[str]`

        The Responses backend model to use for subsequent delegated requests. Omit to keep the current backend model.

      - `parallel_tool_calls: Optional[bool]`

        Whether the delegated Responses model may request multiple tool calls in a single response.

      - `reasoning: Optional[Reasoning]`

        Reasoning settings passed to each delegated Responses request.

        - `effort: Optional[Literal["none", "minimal", "low", 3 more]]`

          How much reasoning effort the delegated Responses model should use. Supported values depend on the backend model.

          - `"none"`

          - `"minimal"`

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"xhigh"`

        - `summary: Optional[Literal["concise", "detailed", "auto"]]`

          The reasoning summary to request from the delegated Responses model, when supported.

          - `"concise"`

          - `"detailed"`

          - `"auto"`

      - `service_tier: Optional[Literal["auto", "default", "fast_tier_temp_pilot", 3 more]]`

        Service tier for delegated Responses requests.

        - `"auto"`

        - `"default"`

        - `"fast_tier_temp_pilot"`

        - `"flex"`

        - `"priority"`

        - `"ultrafast"`

      - `text: Optional[Text]`

        Text generation settings passed to each delegated Responses request.

        - `verbosity: Optional[Literal["low", "medium", "high"]]`

          The amount of detail in text generated by the Responses backend. This does not configure the Live model’s spoken delivery.

          - `"low"`

          - `"medium"`

          - `"high"`

      - `tool_choice: Optional[ToolChoice]`

        Controls which tool the Responses backend uses when handling a task delegated by the Live model.

        - `Literal["auto", "none", "required"]`

          - `"auto"`

          - `"none"`

          - `"required"`

        - `class ToolChoiceLiveFunctionToolChoiceParam: …`

          - `name: str`

          - `type: Literal["function"]`

            - `"function"`

        - `class ToolChoiceLiveMCPToolChoiceParam: …`

          - `name: str`

          - `server_label: str`

          - `type: Literal["mcp"]`

            - `"mcp"`

      - `tools: Optional[List[Tool]]`

        Tools available to the Responses backend while it handles tasks delegated by the Live model.

        - `class FunctionTool: …`

          A function tool available to the Responses backend when the Live model delegates a task.

          - `name: str`

            The name the delegated Responses model uses when calling this function.

          - `type: Literal["function"]`

            The tool type. Always `function`.

            - `"function"`

          - `description: Optional[str]`

            What the function does and when the delegated Responses model should call it.

          - `parameters: Optional[Dict[str, object]]`

            A JSON Schema object describing the arguments accepted by the function.

          - `strict: Optional[bool]`

            Whether the delegated Responses model must follow the function’s parameter schema exactly.

        - `class ToolWebSearch: …`

          A web search tool available to the Live session’s Responses backend.

          - `type: Literal["web_search"]`

            The tool type. Always `web_search`.

            - `"web_search"`

  - `store: Optional[bool]`

    Whether to store the forked session. Omission inherits the stored session's setting.

### Returns

- `class SessionForkResponse: …`

  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.

    - `id: str`

      Opaque session identifier. Preserve the returned value unchanged, including its prefix.

  - `transport: Transport`

    WebRTC transport with the SDP answer.

    - `sdp: str`

      Session Description Protocol message for the WebRTC connection.

    - `type: Literal["webrtc"]`

      The transport used for the Live session. Always `webrtc`.

      - `"webrtc"`

### Example

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
response = client.live.sessions.fork(
    session_id="session_id",
    transport={
        "sdp": "x",
        "type": "webrtc",
    },
)
print(response.session)
```

#### Response

```json
{
  "session": {
    "id": "id"
  },
  "transport": {
    "sdp": "x",
    "type": "webrtc"
  }
}
```
