From df49fbe0ac0cb885f8b478c19d992ffa257117cc Mon Sep 17 00:00:00 2001 From: Yurui Zhou Date: Mon, 27 Apr 2026 13:26:21 +0800 Subject: [PATCH] feat(speech): make OpenAI realtime transcription URL configurable (#570) Allow `OPENAI_REALTIME_URL` env var to override the hardcoded `wss://api.openai.com/v1/realtime?intent=transcription` endpoint, with the current value as default. Pairs with the OpenAI SDK's existing `OPENAI_BASE_URL` support that already makes HTTP audio endpoints reroutable. Unblocks pointing the realtime session at any OpenAI Realtime API protocol-compatible backend (Azure OpenAI, Alibaba Bailian / DashScope, self-hosted compat layers) without further changes. Closes #569 Co-authored-by: Claude Opus 4.7 (1M context) --- .../speech/providers/openai/realtime-transcription-session.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/server/speech/providers/openai/realtime-transcription-session.ts b/packages/server/src/server/speech/providers/openai/realtime-transcription-session.ts index e8b6eb9c8..b8e8eb00c 100644 --- a/packages/server/src/server/speech/providers/openai/realtime-transcription-session.ts +++ b/packages/server/src/server/speech/providers/openai/realtime-transcription-session.ts @@ -102,7 +102,8 @@ export class OpenAIRealtimeTranscriptionSession this.closing = false; this.ready = new Promise((resolve, reject) => { - const url = "wss://api.openai.com/v1/realtime?intent=transcription"; + const url = + process.env.OPENAI_REALTIME_URL ?? "wss://api.openai.com/v1/realtime?intent=transcription"; const ws = new WebSocket(url, { headers: { Authorization: `Bearer ${this.apiKey}`,