Quickstart
From a local checkout to your first access check.
1. Start the platform
Use Node.js 24.x, pnpm and Docker for PostgreSQL and Redis. Configure .env from .env.example, with a verified public Fuji registry and preserved secrets, before running these commands. For a new registry, follow the Avalanche deployment guide first:
corepack pnpm install --frozen-lockfile
corepack pnpm db:up
corepack pnpm db:migrate
corepack pnpm start:local
# In another terminal, after configuring the worker:
corepack pnpm mcp:local| Service | Local address |
|---|---|
| Dashboard | http://localhost:3000/app |
| Website and documentation | http://localhost:3001/docs |
| Entitlements API | http://localhost:4001 |
| MCP | http://localhost:4009/mcp when started separately |
Apply migrations through 0024. Configure email delivery, public Fuji RPC, token, registry and the persistent entitlement subject secret. Public chain connectivity does not deploy web hosting or fund customer wallets. Never paste a private key into the browser or chat.
2. Create a plan and checkout
- 1
Verify email and wallet ownership
Enter your email, confirm its code and sign wallet ownership during first-time onboarding. Returning users reconnect their saved wallet; replacement is a separate confirmation flow.
- 2
Create a provider plan
Select a feature, price in USDC, credit allocation, access duration, and the provider’s merchant wallet.
- 3
Open checkout
Create a checkout session for the customer’s holder identity and selected plan.
- 4
Pay from a wallet
Use the configured Avalanche network and token. After the payment is verified, the checkout creates the entitlement.
Access is granted after the transfer and payment evidence are verified, not merely when the wallet connects or signs in.
3. Check the customer’s access
Replace the example holder with the exact identity used in checkout. Read the API key from your server environment.
curl "http://localhost:4001/v1/check?feature=ocr&holder=customer-123" \
-H "Authorization: Bearer $BAGSEVEN_SECRET_KEY"Read enabled, remaining, and paid_through. Deliver the service only when its authoritative access check allows it.
4. Consume prepaid credits
curl -X POST http://localhost:4001/v1/usage/consume \
-H "Authorization: Bearer $BAGSEVEN_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"feature":"ocr","holder":"customer-123","amount":"1","idempotencyKey":"job-123"}'Reuse the same idempotency key when retrying the same usage event. A numeric credit amount is a feature unit, not a USDC amount. No funded spending permission is required for this prepaid usage.