Authentication
Inference keys, management keys, tickets, private accounts, and compatibility mode.
AnonRouter separates credentials by purpose. A single bearer credential does not automatically receive both inference and account-management authority.
Credential types
| Credential | Purpose | Prefix |
|---|---|---|
| Inference API key | Issue tickets and call inference endpoints | ar_ |
| Management key | Read account balance and usage metadata | arm_ |
| Browser or private session | Manage keys, workspaces, billing, and account state | Cookie |
| Inference ticket | Authorize one model-bound inference request | Opaque |
Secrets are shown once when they are created. Store them in a secret manager or an environment variable. Keys are stored only as a hash, so a lost key cannot be recovered and must be replaced.
Private ticket flow
The recommended production flow has two steps:
- Present the inference key to the control plane at
POST /v1/inference/ticketsand request a ticket. - Present the ticket to the relay in the
x-anonrouter-ticketheader.
The ticket is short-lived, single-use, and bound to the authorized request
constraints (model, operation, output limit, and reasoning selection). The relay
redeems the opaque ticket and never receives your key or account identity. A
request whose model, output limit, or reasoning selection drifts from the
ticket is rejected before any provider work.
Issue one ticket per request
Tickets are valid for about 30 seconds and can be redeemed once. Do not cache or reuse them.
Inference keys vs management keys
Inference keys (ar_) can list models, issue tickets, and run completions,
embeddings, image generation, and speech. They cannot read account balance or
usage.
Management keys (arm_) can read GET /v1/balance and GET /v1/usage. They
cannot run inference or manage other keys.
Creating, listing, and revoking keys is a dashboard operation that requires an authenticated session. Neither key type can rotate keys programmatically. An account may hold up to 20 active inference keys and 5 active management keys.
Each inference key can carry an optional per-key credit limit and an opt-in compatibility flag.
Compatibility mode
Compatibility mode is intended for clients that can only send a static
Authorization: Bearer ... header, such as off-the-shelf OpenAI SDK
integrations.
Privacy tradeoff
In compatibility mode, the broker receives API-key identity and plaintext request content together in memory. Prompts and responses are not intentionally logged or retained, but this flow is not unlinkable like the private ticket flow.
Compatibility mode is opt-in and enabled per inference key, and it is only available where the operator has turned it on. See compatibility mode for the full integration.
Accounts
You can create an account two ways:
- Email and password. Standard sign-up with email verification.
- Private account. A username is assigned automatically, there is no email, and the session stays opaque. Your identity never becomes part of the inference request.
Recovery phrases
A private account can protect itself with a recovery phrase: a standard BIP-39 mnemonic, shown once at sign-up. The dashboard uses a 12-word phrase.
Recovery at POST /v1/private-accounts/recover verifies the phrase, resets the
password, and revokes every existing session and API key. A recovery phrase only
resets the account password. It does not derive a wallet or encrypt account
data. Rotating the phrase invalidates all earlier phrases.
Store the phrase safely
If you lose the recovery phrase for a private account with no email, you may permanently lose access.
Management access
Management keys read account-level balance and usage metadata. They cannot run inference or create and revoke credentials. Credential lifecycle operations require an authenticated browser or private session.