Lightweight single-command SCP flow to pay HTTP 402-protected URLs through hub routing. Handles offer discovery, smart offer selection, channel funding, and payment automatically. Use when user says "auto-pay", "pay URL", "quick pay", "scp light", or wants one-step 402 payment without manual channel management.
Automate 402 URL payment using a single script that handles offer discovery, AI-aware offer selection, channel checks, funding, and payment submission.
Run from the x402s/ project root:
node skill/scp-light/scripts/auto_402_hub_pay.js <url>
Common options:
node skill/scp-light/scripts/auto_402_hub_pay.js <url> \
--topup-payments 100 \
--method GET \
--route hub \
--network base \
--rpc-urls https://mainnet.base.org,https://base-rpc.publicnode.com
POST with JSON body:
node skill/scp-light/scripts/auto_402_hub_pay.js https://pogchamp.tv/chat/chat \
--method POST \
--json '{"message":"hello"}' \
--network base
Dry-run:
node skill/scp-light/scripts/auto_402_hub_pay.js <url> --network base --dry-run
.env from x402s/ if present.hub:<endpoint> channel exists in agent state.approve(MaxUint256).The script scores offers by channel readiness (2=funded, 1=underfunded, 0=none), then by cost. When AI is selecting on behalf of the user:
pay.eth charges 0 base + 0 bpsRequired:
AGENT_PRIVATE_KEY (or enter interactively in TTY)Optional:
NETWORK or NETWORKSRPC_URL, CONTRACT_ADDRESSMAX_AMOUNT, MAX_FEEAGENT_STATE_DIRX402S_ROOT (defaults to workspace x402s)base, sepolia) or CAIP (eip155:*); script normalizes internally.--topup-payments controls channel buffer size (default: 100).--topup-payments is set).PAYMENT_MODE=pay_once, this script performs the first paid call; follow-up calls reuse the access grant.references/env-and-flags.md for full flag/env details and troubleshooting.