This package is ESM-only. It requires Node.js >= 18, a browser environment, or an equivalent JS runtime (Deno, Bun, CF workers, etc). All usage and

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-10-17 08:30:03

This package is ESM-only. It requires Node.js >= 18, a browser environment, or an equivalent JS runtime (Deno, Bun, CF workers, etc).

All usage and events are 100% compatible with the OpenAI JS version. The main difference aside from bug fixes is that all events are fully-typed.

For more info on usage, tools, and custom events, see OpenAI's readme. Note that this package is 100% compatible with OpenAI's beta package in terms of both official and unofficial events. The only difference is that all events are typed.

Alternatively, you can use apiKey with RealtimeClient in the browser, but you also have to pass dangerouslyAllowAPIKeyInBrowser: true.

We strongly recommend against including your API key in any client (mobile or browser). It can be useful for local testing, but for production, you should be using a relay server.

Simple Node.js demo using the RealtimeClient with a microphone and speaker to simulate a full, back & forth conversation from the terminal.

Leave a Comment