openai-realtime-api  by transitive-bullshit

Typed client for OpenAI's realtime voice API

created 9 months ago
349 stars

Top 80.8% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a TypeScript client for OpenAI's real-time voice API, offering a strongly-typed, drop-in replacement for OpenAI's official JavaScript version. It addresses common bugs and inconsistencies, enhancing stability and developer experience for those building real-time voice applications with OpenAI.

How It Works

The client leverages WebSocket connections to interact with OpenAI's real-time API. It provides a typed interface for all events and handlers, ensuring type safety and reducing runtime errors. The architecture supports Node.js, browser, Deno, Bun, and Cloudflare Workers, with a focus on compatibility and ease of use.

Quick Start & Requirements

  • Install: npm install openai-realtime-api
  • Requirements: Node.js >= 18, ESM-only.
  • Examples and documentation are available in the repository.

Highlighted Details

  • 100% typed events and handlers.
  • Fixes numerous bugs and inconsistencies from the official beta package.
  • Supports multiple JavaScript runtimes (Node.js, browser, Deno, Bun, CF workers).
  • Includes Node.js CLI examples and a simple relay server.
  • Features the OpenAI Realtime Console demo.

Maintenance & Community

  • Maintained by Travis Fischer.
  • MIT License.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial use and closed-source applications.

Limitations & Caveats

The RealtimeClient can accept an API key directly in the browser with dangerouslyAllowAPIKeyInBrowser: true, but this is strongly discouraged for production environments due to security risks.

Health Check
Last commit

2 weeks ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
6 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.