OpenAI Realtime Conversation

openclaw-voice-call-realtime · voice, openai-realtime, audio-streaming, voice-conversation, ai

Implements the OpenAI Realtime API for voice conversation with audio streaming.

// Source: https://github.com/TristanBrotherton/openclaw-voice-call-realtime | License: MIT | Copyright 2026 OpenClaw Foundation (original voice-call plugin)
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * OpenAI Realtime Conversation Provider
 *
 * Full conversation mode: Twilio audio -> OpenAI Realtime (STT + LLM + TTS) -> mu-law -> Twilio.
 *
 * Uses the GA Realtime API (the beta API shape was retired by OpenAI with
 * error code `beta_api_shape_disabled`). Event handlers accept both GA and
 * legacy beta event names for safety.
 */

import WebSocket from "ws";

export interface RealtimeConversationConfig {
  apiKey: string;
  model?: string;
  voice?: string;
  systemPrompt?: string;
  silenceDurationMs?: number;
  vadThreshold?: number;
  turnDetection?: "serve

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key