21pins is a local gateway for model access. Whether you're using provider API keys from your paid subscriptions or direct BYOK, your apps use scoped tokens while secrets stay on your machine.
Works with subscription API keys + BYOK · OpenAI-compatible · Keys stay local by default
The problem
Multi-provider workflows are normal now, but key handling is still fragmented. You paste the same expensive keys across multiple products with no shared control plane.
.env filesHow it works
Set each provider key with the CLI. They're stored locally in
~/.config/21pins/ with 0600 file permissions.
Never in env vars. Never in SaaS.
Create scoped bearer tokens for each of your apps. Each token limits which providers, models, and actions that app is allowed to use. Revoke at any time.
Run the local daemon. Your apps point their baseURL
to 127.0.0.1:8787 and use their token as the API key.
That's it — the gateway handles routing, policy, and receipts.
The policy model
Every request is checked against all seven control pins. If one fails, the request is denied or escalated for approval.
Build from source, initialise the config, add your keys, and start routing. Any app that speaks OpenAI-compatible chat will work immediately.
Supported providers
Use provider/model format in the model field — 21pins handles the routing and key injection automatically.
Who it's for
Keep keys in one place, route through one endpoint, and rotate once when needed.
Issue scoped app tokens. 21pins enforces provider and budget policy while apps never see raw keys.
Execution receipts capture grant, decision, and spend data. Approval thresholds gate expensive requests.
Keep keys local, issue scoped app tokens, and plug into one endpoint. Start with your existing toolchain — no rewrite required.
go build -o 21pins ./cmd/21pins
./21pins serve --port 8787