Fund an agent wallet with USDC on a supported x402 V2 chain (Base, Solana, Polygon, etc.) using the x402 SDK or compatible wallet provider
Initiate a wallet session by calling the x402 session creation endpoint on the target service; provide a session budget (maximum total spend), duration, and the signed wallet authorization
The service's facilitator validates the wallet authorization, locks the session budget, and returns a session token with a session ID and expiry
For each subsequent API call within the session, include the session token in the X-Payment-Session header instead of a fresh signed payment; the facilitator deducts from the locked budget without an on-chain transaction per call
When the session expires or the budget is exhausted, the facilitator settles the net amount on-chain in a single transaction, dramatically reducing gas overhead vs per-call settlement
Known gotchas
Session budget is locked (not held) during the session; the full budget amount must be available in the wallet at session creation even if the agent only uses a fraction — do not over-provision session budgets across multiple concurrent sessions or you may exhaust the wallet balance
If the agent crashes mid-session, the session token may become orphaned; the facilitator will settle the locked budget at expiry regardless — implement session cleanup logic that explicitly closes sessions via the x402 session close endpoint on agent shutdown
x402 V2 sessions are chain-specific; a session opened on Base cannot be used to pay a service that only accepts Solana — check the service's X-Accept-Payment header for supported chains before opening a session
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp