From 4cf783b7c1f4231812426ae5bdba6cf9641d6692 Mon Sep 17 00:00:00 2001 From: lurebat <154669821+lurebat@users.noreply.github.com> Date: Fri, 27 Mar 2026 16:23:26 +0300 Subject: [PATCH] fix(skills): honor OPENAI_BASE_URL in whisper api skill (#55597) * fix(skills): honor OPENAI_BASE_URL in whisper api skill * Update skills/openai-whisper-api/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Asaf (via Bruh) Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- skills/openai-whisper-api/SKILL.md | 4 ++-- skills/openai-whisper-api/scripts/transcribe.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/skills/openai-whisper-api/SKILL.md b/skills/openai-whisper-api/SKILL.md index 99e54340ded1..2b18c6ec6dca 100644 --- a/skills/openai-whisper-api/SKILL.md +++ b/skills/openai-whisper-api/SKILL.md @@ -25,7 +25,7 @@ metadata: # OpenAI Whisper API (curl) -Transcribe an audio file via OpenAI’s `/v1/audio/transcriptions` endpoint. +Transcribe an audio file via OpenAI’s `/v1/audio/transcriptions` endpoint. Set `OPENAI_BASE_URL` to use an OpenAI-compatible proxy or local gateway. ## Quick start @@ -49,7 +49,7 @@ Defaults: ## API key -Set `OPENAI_API_KEY`, or configure it in `~/.openclaw/openclaw.json`: +Set `OPENAI_API_KEY`, or configure it in `~/.openclaw/openclaw.json`. Optionally set `OPENAI_BASE_URL` (for example `http://127.0.0.1:51805/v1`) to use an OpenAI-compatible proxy or local gateway: ```json5 { diff --git a/skills/openai-whisper-api/scripts/transcribe.sh b/skills/openai-whisper-api/scripts/transcribe.sh index 551c7b473e27..2a4fd20afa61 100644 --- a/skills/openai-whisper-api/scripts/transcribe.sh +++ b/skills/openai-whisper-api/scripts/transcribe.sh @@ -72,7 +72,10 @@ fi mkdir -p "$(dirname "$out")" -curl -sS https://api.openai.com/v1/audio/transcriptions \ +api_base="${OPENAI_BASE_URL:-https://api.openai.com/v1}" +api_base="${api_base%/}" + +curl -sS "${api_base}/audio/transcriptions" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Accept: application/json" \ -F "file=@${in}" \