a888 Download

free & self-hosted

Put a key in front of any API you run.

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.

MIT licensed · zero npm dependencies · 23 tests · runs on any Docker host

How it works

Four steps, and you're issuing keys for your own API.

1

Deploy the gateway

Run it with Docker, or as a plain Node process. Point it at your existing API with one environment variable, UPSTREAM.

2

Issue a key

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.

3

Hand it to your customer

They call your API with Authorization: Bearer <key>. a888 checks it, counts it, and forwards the request — your API never sees the key.

4

Renew, suspend, or revoke

When they pay again, renew the key. If they stop, suspend or revoke it. Changes take effect on the next request.

What it handles for you

The parts of running a paid API that aren't the API itself.

Exact quotas SQLite

Monthly limits are counted atomically, so a burst of concurrent requests can't slip past the cap.

Per-key rate limits

Each key gets its own requests-per-second ceiling with a short burst allowance, independent of the monthly quota.

Hashed keys

Keys are stored as SHA-256 hashes. The raw key is shown once, at creation, and never again.

Path scoping

Restrict a key to specific routes — give a trial customer /v1/ and nothing else.

Multiple upstreams

Route different path prefixes to different backend services from one running gateway.

Credential stripping

The customer's key and any cookies are removed before the request reaches your upstream API.

What your customers see

StatusMeaning
200Request forwarded to your API, with quota headers attached
401Missing, invalid, or revoked key
402Key expired or suspended — renew to continue
429Rate limit or monthly quota reached

Install

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/

Download

a888-selfhost.zip
Source, README, Dockerfile, tests · MIT license
Download