free & self-hosted
a888 is a small gateway you deploy yourself. It checks a key on every request, enforces a monthly quota and a rate limit, then forwards the call to your own API. No accounts, no telemetry, no dependency to install — just Node and a database file.
Four steps, and you're issuing keys for your own API.
Run it with Docker, or as a plain Node process. Point it at your existing API with one environment variable, UPSTREAM.
From the CLI, the admin API, or the built-in web page. Set an email, a plan, and how long the key is valid for.
They call your API with Authorization: Bearer <key>. a888 checks it, counts it, and forwards the request — your API never sees the key.
When they pay again, renew the key. If they stop, suspend or revoke it. Changes take effect on the next request.
The parts of running a paid API that aren't the API itself.
Monthly limits are counted atomically, so a burst of concurrent requests can't slip past the cap.
Each key gets its own requests-per-second ceiling with a short burst allowance, independent of the monthly quota.
Keys are stored as SHA-256 hashes. The raw key is shown once, at creation, and never again.
Restrict a key to specific routes — give a trial customer /v1/ and nothing else.
Route different path prefixes to different backend services from one running gateway.
The customer's key and any cookies are removed before the request reaches your upstream API.
| Status | Meaning |
|---|---|
| 200 | Request forwarded to your API, with quota headers attached |
| 401 | Missing, invalid, or revoked key |
| 402 | Key expired or suspended — renew to continue |
| 429 | Rate limit or monthly quota reached |
Needs Node 22.5+ if you're running it directly. No other dependencies.
# unzip the download, then: cd a888-selfhost # edit docker-compose.yml — set UPSTREAM and a long ADMIN_TOKEN docker compose up -d # open the admin page open http://localhost:8888/_a888/
# unzip the download, then: cd a888-selfhost UPSTREAM=https://your-api.example.com \ ADMIN_TOKEN=$(openssl rand -hex 24) \ npm start # issue a key node bin/a888.js keys create --email jo@example.com --plan pro