Create session
client.live.create(LiveCreateParams { session, transport } body, RequestOptionsoptions?): LiveCreateResponse { session, transport }
POST/live/sessions
Create a Live WebRTC session. Start with the Live prompting guide.
Create session
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const live = await client.live.create({
session: { model: 'gpt-live-1' },
transport: { sdp: 'x', type: 'webrtc' },
});
console.log(live.session);{
"session": {
"id": "live_123"
},
"transport": {
"type": "webrtc",
"sdp": "<SDP answer>"
}
}Returns Examples
{
"session": {
"id": "live_123"
},
"transport": {
"type": "webrtc",
"sdp": "<SDP answer>"
}
}