AGENTS
Give an agent a session: a fresh address with a budget, caps and a kill switch that stay with the issuer. It pays any x402 API from there. Fund a session from the Spend page.
Owner
Caps and the kill switch live here, not on the agent.
Register, then ask the gateway something. It answers 402; the issuer opens a session, signs 0.01 USDG to a one-time address, and retries.
import { Meryal } from "@meryal/rx402"; // The issuer holds the pool seed and every session key. // The agent holds one token, and the caps run off its machine. const meryal = new Meryal({ issuer: "https://www.meryalraven.sbs/api/issuer", token: process.env.MERYAL_TOKEN! }); // Looks like fetch. On a 402 the issuer opens or rotates a session, // signs a USDG payment from a fresh address and retries. const r = await meryal.fetch("https://api.prices.example/quote?nvda"); console.log(await r.json()); // Stealth merchants are paid at a one-time address, automatically. // Turn it off with { stealth: false }.