anonrouterdocs

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.

Open WebUI logoOpen WebUIProvider integration guide

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 settingValue
Connection typeOpenAI
URLhttps://api.anonrouter.ai/v1
API keyA 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:

  1. A working Open WebUI installation.
  2. An AnonRouter account with available credits.
  3. 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 key

Connect through the admin interface

  1. Sign in to Open WebUI as an administrator.
  2. Open Admin Settings → Connections → OpenAI.
  3. Select Add Connection.
  4. Enter https://api.anonrouter.ai/v1 as the URL.
  5. Paste your compatibility-enabled ar_... key.
  6. Optionally add exact model ids under Model IDs (Filter).
  7. 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:main

Then 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:

  1. Keep Open WebUI's default local SentenceTransformers embedding engine, or configure another embedding service you control.
  2. Create a collection under Workspace → Knowledge and upload the files.
  3. Attach only the collection needed for the chat, or bind it to a dedicated model configuration.
  4. 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_ID

Embedding 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

FeatureStatus with AnonRouter
Model discoverySupported through GET /v1/models
Chat CompletionsSupported, streaming and non-streaming
Tool callingSupported on tool-capable routes
EmbeddingsSupported with an embedding model
Inline multimodal message arraysNot supported by the current compatibility contract
Legacy text completionsNot supported
OpenAI image or audio endpointsNot 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

AnonRouter is an independent service and is not affiliated with Open WebUI.

On this page