gpt55-x402-gateway

x402 First Payment Client

This is the bridge from quote to settlement for a real external buyer.

Default mode is safe: it only fetches the live HTTP 402 quote and checks amount, network, and payTo. Each run writes a local evidence file at examples/x402-first-payment-client/last-run.evidence.json unless EVIDENCE_FILE=0 is set.

Run Quote-only

node examples/x402-first-payment-client/first-payment-client.mjs

The evidence file records the requested URL, live quote, spend cap, expected payTo, expected network, expected asset, and whether all prepay checks passed.

Real Payment Mode

Only the buyer should run this with a buyer-owned wallet.

npm install
PAY_REAL_X402=1 EVM_PRIVATE_KEY=0x... node examples/x402-first-payment-client/first-payment-client.mjs

The script refuses to pay unless all quote checks pass and PAY_REAL_X402=1 is explicitly set.

First Route

ROUTE_ID=wallet-signing-safety-pack MAX_USDC=0.02 node examples/x402-first-payment-client/first-payment-client.mjs

Quote-only runs are not revenue. Only a non-self buyer’s settled x402 payment counts as external revenue.