Skip to content

Commit 68e150c

Browse files
author
lagutinl613-alt
committed
feat: support custom baseUrl for OpenAI/OpenRouter providers
Allows using local proxies, OpenClaw gateway, or any OpenAI-compatible endpoint by setting baseUrl in LLM config. Falls back to default URLs.
1 parent b4fac5b commit 68e150c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/llm/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,12 @@ export function createLLMProvider(config: LLMConfig): LLMProvider {
289289
case "openai":
290290
return createOpenAICompatibleProvider(
291291
config,
292-
"https://api.openai.com/v1",
292+
(config as any).baseUrl || "https://api.openai.com/v1",
293293
);
294294
case "openrouter":
295295
return createOpenAICompatibleProvider(
296296
config,
297-
"https://openrouter.ai/api/v1",
297+
(config as any).baseUrl || "https://openrouter.ai/api/v1",
298298
);
299299
default:
300300
throw new Error(`Unknown LLM provider: ${config.provider}`);

0 commit comments

Comments
 (0)