Open WebUI can use ModRouter through the plain OpenAI-compatible /v1 API.

Endpoint

Set MODROUTER_BASE_URL from the Open WebUI runtime environment to the ModRouter root URL reachable by Open WebUI.

Setup

  1. Open Open WebUI admin settings.
  2. Add an OpenAI-compatible connection.
  3. Set URL to your ModRouter /v1 endpoint.
  4. Set API Key to a ModRouter virtual key, or a placeholder value if auth is disabled.
  5. Let Open WebUI fetch models from /v1/models, or add model IDs manually.
Example model IDs:

Environment Variables

Open WebUI deployments can also set the OpenAI-compatible base URL through environment variables:

Notes

  • Use /v1, not /openai, for the normal Open WebUI connection.
  • If you use SSO and want ModRouter to attribute users, ensure Open WebUI forwards the bearer token or a virtual key header accepted by your ModRouter deployment.