## Create session

`LiveCreateResponse live().create(LiveCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/live/sessions`

Create a Live WebRTC session. Start with the [Live prompting guide](/api/docs/guides/live-prompting).

### Parameters

- `LiveCreateParams params`

  - `MediaSessionConfig session`

    Startup configuration for the Live session.

  - `Transport transport`

    WebRTC transport with the browser's SDP offer.

    - `String sdp`

      Session Description Protocol message for the WebRTC connection.

    - `JsonValue; type "webrtc"constant`

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

      - `WEBRTC("webrtc")`

### Returns

- `class LiveCreateResponse:`

  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.

    - `String id`

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

  - `Transport transport`

    WebRTC transport with the SDP answer.

    - `String sdp`

      Session Description Protocol message for the WebRTC connection.

    - `JsonValue; type "webrtc"constant`

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

      - `WEBRTC("webrtc")`

### Example

```java
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.live.LiveCreateParams;
import com.openai.models.live.LiveCreateResponse;
import com.openai.models.live.MediaSessionConfig;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        LiveCreateParams params = LiveCreateParams.builder()
            .session(MediaSessionConfig.builder()
                .model(MediaSessionConfig.Model.GPT_LIVE_1)
                .build())
            .transport(LiveCreateParams.Transport.builder()
                .sdp("x")
                .build())
            .build();
        LiveCreateResponse live = client.live().create(params);
    }
}
```

#### Response

```json
{
  "session": {
    "id": "live_123"
  },
  "transport": {
    "type": "webrtc",
    "sdp": "<SDP answer>"
  }
}
```
