Open WebUI Setup with AnonRouter
Connect Open WebUI to AnonRouter, discover models, run the Docker image with a preset connection, and understand the privacy boundary for RAG.
Use AnonRouter as an OpenAI-compatible provider in Open WebUI. Open WebUI can discover AnonRouter models, send streaming Chat Completions, use supported tools, and add retrieved document context to a chat.
Ready-made connection values
In Admin Settings → Connections → OpenAI, add a connection with URL
https://api.anonrouter.ai/v1 and a compatibility-enabled AnonRouter
inference key. Leave Model IDs (Filter) empty to discover models, or add
only the ids you want users to see.
Open WebUI does not currently document an importable provider-connection file. Its JSON import/export is for Workspace model presets, which is a different feature. Use the values above in the connection form or set the documented environment variables for a new deployment.
Open WebUI connection settings
| Open WebUI setting | Value |
|---|---|
| Connection type | OpenAI |
| URL | https://api.anonrouter.ai/v1 |
| API key | A compatibility-enabled AnonRouter inference key beginning with ar_ |
| Model IDs (Filter) | Optional allowlist of exact AnonRouter model ids |
Use the /v1 base URL. Open WebUI appends /models while verifying the
connection and /chat/completions when chatting.
Before you begin
You need:
- A working Open WebUI installation.
- An AnonRouter account with available credits.
- An inference key with OpenAI-compatible access enabled.
Open WebUI uses a conventional bearer key and does not perform AnonRouter's two-step private ticket exchange. Enable compatibility access only on the key you intend to use for this connection.
Create an API keyConnect through the admin interface
- Sign in to Open WebUI as an administrator.
- Open Admin Settings → Connections → OpenAI.
- Select Add Connection.
- Enter
https://api.anonrouter.ai/v1as the URL. - Paste your compatibility-enabled
ar_...key. - Optionally add exact model ids under Model IDs (Filter).
- Save the connection and select an AnonRouter model in a new chat.
Open WebUI verifies an OpenAI-compatible connection with an authenticated
GET /models request. AnonRouter implements GET /v1/models, so the model
selector should populate automatically. A filter is still useful on a shared
instance because it limits which discovered models appear to users.
To let AnonRouter choose a suitable route, add /auto to Model IDs (Filter)
and select it in the model picker. To pin a route, copy its exact id from the
AnonRouter model catalog.
Docker example
The Open WebUI image accepts the same provider settings as environment variables:
docker run -d \
-p 3000:8080 \
-e OPENAI_API_BASE_URL=https://api.anonrouter.ai/v1 \
-e OPENAI_API_KEY=ar_REPLACE_WITH_YOUR_API_KEY \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:mainThen open http://localhost:3000. The named volume preserves Open WebUI data
across container replacements.
These provider variables are persistent configuration values. On an existing installation, values already stored in Open WebUI's database can override later environment changes; edit the connection in Admin Settings when updating an established deployment.
Treat environment variables as secrets
A key passed on the command line can be visible in shell history and local container metadata. For a shared or production deployment, use the secret mechanism provided by your container platform and create a dedicated AnonRouter key with an appropriate credit limit.
Because AnonRouter is a remote HTTPS service, Docker does not need
host.docker.internal for this connection. That hostname is only relevant when
the provider itself runs on the Docker host.
Private-RAG setup and limits
Open WebUI's Knowledge feature extracts files, splits them into chunks, embeds the chunks, and stores vectors for retrieval. When a chat uses a knowledge base, the relevant text is inserted into the model request.
For the smallest remote-data footprint:
- Keep Open WebUI's default local SentenceTransformers embedding engine, or configure another embedding service you control.
- Create a collection under Workspace → Knowledge and upload the files.
- Attach only the collection needed for the chat, or bind it to a dedicated model configuration.
- Review the retrieved citations and route privacy label before using sensitive material.
This keeps document parsing, vector creation, and vector storage on your Open WebUI deployment. It does not make generation fully local: the retrieved passages included in a prompt are sent through AnonRouter to the selected model provider.
Use AnonRouter for embeddings
AnonRouter also exposes POST /v1/embeddings in compatibility mode. If you
choose OpenAI as Open WebUI's RAG embedding engine, use the same base URL and
a current embedding-model id from the model catalog. In environment-based
deployments, Open WebUI documents these settings:
RAG_EMBEDDING_ENGINE=openai
RAG_OPENAI_API_BASE_URL=https://api.anonrouter.ai/v1
RAG_OPENAI_API_KEY=ar_REPLACE_WITH_YOUR_API_KEY
RAG_EMBEDDING_MODEL=REPLACE_WITH_AN_EMBEDDING_MODEL_IDEmbedding this way sends document chunks to AnonRouter and the selected embedding provider. Use local embeddings if that is outside your privacy boundary. After changing embedding models, re-index existing documents so old and new vectors are not mixed.
Supported features and limits
| Feature | Status with AnonRouter |
|---|---|
| Model discovery | Supported through GET /v1/models |
| Chat Completions | Supported, streaming and non-streaming |
| Tool calling | Supported on tool-capable routes |
| Embeddings | Supported with an embedding model |
| Inline multimodal message arrays | Not supported by the current compatibility contract |
| Legacy text completions | Not supported |
| OpenAI image or audio endpoints | Not exposed through compatibility mode |
Open WebUI can expose settings a selected route ignores or rejects. Start with plain text chat, confirm the connection, then enable tools or other features one at a time.
Privacy and multi-user deployments
This integration uses compatibility mode. The compatibility broker receives the stable key identity and plaintext request together long enough to authorize and forward it. Prompts and responses are not intentionally retained, but this path is not unlinkable like AnonRouter's native ticket flow.
On a shared Open WebUI server, administrators choose the provider connection and can make it available to other users. Use a least-privilege inference key, set a per-key credit limit, restrict admin access, and protect the Open WebUI database and persistent data volume.
Troubleshooting
Connection verification returns 401 or 403
Confirm that the full ar_... key is present, has not been revoked, and has
OpenAI-compatible access enabled. A key without that opt-in cannot use the
static-key endpoint.
Connection verification returns 404
Use https://api.anonrouter.ai/v1, not the full
/v1/chat/completions request URL.
Models are missing
Save the connection again to repeat model discovery. If you set Model IDs (Filter), only those exact ids appear. Remove a stale id or copy a current id from the live model catalog.
A tool or file chat fails
Verify that the selected route supports tool calling and that the resulting message content remains within AnonRouter's supported Chat Completions shape. For RAG, test retrieval and ordinary chat separately before combining them.
Open WebUI setup FAQ
What URL should I enter?
Use https://api.anonrouter.ai/v1.
Can Open WebUI discover AnonRouter models automatically?
Yes. Open WebUI checks the provider's /models route and AnonRouter implements
the corresponding authenticated GET /v1/models endpoint.
Is this the private ticket flow?
No. Open WebUI sends a static bearer key, so the connection uses AnonRouter compatibility mode.
Does self-hosting Open WebUI keep every RAG document local?
Local embeddings can keep extraction and vector storage local, but passages retrieved into a prompt are sent to the remote generation route. External embeddings also receive the chunks they embed.
Sources and further reading
- Open WebUI: connect an OpenAI-compatible provider
- Open WebUI: Knowledge and RAG
- Open WebUI: deployment hardening
- Open WebUI: environment-variable reference
- AnonRouter compatibility mode
- AnonRouter models
AnonRouter is an independent service and is not affiliated with Open WebUI.
SillyTavern Setup with AnonRouter
Connect SillyTavern to AnonRouter as a custom OpenAI-compatible Chat Completion API, load models, test the connection, and fix common errors.
RisuAI Setup with AnonRouter
Install the AnonRouter preview provider plugin for RisuAI and use the native single-use ticket API for character chats.