Using the Admin UI
The Admin UI is the web console that ships inside every Spanway gateway. It calls the same management API that is documented in the API reference, so anything you do here you can also script. This guide walks through the UI one screen at a time. This page covers opening the UI, signing in, the layout, roles and license states. The other pages in this section each cover one area of the left nav, control by control.
A real-world scenario
A new platform admin has just been given a gateway URL and the master key. They open the Admin UI, sign in as admin, check which entries the left nav shows for their role, and create a personal account so they stop using the master key day to day.
Steps
-
Check that the gateway is up and has a database, since the Admin UI needs one.
curl http://localhost:4000/health/readiness -
Open
http://localhost:4000/ui. The sign-in page opens at/ui/login. -
Type
adminas Username and the master key as Password, and click Login. -
Open the account menu at the bottom of the left nav and check your role and Tier.
-
Open Internal Users, click + Invite User, and invite yourself with the role you need. The same with the API:
curl -X POST http://localhost:4000/user/new \-H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" \-d '{"user_email": "jane@example.com", "user_role": "proxy_admin"}'
Expected result
The Home page opens after sign in, the left nav shows the groups your role may use, and the new user appears on the Internal Users page.
Opening the Admin UI
The gateway serves the UI at /ui, for example http://localhost:4000/ui on a local gateway or https://gateway.example.com/ui behind your load balancer. Opening /ui sends you to the sign-in page at /ui/login when you have no valid session, and back to the page you asked for after you sign in. When the gateway runs under a sub-path, set SERVER_ROOT_PATH and PROXY_BASE_URL as described on the Admin UI page so links and SSO redirects are built correctly.
The UI needs a database, so the gateway must have DATABASE_URL set. When an operator turns the UI off with DISABLE_ADMIN_UI, the sign-in page shows Admin UI Disabled and tells the operator to set DISABLE_ADMIN_UI=False to turn it back on. Nothing else on that screen can be used.
Signing in
The sign-in card is titled Login with the line "Access your Spanway Admin UI.".
| Control | Type | What it does |
|---|---|---|
| Default Credentials | Notice | Explains that the default username is admin and the password is the gateway master key, with a link to the documentation. It disappears once UI_PASSWORD is set, and operators can also hide it with general_settings.hide_default_credentials_hint: true or SPANWAY_HIDE_DEFAULT_CREDENTIALS_HINT=true. It is also hidden during a two-factor step. |
| Work email and Continue with SSO | Field and button | Shown only when at least one organization has its own single sign-on set up. Enter your work email and the gateway looks up your organization. When your domain uses SSO, you are sent to your identity provider. Otherwise the card says "Your organization does not use single sign-on here. Log in with your username and password.". |
| Worker | Dropdown | Shown only on a control plane with registered workers. Picks the worker gateway you want to manage. A link can preselect a worker with ?worker=<id>. |
| Username | Text field | Required. An empty field shows "Please enter your username". |
| Password | Password field | Required. An empty field shows "Please enter your password". |
| Login | Button | Signs in with the username and password. It reads "Logging in..." while the request runs. A failed sign-in shows the gateway's error above the form. |
| Login with SSO | Button | Starts the gateway wide SSO flow. It is disabled with the tooltip "Please configure SSO to log in with SSO." until an admin sets up SSO. |
When SSO is set up, a dismissible notice explains that the page no longer redirects to SSO on its own and that setting AUTO_REDIRECT_UI_LOGIN_TO_SSO=true brings the automatic redirect back. The redirect is skipped while any organization has its own SSO, so people from that organization can still pick it on the Work email field.
The password form stays on the page even when an operator turns password sign-in off with disable_password_login_when_sso_enabled or disable_env_credential_login. Submitting it then shows the gateway's refusal above the form, for example "Username/password login is disabled because SSO is configured and 'disable_password_login_when_sso_enabled' is set. Sign in via SSO.", so use Login with SSO instead. Repeated failed sign-ins from one address are blocked for a while, as described on the Admin UI page. Setting up SSO is covered in Admin UI SSO, and per organization SSO in organization SSO.
Every sign-in path, password, SSO or two-factor, ends with the gateway setting an HttpOnly session cookie. Scripts in the page cannot read it, so the UI asks GET /session/me who is signed in, and Logout calls POST /session/logout to revoke the session on the gateway. One exception is a control plane managing a worker: the worker's cookie belongs to the worker's address, so the UI keeps the worker session token in the browser tab's session storage until the tab closes or you sign out, and the token is readable by scripts on the control plane page.
Two-factor sign-in
When your account has two-factor sign-in turned on, the password step is followed by Two-factor sign-in. Enter the 6-digit Code from your authenticator app and press Verify. Use a recovery code switches the field to Recovery code, and each recovery code works once. Use an authenticator code switches back. The page shows "Two-factor sign-in is required for your account. Sign in here to continue." when you are sent back to sign in because your account now requires it.
When an admin or your organization requires two-factor sign-in and you have not set it up yet, the next step is Set up two-factor sign-in. Add the account to an authenticator app with Open in an authenticator app on this device, or type the setup key it shows by hand, then enter the 6-digit Code and press Turn on two-factor sign-in. The next screen, Two-factor sign-in is on, lists your recovery codes once. Save them somewhere safe before you press Continue to the dashboard, because the UI cannot show them again. You manage two-factor sign-in later from your account, see the Account page.
First sign-in and password resets
An invitation link lets a new person set their own password without an admin ever knowing it, and a reset link does the same for someone who forgot theirs. Both open the onboarding screen at /ui/onboarding.
- Open the link the admin sent, which looks like
https://gateway.example.com/ui/onboarding?invitation_id=..., or...&action=reset_passwordfor a reset. A spinner shows while the gateway checks the link. - The card is titled Sign Up with "Claim your user account to login to Admin UI.", or Reset Password with "Reset your password to access Admin UI.". Email Address shows your address and cannot be changed.
- Type a password in Password, whose help reads "Create a password for your account" or "Enter your new password". An empty field shows "password required to sign up". The gateway applies the password policy, 12 characters with upper and lower case letters, a digit and a special character by default, and refuses a password found in a public breach list.
- Click Sign Up or Reset Password.
Expected result: you land on the dashboard already signed in. The link is marked used and every other Admin UI session of your account is signed out, in case an old one was in the wrong hands. When your account needs two-factor sign-in, you are sent to the sign-in page with "Two-factor sign-in is required for your account. Sign in here to continue." and sign in once more with the new password and your code.
A link that cannot be used shows "Failed to load invitation" and "The invitation link may be invalid or expired." with a Back to Login button. Links expire seven days after they were made. Ask an admin for a new one, see invitation links. When an admin requires a new password after sign-in, you are sent to the change password screen on the Account page before anything else.
The layout
Every screen has the same frame, a left nav, a top bar and the page itself.
Left nav
The top of the nav shows the logo, which links to Home, and a version badge such as v2.0.0 that opens the release notes. The panel button next to it collapses the nav to an icon rail and expands it again. In the rail, hovering an icon shows its name.
The nav is split into five groups. Groups and entries you are not allowed to open are hidden, so two people can see different navs on the same gateway.
| Group | Entries |
|---|---|
| AI GATEWAY | Home, Virtual Keys, Playground, API Playground, Chat, Models + Endpoints, Routing Presets, Agentic with Agents, Workflow Runs, Run Ledger and Memory, then MCP Servers, Skills, Guardrails, Policies, Prompts, and Tools with Search Tools, Code Graph, Vector Stores and Tool Policies. |
| OBSERVABILITY | Usage, Model Leaderboard, Cost Optimization, Logs, Lens, Status Page and Guardrails Monitor. |
| ACCESS CONTROL | Teams, Projects, Internal Users, Customers, Organizations, Roles, Access Requests, Access Groups, Budgets and Tag Management. |
| DEVELOPER TOOLS | API Reference, AI Hub, Learning Resources (opens these docs in a new tab), Response Cache, Evals and Review. |
| SETTINGS | Settings with Router Settings, Logging & Alerts, Admin Settings, Cost Tracking, Compliance, Billing, Tenants, Cloud plan and UI Theme. |
Agentic, Tools and Settings are folders. Click one to open or close it. The folder that holds the page you are on stays open. Two pages are not in the nav and are reached from other screens, Key Hygiene from the Virtual Keys page and the legacy usage page described on the Usage page.
The bottom of the nav holds a usage card for admins, described on the Home page, and the account menu with your name, display switches, Change Password and Logout, described on the Account page. Logout also clears what the browser kept for your session, so the Playground settings and the Chat history are gone for the next person who signs in on that browser.
When you sign in with a view-only role, such as Admin Viewer or Internal Viewer, a banner under the top bar says "You are signed in with a view-only role. Pages show their settings, but the buttons that change them are hidden." Pages show their lists and settings, and the controls that would change something are not shown.
Top bar
| Control | What it does |
|---|---|
| View switcher | The first item of the breadcrumb. It shows the current view, AI Gateway by default, and lists any UI plugins an admin installed (see UI plugins). Chat opens the Chat UI when it is turned on. When it is off, Chat is disabled with the hint "Admins can enable in Settings". |
| Page title | The name of the page you are on. |
| Search or jump to... | Opens the command palette. The button shows the keyboard shortcut, Ctrl K on Windows and Linux and Command K on macOS. Type to find a page in the nav you are allowed to open and press Enter to go there. On the Virtual Keys page the button reads Search keys... and searches keys. |
| Worker switcher | Shown only on a control plane after you pick a worker. Switching worker signs you out of the current one and opens the sign-in page for the new one. |
| Admin Assistant | The built-in admin assistant. Shown only to a proxy admin who is not view-only, on a gateway with an enterprise license, unless they hid it in the account menu. It opens a docked chat that answers questions about the gateway and proposes changes for you to review in the chat. It asks you to approve the connection first and uses a chat model on your gateway. See Admin Assistant in the Admin UI. |
| Docs | Opens the docs page for the screen you are on in a new tab. Screens without their own docs page open this guide. |
| Blog | Lists the five newest posts from the Spanway blog. Operators can hide it. |
| Get support | Opens the Spanway support page. It is hidden when the operator turns off product prompts. |
| Theme toggle | Switches between light mode and dark mode. Dark mode is marked beta. |
| Notifications | A bell with product announcements. Read the docs opens the announced feature and Mark as read clears the dot. |
On a narrow screen the tools move into a More options menu, titled Gateway tools, and the left nav opens from a menu button.
Banners
Some notices can appear above any page, for example a license that is about to expire, a gateway running in debug mode, a gateway without Redis, or a banner text set by an admin. Each banner and what to do about it is listed on the Home page.
Roles and what each one sees
Every person who signs in has one built-in role. The UI uses it to decide which nav entries and controls to show, and the gateway checks the same role again on every request, so hiding a control in the UI is never the only protection. Roles are explained in depth in access control and users.
| Role | Stored value | Writes | What they see |
|---|---|---|---|
| Proxy admin | proxy_admin | Yes | Every nav entry. Some enterprise screens also need a license feature, see below. |
| Proxy admin viewer | proxy_admin_viewer | No | Signs in with the session role Admin Viewer. The same nav as a proxy admin except the Playground, because viewers must not run paid model calls from it, and Review. Most write buttons are hidden. Every write is refused by the gateway, so the few screens that still show a write button to a viewer fail with a permission error. |
| Org admin | org_admin | Within their organizations | Home, Virtual Keys, Chat when it is on, MCP Servers, Guardrails, Search Tools, Vector Stores, Workflow Runs, Logs, Lens, Teams, Projects (when projects are turned on), Internal Users, Organizations, Access Requests, API Reference, AI Hub, Learning Resources, and Cloud plan under Settings. They manage the teams, users and keys of the organizations they administer. |
| Internal user | internal_user | Their own keys and resources | Home, Virtual Keys, Playground, API Playground, Chat when it is on, Models + Endpoints, Routing Presets, Agents, Workflow Runs, Run Ledger, MCP Servers, Guardrails, Search Tools, Code Graph, Vector Stores, Usage, Cost Optimization, Logs, Lens, Teams, Access Requests, API Reference, AI Hub, Learning Resources and Review. Their data is limited to their own keys, teams and spend. |
| Internal viewer | internal_user_viewer | No | The internal user nav without the Playground, Models + Endpoints, Agents and Review. |
A team admin is an internal user who holds the admin role on a team. Team admins manage that team's members, keys and the team settings an admin allowed them to edit, they see the Projects page when projects are turned on, and admins can let them use Agents and Vector Stores even when those pages are turned off for other internal users. An org admin membership works the same way. A person whose base role is internal user but who is an org admin of at least one organization also gets the Internal Users and Organizations entries.
Admins can narrow the nav further for everyone who is not an admin. The UI settings on the Admin Settings page can limit internal users and org admins to a chosen list of pages, turn off Agents or Vector Stores for internal users, turn the Chat UI and the Projects page on or off, and hide blog and support prompts. Setting general_settings.ui_access_mode to admin_only lets only proxy admins sign in at all.
Custom roles
With the custom_roles license feature, an admin can give a person a custom role on the Roles page. A custom role starts from a built-in base role, then grants extra permissions and denies others, and denials always win. The left nav still follows the base role, so a page opened by a granted permission may have no nav entry. For example a custom role with evals.read can open /ui/evals by typing the address, and the page then shows only that person's team records. The gateway applies the grants and denials on every request. See custom roles.
Free and enterprise license states
The core gateway works without a license. Enterprise screens and controls need a Spanway license, and many need a named feature in that license. The license features are listed on the Enterprise page.
A screen that needs a feature your gateway does not have shows a card titled "Screen name needs a Spanway Enterprise license" in place of the screen. Without any license, the card says this is an enterprise feature and names the license features that unlock it. With an enterprise license that lacks the feature, the card names the missing features and asks you to contact sales@spanway.ai to add them. Both versions link to a trial license. For example Roles names "Custom roles", Access Requests names "Access requests", Key Hygiene names "Key hygiene", Compliance names "Compliance" or "Compliance evidence bundles", the workflow tabs name features such as "Workflow runner" or "Human approval", Evals names "Evals and red teaming", Billing names "Billing and invoicing" and the Cloud pages name "Spanway Cloud". A short loading state shows while the license is checked.
Smaller enterprise controls inside a free screen are disabled or marked as an enterprise feature instead, for example per key guardrails or team logging. When the UI cannot read the license at all, it does not show the screen. A card titled "Screen name is hidden until the license can be checked" asks you to reload the page or have a proxy admin check that GET /health/license answers. The gateway also checks the license on every request and refuses a missing feature with a message such as "Your Spanway license does not include the 'evals' feature. Contact sales@spanway.ai to add it.".
When a license is close to expiry, a banner at the top of every page counts down the days and asks you to renew. Once it has expired, the banner says enterprise features are now disabled. In both cases contact sales@spanway.ai.
Getting help
The Docs link in the top bar opens the docs page for the screen you are on, or this page when a screen has no page of its own. Each page of this guide lists the feature docs for its screen at the bottom. For anything else, use Get support in the top bar or write to support@spanway.ai.
Errors
| What you see | What it means | Fix |
|---|---|---|
| Admin UI Disabled | DISABLE_ADMIN_UI is set on the gateway. | Set DISABLE_ADMIN_UI=False and restart. |
| "Invalid credentials used to access UI. Check 'UI_USERNAME' and 'UI_PASSWORD', or the password set for your user" above the form | The username or password is wrong. When the built-in admin login is off the message names only your own password. | Use admin and the exact master key, or your own email and password. |
| "Too many failed sign-in attempts. Try again later." | Too many failed sign-ins for this username or from this address, so sign-in is blocked for the number of seconds in Retry-After, 300 by default. | Wait, then sign in with the right password. An admin can still use the master key over the API. |
| "Username/password login is disabled because SSO is configured and 'disable_password_login_when_sso_enabled' is set. Sign in via SSO." | Password sign-in is turned off. | Use Login with SSO. |
| "Two-factor sign-in is required but no database is connected, so it cannot be checked. ..." | Two-factor sign-in is required and the database is down. | Restore the database. Meanwhile use the master key over the API. |
| "No Database connected. Set DATABASE_URL in .env. ..." | The gateway has no database, which the UI needs. | Set DATABASE_URL. |
| "Invalid or expired login code" | On a control plane, the sign-in code from the worker was used, too old or reached another worker instance. The page now shows this instead of loading forever. | Sign in again. If it keeps happening, configure Redis on the worker, see control plane. |
| "Failed to load invitation" on the onboarding screen | The invitation or reset link is expired, revoked, already used, or its user was deleted. | Ask an admin for a new link. |
| Login with SSO is disabled | SSO is not set up. | Set it up on the SSO Settings tab of Admin Settings, see Admin UI SSO. |
| A card that says a screen needs a Spanway Enterprise license | The license lacks the feature that screen needs. | Add the feature, see Enterprise. |
Audit
Every password sign-in writes an audit row on Spanway_UserTable with action invoked, event sign_in, its outcome (succeeded, failed or locked_out), the username typed and the source address, so an admin can see who signed in, who was refused and who was locked out. Logout writes event sign_out, and setting a password through an invitation or reset link writes updated with event password_set_by_link. Passwords and links are never written.
Logs
The sign-in path writes these lines to the gateway log. The log reference has the full list.
| Level | Line | Meaning |
|---|---|---|
| WARNING | Admin UI sign-in refused: the <scope> is blocked for <n> more seconds; ... | A sign-in arrived while blocked. Normal after a guessing attempt, check the source when it repeats. |
| WARNING | Admin UI sign-in blocked for <n> seconds after too many failures; ... | A block started. Look at the source address. |
| WARNING | Running <n> workers but Redis is not configured. Failed Admin UI sign-in attempts are counted per worker, ... | The sign-in limits are per worker. Configure Redis to share them. |
| WARNING | Login-time breach screening could not update user <id>: ... | A breached password was found but the user was not marked. Check the database. |
| ERROR | Failed to roll back onboarding invitation after session key mint failed. | An onboarding claim failed halfway. Send the user a new link. |
Related
- Admin UI for the settings that control sign in and sub-paths.
- Admin UI SSO for single sign on.
- Access control for roles.