Developers

One fetch. Paid.

Replace fetch. Any 402 under the cap settles in USDG and the response comes back. Over the cap, the user gets one prompt.

$ npm i @payhole/sdk

payholeFetch

The same signature as fetch, with one extra option. A 402 comes back, the pocket signs and settles it, the request is retried, and your code gets the 200. Under the cap none of that reaches you.

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());

The CLI

Agents get the same pocket through their own session key, each with its own cap. Revoke one and the rest keep working.

# 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

What you get

Gasless

x402 settlement costs the payer no gas. The facilitator submits the transaction.

Per-origin keys

One address per origin, derived from the seed. A service sees its own and nothing else.

Hard caps

The cap is enforced by the pocket contract on chain, not by the client asking nicely.

Revocable

Kill one agent's key without touching the pocket or any other key.