Authentication

One header, one key format, no OAuth.

The only auth header
Authorization: Bearer mr-live-<26 base58>

Keys are created before any payment. Two equal ways in: accountless at minirouter.sh/key, or an account with an email or Solana wallet — same prices, same API behaviour. We store the 14-character prefix and a sha256 hash. The key itself is never stored. The plaintext is returned only when the key is created or rotated.

Accountless mode

No email or wallet identity is required. Turnstile protects anonymous account creation without becoming an account. Setup returns a one-time API key and a separately hashed permanent dashboard link. Both must be saved before payment. The link stays valid when the API key is rotated and can create a replacement key. Browser-push and email credit alerts are optional. The x-minirouter-balance-usd header on every response remains the always-on balance signal.

Account mode

Sign in with an email or a Solana wallet at /start — passwordless either way. Adds account recovery, key replacement and personal recovery. Existing plaintext keys still cannot be recovered because only their hashes are stored, but a signed-in dashboard can create a replacement.

Claim an account later

Attach an email or a wallet to an accountless balance. The API key is the proof of control; the key keeps working unchanged:

Attach an email to an accountless account
curl https://api.minirouter.sh/me/claim \
  -H "Authorization: Bearer $MINIROUTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com"}'

Rotation — with a 24-hour grace window

Rotating returns the new key and the old key’s expiry, 24 hours out — instant-kill rotation would brick a running agent mid-task. After the window the old key returns 401 invalid_api_key.

Per-key controls

Every key carries rpmLimit, tpmLimit, dailyLimitNano, monthlyLimitNano and an allowedModels list. Spend caps are on by default, lower for accountless keys. Raise limits in the dashboard; see rate limits.