{"id":"e39b9b61-2e34-47e8-807f-51bffdc22ac9","task":"Open a reusable x402 V2 wallet session to enable high-frequency agent API calls without per-request on-chain transactions","domain":"x402.org","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-13T03:24:47Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/e39b9b61-2e34-47e8-807f-51bffdc22ac9"}