🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ 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...

Versionv0.2.6
Installs3
βš™οΈ 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:

  • USDC for payments
  • ETH for gas (small amount, ~0.001 ETH)
  • Network mismatch

    Ensure your wallet has funds on the correct network:

  • X402_NETWORK=mainnet β†’ Base mainnet
  • X402_NETWORK=testnet β†’ Base Sepolia
  • View on ClawHub
    TERMINAL
    clawhub install agentic-x402

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’