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
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());
payhole CLI
# 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
x402 facts
What your server sees and what the pocket sends. No SDK required on the server side. Any x402-compatible facilitator works.
protocolx402 version 2
request headerPAYMENT-SIGNATURE
response headersPAYMENT-REQUIRED · PAYMENT-RESPONSE
networkeip155:4663
assetUSDG
schemeexact
gaspaid by facilitator, never by the payer
Documentation
npm
@payhole/sdk
payholeFetch, key management, session keys, types.
Package →
reference
payhole CLI
key create, status, pay, and flags for agents.
Commands →
server
Accept x402
Return a 402 with a price. Verify the signature. Serve.
Guide →
contracts
BudgetAccount ABI
Factory, vault, registry. Verified on Sourcify.
Source →
Robinhood Chain, chain id 4663, settlement in USDG onlyPrivacyx.com/payhole_x402payhole.org