import { payholeFetch } from "@payhole/sdk"; // Same signature as fetch. One extra option. const res = await payholeFetch("https://api.example.com/report", { method: "POST", body: JSON.stringify({ q: "usdg volume" }), cap: "0.50" // max USDG for this call }); // 402 → signed → settled → 200 console.log(res.headers.get("payment-response")); console.log(await res.json());
# A session key for an agent, capped at 5 USDG $ payhole key create --name research --cap 5 created 0x9c1e…4a2f cap 5.00 USDG # Pocket, keys, spend $ payhole status pocket 24.88 USDG keys research 0.12 / 5.00 sinkhole on # Pay one URL from a key $ payhole pay https://example.com/article --key research paid 0.02 USDG tx 0x8e2c…91ab