Skip to content

Hang up call

client.Realtime.Calls.Hangup(ctx, callID) error
POST/realtime/calls/{call_id}/hangup

End an active Realtime API call, whether it was initiated over SIP or WebRTC.

ParametersExpand Collapse
callID string

Hang up call

package main

import (
  "context"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  err := client.Realtime.Calls.Hangup(context.TODO(), "call_id")
  if err != nil {
    panic(err.Error())
  }
}
Returns Examples