Skip to main content
Copilot API includes a built-in web app that lets you inspect account runtime status and request history captured by the proxy. You can filter requests by model, endpoint, or error state, drill into individual request metadata, and share deep links to specific views — all without installing any extra tooling.

Opening the Admin UI

1

Start the proxy

Run the proxy with your usual command:
npx @nick3/copilot-api@latest start
2

Open the UI in your browser

Navigate to:
http://localhost:4141/admin
Replace 4141 with the port you set if you changed the default.

UI features

Accounts view

The Accounts view shows a KPI overview across all registered accounts, including error rate and average tokens per request. You can filter and sort the account list. Click any account to jump directly to the Requests view with that account’s filter pre-applied.

Requests view

The Requests view lets you search and filter your request history. Available filters include:
  • account_id — the account that handled the request
  • model — the client-requested model or the upstream model
  • endpoint — the endpoint path
  • status — HTTP response status
  • has_error — show only requests that returned errors
  • Time range — preset windows (15 min, 1 h, 6 h, 24 h, 7 days) or a custom date/time range
Requests paginate using cursor-based pagination. Click Next to load the following page.

Request detail

Click any row in the Requests view to open the request detail page. From there you can:
  • Use the Back button to return to the Requests view with your filters preserved
  • View summary fields — each one links back into the Requests view with that value as a filter
  • Inspect the full request metadata in the JSON viewer, which supports search/highlight, expand/collapse, copy, and download

Header controls

The top-right corner of the UI exposes three controls:
  • Motion — choose Magic, Subtle, or Off. Automatically forced to Off when your OS has reduced motion enabled.
  • Theme — choose System, Light, or Dark.
  • Admin token — open a dialog to save and test your admin token, which is stored in sessionStorage and sent as the x-admin-token header.
The Admin UI uses hash routing. You can copy and share URLs that preserve your current view and filters:
http://localhost:4141/admin/#/requests?account_id=octocat&has_error=1

Data storage and retention

The proxy stores request metadata in admin.sqlite under the app data directory:
  • Linux / macOS: ~/.local/share/copilot-api/admin.sqlite
  • Windows: %USERPROFILE%\.local\share\copilot-api\admin.sqlite
What is stored: request metadata only — model names, endpoints, token counts, timing, and error summaries. GitHub tokens, Copilot tokens, and request/response content are never stored. Retention: up to 14 days, capped at 200,000 rows. Older entries are cleaned up automatically.

Access control

When you access the Admin UI from localhost, 127.0.0.1, or ::1, no token is required. The Admin UI and API are restricted to loopback access by default.
To allow access from a non-loopback address (for example, a remote machine or a LAN IP), set the ADMIN_TOKEN environment variable on the server before starting the proxy:
ADMIN_TOKEN=your_admin_token_here npx @nick3/copilot-api@latest start
Then include the token in every request using one of:
x-admin-token: your_admin_token_here
Authorization: Bearer your_admin_token_here
Tokens in URL query parameters are intentionally not supported. Always pass the token as a header.
Error codes:
  • 403 Forbidden — the request came from a non-loopback address and ADMIN_TOKEN is not set on the server.
  • 401 UnauthorizedADMIN_TOKEN is set but you did not include the token in the request header.

Admin API endpoints

You can query the same data programmatically using the Admin API:
EndpointDescription
GET /api/admin/metaReturns database metadata: path, retention settings, and row count.
GET /api/admin/accounts?include_stats=1Lists all accounts with runtime status. Pass include_stats=1 to include aggregated request statistics per account.
GET /api/admin/requestsReturns paginated request logs. Supports filters: account_id, upstream_model, client_model, status, has_error, from_ms, to_ms. Paginate using cursor_id from the previous response’s next_cursor_id.
GET /api/admin/requests/:requestIdReturns the full metadata record for a single request by its ID.
curl "http://localhost:4141/api/admin/meta"