Skip to content

Issue: OpenRouter Custom Base URL Integration Not Fully Implemented #681

Description

@cobra91

Description

The current implementation (webview-ui/src/components/settings/providers/OpenRouter.tsx) fails to properly support custom OpenRouter base URLs when retrieving model providers and model lists. While the UI allows users to input a custom base URL, this value is not being passed to the useOpenRouterModelProviders hook or used in the underlying API calls. As a result, the application continues to fetch model data from the default OpenRouter endpoint (https://openrouter.ai/api/v1) instead of the user-specified URL.

This creates two key problems:

Model List Mismatch: The ModelPicker component displays models from the default OpenRouter API rather than the custom endpoint
Provider Data Inconsistency: Model provider information is fetched from the default endpoint, not the custom base URL
The required fixes involve:

Modifying useOpenRouterModelProviders to accept and utilize a baseUrl parameter
Updating the underlying getOpenRouterModelProviders API call to use this custom URL
Ensuring the ModelPicker component uses the correct service URL for model display
Adding baseUrl to the query key for proper React Query caching
Without these changes, users cannot effectively utilize self-hosted OpenRouter-compatible services or alternative endpoints. The current implementation only works with the default OpenRouter service, making the custom URL feature non-functional. The issue affects both model selection and provider routing functionality.

Would you like me to provide the exact code modifications needed for this fix? The changes are relatively straightforward but require updates across multiple files to ensure proper URL propagation through the application stack.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions