Connect Open WebUI Computer to Open WebUI
Open WebUI Computer ships an OpenAI-compatible gateway: it exposes each workspace as a model over /v1/models and /v1/chat/completions. Point Open WebUI at it as an OpenAI connection and every workspace shows up as a model named cptr/<workspace>. Chatting with that model in Open WebUI runs the full Open WebUI Computer agent loop, reading files, editing code and running commands, in that workspace, and the conversation appears in both Open WebUI and the Open WebUI Computer sidebar.
This lets Open WebUI drive an Open WebUI Computer workspace as a model: new chats you start in Open WebUI run through Open WebUI Computer. It is not a sync of Open WebUI Computer's existing standalone chats into Open WebUI, and it does not share Open WebUI knowledge bases into Open WebUI Computer.
Setup
-
Create a gateway API key in Open WebUI Computer. Open the Gateway admin tab, create a key and copy it. Keys are stored hashed and shown only once.
-
Note the base URL. The Gateway tab shows it: your Open WebUI Computer server origin plus
/v1, for examplehttp://localhost:8000/v1(use your host's address if Open WebUI Computer runs elsewhere). -
Add Open WebUI Computer as a connection in Open WebUI. In Admin Panel > Settings > Connections, add an OpenAI API connection. Set the base URL to the gateway URL from step 2 and paste the API key from step 1.
-
Add the recommended headers. The Gateway tab has a one-click copy of the header config. Paste it into the connection's custom headers:
{ "X-OpenWebUI-Chat-Id": "{{CHAT_ID}}", "X-OpenWebUI-Message-Id": "{{MESSAGE_ID}}", "X-OpenWebUI-User-Message-Id": "{{USER_MESSAGE_ID}}", "X-OpenWebUI-User-Message-Parent-Id": "{{USER_MESSAGE_PARENT_ID}}", "X-OpenWebUI-Task": "{{TASK}}" } -
Pick a workspace and chat. Your workspaces now appear in the Open WebUI model picker as
cptr/<workspace>. Select one and start a conversation; it runs the Open WebUI Computer agent loop in that workspace.
Why the headers matter
The {{...}} values are Open WebUI's custom-header placeholders, filled in per request from the chat metadata. They give Open WebUI Computer the chat and message lineage it needs to:
- Branch correctly. Regenerating or editing a message in Open WebUI creates a matching branch in the Open WebUI Computer sidebar (via
X-OpenWebUI-User-Message-IdandX-OpenWebUI-User-Message-Parent-Id), instead of appending in the wrong place. - Ignore background work. Open WebUI also calls the gateway for title generation, tag extraction and follow-up suggestions.
X-OpenWebUI-Tasktells Open WebUI Computer which requests are background tasks, so it skips them instead of spawning ghost chats or running a full agent loop.
The {{USER_MESSAGE_ID}}, {{USER_MESSAGE_PARENT_ID}} and {{TASK}} placeholders were added in Open WebUI 0.10.0. On 0.9.6 the basic gateway connection still works, you can chat with a workspace as a model, but those three headers are not filled in, so branching and background-task filtering do not work yet.