Open WebUI API Setup

Add TokenHub to Open WebUI as an OpenAI-compatible connection, select a model, and verify a chat request.

What is Open WebUI?

Open WebUI is a self-hosted interface for chatting with AI models and connecting OpenAI-compatible model providers.

This Open WebUI setup adds TokenHub from the admin connection panel. It uses the OpenAI Chat Completions protocol and provides a manual model allowlist when a provider does not expose /models. The connection belongs in the administrator connection panel, where one OpenAI-compatible provider can expose one or more models to users. When automatic model discovery is unavailable, use the model allowlist instead of assuming the chat endpoint is broken, and test network access from inside the Open WebUI container when self-hosting with Docker.

Open WebUI manages model services by protocol instead of requiring a separate plug-in for every provider. Add TokenHub as an OpenAI API Connection. Open WebUI then appends /models and /chat/completions to the API base URL.

Add TokenHub under Admin Connections

This follows Open WebUI's official Step 1: Add Your Provider Connection sequence:

  1. Sign in to Open WebUI with an administrator account.
  2. Go to Settings → Admin → Connections.
  3. Find Manage OpenAI API Connections and click Add Connection (the plus button).
  4. Enter https://us-api.tokenhub.com/v1 in URL.
  5. Enter your TokenHub API key in API Key.
  6. If connection verification does not return any models, enter an exact TokenHub model ID under Model IDs (Filter) and click the plus button to add it to the allowlist.
  7. Click Save.

Do not put /chat/completions in the URL. Open WebUI appends request paths itself, so a full request URL creates a duplicated path.

Understand Verify Connection and Model IDs (Filter)

Before saving, Open WebUI sends a standard Bearer-token request to the provider's /models endpoint. Its documentation notes that some compatible services return 400, 401, or 403 to this discovery request even though chat completions work. Test in this order:

  1. Add the model ID manually under Model IDs (Filter) and save.
  2. Start a new chat and confirm that the model appears in the selector.
  3. Select it and send a message so that you test an actual Chat Completions request.

Add each model ID only once. Open WebUI trims surrounding whitespace. The switch beside a connection disables the provider temporarily without deleting its settings.

Do not substitute host.docker.internal for a remote API

The official host.docker.internal tip applies only when an Open WebUI container must reach a model server running on the Docker host. TokenHub is a remote HTTPS service, so keep https://us-api.tokenhub.com/v1. If only the container times out, inspect its DNS resolution, outbound HTTPS access, and proxy configuration rather than changing the URL to localhost.

Verify the request Open WebUI actually sends

  1. Create a chat and choose the TokenHub model you added to the allowlist.
  2. Send a short text-only message first.
  3. In TokenHub request logs, confirm the path is /v1/chat/completions, the model ID is exact, and usage was recorded.
  4. Only after basic chat works, test tools, images, and knowledge features separately. A control in Open WebUI does not guarantee that the selected model or compatible endpoint supports that capability.

For a 404, first confirm that the URL ends at /v1. If the model is missing, return to Model IDs (Filter). If the failure occurs only in Docker, inspect the container network.

Official reference

Choose a compatible Open WebUI model

WorkloadModel choiceWhy it fits
Complex coding tasksA tool-capable reasoning modelUse a model with reliable tool use, streaming, and the context length your workflow needs.
Daily implementationA balanced coding modelPrioritize reliable edits and useful latency for normal coding loops.
Background and subagent workA fast, lower-cost modelUse this for iterations, summaries, and simpler work only after validating tool use.
Browse TokenHub models and compatibility

Open WebUI API setup FAQ

How do I add an OpenAI-compatible API to Open WebUI?

Open Settings → Admin → Connections and add a connection under Manage OpenAI API Connections. Enter the TokenHub /v1 URL and API key, then save it.

Should the Open WebUI URL include /chat/completions?

No. Use the API root ending in /v1; Open WebUI constructs the request path for each operation.

Why is the Open WebUI model list empty?

If model discovery is unavailable, add the exact TokenHub model ID under Model IDs (Filter), save, and reopen the new-chat model selector.

Why can Dockerized Open WebUI not reach TokenHub?

Test DNS, proxy, certificates, and outbound access from inside the Open WebUI container. Host-browser connectivity does not prove that the container has network access.

How do I verify Open WebUI is using TokenHub?

Select the configured model in a new chat, send a short message, and confirm the model ID, status, and token usage in TokenHub request logs.

References

This setup is based on TokenHub and official documentation, last verified on 2026-09-08.