openai/openai-realtime-api-beta

Websocket Connection Failing on Chrome with error (Error : Could not connect to "wss://api.openai.com/v1/realtime)

Closed this issue · 2 comments

In chrome. We get the following error: (Error : Could not connect to "wss://api.openai.com/v1/realtime), but it worked earlier

Surprisingly, the code works just fine on Safari.

Please provide guidance.

Code:

import { RealtimeClient } from '@openai/realtime-api-beta';

const clientRef = ref<RealtimeClient | null>(null);
clientRef.value = new RealtimeClient({ 
    apiKey: import.meta.env.VITE_APP_OPENAI_KEY,
    dangerouslyAllowAPIKeyInBrowser: true
  });

Same issue here.

The issue was related to openAI TLS configuration and it was solved by the openAI team.

Reference: https://community.openai.com/t/is-anyone-experiencing-websocket-realtime-error-on-chrome-browser/1091793/68