Skip to content

fix(skills): honor OPENAI_BASE_URL in whisper api skill#55597

Merged
sallyom merged 2 commits into
openclaw:mainfrom
lurebat:fix/whisper-api-openai-base-url
Mar 27, 2026
Merged

fix(skills): honor OPENAI_BASE_URL in whisper api skill#55597
sallyom merged 2 commits into
openclaw:mainfrom
lurebat:fix/whisper-api-openai-base-url

Conversation

@lurebat

@lurebat lurebat commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make skills/openai-whisper-api/scripts/transcribe.sh honor OPENAI_BASE_URL
  • keep the default OpenAI endpoint unchanged when the env var is unset
  • document the OPENAI_BASE_URL override in the skill docs

Why

The current openai-whisper-api skill hardcodes https://api.openai.com/v1/audio/transcriptions, which makes it fail for users routing OpenAI-compatible traffic through a local gateway or proxy (for example LiteLLM).

This keeps the existing default behavior, but allows:

  • OPENAI_BASE_URL=http://127.0.0.1:51805/v1
  • OPENAI_BASE_URL=https://proxy.example.com/v1

Testing

  • tested locally with bash -n skills/openai-whisper-api/scripts/transcribe.sh
  • verified the script now builds ${OPENAI_BASE_URL}/audio/transcriptions
  • full pnpm build && pnpm check && pnpm test not run
    • attempted broader repo checks, but they fail locally due to an unrelated existing config validation issue in /home/asaf/.openclaw/openclaw.json

AI assistance

AI-assisted. I verified the change and the resulting diff.

@greptile-apps

greptile-apps Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes the openai-whisper-api skill configurable via OPENAI_BASE_URL, allowing users to route transcription requests through a local proxy (e.g. LiteLLM) instead of the hardcoded OpenAI endpoint. The default behavior is fully preserved when the env var is unset.

  • transcribe.sh: introduces api_base with the correct :- default fallback and a single-trailing-slash strip (%/), then substitutes the variable into the curl URL. The implementation is clean and handles the common edge-case of a user-supplied trailing slash.
  • SKILL.md: adds OPENAI_BASE_URL documentation in both the title description and the API-key section. A minor redundancy exists in the API-key section (see inline comment), but it is purely cosmetic.

Confidence Score: 5/5

Safe to merge — the change is minimal, default behavior is unchanged, and the only finding is a cosmetic doc redundancy.

Two-line shell change is correct: default fallback preserves the original hardcoded URL, the trailing-slash strip prevents double-slash in the path, and the variable is properly quoted. No logic errors, no security concerns. The single P2 comment is a documentation style nit with no functional impact.

No files require special attention.

Important Files Changed

Filename Overview
skills/openai-whisper-api/scripts/transcribe.sh Adds OPENAI_BASE_URL support with a correct default fallback and a trailing-slash strip. Logic is sound and default behavior is fully preserved.
skills/openai-whisper-api/SKILL.md Documents OPENAI_BASE_URL in two places; the API-key section now has a minor redundancy (OPENAI_API_KEY mentioned twice in quick succession).
Prompt To Fix All With AI
This is a comment left during a code review.
Path: skills/openai-whisper-api/SKILL.md
Line: 52-54

Comment:
**Duplicate `OPENAI_API_KEY` mention**

The new line at 52 and the existing line 54 both start with "Set `OPENAI_API_KEY`", making the section slightly repetitive. Consider folding the `OPENAI_BASE_URL` note into the existing sentence instead of prepending a separate one.

```suggestion
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:
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(skills): honor OPENAI_BASE_URL in wh..." | Re-trigger Greptile

Comment thread skills/openai-whisper-api/SKILL.md Outdated
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@sallyom

sallyom commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Merging this as a small, coherent skill fix.

@sallyom sallyom merged commit 4cf783b into openclaw:main Mar 27, 2026
20 of 26 checks passed
johnkhagler pushed a commit to johnkhagler/openclaw that referenced this pull request Mar 29, 2026
* 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) <asaf@asafshq.win>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
alexcode-cc pushed a commit to alexcode-cc/clawdbot that referenced this pull request Mar 30, 2026
* 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) <asaf@asafshq.win>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* 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) <asaf@asafshq.win>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* 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) <asaf@asafshq.win>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* 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) <asaf@asafshq.win>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
sunapi386 added a commit to aceteam-ai/safeclaw that referenced this pull request May 13, 2026
…eUrl

The dynamic-model resolver in extensions/openai/openai-provider.ts hardcoded
`baseUrl: "https://api.openai.com/v1"` for every default GPT entry. This
means setting `OPENAI_BASE_URL` in env (e.g. when running OpenClaw behind a
LiteLLM/vLLM/local-proxy) has no effect — the discovered baseUrl wins via
the `?? discoveredModel.baseUrl` fallback in
src/agents/pi-embedded-runner/model.ts and the agent calls api.openai.com
directly with a stale or proxy-style key, returning 401.

Adds `resolveOpenAIDefaultBaseUrl()` in base-url.ts that returns
`process.env.OPENAI_BASE_URL` (when non-empty) and falls back to the
hardcoded URL otherwise. Replaces the 5 hardcoded literals in the dynamic
model registry with the helper.

This mirrors the precedent set by openclaw#55597 (honor OPENAI_BASE_URL in whisper
api skill) and matches what the OpenAI Node SDK already does — its
constructor falls back to env when `baseURL` is undefined. Provider-config
baseUrl still takes precedence (resolver consults `providerConfig.baseUrl`
before `discoveredModel.baseUrl`), so this is fully backwards-compatible:
users with explicit config see no change, users with only the env var now
get the routing they expected.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* 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) <asaf@asafshq.win>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants