Admin UI
Every gateway serves the Admin UI at /ui, for example http://localhost:4000/ui. Admins use it to add models, create keys, manage teams, users and organizations, set budgets and guardrails, configure logging and alerting, and read usage and request logs. Developers use it to see their keys, try models in the playground and request access to models. The UI is a static application bundled with the gateway and calls the same management API documented in the API reference.
For a screen by screen walkthrough of every control, see Using the Admin UI.
A real-world scenario
A company runs the gateway behind its load balancer at https://ai.example.com/gateway, and only the platform team should use the Admin UI while every developer uses the API. The admin sets the sub-path and public URL so links work, limits the UI to proxy admins, and checks that a developer's sign in is refused.
Steps
-
Set
SERVER_ROOT_PATH=/gatewayandPROXY_BASE_URL=https://ai.example.com/gatewayin the gateway container's environment, add the access mode to the config file, and restart.general_settings:ui_access_mode: admin_only -
Check that the gateway answers under the sub-path.
curl https://ai.example.com/gateway/health/liveliness -
Open
https://ai.example.com/gateway/ui, typeadminas Username and the master key as Password, and click Login. -
Sign in as a developer with the
internal_userrole and check that the sign in is refused.
Expected result
The Admin UI opens under the sub-path for proxy admins, links and SSO redirects use the public URL, and other roles cannot sign in while the API keeps working for their keys.
Signing in
The UI needs a database, so set DATABASE_URL first. With no SSO configured, the sign-in page accepts a username and password.
| Setting | Default | Effect |
|---|---|---|
UI_USERNAME | admin | Username for the built-in admin login. |
UI_PASSWORD | master key | Password for the built-in admin login. When unset, the master key is the password. |
PROXY_BASE_URL | none | Public URL of the gateway, required for SSO redirects and invitation links. |
SERVER_ROOT_PATH | none | Serve the gateway and UI under a sub-path, such as /spanway. |
DISABLE_ADMIN_UI | false | Turn the UI off entirely. |
AUTO_REDIRECT_UI_LOGIN_TO_SSO | false | Send the sign-in page straight to SSO. Skipped while any organization has its own SSO. |
hide_default_credentials_hint | false | A general_settings key that hides the Default Credentials notice once real admins exist. UI_PASSWORD or SPANWAY_HIDE_DEFAULT_CREDENTIALS_HINT=true hide it too. |
Every variable with its default is in the settings reference.
Repeated failed sign-ins from one address are blocked for a while. general_settings.failed_login_window_seconds and failed_login_block_seconds control the window and the block length. For single sign-on with Google, Microsoft Entra ID or any OIDC provider, see Admin UI SSO. Users invited by email set their own password on first sign-in, and the password rules are controlled by the password_policy_* keys in general_settings.
Every sign-in ends with the session in an HttpOnly token cookie, so scripts in the page never see the session key, except on a control plane managing a worker, where the UI keeps the worker's session token in the tab's session storage. The UI reads who is signed in from GET /session/me, and POST /session/logout revokes the session key and clears the cookie. See Admin UI sessions.
Sections of the UI
The sidebar is organised in five groups. Each page below is an entry of the sidebar, and the enterprise ones appear once a licence is set.
AI Gateway
| Page | What it is for |
|---|---|
| Home | Overview of the deployment and shortcuts. |
| Virtual Keys | Create and manage keys, budgets and limits. |
| Playground | Try models with your own key. |
| API Playground | Build a request and see how the gateway transforms it for the provider. |
| Chat | The user facing Chat UI, shown when enable_chat_ui is on. |
| Models + Endpoints | Add, edit and test model deployments, credentials and pass-through endpoints. |
| Routing Presets | Named routing presets that bundle a model list, provider preferences and default parameters for use as @preset/name. |
| Agentic, with Agents, Workflow Runs, Run Ledger and Memory | Register agents, inspect workflow runs, the run ledger and memory entries. |
| MCP Servers | Register MCP servers, toolsets, access groups and the semantic filter and tool search settings. |
| Skills | Registered skills and the Claude Code plugin marketplace. |
| Guardrails | Configure guardrails. |
| Policies | Guardrail policies that bundle guardrails per route or tag. |
| Prompts | Prompt management. |
| Tools, with Search Tools, Code Graph, Vector Stores and Tool Policies | Register search tools, index repositories for the code graph, register vector stores, and set tool policies. |
Observability
| Page | What it is for |
|---|---|
| Usage | Spend by key, team, model, tag and customer, see cost tracking. |
| Model Leaderboard | Which models carry traffic and spend, by day and by task, see model leaderboard. |
| Cost Optimization | Auto router savings, shadow evals and prompt caching, see cost optimisation. |
| Logs | Per request logs, including MCP tool calls and guardrail results. |
| Lens | Agent traces from Lens, with search, sessions, agent graphs and comments. |
| Status Page | Uptime, latency and incidents per model group and provider, see status page. |
| Guardrails Monitor | Guardrail detections over time. |
Access control
| Page | What it is for |
|---|---|
| Teams, Projects, Internal Users, Organizations | Manage the user hierarchy. |
| Customers | End users of your applications with their budgets and limits, see customers. |
| Roles | Enterprise custom roles. |
| Access Requests | Enterprise access requests from the developer portal. |
| Access Groups | Model, MCP and agent access groups granted to keys and teams. |
| Budgets | Shared budgets attached to keys, teams and customers. |
| Tag Management | Tags used for tag routing and tag budgets. |
Developer tools
| Page | What it is for |
|---|---|
| API Reference | Sample OpenAI SDK, LlamaIndex and LangChain code with this gateway's base URL filled in. It is on a draft deprecation list, see API Reference page. |
| AI Hub | Public catalogue of models, agents and MCP servers, see AI hub. |
| Learning Resources | Links to guides. |
| Response Cache | Caching settings and the coordination Redis connection. |
| Evals | Enterprise evals and red teaming. |
| Review | Enterprise review queues where people label eval results and sampled responses. |
Settings
| Page | What it is for |
|---|---|
| Router Settings | Retries, fallbacks and routing strategy, see routing. |
| Logging & Alerts | Logging callbacks and alerting. |
| Admin Settings | SSO, security settings including the IP allow-list, SCIM, UI settings, logging, secret manager connections, plugins and web search interception. |
| Cost Tracking | Discounts, margins and pricing controls, see custom pricing. |
| Compliance | Enterprise compliance controls. |
| Billing | Enterprise billing. |
| Tenants, Cloud plan | The hosted cloud edition. |
| UI Theme | The logo, dark mode logo and favicon shown to your users. |
On a control plane the sign-in page also lists the workers to manage and the header carries a worker switcher.
Restricting who can use the UI
Set general_settings.ui_access_mode to admin_only to let only proxy admins sign in. The default is all, which lets every user sign in and see the parts their role allows. Roles are described in access control. If you run the gateway as a headless API, set DISABLE_ADMIN_UI=true.
Running behind a reverse proxy
When the gateway sits behind a load balancer on a sub-path, set SERVER_ROOT_PATH to that path so the UI builds its links correctly, and set PROXY_BASE_URL to the public URL. Both values must match what users type in their browser.
Errors
| What you see | What it means | Fix |
|---|---|---|
| Admin UI Disabled | DISABLE_ADMIN_UI is true. | Set it to false and restart. |
| Pages load without styles or links go to the wrong path | SERVER_ROOT_PATH does not match the path users type. | Set it to the exact sub-path. |
SSO redirects to localhost | PROXY_BASE_URL is unset or wrong. | Set it to the public URL. |
| "Too many failed sign-in attempts. Try again later." | Too many failed sign-ins for the username or from one address. | Wait for failed_login_block_seconds, then sign in with the right password. |
| "Invalid credentials used to access UI. ..." | The username or password is wrong. | Check both, see getting started for every sign-in message. |
| "Username/password login is disabled because SSO is configured ..." | disable_password_login_when_sso_enabled is on, while the form is still shown. | Use Login with SSO. |
| The UI asks for a database | DATABASE_URL is not set. | Set it, the UI needs a database. |
Logs
Sign-in writes the lines listed in the log reference, for example Admin UI sign-in blocked for <n> seconds after too many failures at WARNING when a block starts, and a WARNING at startup when several workers run without Redis, because the sign-in limits are then counted per worker. Each sign-in, failure, lockout and sign-out also writes an audit row.
Related
- Using the Admin UI for every screen.
- Admin UI SSO.
- Access control for the roles.