No-code Platforms · As of 2026-11-25

Open WebUI and LobeChat with Claude and GPT: Self-Hosted Setup with One API Key

As of 2026-11-25, Open WebUI (0.13.4) connects to QCode through an OpenAI-compatible connection at https://api.qcode.cc/openai/v1, which gives you GPT-6.2 and Chinese models such as GLM, DeepSeek, Qwen and Kimi. Claude is different: Open WebUI sends OpenAI Chat Completions requests, while QCode serves Claude only on the Anthropic Messages endpoint https://api.qcode.cc/api. So for Claude you either use LobeChat (now LobeHub), whose Anthropic provider accepts a custom proxy URL, or add a small Pipe function or a LiteLLM proxy to Open WebUI. This guide covers all of it, starting with a five-minute Docker run.

QCode is an independent third-party API service. It is not operated by, endorsed by, or partnered with Open WebUI, LobeHub, Anthropic, OpenAI or any model vendor. Field names come from the projects' documentation and QCode's tested guides on docs.qcode.cc.

Updated 2026-11-26

Key facts

Open WebUI LobeChat / LobeHub
Version checked 0.13.4 (Docker) 2.3.4 (desktop; Docker self-host)
GPT and Chinese models OpenAI connection, URL https://api.qcode.cc/openai/v1 OpenAI provider, proxy URL https://api.qcode.cc/openai/v1
Claude Not through the OpenAI connection; use a Pipe function or LiteLLM Anthropic provider, proxy URL https://api.qcode.cc/api
Default local URL http://localhost:3000 http://localhost:3210
Easiest for Teams already on Open WebUI, GPT and Chinese models Claude plus GPT in one UI
  • One cr_ key works on both endpoints. Model IDs must match /models: claude-sonnet-5-5 ($2 / $10 per million tokens), claude-opus-5-5 ($4 / $20), claude-haiku-5-5 ($0.10 / $0.50 up to 100K prompt), gpt-6.2-sol ($2 / $10).
  • Billing is official API price × service multiplier, currently ×1.0 for Anthropic and OpenAI models. Gemini models are not on QCode /models as of 2026-11-26; check /models.

Fastest path: Open WebUI with GPT in about five minutes

On Linux or macOS with Docker installed:

docker run -d -p 3000:8080 \
  -e OPENAI_API_BASE_URL=https://api.qcode.cc/openai/v1 \
  -e OPENAI_API_KEY=cr_your_key \
  -e WEBUI_SECRET_KEY="$(openssl rand -hex 32)" \
  -v open-webui:/app/backend/data \
  --name open-webui --restart always \
  ghcr.io/open-webui/open-webui:main

Open http://localhost:3000, create the first account (it becomes the admin), start a new chat and pick gpt-6.2-sol. The two OPENAI_* variables are read only on first start; after that, change the connection in the Admin Panel. The -v open-webui:/app/backend/data volume keeps your settings and chats when the container is rebuilt.

On Windows PowerShell, generate the secret first and pass it in:

$b = New-Object byte[] 32; [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b); $KEY = ($b | ForEach-Object { $_.ToString("x2") }) -join ""
docker run -d -p 3000:8080 -v open-webui:/app/backend/data -e WEBUI_SECRET_KEY="$KEY" --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Prerequisites

  • Docker Desktop (Windows/macOS) or Docker Engine (Linux).
  • A QCode cr_ key. A trial plan is enough to test everything here.
  • Ports 3000 (Open WebUI) and/or 3210 (LobeHub) free, or change the left side of -p.
  • Outbound HTTPS from the container to api.qcode.cc (alternates: asia.qcode.cc, us.qcode.cc, same key and paths).

Quick check that the key works, before any UI:

curl -sS https://api.qcode.cc/openai/v1/chat/completions \
  -H "Authorization: Bearer cr_your_key" -H "Content-Type: application/json" \
  -d '{"model":"gpt-6.2-sol","messages":[{"role":"user","content":"ping"}]}'

Open WebUI: add the QCode connection by hand

The menu path differs between Open WebUI releases, so follow the labels in your build: open the Admin Panel and find the external OpenAI connection settings. Click + next to "Manage OpenAI API connections":

Field Value
Connection type External (default)
API type Chat Completions (default)
URL https://api.qcode.cc/openai/v1 (no trailing slash)
Auth Bearer
API key cr_your_key
Advanced → Model IDs add gpt-6.2-sol, glm-5.3, deepseek-v4-pro, qwen3.8-max, kimi-k3 as needed, then Save

Notes that save time:

  • The verify icon only proves the server answered /models. It does not mean your Model IDs were saved; check that the ID tags are still there after saving.
  • With the Model IDs list empty, Open WebUI auto-loads every model the endpoint returns. Once you add IDs, only those appear. A short list keeps users on the models you intend.
  • If the model list loads slowly, raise the timeout with AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST=30.
  • Inside Docker, localhost means the container. QCode is a public host, so you do not need host.docker.internal for it.

