Create a Live WebRTC session. Start with the Live prompting guide.
Create session
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
live = client.live.create(
session={
"model": "gpt-live-1"
},
transport={
"sdp": "x",
"type": "webrtc",
},
)
print(live.session){
"session": {
"id": "live_123"
},
"transport": {
"type": "webrtc",
"sdp": "<SDP answer>"
}
}Returns Examples
{
"session": {
"id": "live_123"
},
"transport": {
"type": "webrtc",
"sdp": "<SDP answer>"
}
}