Authentication tokens
Definition
An authentication token is the credential a client presents to the gateway. The gateway recognises gateway tokens and personal access tokens for inference, and the admin session for the admin API.
Gateway token
Authorises inference requests (/v1/) on one gateway. A tenant admin creates it on the gateway. It is bound to the gateway, not to a user.
Personal access token
Authorises inference requests on one gateway on behalf of one user. The user creates it on the Account › Profile page.
Admin session
Authorises requests to the admin API (/admin/v1/). It is issued when a user signs in to the app and is carried in a session cookie. It is not used for inference.
Rules and facts
- A token is scoped to exactly one gateway. A token for gateway A is rejected on gateway B.
- A token can carry its own budget and rate limit. These are set on the token; they are not inherited from the user.
- A token carries scopes that restrict what it may call (for example inference, or the MCP proxy for a per-agent token).
- The plaintext token is shown once, at creation. The gateway stores only a one-way hash and cannot show it again.
- A client sends the token in the
Authorization: Bearerheader; the gateway also accepts thex-aig-tokenandx-api-keyheaders. - Deleting a user immediately disables that user's tokens.
Comparison
| Credential | Authorises | Created by |
|---|---|---|
| Gateway token | inference on one gateway | tenant admin |
| Personal access token | inference on one gateway, as the user | the user |
| Admin session | admin API | sign-in |
See also
- Profile — creating and revoking personal tokens.
- Users — managing other users' tokens.
- Token fields and Token capability scopes.