Claude in Open WebUI: three working options

Changing the URL does not help: Open WebUI's built-in Anthropic handling is tied to api.anthropic.com and uses Anthropic's own OpenAI-compatible layer, which QCode does not provide for Claude. Your options:

Option Effort When to choose it
A. Use LobeChat for Claude (section 4) Lowest You just want a good Claude chat UI
B. Pipe function in Open WebUI Low You want Claude inside your existing Open WebUI
C. LiteLLM proxy in front Medium You already run LiteLLM or need many Claude features

Option B: a minimal Pipe. Open WebUI Functions are Python plugins; a Pipe can expose models of its own. The example below calls QCode's Anthropic endpoint directly. It is deliberately minimal (text only, no streaming) so you can read every line before you install it. Install it from the Functions page in the Admin Panel (the menu location varies by build): click +, paste the code, save, then set the API_KEY valve.

"""
title: QCode Claude (Anthropic Messages)
version: 0.1.0
"""
import requests
from pydantic import BaseModel, Field


class Pipe:
    class Valves(BaseModel):
        BASE_URL: str = Field(default="https://api.qcode.cc/api")
        API_KEY: str = Field(default="")
        MODELS: str = Field(default="claude-sonnet-5-5,claude-haiku-5-5,claude-opus-5-5")
        MAX_TOKENS: int = Field(default=4096)

    def __init__(self):
        self.valves = self.Valves()

    def pipes(self):
        return [{"id": m.strip(), "name": m.strip()} for m in self.valves.MODELS.split(",") if m.strip()]

    def pipe(self, body: dict):
        model = body["model"].split(".", 1)[-1]  # Open WebUI prefixes the function id
        system, messages = [], []
        for m in body.get("messages", []):
            content = m.get("content", "")
            if isinstance(content, list):  # keep text parts only in this minimal version
                content = "\n".join(p.get("text", "") for p in content if p.get("type") == "text")
            if m["role"] == "system":
                system.append(content)
            else:
                messages.append({"role": m["role"], "content": content})
        payload = {"model": model, "max_tokens": body.get("max_tokens") or self.valves.MAX_TOKENS, "messages": messages}
        if system:
            payload["system"] = "\n\n".join(system)
        r = requests.post(
            self.valves.BASE_URL.rstrip("/") + "/v1/messages",
            headers={"x-api-key": self.valves.API_KEY, "anthropic-version": "2023-06-01", "content-type": "application/json"},
            json=payload,
            timeout=300,
        )
        if r.status_code != 200:
            return f"QCode error {r.status_code}: {r.text[:300]}"
        data = r.json()
        return "".join(b.get("text", "") for b in data.get("content", []) if b.get("type") == "text")

Only text blocks are returned, so thinking blocks from claude-opus-5-5 are skipped. For images, streaming or prompt caching you would extend it, or use option C. This example has not been verified against every Open WebUI release; run a one-line prompt through it before you rely on it.

Option C: LiteLLM. LiteLLM translates OpenAI-format requests into Anthropic Messages. A minimal config.yaml:

model_list:
  - model_name: claude-sonnet-5-5
    litellm_params:
      model: anthropic/claude-sonnet-5-5
      api_base: https://api.qcode.cc/api
      api_key: os.environ/QCODE_API_KEY

