Open WebUI OpenAI-Compatible API: Setup and Fixes (2026)
How do you connect Open WebUI to an OpenAI-compatible API?
Set the connection URL to the provider's OpenAI-compatible base URL ending in /v1, add a Bearer API key, and (if Verify Connection fails) add model IDs by hand. In current Open WebUI admin settings this lives under Settings > Connections, in the Manage OpenAI API Connections list. You can also set OPENAI_API_BASE_URL and OPENAI_API_KEY when you start the container.
Open WebUI talks to backends through the OpenAI Chat Completions protocol rather than a one-off integration for every vendor. That is why a local vLLM server, a cloud gateway, or a hosted OpenAI-compatible API can all be added the same way. This guide covers the official connection flow (checked against Open WebUI's docs on December 3, 2026), the environment-variable path, the /models verification gotcha, and the usual URL mistakes.
Where to add the Open WebUI OpenAI-compatible API connection
- Open Open WebUI and sign in with an admin account (on a new install, that is the first account you created).
- Go to Settings > Connections. In current versions this is the admin section inside Settings, not the separate panel for managing users.
- Find Manage OpenAI API Connections and click Add Connection.
- Set the URL to the base URL that already includes
/v1. Open WebUI appends/modelsand/chat/completionsto exactly what you type. - Set auth to Bearer and paste the API key.
- Click Verify Connection, then Save.
A fresh install may already have a row for https://api.openai.com/v1. Turn that off if you are not using an OpenAI key, so Open WebUI stops polling it for a model list. Each connection also has a toggle, so you can disable a provider without deleting the row.
Environment variables and Docker
For a first-run install you can inject the same settings with environment variables:
docker run -d \
--name open-webui \
-p 3000:8080 \
-v open-webui:/app/backend/data \
-e OPENAI_API_BASE_URL=http://host.docker.internal:8000/v1 \
-e OPENAI_API_KEY=your-key \
--add-host=host.docker.internal:host-gateway \
ghcr.io/open-webui/open-webui:mainIf Open WebUI runs in Docker and the model server is on the host, do not use localhost or 127.0.0.1 in the URL. Inside the container those addresses point at the container itself. Use host.docker.internal (and host-gateway on Linux), or put both services on the same Docker network and use the service name.
The Verify Connection gotcha
Verify Connection calls the provider's GET /v1/models endpoint with a standard Bearer token. Some providers do not implement /models, or they authenticate that route differently. In those cases verification can return 400, 401 or 403 even though chat completions still work.
If that happens, add the model IDs you need to the Model IDs allowlist in the connection settings, then save. The models will show up in the selector without a successful verify. Official Open WebUI docs are explicit: a failed verify does not by itself mean the provider is incompatible.
Endpoints your backend should implement
|
Endpoint |
Required? |
What Open WebUI uses it for |
|---|---|---|
|
|
Yes |
Chat |
|
|
Recommended |
Auto-filling the model selector |
|
Other OpenAI routes |
Optional |
Only if you use those features |
If /models is missing, use the allowlist. If chat completions is missing or speaks a different protocol, put a gateway in front, or see our notes on compatibility limits and base URL mistakes. A proxy in front of the API is the usual workaround when the vendor only offers a proprietary API.
Common OpenAI-compatible API setup mistakes in Open WebUI
|
Symptom |
Likely cause |
What to set instead |
|---|---|---|
|
404 on verify or chat |
URL already includes |
Stop at |
|
Connection refused in Docker |
|
|
|
Empty model list, chat works |
|
Add Model IDs manually |
|
401 or 403 |
Wrong key, or the server expects a different header |
Confirm Bearer vs a vendor-specific header |
|
Models appear, replies fail |
Chat endpoint is not actually OpenAI-compatible |
Read the raw error; you may need a proxy |
A worked example: for a vLLM server listening on host port 8000, the URL is http://host.docker.internal:8000/v1 when Open WebUI is in Docker, or http://127.0.0.1:8000/v1 when both run on the same host without containers.
Frequently asked questions
Does Open WebUI work with any OpenAI-compatible API?
It works with servers that implement the Chat Completions protocol. Official docs say Open WebUI supports that protocol (and also Open Responses) and does not add one-off proprietary APIs in core. Unsupported vendors usually need a proxy.
Why did Verify Connection fail if chat still works?
Verification hits /v1/models. That route is recommended, not strictly required for chat. Add model IDs to the allowlist and save.
What is the difference between OPENAI_API_BASE_URL and the Connections UI?
They set the same kind of connection. Environment variables are convenient on first start. The Connections UI is the place to add extra providers, disable a row without deleting it, or maintain an allowlist.
Can I point Open WebUI at a local model server?
Yes. vLLM, llama.cpp, LocalAI and similar servers that expose /v1/chat/completions are a common setup. Watch the Docker networking issue above. For another local-client setup, see LM Studio's OpenAI-compatible API.
Do I need an official OpenAI key?
No. The connection is protocol-based. You need a reachable /v1 base URL and whatever key that server expects. Some local servers accept any string, or no key at all.
The short version
Point Open WebUI at a /v1 base URL, add a Bearer key, and do not treat a failed Verify Connection as a hard incompatibility. If /models is missing, allowlist the model IDs. If you are in Docker, do not use localhost for a host-side server. Re-check Open WebUI's provider docs when the UI labels move; the protocol and the /v1 rule stay the same.
Sources: Open WebUI documentation, OpenAI-Compatible / Open WebUI, checked December 3, 2026.