Setup Guide: Open WebUI + LiteLLM

Connect OpenRouter models to your self-hosted Open WebUI and LiteLLM proxy. This guide covers getting an API key, configuring LiteLLM as a proxy, and pointing Open WebUI at it.

1

Get your OpenRouter API key

Go to openrouter.ai/keys and create a key. You'll need it for both LiteLLM and Open WebUI.

2

Install LiteLLM proxy

Install the LiteLLM proxy server:

pip install 'litellm[proxy]'
bash
3

Create a LiteLLM config.yaml

Use the button on the models page to generate a config, or write one manually. Here's a minimal example:

model_list:
  - model_name: "glm-5.2"
    litellm_params:
      model: "openrouter/z-ai/glm-5.2"
      api_key: "os.environ/OPENROUTER_API_KEY"

  - model_name: "kimi-k3"
    litellm_params:
      model: "openrouter/moonshotai/kimi-k3"
      api_key: "os.environ/OPENROUTER_API_KEY"

  - model_name: "qwen3.8"
    litellm_params:
      model: "openrouter/qwen/qwen3.8-2.4t-a95b"
      api_key: "os.environ/OPENROUTER_API_KEY"

  - model_name: "deepseek-v4-pro"
    litellm_params:
      model: "openrouter/deepseek/deepseek-v4-pro-0813"
      api_key: "os.environ/OPENROUTER_API_KEY"

  - model_name: "inkling-small"
    litellm_params:
      model: "openrouter/thinkingmachines/inkling-small"
      api_key: "os.environ/OPENROUTER_API_KEY"

general_settings:
  master_key: "os.environ/LITELLM_MASTER_KEY"  # optional: protect your proxy
yaml

Tip: The model field must start with openrouter/ followed by the model ID exactly as shown on the models page (e.g. openrouter/z-ai/glm-5.2). The model_name is what Open WebUI will display — you can pick any friendly name.

4

Start the LiteLLM proxy

# Set your API key
export OPENROUTER_API_KEY="sk-or-v1-..."

# Optional: set a master key to protect the proxy
export LITELLM_MASTER_KEY="sk-litellm-..."

# Start the proxy on port 4000
litellm --config config.yaml --port 4000
bash

The proxy exposes an OpenAI-compatible API at http://localhost:4000/v1.

5

Connect Open WebUI to LiteLLM

In Open WebUI, go to Settings → Connections → OpenAI API and add:

# OpenAI API Base URL
http://localhost:4000/v1

# API Key (your LITELLM_MASTER_KEY, or any string if you didn't set one)
sk-litellm-...
env

Open WebUI will auto-discover all model_name entries from your LiteLLM config. They'll appear in the model dropdown in the chat interface.

6

Alternatively: connect Open WebUI directly to OpenRouter

If you don't need LiteLLM (rate limiting, load balancing, fallbacks), you can connect Open WebUI directly:

# OpenAI API Base URL
https://openrouter.ai/api/v1

# API Key (your OpenRouter key)
sk-or-v1-...
env

Then in Settings → Models, add model IDs manually (use the copy button on each model card), e.g. z-ai/glm-5.2.

7

Docker Compose (optional)

If you're running both in Docker:

services:
  litellm:
    image: ghcr.io/berriai/litellm:main-latest
    ports:
      - "4000:4000"
    volumes:
      - ./config.yaml:/app/config.yaml
    environment:
      - OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
      - LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY}
    command: --config /app/config.yaml --port 4000

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    ports:
      - "3000:8080"
    environment:
      - OPENAI_API_BASE_URL=http://litellm:4000/v1
      - OPENAI_API_KEY=${LITELLM_MASTER_KEY}
    depends_on:
      - litellm
    volumes:
      - open-webui-data:/app/backend/data

volumes:
  open-webui-data:
yaml

Other config formats

The Export button on the models page also supports these formats:

🤖 Hermes Agent — generates ~/.hermes/config.yaml with OpenRouter provider and fallback models.

🦞 OpenClaw — OpenAI-compatible provider config pointing at https://openrouter.ai/api/v1.

🧭 Odysseus — cloud/API model config for Odysseus with model IDs.

💬 Open WebUI — list of model IDs to paste into Settings → Models.

Capability filters explained

Tools — supports function/tool calling. Required for Open WebUI's built-in tools and function calls.

Structured — supports JSON schema / structured output. Good for agentic pipelines.

Vision — accepts image inputs. For multimodal chat with image uploads.

Web Search — supports OpenRouter's native web search option.

Benchmark scores

Click "Load scores" on the models page to fetch Arena AI (LMArena) ELO scores from arena.ai via daily snapshots. Models are matched by name similarity and vendor. Scores appear as badges (🏆 ELO · rank) on model cards and in the comparison view.

Install as app (PWA)

OpenRouter Radar is a Progressive Web App — install it to your home screen for quick access and offline browsing. Model data is cached for offline use.

Chrome/Edge: click the install icon in the address bar. Safari (iOS): Share → Add to Home Screen. Safari (Mac): File → Add to Dock.