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

Accept call

client.Live.Sessions.Accept(ctx, sessionID, body) error
POST/live/sessions/{session_id}/accept

Accept an incoming SIP call. Supply session with type live, the model, and startup configuration. Before accepting calls, follow the Live prompting guide to write frontend conversation instructions and a separate backend prompt. SIP media format is negotiated; omit audio.format.

ParametersExpand Collapse
sessionID string
body SessionAcceptParams

Accept call

package main

import (
  "context"

  "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"),
  )
  err := client.Live.Sessions.Accept(
    context.TODO(),
    "session_id",
    live.SessionAcceptParams{
      Session: live.SessionAcceptParamsSession{
        Model: "gpt-live-1",
        Type: live.LiveLive,
      },
    },
  )
  if err != nil {
    panic(err.Error())
  }
}
Returns Examples