## Create session

`client.Live.New(ctx, body) (*LiveNewResponse, error)`

**post** `/live/sessions`

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

### Parameters

- `body LiveNewParams`

  - `Session param.Field[MediaSessionConfig]`

    Startup configuration for the Live session.

  - `Transport param.Field[LiveNewParamsTransport]`

    WebRTC transport with the browser's SDP offer.

    - `Sdp string`

      Session Description Protocol message for the WebRTC connection.

    - `Type Webrtc`

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

      - `const WebrtcWebrtc Webrtc = "webrtc"`

### Returns

- `type LiveNewResponse 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 LiveNewResponseSession`

    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 LiveNewResponseTransport`

    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`.

      - `const WebrtcWebrtc Webrtc = "webrtc"`

### Example

```go
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"),
  )
  live, err := client.Live.New(context.TODO(), live.LiveNewParams{
    Session: live.MediaSessionConfigParam{
      Model: live.MediaSessionConfigModelGPTLive1,
    },
    Transport: live.LiveNewParamsTransport{
      Sdp: "x",
    },
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", live.Session)
}
```

#### Response

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