Realtime
OpenAI Realtime API 互換の音声 WebSocket。
WS/v1/realtime
WS /v1/realtime は OpenAI Realtime イベントを透過プロキシします。
Auth
ハンドシェイクで Authorization: Bearer plm_… または x-api-key を使います。
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| model | query | 필수 | gpt-realtime-2.1 または gpt-realtime-2.1-mini |
| Authorization | header | 필수 | Bearer plm_… または x-api-key |
Example
ts
import WebSocket from "ws";
const model = "gpt-realtime-2.1";
const url = `wss://apirouter.pleum.ai/v1/realtime?model=${model}`;
const ws = new WebSocket(url, {
headers: {
Authorization: "Bearer " + process.env.PLEUM_API_KEY,
},
});
ws.on("open", () => {
ws.send(JSON.stringify({
type: "session.update",
session: { modalities: ["audio", "text"], voice: "alloy" },
}));
});
ws.on("message", (data) => {
const event = JSON.parse(data.toString());
console.log(event.type);
});Billing
接続時に hold、終了時に response.done usage で settle します。
最大 25 分 · idle 5 分 · 最初のクライアントメッセージ 30 秒以内。