Open WebUI
Open WebUI is a web interface for chatting with models, managing conversations, attaching knowledge, and using tools. It connects to model services through protocol-based connections, including OpenAI-compatible APIs.
An Open WebUI administrator can add AISIX as an OpenAI-compatible connection. Open WebUI then discovers the model aliases available to the AISIX caller key and sends chat requests through the gateway. AISIX governs the model request path, while Open WebUI continues to manage users, chats, knowledge, tools, and interface behavior.
Prerequisites
Before starting, prepare the following:
- An Open WebUI account with administrator access.
- An AISIX proxy URL the Open WebUI deployment can reach.
- An AISIX caller API key dedicated to Open WebUI.
- A chat-capable model alias the caller key can access through the OpenAI-Compatible API.
If Open WebUI runs in a container, an AISIX gateway on the container host is not reachable through localhost. Use a hostname that resolves from the Open WebUI container, such as the gateway service name on a shared container network.
Add the AISIX Connection
Configure AISIX as a standard OpenAI-compatible connection:
- In Open WebUI, open Settings → Admin → Connections.
- Under Manage OpenAI API Connections, select Add Connection.
- Set URL to the AISIX proxy API root, including
/v1, for examplehttps://gateway.example.com/v1. - Keep Auth set to Bearer and set API Key to the AISIX caller API key.
- Keep API Type set to Chat Completions so Open WebUI sends requests to
/v1/chat/completions. - Under Advanced, leave Provider set to Default.
- Leave Model IDs empty so Open WebUI discovers the aliases that the caller key can access.
- Select Save.
Open WebUI requests GET /v1/models with the caller key. AISIX returns only the model aliases that key can use, so the Open WebUI model selector follows the gateway's access policy.
If you want to expose only part of that returned list, add the selected AISIX aliases under Model IDs. This filter narrows what Open WebUI displays; it does not grant access that the AISIX caller key does not already have.
Verify Chat and Streaming
Start a new chat, select a chat-capable AISIX model alias, and send a short prompt such as “Reply with one sentence about AI gateways.”
Confirm these results:
- Open WebUI displays the streamed response.
- AISIX records a successful
POST /v1/chat/completionsrequest. - The recorded caller key and model match the Open WebUI connection and selected alias.
Open WebUI may use models for background tasks in addition to the visible chat. If you configure separate models or endpoints for tasks, embeddings, image generation, speech, or reranking, verify those paths independently before treating all Open WebUI model traffic as governed by AISIX.
Verify Tools Separately
Open WebUI's native tool path expects OpenAI-compatible streamed tool-call fragments. Each fragment must retain its tool-call index so Open WebUI can assemble the function name and arguments before executing the tool.
AISIX preserves the indexed tool-call stream on the Chat Completions path. The upstream model must also support the requested tool, and Open WebUI must enable and authorize it. Run one real tool-using turn and confirm these outcomes:
- Open WebUI executes the expected tool.
- AISIX records the model request that produces the tool call and the follow-up request containing the tool result.
- The final answer appears in the chat.
A successful plain-text chat does not prove that this multi-request tool loop works.
Troubleshoot the Connection
| Symptom | Check |
|---|---|
| No models appear | Confirm the URL ends in /v1, the caller key is valid, and GET /v1/models returns the expected aliases. Add an alias to Model IDs only after confirming the request path. |
Connection returns 401 | Confirm API Key contains the AISIX caller key, not an upstream provider key. |
Chat returns 403 | Confirm the caller key can access the selected AISIX model alias. |
Chat returns 404 | Remove /chat/completions from URL. Open WebUI appends that path to the /v1 API root. |
| Container deployment cannot connect | Use a gateway hostname reachable from the Open WebUI container instead of localhost. |
| A tool turn returns an empty reply | Verify the selected model emits indexed OpenAI-compatible tool-call stream fragments, then inspect the AISIX and Open WebUI logs for the tool request. |
Next Steps
- Streaming: review gateway stream behavior.
- Tool Calling: understand the OpenAI-compatible tool loop.
- Metrics and Logs: monitor requests from Open WebUI.