Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 3a8dea8

Browse files
committed
feat: use custom Base URL for OpenRouter model list fetch
When a custom Base URL is configured for the OpenRouter provider, Roo Code now uses that URL to fetch the list of available models instead of always hitting the public OpenRouter API. Changes: - webviewMessageHandler.ts: Pass openRouterBaseUrl to the openrouter candidate options - modelCache.ts: Forward baseUrl option to getOpenRouterModels() Fixes #11150
1 parent ede1d29 commit 3a8dea8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/api/providers/fetchers/modelCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async function fetchModelsFromProvider(options: GetModelsOptions): Promise<Model
6767

6868
switch (provider) {
6969
case "openrouter":
70-
models = await getOpenRouterModels()
70+
models = await getOpenRouterModels({ openRouterBaseUrl: options.baseUrl })
7171
break
7272
case "requesty":
7373
// Requesty models endpoint requires an API key for per-user custom policies.

src/core/webview/webviewMessageHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ export const webviewMessageHandler = async (
894894

895895
// Base candidates (only those handled by this aggregate fetcher)
896896
const candidates: { key: RouterName; options: GetModelsOptions }[] = [
897-
{ key: "openrouter", options: { provider: "openrouter" } },
897+
{ key: "openrouter", options: { provider: "openrouter", baseUrl: apiConfiguration.openRouterBaseUrl } },
898898
{
899899
key: "requesty",
900900
options: {

0 commit comments

Comments
 (0)