allmodels.ioDocs
API ReferenceRealtime

Connect to a Realtime session

Connect with a single-use client_secret, or use profile_id with an Authorization Bearer token. Client audio is accepted as soon as the WebSocket opens.

GET/v1/realtime

Connect with a single-use client_secret, or use profile_id with an Authorization Bearer token. Client audio is accepted as soon as the WebSocket opens.

Authorization

client_secret<token>

Single-use client secret returned by POST /v1/realtime/client-secrets.

In: query

Query Parameters

client_secret?string

Single-use credential returned by POST /v1/realtime/client-secrets.

profile_id?string

Realtime profile used with Authorization Bearer authentication.

Response Body

application/json

application/json

application/json

Client
Language
import { readFile } from "node:fs/promises";import WebSocket from "ws";const audioChunk = await readFile("chunk.pcm");const ws = new WebSocket("wss://api.allmodels.io/v1/realtime?client_secret=$REALTIME_CLIENT_SECRET");ws.on("open", () => {  ws.send(audioChunk);  ws.send(JSON.stringify({ type: "realtime.input_audio.commit" }));});ws.on("message", (data, isBinary) => {  if (isBinary) process.stdout.write(data);  else console.log(JSON.parse(data.toString()));});ws.on("error", console.error);
Empty
{  "error": "missing_api_key"}
{  "error": "websocket_upgrade_required"}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "property1": null,    "property2": null  }}