Protocol
Architecture
A thin stack: a static frontend, an Express API, Postgres, and Solana for auth and settlement.
Components
- Frontend — static marketplace, account dashboard, and docs (Vercel).
- Backend API — Express service handling auth, keys, balances, top-ups, and the gateway proxy.
- Database — Supabase Postgres for users, API keys, balances, usage logs, and top-up records.
- Chain — Solana for wallet auth and USDC top-up settlement.
Auth
Sign-in uses a Solana message signature, not a password. A nonce endpoint returns a message; login verifies the signature and issues a JWT. Dashboard and top-up routes require that JWT.
wallet signature → JWT → dashboard / top-up routes api key (hashed) → gateway proxy → upstream model
Settlement
Top-ups are real on-chain USDC transfers. Usage metering and balances are kept in Postgres for speed. We describe this as "USDC top-ups, metered off-chain" — accurate to how it runs.