Version: v0.4.1 Released: 2025-05-25 Changes: Added "free only" model filter. Github: https://github.com/kevarch/OpenWebUI-Openrouter-API-Model-Function
This pipe integrates the OpenRouter.ai API with OpenWebUI, allowing users to access a wide variety of large language models available through OpenRouter directly within the OpenWebUI interface.
It acts as a bridge, fetching the list of available models from OpenRouter and forwarding chat requests from OpenWebUI to the selected OpenRouter model, handling both streaming and non-streaming responses.
Getting started with OpenRouter is straightforward: simply sign up on their website at OpenRouter.ai, add some credits, and generate an API key to use with this function.
OR: ) to model names in the OpenWebUI list for easy identification. This field is optional and can be left empty for more flexible configuration. FREE_ONLY): Enables showing only free models to facilitate testing and usage without consuming credits. [1]) with clickable Markdown links (e.g., [[1]](citation_url)).include_reasoning=true). <think>...</think> tags for clear separation in the UI.cache_control), potentially reducing costs for supported models on repeated requests with similar initial prompts. MODEL_PROVIDERS): This parameter accepts a comma-separated list of providers to include or exclude and is optional for more flexible setup.This function can be installed manually or easily installed from the OpenWebUI Hub:
https://openwebui.com/f/preswest/openrouter_integration_for_openwebui
After installing:
The following settings can be configured via the OpenWebUI Pipe settings interface:
OPENROUTER_API_KEY (Required): Your personal API key from OpenRouter.ai. INCLUDE_REASONING (Default: True): Whether to request reasoning tokens from models that support them. If enabled, reasoning appears within <think> tags. MODEL_PREFIX (Optional, Default: ""): An optional text prefix added to the names of OpenRouter models displayed in OpenWebUI (e.g., setting it to OR: will show models like OR: xAI: Grok 3 Beta). REQUEST_TIMEOUT (Default: 90): The maximum time (in seconds) to wait for a response from the OpenRouter API before timing out. MODEL_PROVIDERS (Optional): Comma-separated list of model providers to include or exclude. Leave empty to include all providers. INVERT_PROVIDER_LIST: If true, the 'Model Providers' list becomes an exclude list instead of an include list. FREE_ONLY (Optional, Default: False): If true, filters to show only free models. ENABLE_CACHE_CONTROL (Default: False): If true, enables OpenRouter's prompt caching, potentially reducing costs for supported models on repeated requests with similar initial prompts and repeated context.FREE_ONLY. This project is licensed under the MIT License.
Open WebUI Enterprise — White-labeling, SSO, and dedicated support for your team.