Guides9 min readPublished 2026-08-03

How to Connect Open WebUI to an OpenAI-Compatible API

Connect Open WebUI to an OpenAI-compatible API with the correct base URL, model discovery, secure key handling and a practical error matrix.

By LumeAPI Engineering Team

Cheap LLM API hub → Build with a Chatbot API →

Short path: OpenAI-compatible API · Multi-model API · Chatbot API · Models

Last verified: August 3, 2026

To connect Open WebUI to an OpenAI-compatible API, add a connection under Admin Settings → Connections → OpenAI, enter the provider's /v1 base URL and API key, verify the connection, and select an available model. For LumeAPI, use https://api.lumeapi.site/v1. If model discovery fails, add an exact catalog model ID to Open WebUI's filter instead of inventing a display name.

Open WebUI's official documentation describes this as a protocol-based connection: the backend must provide Chat Completions, and /v1/models is recommended for model discovery. That makes the same setup useful for a hosted gateway, a local server, or a team-controlled proxy.

The four fields that must agree

Open WebUI fieldLumeAPI valueWhy it matters
Connection typeOpenAIOpen WebUI groups compatible Chat Completions providers here
URLhttps://api.lumeapi.site/v1The client appends resource paths such as /models and /chat/completions
API keyYour LumeAPI inference keySent as a Bearer credential; do not use the Research publishing secret
Model IDExact ID from /modelsA friendly label that does not exist in the catalog returns a model error

This field map is the fastest diagnostic asset for this integration. Most failures come from mixing a portal URL with an API URL, pasting a non-inference credential, or using a marketing model name instead of a catalog ID.

Preflight the endpoint before opening the UI

Test model discovery from the same network that runs Open WebUI:

bash
curl https://api.lumeapi.site/v1/models \
  -H "Authorization: Bearer $LUMEAPI_API_KEY"

Then test one non-streaming chat request with a current model ID:

bash
curl https://api.lumeapi.site/v1/chat/completions \
  -H "Authorization: Bearer $LUMEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-terra",
    "messages": [{"role": "user", "content": "Reply with exactly: connection ok"}],
    "temperature": 0
  }'

If either command fails, fix the API path, key, model or network before debugging Open WebUI. This separates provider errors from interface configuration errors.

Add the connection in Open WebUI

  1. Sign in with an Open WebUI administrator account.
  2. Open Admin Settings, then Connections.
  3. Under OpenAI, choose Add Connection.
  4. Enter https://api.lumeapi.site/v1 as the URL.
  5. Enter a LumeAPI inference key. Do not paste it into chat, screenshots or shared documentation.
  6. Choose Verify Connection.
  7. Save, then open a new chat and select a returned model.

Open WebUI documents /v1/chat/completions as required and /v1/models as recommended. If the connection verifies but the model menu is empty, add one or more exact model IDs to Model IDs (Filter). Check the live LumeAPI model catalog before saving a shared allowlist.

Docker networking: the URL is public, but the diagnosis is still useful

For a public HTTPS endpoint such as LumeAPI, the container should call the same public URL. The common localhost trap applies when Open WebUI connects to a model server running on the Docker host: inside a container, localhost means the container itself. Open WebUI's docs recommend host.docker.internal for that local-host case.

Use this container-side check when the browser can reach an endpoint but Open WebUI cannot:

bash
docker exec -it open-webui sh -lc \
  'wget -qO- https://api.lumeapi.site/v1/models \
  --header="Authorization: Bearer YOUR_INFERENCE_KEY"'

Avoid placing a real key in shell history on a shared machine. Prefer a short-lived test key or inject it through the container's secret mechanism.

Why the model list may be empty

SymptomLikely causeFirst fix
Verify returns 401Wrong, expired or whitespace-padded keyRecreate the inference credential and paste only its value
Verify returns 404URL does not end at the compatible /v1 rootUse https://api.lumeapi.site/v1, not the portal URL or a full resource URL
Connection saves, no models appear/models is unavailable, filtered or blockedAdd exact model IDs to the allowlist and retest discovery
Model appears, chat returns model-not-foundStale or friendly model nameCopy the current ID from /models
Chat starts, then stallsStreaming or reverse-proxy buffering problemTest a non-streaming curl request, then inspect proxy buffering and timeouts
Only RAG failsEmbeddings route or selected model is not compatibleTest the embedding capability separately; chat success does not prove RAG support

Do not treat every compatible provider as feature-identical. Open WebUI can pass standard parameters and tool definitions, but a specific model route may not support every option, tool pattern, image input or embedding request.

A safe team setup

Use an administrator-managed connection rather than asking every user to paste a key. Restrict model IDs to approved routes, rotate the credential separately from user accounts, and check gateway usage logs for unexpected models, token spikes and repeated failures. If lower cost is the reason for adding a gateway, compare cost per completed chat or workflow—not only the advertised token rate—using the cheap LLM API guide.

Keep Open WebUI updated. External compatible endpoints cross a trust boundary: the UI renders streamed content and may expose tools or rich events depending on configuration. Only connect endpoints your team has vetted, limit tool permissions, and test new providers in a non-production workspace first.

Verification checklist

  • /v1/models returns at least one expected model.
  • The selected model ID exactly matches the gateway catalog.
  • A non-streaming request returns one assistant message.
  • A streaming request finishes instead of remaining in a loading state.
  • The Open WebUI connection is limited to intended users.
  • No key appears in exported settings, screenshots or browser chat history.
  • Usage logs show the same model and request time as the UI test.

Sources and testing boundary

The field mapping and HTTP examples were checked against public documentation on August 3, 2026. No customer inference key was available in this editorial workspace, so this page does not claim a billable end-to-end Open WebUI chat test.

Ready to call these models?

Create a LumeAPI key in under a minute — one OpenAI-compatible gateway for GPT, Claude, Gemini, and more.