API tokens
Scripts and agents call Axel's API with a personal access token. A token acts as the person who made it, only within the scopes they gave it, and loses whatever its owner later loses.
Create a token
- Sign in, open Account and fill in Personal access tokens: a name, the scopes and how many days it lasts.
- Copy the token. It is shown once; Axel keeps only its hash.
Until the web app ships in the install, create one through the API, signed in as Model connections shows:
curl -sS -b axel.cookies -H 'Content-Type: application/json' \
-d '{"name": "backup check", "scopes": ["admin:read"], "expires_in_days": 30}' \
https://axel.example.com/api/account/tokensUse it in the Authorization header:
curl -sS -H "Authorization: Bearer $AXEL_TOKEN" https://axel.example.com/api/accountRevoke a token from the same page. A token stops working when it expires, is revoked, or its owner is deactivated. Changing your password or signing out other sessions leaves tokens working, as API keys keep working on claude.ai, so revoke any token you no longer trust.
Scopes
| Scope | Allows |
|---|---|
account:read | Reading your own account, sessions and tokens |
account:write | Revoking your tokens |
account:security | Creating tokens, changing your password, ending sessions; signed-in sessions only |
admin:read | Reading the licence, notifications, support bundle and model connections |
admin:write | Dismissing notifications and rerunning model connection checks |
admin:security | Model connection and token policy changes; signed-in sessions only, never a token |
audit:read | Reading the audit log |
A token gets only scopes its owner's role has, and never account:security or admin:security.
Token policy
Admins set which scopes tokens may carry and their longest lifetime, 365 days by default. A narrower policy applies to existing tokens at once: they lose the scopes it drops, and a shorter lifetime moves their expiry forward.
curl -sS -b axel.cookies -X PUT -H 'Content-Type: application/json' -H 'If-Match: "0"' \
-d '{"allowed_scopes": ["account:read", "admin:read"], "max_days": 90}' \
https://axel.example.com/api/admin/token-policyIf-Match is the ETag of GET /api/admin/token-policy; "0" until the policy is first changed.