diff --git a/lib/api.js b/lib/api.js index e522263..6eb1aab 100644 --- a/lib/api.js +++ b/lib/api.js @@ -113,13 +113,14 @@ export class RealtimeAPI extends RealtimeEventHandler { const wsModule = await import(/* webpackIgnore: true */ moduleName); const WebSocket = wsModule.default; const ws = new WebSocket( - 'wss://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview-2024-10-01', + `${this.url}${model ? `?model=${model}` : ''}`, [], { finishRequest: (request) => { // Auth request.setHeader('Authorization', `Bearer ${this.apiKey}`); request.setHeader('OpenAI-Beta', 'realtime=v1'); + request.setHeader("api-key", this.apiKey); request.end(); }, },