π¦ ClawHub
Agentic X402
by @ya7ya
Make x402 payments to access gated APIs and content. Fetch paid resources, check wallet balance, and create payment links. Use when encountering 402 Payment...
βοΈ Configuration
Run the interactive setup to create a new wallet:
x402 setup
This will:
1. Generate a new wallet (recommended) or accept an existing key
2. Save configuration to ~/.x402/.env
3. Display your wallet address for funding
Important: Back up your private key immediately after setup!
Manual Configuration
Alternatively, set the environment variable directly:
export EVM_PRIVATE_KEY=0x...your_private_key...
Or create a config file:
mkdir -p ~/.x402
echo "EVM_PRIVATE_KEY=0x..." > ~/.x402/.env
chmod 600 ~/.x402/.env
Verify setup:
x402 balance
π Tips & Best Practices
"Missing required environment variable: EVM_PRIVATE_KEY"
Set your wallet private key:
export EVM_PRIVATE_KEY=0x...
Or create a .env file in your working directory, or install globally and use ~/.x402/.env.
"Payment exceeds max limit"
Increase the limit:
x402 pay https://... --max 50
Low balance warnings
Fund your wallet with:
Network mismatch
Ensure your wallet has funds on the correct network:
X402_NETWORK=mainnet β Base mainnetX402_NETWORK=testnet β Base SepoliaTERMINAL
clawhub install agentic-x402