Skip to main content

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​

  1. Set SERVER_ROOT_PATH=/gateway and PROXY_BASE_URL=https://ai.example.com/gateway in the gateway container's environment, add the access mode to the config file, and restart.

    general_settings:
    ui_access_mode: admin_only
  2. Check that the gateway answers under the sub-path.

    curl https://ai.example.com/gateway/health/liveliness
  3. Open https://ai.example.com/gateway/ui, type admin as Username and the master key as Password, and click Login.

  4. Sign in as a developer with the internal_user role 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.

SettingDefaultEffect
UI_USERNAMEadminUsername for the built-in admin login.
UI_PASSWORDmaster keyPassword for the built-in admin login. When unset, the master key is the password.
PROXY_BASE_URLnonePublic URL of the gateway, required for SSO redirects and invitation links.
SERVER_ROOT_PATHnoneServe the gateway and UI under a sub-path, such as /spanway.
DISABLE_ADMIN_UIfalseTurn the UI off entirely.
AUTO_REDIRECT_UI_LOGIN_TO_SSOfalseSend the sign-in page straight to SSO. Skipped while any organization has its own SSO.
hide_default_credentials_hintfalseA 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​

PageWhat it is for
HomeOverview of the deployment and shortcuts.
Virtual KeysCreate and manage keys, budgets and limits.
PlaygroundTry models with your own key.
API PlaygroundBuild a request and see how the gateway transforms it for the provider.
ChatThe user facing Chat UI, shown when enable_chat_ui is on.
Models + EndpointsAdd, edit and test model deployments, credentials and pass-through endpoints.
Routing PresetsNamed 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 MemoryRegister agents, inspect workflow runs, the run ledger and memory entries.
MCP ServersRegister MCP servers, toolsets, access groups and the semantic filter and tool search settings.
SkillsRegistered skills and the Claude Code plugin marketplace.
GuardrailsConfigure guardrails.
PoliciesGuardrail policies that bundle guardrails per route or tag.
PromptsPrompt management.
Tools, with Search Tools, Code Graph, Vector Stores and Tool PoliciesRegister search tools, index repositories for the code graph, register vector stores, and set tool policies.

Observability​

PageWhat it is for
UsageSpend by key, team, model, tag and customer, see cost tracking.
Model LeaderboardWhich models carry traffic and spend, by day and by task, see model leaderboard.
Cost OptimizationAuto router savings, shadow evals and prompt caching, see cost optimisation.
LogsPer request logs, including MCP tool calls and guardrail results.
LensAgent traces from Lens, with search, sessions, agent graphs and comments.
Status PageUptime, latency and incidents per model group and provider, see status page.
Guardrails MonitorGuardrail detections over time.

Access control​

PageWhat it is for
Teams, Projects, Internal Users, OrganizationsManage the user hierarchy.
CustomersEnd users of your applications with their budgets and limits, see customers.
RolesEnterprise custom roles.
Access RequestsEnterprise access requests from the developer portal.
Access GroupsModel, MCP and agent access groups granted to keys and teams.
BudgetsShared budgets attached to keys, teams and customers.
Tag ManagementTags used for tag routing and tag budgets.

Developer tools​

PageWhat it is for
API ReferenceSample 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 HubPublic catalogue of models, agents and MCP servers, see AI hub.
Learning ResourcesLinks to guides.
Response CacheCaching settings and the coordination Redis connection.
EvalsEnterprise evals and red teaming.
ReviewEnterprise review queues where people label eval results and sampled responses.

Settings​

PageWhat it is for
Router SettingsRetries, fallbacks and routing strategy, see routing.
Logging & AlertsLogging callbacks and alerting.
Admin SettingsSSO, security settings including the IP allow-list, SCIM, UI settings, logging, secret manager connections, plugins and web search interception.
Cost TrackingDiscounts, margins and pricing controls, see custom pricing.
ComplianceEnterprise compliance controls.
BillingEnterprise billing.
Tenants, Cloud planThe hosted cloud edition.
UI ThemeThe 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 seeWhat it meansFix
Admin UI DisabledDISABLE_ADMIN_UI is true.Set it to false and restart.
Pages load without styles or links go to the wrong pathSERVER_ROOT_PATH does not match the path users type.Set it to the exact sub-path.
SSO redirects to localhostPROXY_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 databaseDATABASE_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.