Stripe-backed API key management for ZenBin.
npm install
npm run devZENBIN_JWT_SECRET=your-secret-key
STRIPE_SECRET_KEY=sk_test_xxx
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_xxx
- User signs up → gets a static API key (
zb_live_xxxxx) - Agent exchanges API key for JWT via
/api/auth/token - Agent uses JWT to call ZenBin API
- When JWT expires, agent refreshes using the same API key
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Agent │ ──────► │ Portal │ ◄────── │ User │
│ │ POST │ /auth/ │ signup │ │
│ │ apiKey │ token │ │ │
└──────────┘ └────┬─────┘ └──────────┘
│ JWT
▼
┌──────────┐
│ ZenBin │
│ API │
└──────────┘
Exchange API key for JWT:
curl -X POST https://zenbin.org/api/auth/token \
-H "Content-Type: application/json" \
-d '{"apiKey": "zb_live_xxxxxxxxxxxxxxxx"}'Response:
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 86400
}Create account and get API key:
curl -X POST https://zenbin.org/api/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "secret"}'Login with email/password:
curl -X POST https://zenbin.org/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "secret"}'zb_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Plan | Requests/mo | Price |
|---|---|---|
| Free | 10 | $0 |
| Hobby | 1,000 | $5 |
| Pro | 10,000 | $15 |
| Business | 100,000 | $49 |
Deploy to Vercel:
vercel --prod