/admin, accessible as JSON so you can integrate it into your own scripts or monitoring tools.
Access control
Access rules differ based on where requests originate:
When
ADMIN_TOKEN is set on the server, pass it in one of these headers:
Tokens in URL query parameters are not supported.
GET /api/admin/meta
Returns metadata about the request history database, including the database file path and retention settings.GET /api/admin/accounts
Lists accounts with their runtime status. Passinclude_stats=1 to include aggregated request statistics for each account.
include_stats=1:
GET /api/admin/requests
Queries request logs with optional filters and cursor-based pagination.Query parameters
Response fields
Examples
GET /api/admin/requests/:requestId
Returns a single request log entry by its ID.GET /api/admin/config
Returns the current server configuration. You can also usePOST /api/admin/config to update configuration values without restarting the server. Changes made via the API are validated and applied immediately.
Unknown keys are rejected. Only fields documented in the configuration reference are accepted.
Data storage and retention
Request history is stored inadmin.sqlite in the app data directory:
- Linux / macOS:
~/.local/share/copilot-api/admin.sqlite - Windows:
%USERPROFILE%\.local\share\copilot-api\admin.sqlite