## Fork session

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

Fork a stored Live session onto a new WebRTC connection.

### Path Parameters

- `session_id: string`

### Body Parameters

- `transport: object { sdp, type }`

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

  - `sdp: string`

    Session Description Protocol message for the WebRTC connection.

  - `type: "webrtc"`

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

    - `"webrtc"`

- `session: optional MediaSessionForkConfig`

  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 "all" or array of string`

        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.

        - `"all"`

          - `"all"`

        - `array of string`

      - `allowed_server_events: optional "all" or array of ServerEventSelector`

        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.

        - `"all"`

          - `"all"`

        - `array of ServerEventSelector`

          - `type: string`

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

          - `response_event: optional string`

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

  - `delegation: optional object { type, acknowledgement_delay_ms, responses }`

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

    - `type: "responses"`

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

      - `"responses"`

    - `acknowledgement_delay_ms: optional number`

      Milliseconds to wait before requesting an automatic spoken acknowledgement for a delegation. The model may still speak before this delay. Any commentary or thinking appended to the session cancels all pending acknowledgements, including those for other delegations. Defaults to 400 for Decisions sessions and 0 (request immediately) for other sessions. Omission in a session update preserves the current value. Updates apply to subsequent delegations.

    - `responses: optional ResponsesDelegationUpdateConfig`

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

      - `instructions: optional string or null`

        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 number or null`

        Maximum number of output tokens for each delegated response.

      - `model: optional string`

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

      - `parallel_tool_calls: optional boolean or null`

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

      - `reasoning: optional object { effort, summary }  or null`

        Reasoning settings passed to each delegated Responses request.

        - `effort: optional "none" or "minimal" or "low" or 3 more or null`

          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 "concise" or "detailed" or "auto" or null`

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

          - `"concise"`

          - `"detailed"`

          - `"auto"`

      - `service_tier: optional "auto" or "default" or "fast_tier_temp_pilot" or 3 more or null`

        Service tier for delegated Responses requests.

        - `"auto"`

        - `"default"`

        - `"fast_tier_temp_pilot"`

        - `"flex"`

        - `"priority"`

        - `"ultrafast"`

      - `text: optional object { verbosity }  or null`

        Text generation settings passed to each delegated Responses request.

        - `verbosity: optional "low" or "medium" or "high" or null`

          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 "auto" or "none" or "required" or Function { name, type }  or Mcp { server_label, type, name }  or 11 more`

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

        - `LiveToolChoiceEnum = "auto" or "none" or "required"`

          - `"auto"`

          - `"none"`

          - `"required"`

        - `Function object { name, type }`

          - `name: string`

            The name of the function tool to call.

          - `type: "function"`

            The tool to call. Always `function`.

            - `"function"`

        - `Mcp object { server_label, type, name }`

          - `server_label: string`

            The label of the MCP server to call.

          - `type: "mcp"`

            The tool to call. Always `mcp`.

            - `"mcp"`

          - `name: optional string or null`

            The name of the MCP tool to call. If omitted, the server may choose a default.

        - `FileSearch object { type }`

          - `type: "file_search"`

            The tool to call. Always `file_search`.

            - `"file_search"`

        - `WebSearch object { type }`

          - `type: "web_search"`

            The tool to call. Always `web_search`.

            - `"web_search"`

        - `WebSearchPreview object { type }`

          - `type: "web_search_preview"`

            The tool to call. Always `web_search_preview`.

            - `"web_search_preview"`

        - `ImageGeneration object { type }`

          - `type: "image_generation"`

            The tool to call. Always `image_generation`.

            - `"image_generation"`

        - `Computer object { type }`

          - `type: "computer"`

            The tool to call. Always `computer`.

            - `"computer"`

        - `CodeInterpreter object { type }`

          - `type: "code_interpreter"`

            The tool to call. Always `code_interpreter`.

            - `"code_interpreter"`

        - `ProgrammaticToolCalling object { type }`

          - `type: "programmatic_tool_calling"`

            The tool to call. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `Shell object { type }`

          Forces the model to call the shell tool when a tool call is required.

          - `type: "shell"`

            The tool to call. Always `shell`.

            - `"shell"`

        - `Custom object { name, type }`

          - `name: string`

            The name of the custom tool to call.

          - `type: "custom"`

            The tool to call. Always `custom`.

            - `"custom"`

        - `ApplyPatch object { type }`

          Forces the model to call the apply_patch tool when executing a tool call.

          - `type: "apply_patch"`

            The tool to call. Always `apply_patch`.

            - `"apply_patch"`

        - `LiveAllowedToolsChoiceParam object { tools, type, mode }`

          - `tools: array of Function { name, type }  or Mcp { server_label, type, name }  or FileSearch { type }  or 9 more`

            The tools that the delegated Responses model may call.

            - `Function object { name, type }`

              - `name: string`

                The name of the function tool to call.

              - `type: "function"`

                The tool to call. Always `function`.

                - `"function"`

            - `Mcp object { server_label, type, name }`

              - `server_label: string`

                The label of the MCP server to call.

              - `type: "mcp"`

                The tool to call. Always `mcp`.

                - `"mcp"`

              - `name: optional string or null`

                The name of the MCP tool to call. If omitted, the server may choose a default.

            - `FileSearch object { type }`

              - `type: "file_search"`

                The tool to call. Always `file_search`.

                - `"file_search"`

            - `WebSearch object { type }`

              - `type: "web_search"`

                The tool to call. Always `web_search`.

                - `"web_search"`

            - `WebSearchPreview object { type }`

              - `type: "web_search_preview"`

                The tool to call. Always `web_search_preview`.

                - `"web_search_preview"`

            - `ImageGeneration object { type }`

              - `type: "image_generation"`

                The tool to call. Always `image_generation`.

                - `"image_generation"`

            - `Computer object { type }`

              - `type: "computer"`

                The tool to call. Always `computer`.

                - `"computer"`

            - `CodeInterpreter object { type }`

              - `type: "code_interpreter"`

                The tool to call. Always `code_interpreter`.

                - `"code_interpreter"`

            - `ProgrammaticToolCalling object { type }`

              - `type: "programmatic_tool_calling"`

                The tool to call. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `Shell object { type }`

              Forces the model to call the shell tool when a tool call is required.

              - `type: "shell"`

                The tool to call. Always `shell`.

                - `"shell"`

            - `Custom object { name, type }`

              - `name: string`

                The name of the custom tool to call.

              - `type: "custom"`

                The tool to call. Always `custom`.

                - `"custom"`

            - `ApplyPatch object { type }`

              Forces the model to call the apply_patch tool when executing a tool call.

              - `type: "apply_patch"`

                The tool to call. Always `apply_patch`.

                - `"apply_patch"`

          - `type: "allowed_tools"`

            The tool choice type. Always `allowed_tools`.

            - `"allowed_tools"`

          - `mode: optional "none" or "auto" or "required" or null`

            How to select a tool from the allowed set.

            - `"none"`

            - `"auto"`

            - `"required"`

      - `tools: optional array of FunctionTool or WebSearch { type }  or FileSearch { type }  or 10 more`

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

        - `FunctionTool object { name, type, description, 2 more }`

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

          - `name: string`

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

          - `type: "function"`

            The tool type. Always `function`.

            - `"function"`

          - `description: optional string or null`

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

          - `parameters: optional map[unknown] or null`

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

          - `strict: optional boolean or null`

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

        - `WebSearch object { type }`

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

          - `type: "web_search"`

            The tool type. Always `web_search`.

            - `"web_search"`

        - `FileSearch object { type }`

          - `type: "file_search"`

            - `"file_search"`

        - `CodeInterpreter object { type }`

          - `type: "code_interpreter"`

            - `"code_interpreter"`

        - `Shell object { type, environment }`

          A Responses shell tool. Use a hosted container or return local shell results with response.item.create. Domain secrets are not supported.

          - `type: "shell"`

            - `"shell"`

          - `environment: optional ContainerAuto { type, file_ids, memory_limit, 2 more }  or ContainerReference { container_id, type }  or Local { type, skills }  or null`

            - `ContainerAuto object { type, file_ids, memory_limit, 2 more }`

              - `type: "container_auto"`

                Automatically creates a container for this request

                - `"container_auto"`

              - `file_ids: optional array of string or null`

                An optional list of uploaded files to make available to your code.

              - `memory_limit: optional "1g" or "4g" or "16g" or "64g" or null`

                The memory limit for the container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy: optional Disabled { type }  or Allowlist { allowed_domains, type }  or null`

                Network access policy for the container.

                - `Disabled object { type }`

                  - `type: "disabled"`

                    Disable outbound network access. Always `disabled`.

                    - `"disabled"`

                - `Allowlist object { allowed_domains, type }`

                  - `allowed_domains: array of string`

                    A list of allowed domains when type is `allowlist`.

                  - `type: "allowlist"`

                    Allow outbound network access only to specified domains. Always `allowlist`.

                    - `"allowlist"`

              - `skills: optional array of SkillReference { skill_id, type, version }  or Inline { description, name, source, type }  or null`

                An optional list of skills referenced by id or inline data.

                - `SkillReference object { skill_id, type, version }`

                  - `skill_id: string`

                    The ID of the referenced skill.

                  - `type: "skill_reference"`

                    References a skill created with the /v1/skills endpoint.

                    - `"skill_reference"`

                  - `version: optional string or null`

                    Optional skill version. Use a positive integer or 'latest'. Omit for default.

                - `Inline object { description, name, source, type }`

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `source: object { data, media_type, type }`

                    Inline skill payload

                    - `data: string`

                      Base64-encoded skill zip bundle.

                    - `media_type: "application/zip"`

                      The media type of the inline skill payload. Must be `application/zip`.

                      - `"application/zip"`

                    - `type: "base64"`

                      The type of the inline skill source. Must be `base64`.

                      - `"base64"`

                  - `type: "inline"`

                    Defines an inline skill for this request.

                    - `"inline"`

            - `ContainerReference object { container_id, type }`

              - `container_id: string`

                The ID of the referenced container.

              - `type: "container_reference"`

                References a container created with the /v1/containers endpoint

                - `"container_reference"`

            - `Local object { type, skills }`

              - `type: "local"`

                Use a local computer environment.

                - `"local"`

              - `skills: optional array of object { description, name, path }  or null`

                An optional list of skills.

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `path: string`

                  The path to the directory containing the skill.

        - `ImageGeneration object { type }`

          - `type: "image_generation"`

            - `"image_generation"`

        - `Mcp object { type }`

          - `type: "mcp"`

            - `"mcp"`

        - `Custom object { type }`

          - `type: "custom"`

            - `"custom"`

        - `Namespace object { type }`

          - `type: "namespace"`

            - `"namespace"`

        - `ToolSearch object { type }`

          - `type: "tool_search"`

            - `"tool_search"`

        - `ProgrammaticToolCalling object { type }`

          - `type: "programmatic_tool_calling"`

            - `"programmatic_tool_calling"`

        - `Computer object { type }`

          - `type: "computer"`

            - `"computer"`

        - `ApplyPatch object { type }`

          - `type: "apply_patch"`

            - `"apply_patch"`

  - `store: optional boolean`

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

### Returns

- `session: object { id }`

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

  - `id: string`

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

- `transport: object { sdp, type }`

  WebRTC transport with the SDP answer.

  - `sdp: string`

    Session Description Protocol message for the WebRTC connection.

  - `type: "webrtc"`

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

    - `"webrtc"`

### Example

```http
curl https://api.openai.com/v1/live/sessions/$SESSION_ID/fork \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -d '{
          "transport": {
            "sdp": "x",
            "type": "webrtc"
          }
        }'
```

#### Response

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

### Example

```http
curl https://api.openai.com/v1/live/sessions/live_123/fork \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"session":{},"transport":{"type":"webrtc","sdp":"<SDP offer>"}}'
```
