Skip to main content
These endpoints expose runtime status and quota information for the accounts loaded by the proxy. Use them to monitor remaining premium requests, check which accounts are active, and debug authentication issues.

Authentication

When API keys are configured in auth.apiKeys, the /usage endpoints require authentication using one of:
HeaderFormat
x-api-keyx-api-key: <key>
AuthorizationAuthorization: Bearer <key>
If no keys are configured, the endpoints are open.

GET /usage

Returns runtime status snapshots for all accounts currently loaded by the proxy. Each entry includes the account ID, remaining premium quota, and whether the account has unlimited access.
curl http://localhost:4141/usage
Example response:
{
  "accounts": [
    {
      "id": "octocat",
      "entitlement": 300,
      "remaining": 212,
      "unlimited": false,
      "failed": false
    },
    {
      "id": "octocat2",
      "entitlement": 300,
      "remaining": 300,
      "unlimited": false,
      "failed": false
    }
  ]
}

GET /usage/:accountIndex

Returns detailed Copilot usage for a specific account, including quota_snapshots with a breakdown of usage over time. The accountIndex parameter is 0-based.
# Detailed usage for the first account
curl http://localhost:4141/usage/0

# Detailed usage for the second account
curl http://localhost:4141/usage/1
If you started the server with --github-token, a temporary account is added at index 0 and your registered accounts start at index 1. Run GET /usage first to see which account is at each index.Note that auth rm <index> uses a 1-based index (as shown by auth ls), while /usage/:accountIndex is 0-based. These are different numbering schemes.

GET /token

Returns the current Copilot token the proxy is using to authenticate upstream requests. Useful for debugging authentication failures or verifying that a token refresh has occurred.
curl http://localhost:4141/token
Example response:
{
  "token": "tid=...;exp=...;sku=...",
  "expires_at": 1735000000
}