Option A — Console (browser wallet)
If you’ve got a browser wallet (MetaMask, Coinbase, Rabby, etc.):- Open console.luxxon.dev
- Connect wallet → sign the SIWE challenge
- New workspace → pick a slug, name, and role (CONSUMER / SUPPLIER) → sign
- Mint key → save the plaintext (it’s shown once)
- Wallet → Top up pool → pick an amount and sign (first top-up is approve + deposit; subsequent ones are just deposit)
Option B — curl / SDK
This is the wire protocol the SDK wraps. The flow:The API base URL is
https://api.luxxon.dev/api/v1. Examples
below use $API — export API=https://api.luxxon.dev/api/v1.Today the platform runs on Base Sepolia testnet only — every API
key is TEST-scoped. Mainnet (LIVE keys) lights up when we cut
over. Hit GET /config for
the active chain + contract addresses.-
Get a challenge
No auth — issue a nonce + message bound to your wallet address:Response carriesnonce,message(the exact bytes to sign), andexpiresAt(5 min TTL). -
Sign the challenge
Sign the returnedmessagewith the wallet’s private key. Any SIWE-compatible signer works: -
Create the workspace
Public endpoint — the signature in the body is the auth.-iexposes headers — captureX-Lx-Consistency-Token(also returned in the body asconsistencyToken). The response carries the workspace id; save as$WORKSPACE. -
Sign in for the dashboard surface (wallet session)
Minting API keys requires a wallet session — a signed-cookie identity. Two SIWE steps:Thelx_sessioncookie incookies.txtis now your dashboard identity. HttpOnly, HMAC-signed, 12h TTL. -
Mint an API key
Echo the workspace-create ZedToken so the request is guaranteed to see the SpiceDB write:plaintextin the response is your API key. Save it now — it’s never returned again. Store as$KEY. -
Top up the pool
Sessions debit from a pre-funded pool onLuxxonSettlement. Top it up once and every subsequent session is signature-free.HitGET /configto grabusdcAddress+settlementAddressfor the active chain. The sameLuxxonSettlement.withdraw(amount)pulls the balance back any time — even during a pause. -
Open a session
State:REQUESTED. Saveidas$SID. Rate is locked atratePerSecondMicroUsdcfor the rest of the session. The API reads your pool balance on-chain at this step and returnsINSUFFICIENT_CREDITif it can’t coverrate × maxDurationSeconds. -
Accept + start + end
For the smoke test, use the same workspace as both consumer and supplier (you setroles: ["CONSUMER", "SUPPLIER"]in step 3, so it qualifies on both sides):The final response carriescleanSeconds,chargedMicroUsdc, andstate: "ENDED". -
Inspect the settlement
On testnet you’ll seestate: "PENDING"briefly, thenCONFIRMEDwith atxHashonce the relayer broadcasts. The payload reveals the exact args the relayer passes toLuxxonSettlement.settleFromPool(sessionId, from, to, rate, seconds, toAmount, feeAmount)— the contract debits your pool in the same transaction.
What you just did
You exercised every layer of the platform: SIWE wallet sign-in, public signature-authed workspace creation, wallet-session-gated key minting, scoped API-key calls, SpiceDB authorization (via ZedTokens), per-second pricing, on-chain pool deposit, the session lifecycle, and on-chain settlement composition — all without any SDK and with a single wallet signature beyond the workspace bootstrap.Next
- Console — UI for workspace + keys + wallet + sessions
- Concepts / Architecture — wide-angle view
- Concepts / Conventions — µUSDC, ZedTokens, basis points
- Concepts / MCP — let agents request live views via Claude / Cursor
- Concepts / SDKs —
@luxxon/sdkfor Node/TS