How it works
Creating a session
From the app, click Start Session:- Select budget — 5, 25, or $100 USDC.
- Select duration — 1h, 6h, 12h, or 24h.
- Approve — one wallet signature authorizes the treasury to pull USDC up to your budget.
Compose Keys
A Compose Key is a signed JWT that inherits a session budget (or stands alone with its own budget). Format:compose-{base64-jwt}.
Generate a key
budgetLimit, expiresAt, chainId, and purpose ("api" or "session"). The API checks USDC funding before creating the key. Response includes keyId, token, and budget state.
Use and revoke
DELETE /api/keys/{keyId} and Authorization: Bearer compose-.... Revocation uses signed key ownership — the bearer key must belong to the same wallet as the target key.
Budget headers
Every billable response includes live budget headers:Live budget tracking
The SDK parses budget headers and emits abudget event on every paid response:
Deferred settlement
Instead of settling each micropayment on-chain, the batch worker groups pending intents by user and chain, then executes one USDCtransferFrom per group. If settlement fails, budget is unlocked and the user can retry.
Security model
Worst-case exposure is the session budget — funds can only be pulled up to the approved amount, and only to the treasury wallet.
Related
- x402: Sessions — protocol details, session state, and events
- SDK: Sessions — SDK API for budget tracking and session lifecycle
- x402 Payments — payment methods and x402 schemes