Node.js reference client for OpenAI's Realtime API (beta)
Top 38.6% on sourcepulse
This repository provides a Node.js and JavaScript reference client for OpenAI's Realtime API, targeting developers building conversational applications. It simplifies prototyping by offering a high-level abstraction for managing real-time audio, text, and function calls, enabling rapid development of interactive AI experiences.
How It Works
The client abstracts the underlying WebSocket connection into three primitives: RealtimeClient
for high-level control, RealtimeAPI
for direct WebSocket interaction, and RealtimeConversation
for managing client-side conversation state and event validation. The RealtimeClient
simplifies common tasks like sending messages, streaming audio, and integrating tools via callbacks, while also providing curated events for application logic.
Quick Start & Requirements
npm i openai/openai-realtime-api-beta --save
dangerouslyAllowAPIKeyInBrowser: true
.Highlighted Details
appendInputAudio()
and tool integration with automatic callback execution.cancelResponse
.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
This library is in beta and not a final implementation. Direct browser usage of API keys is not recommended due to security risks.
8 months ago
1 day