cURL
curl --request POST \
--url https://my.orq.ai/v3/router/live/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session": {
"idle_timeout_s": 15,
"model": "openai/gpt-live-1.1",
"wake_policy": {
"type": "speech"
}
},
"transport": {
"sdp": "<SDP offer>",
"type": "webrtc"
}
}
'import { readFile } from "node:fs/promises";
import { Orq } from "@orq-ai/node";
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
const result = await orq.live.createSession({
session: {
model: "openai/gpt-live-1.1",
instructions: "Keep replies brief.",
wakePolicy: { type: "speech" },
idleTimeoutS: 15,
},
transport: {
type: "webrtc",
sdp: await readFile("offer.sdp", "utf8"),
},
});
console.log(result.transport.sdp);import requests
url = "https://my.orq.ai/v3/router/live/sessions"
payload = {
"session": {
"idle_timeout_s": 15,
"model": "openai/gpt-live-1.1",
"wake_policy": { "type": "speech" }
},
"transport": {
"sdp": "<SDP offer>",
"type": "webrtc"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"session": {
"id": "<string>"
},
"transport": {
"sdp": "<string>",
"type": "webrtc"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}Live
Create a Live WebRTC session
Exchange a WebRTC SDP offer for an answer and start a GPT-Live session. Requires an API key that grants realtime.execute.
POST
/
v3
/
router
/
live
/
sessions
cURL
curl --request POST \
--url https://my.orq.ai/v3/router/live/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session": {
"idle_timeout_s": 15,
"model": "openai/gpt-live-1.1",
"wake_policy": {
"type": "speech"
}
},
"transport": {
"sdp": "<SDP offer>",
"type": "webrtc"
}
}
'import { readFile } from "node:fs/promises";
import { Orq } from "@orq-ai/node";
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
const result = await orq.live.createSession({
session: {
model: "openai/gpt-live-1.1",
instructions: "Keep replies brief.",
wakePolicy: { type: "speech" },
idleTimeoutS: 15,
},
transport: {
type: "webrtc",
sdp: await readFile("offer.sdp", "utf8"),
},
});
console.log(result.transport.sdp);import requests
url = "https://my.orq.ai/v3/router/live/sessions"
payload = {
"session": {
"idle_timeout_s": 15,
"model": "openai/gpt-live-1.1",
"wake_policy": { "type": "speech" }
},
"transport": {
"sdp": "<SDP offer>",
"type": "webrtc"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"session": {
"id": "<string>"
},
"transport": {
"sdp": "<string>",
"type": "webrtc"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "<string>",
"failures": "<unknown>"
}
}Related guide: Realtime guide. See the Realtime guide for a walkthrough with examples.
Authorizations
Body
application/json
Was this page helpful?