Run LiteLLM next to Open WebUI and add it as a second OpenAI connection (http://litellm:4000/v1 on a shared Docker network, with your LiteLLM key). Keep GPT and Chinese models on the direct QCode connection. Whether LiteLLM appends /v1/messages to api_base depends on its version; test the route with a small request first.

LobeChat (LobeHub): Claude and GPT side by side

LobeChat is now branded LobeHub. Desktop builds may be unsigned (SmartScreen can ask for "More info → Run anyway") and may require signing in to LobeHub Cloud or connecting a self-hosted instance; check the current release notes before installing.

In the UI: open Settings → AI Providers, then:

Provider API Key API proxy URL Models
Anthropic cr_your_key https://api.qcode.cc/api claude-sonnet-5-5, claude-opus-5-5, claude-haiku-5-5
OpenAI same key https://api.qcode.cc/openai/v1 gpt-6.2-sol, glm-5.3, deepseek-v4-pro, qwen3.8-max, kimi-k3

Enable each provider, click Check, then switch on the models you need (use "get or add models" for IDs missing from the built-in list). Never select a Claude model under the OpenAI provider; QCode answers model_not_available_on_endpoint.

Self-hosted with Docker Compose (Linux/macOS, or WSL 2 on Windows):

mkdir lobehub && cd lobehub
bash <(curl -fsSL https://lobe.li/setup.sh) -l en
# add the provider variables below to the environment configuration the script generated
docker compose up -d
docker logs -f lobehub
ANTHROPIC_API_KEY=cr_your_key
ANTHROPIC_PROXY_URL=https://api.qcode.cc/api
OPENAI_API_KEY=cr_your_key
OPENAI_PROXY_URL=https://api.qcode.cc/openai/v1
OPENAI_MODEL_LIST=-all,+gpt-6.2-sol,+glm-5.3,+deepseek-v4-pro,+qwen3.8-max,+kimi-k3

The setup script generates the security keys and asks a few questions (press Enter for Local Mode); add the provider variables to the environment configuration it generated, in the lobehub folder. Open http://localhost:3210 when the logs show the app is ready. In OPENAI_MODEL_LIST, -all hides the built-in list and each +id adds one model; id=Display Name renames one. Avoid Vercel for long answers: its serverless timeout cuts responses off, so use Docker or another host.

A sample setup that people actually use

  • Daily driver in LobeHub: create an assistant "Code reviewer" on claude-sonnet-5-5 with a system prompt listing your team's rules; a second assistant "Quick answers" on claude-haiku-5-5 for cheap lookups; a "Translator" on glm-5.3 or qwen3.8-max.
  • Model comparison in Open WebUI: select two models in one chat (for example gpt-6.2-sol and glm-5.3) and send the same prompt to see answers next to each other before you standardize on one.
  • Documents and RAG: both apps need an embedding model for knowledge bases. Check /models for one; if none is listed, point Open WebUI and LobeHub at a separate embeddings provider. The chat model that answers can still be on QCode.

Errors and fixes

Symptom Likely cause Fix
Claude models missing in Open WebUI Protocol mismatch Use a Pipe, LiteLLM or LobeHub's Anthropic provider (sections 3–4)
model_not_available_on_endpoint Claude ID sent to /openai/v1 Claude → https://api.qcode.cc/api; GPT/Chinese → /openai/v1
Open WebUI model dropdown empty Model IDs not saved, or auto-discovery returned nothing Add IDs under Advanced, Save, open a new chat
"Verified server connection" but no models Verify only checks /models Confirm the ID tags are saved
Red error in an Open WebUI reply URL has a trailing slash or key has spaces Fix URL/key; test with curl
LobeHub returns an empty message OPENAI_PROXY_URL wrong Set exactly https://api.qcode.cc/openai/v1
LobeHub desktop asks to sign in Desktop builds may require an account Sign in to LobeHub Cloud or connect your self-hosted instance
curl: (3) bad range specification on Windows PowerShell 5.1 splits unquoted JSON Wrap JSON in single quotes, escape inner quotes
Long answers cut off on Vercel Serverless timeout Self-host with Docker
Key stopped working after plan end Personal plan keys expire with the plan Paste the new key into the connection/provider and save

FAQ

Can Open WebUI use Claude through QCode?

Not through its OpenAI connection, because QCode serves Claude only on the Anthropic Messages protocol. Add a Pipe function or a LiteLLM proxy, or use LobeHub's Anthropic provider.

What URL do I enter in Open WebUI?

https://api.qcode.cc/openai/v1 with Bearer auth and your cr_ key. This connection serves GPT and Chinese models such as glm-5.3 and deepseek-v4-pro.

What proxy URL does LobeChat's Anthropic provider need?

https://api.qcode.cc/api, with no /v1 and no trailing slash. The OpenAI provider uses https://api.qcode.cc/openai/v1.

Is LobeChat the same as LobeHub?

Yes, the project is now branded LobeHub. Desktop builds may require signing in to LobeHub Cloud or a self-hosted instance; self-hosted Docker uses the same provider variables.

Do the environment variables in Open WebUI override the Admin Panel?

OPENAI_API_BASE_URL and OPENAI_API_KEY are applied on first start only. After that, Open WebUI keeps settings in its database, so edit the connection in the Admin Panel.

Can I use these apps' document chat (RAG) with QCode?

Yes for the chat model. Check /models for an embedding model; if none is listed, embeddings must come from another source.

Which model should I set as default?

claude-sonnet-5-5 in LobeHub and gpt-6.2-sol in Open WebUI are good defaults at $2 / $10 per million tokens. Use claude-haiku-5-5 for cheap quick answers.

Try it on a trial plan

Self-hosted chat UIs are the easiest way to see which model your team prefers. QCode's trial plan (Starter), from $9 for 30 days with $5 of usage per day, covers Claude, GPT and Chinese models on one key. See /pricing for all plans and /models for live prices.

Try it on a trial plan

One key for both the Anthropic Messages API and OpenAI-compatible APIs. Claude and GPT are billed at the official price ×1.0; live rates are on /models.

Not sure where to start?

Try it for a week

Small Pack: $4 for $30 of quota, valid 7 days

Use it every day

Starter: $9.00/month with $5 of quota every day — just $0.060 per $1 of quota, vs about $0.113 for the Medium Pack