-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Problem (one or two sentences)
The "OpenRouter" provider ignores the configured "Base URL" when fetching the model list (GET /models), hardcoding the request to openrouter.ai instead. This prevents users from using local proxies to filter or manage the available models list.
Context (who is affected and when)
This affects users who need to restrict or curate the model list via a proxy (e.g., corporate environments or custom setups) while keeping the OpenRouter provider's features. It happens whenever the model list is refreshed in the settings.
Desired behavior (conceptual, not technical)
When I configure a custom "Base URL" in the OpenRouter provider settings, Roo Code should use that URL to fetch the list of models instead of always going to the public OpenRouter API. If no Base URL is set, it should keep using the public API.
Constraints / preferences (optional)
The fallback to the public OpenRouter API (if no Base URL is set) must be preserved to ensure the default experience remains unchanged for most users.
Request checklist
- I've searched existing Issues and Discussions for duplicates
- This describes a specific problem with clear context and impact
Roo Code Task Links (optional)
No response
Acceptance criteria (optional)
Given the OpenRouter provider is selected
And a custom Base URL (e.g., http://localhost:5556/api/v1) is configured
When I refresh the model list
Then Roo Code should send a GET request to http://localhost:5556/api/v1/models
And display the models returned by that endpoint.
Given the OpenRouter provider is selected
And NO custom Base URL is configured
When I refresh the model list
Then Roo Code should send a GET request to https://openrouter.ai/api/v1/models (default behavior).
Proposed approach (optional)
Modify the OpenRouterProvider class (or equivalent handler) to check for the existence of a custom baseUrl configuration before making the model list request. If it exists, use it; otherwise, fall back to the default OpenRouter API URL.
Trade-offs / risks (optional)
Minimal risk. If a user has a broken or unreachable Base URL configured, the model list fetch will fail, but this is expected behavior for a misconfiguration.