Philosophy
GoModel ships with admin endpoints enabled by default. The goal is simple: you should be able to deploy GoModel and immediately have visibility into what’s happening — no extra services, no separate monitoring stack, no configuration. The admin layer is split into two independently controllable pieces:- Admin REST API (
/admin/*) — machine-readable JSON endpoints for usage data, budgets, and model inventory. Protected byGOMODEL_MASTER_KEYlike all other API routes. - Admin Dashboard UI (
/admin/dashboard) — a lightweight, embedded HTML dashboard that visualizes the same data. No external dependencies, no JavaScript frameworks to install — it’s compiled into the binary.
Configuration
Admin and dashboard behavior is controlled by environment variables (or the equivalentadmin: YAML block). See
Admin configuration for the full table of
variables, defaults, and the equivalent admin: YAML block.
The dashboard UI requires the REST API to be enabled. If you set
ADMIN_ENDPOINTS_ENABLED=false but leave ADMIN_UI_ENABLED=true, the UI
will be automatically disabled with a warning in the logs.Authentication
The admin REST API endpoints (/admin/*) accept two credentials as a Bearer token:
GOMODEL_MASTER_KEY— always has admin access.- A managed API key with dashboard access — managed keys are created without dashboard access by default, so a key handed out for model traffic cannot read the audit log, issue new keys, or change gateway settings. Requests made with a managed key that lacks access return
403with error codedashboard_access_denied.
"dashboard_access": true on POST /admin/auth-keys), or later:
GET /admin/auth-keys rows carry restricted and effective_models — the
catalog models a request with that key can actually call, with its user path
policies, its own allowlist, and model-side policies applied.
Restrict a key to specific models with the optional allowed_models on
POST /admin/auth-keys (omitted means no key-level restriction, like every
other optional creation field) or later with
PUT /admin/auth-keys/<key-id>/allowed-models ({"allowed_models": ["anthropic/*", "openai/gpt-4o"]};
an explicit empty list lifts the key-level restriction; omitting the field is rejected). Group- and user-level
allowlists are managed through the user endpoints.
Dashboard access only gates /admin/*. Model endpoints and the self-service GET /v1/usage endpoint stay available to every managed key.
Scoped admin access
A managed key’suser_path also bounds what it can administer. A key with
dashboard access and no user_path (or /) is a global admin and sees
everything, like the master key. A key bound to /team/alpha is a scoped
admin: it reads and manages only /team/alpha and its descendants
(/team/alpha/service, /team/alpha/service/worker, …). The
X-GoModel-User-Path header never widens a key’s scope.
Extension identities such as SSO sessions follow the same rule: the session’s
user path is the subtree it administers, so an extension binds gateway admins
to / and team admins to the team root.
Use GET /admin/access to find out which one a credential is:
- Usage, audit, API key, user, budget, and rate-limit endpoints are filtered
to the scope. An omitted
user_pathfilter means the scope root; auser_pathoutside the scope returns403with codeuser_path_out_of_scope. - Objects addressed by ID that belong to another subtree (an audit entry, an
API key) return
404, exactly as if they did not exist. - New API keys and user policies default to the scope root and cannot be created outside it. Keys with dashboard access created this way are scoped admins of that subtree in turn.
- Only user-path budgets and rate limits are visible and editable; label, provider, and model rules are gateway-wide.
- Gateway-wide endpoints return
403with codeadmin_scope_denied: provider status and credentials, runtime settings and refresh, tagging settings, virtual models, workflows, guardrails, MCP servers, pricing overrides, cache overview, live logs, token throughput, pricing recalculation, budget and rate-limit reset-all, and budget settings updates. The dashboard hides the matching pages and actions.
/v1 lifecycle objects; see
User Path → Object ownership.
The dashboard UI pages (/admin/dashboard) and static assets (/admin/static/*) skip authentication so the dashboard shell is accessible without configuring API keys in the browser — the data it loads still requires a key with dashboard access.
REST API Endpoints
All admin API endpoints are mounted under/admin.
Legacy path alias — until 2026-08-09, the same endpoints are also
reachable under
/admin/api/v1/*. Responses on the legacy path carry
Deprecation: true, Sunset: Sun, 09 Aug 2026 00:00:00 GMT, and a Link
header pointing to the new path. To migrate, replace /admin/api/v1/ with
/admin/ in your scripts. One endpoint also moved within /admin:
/admin/api/v1/dashboard/config → /admin/runtime/config.GET /admin/access
Returns the caller’s admin scope so scripts and the dashboard can adapt. See Scoped admin access. Response:scope is global (master key, or a key without a user_path) or
user_path; user_path is present only for scoped credentials.
GET /admin/usage/summary
Returns aggregate token usage statistics over a configurable time window. Query parameters:
Use
start_date/end_date for explicit ranges or days as a shorthand. When both are provided, start_date/end_date take priority.
Response:
GET /admin/usage/daily
Returns per-period token usage breakdown over a configurable time window, grouped by the specified interval. Query parameters:
The
date field in the response changes format based on the interval: YYYY-MM-DD (daily), YYYY-Www (weekly), YYYY-MM (monthly), or YYYY (yearly).
Response:
GET /admin/usage/sessions
Returns a bounded page of usage grouped by detected, user-path-scoped session, ordered by latest session activity. Rows without a detected session are omitted. Request and token totals include local response-cache hits. Cost totals include provider-bound requests only, so avoided cache cost is not reported as spend. Query parameters:GET /admin/audit/stats
Returns time-bucketed request counts grouped into2xx/4xx/5xx status
classes, an overall success-rate summary, and average request duration per
provider. This powers the “Requests by Status” and “Provider Latency” charts on
the dashboard’s Overview page. Data comes from the audit log (audit logging is enabled by default;
LOGGING_ENABLED).
Query parameters:
Ranges up to 3 days use hourly buckets (
"interval": "hour"); longer ranges use
daily buckets ("interval": "day"). Buckets are zero-filled from the range
start up to the current time.
Response:
provider_latency series aligns index-by-index with buckets. Entries are
null for buckets where the provider served no successful request, and the
averages cover only successful (2xx) requests that reached the provider — local
response-cache hits and failed requests are excluded. If audit logging is
disabled, returns empty buckets.
Budget endpoints
Budgets are managed under/admin/budgets. These endpoints are
available when budget management is enabled.
PUT, DELETE, and reset-one identify one budget by the composite
(user_path, period) key, or (user_path, period_seconds) for custom periods.
These operations are not global per period. For the path-scoped PUT and
DELETE routes, URL-encode user_path; see Budgets for
the request shape.
See Budgets for request examples and enforcement behavior.
User endpoints
GET /admin/users returns every node the gateway knows about — stored
policies, the user paths of managed API keys, and their ancestors — sorted by
path:
allowed_models is the node’s own list in canonical form (anthropic/ for a
provider wildcard, / for everything); inherited_from lists the ancestors
whose lists also apply. effective_models is the path-level result — the node’s list, its ancestors’
lists, and the model-side virtual-model policies — evaluated through the same
authorizer inference uses; a managed API key’s own allowed_models may narrow
a request further. An empty list with restricted: true means the node’s
lists intersect to nothing. configured is false for nodes implied only by keys
or descendants; managed: true marks policies declared in configuration,
which are read-only here (409, code user_managed).
PUT /admin/users takes {"user_path": "/acme/eng", "allowed_models": ["anthropic/*"], "description": "..."}
and returns the updated tree. Selectors are validated against the configured
providers. See Users for the matching rules.
GET /admin/models
Returns all registered models with both provider type and configured provider name. Response:/v1/models endpoint: the admin version includes both provider_type and provider_name for each model, making it useful for understanding both the provider family and the concrete configured provider instance that serves the model.
Admin Dashboard
The dashboard is a server-rendered HTML page embedded in the GoModel binary. Access it at:DASHBOARD_LIVE_LOGS_ENABLED=true, the dashboard opens
GET /admin/live/logs and streams compact audit/usage lifecycle previews. This
lets the Audit Logs and Usage pages show a request as it moves through the
workflow before the async database flush finishes. The stream uses sequence
cursors, bounded replay, and heartbeat events so reconnecting browsers can catch
up after short network drops.
The persisted audit and usage tables remain the source of truth. If the
browser’s cursor falls outside the replay buffer, the stream sends a reset event
and the dashboard reloads from the normal REST endpoints.