From 9b68e3624a1681409d0f304944777a9748c83a8e Mon Sep 17 00:00:00 2001 From: anor Date: Mon, 30 Mar 2026 17:32:52 +1000 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BF=D1=80=D0=BE=D0=BA=D1=81=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20OpenAI=20Whisper=20API=20(403=20=D0=B1?= =?UTF-8?q?=D0=B5=D0=B7=20=D0=BF=D1=80=D0=BE=D0=BA=D1=81=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- src/smeta_railway/ai/telegram_bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/smeta_railway/ai/telegram_bot.py b/src/smeta_railway/ai/telegram_bot.py index 120666d..0cd3500 100644 --- a/src/smeta_railway/ai/telegram_bot.py +++ b/src/smeta_railway/ai/telegram_bot.py @@ -306,7 +306,8 @@ async def transcribe_voice(file_path: str) -> str: if not api_key: return "" - async with httpx.AsyncClient(timeout=30) as client: + proxy = os.environ.get("OPENAI_PROXY") or os.environ.get("HTTPS_PROXY") + async with httpx.AsyncClient(timeout=30, proxy=proxy) as client: with open(file_path, "rb") as f: resp = await client.post( "https://api.openai.com/v1/audio/transcriptions",