Skip to content

Realtime

OpenAI Realtime API–compatible voice WebSocket.

WS/v1/realtime

WS /v1/realtime transparently proxies OpenAI Realtime events. Server-to-server clients work by changing base URL and API key only.

Auth

Pass Authorization: Bearer plm_… or x-api-key on the handshake. Do not put the key in the query string.

파라미터타입필수설명
modelquery필수gpt-realtime-2.1 or gpt-realtime-2.1-mini
Authorizationheader필수Bearer plm_… or 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

Credits are held on connect and settled from response.done usage (text/audio tokens) when the session ends. A successful upstream session bills at least one minor currency unit.

Max session 25 minutes · idle 5 minutes · first client message within 30 seconds.