Skip to main content
This guide gets you from zero to a working agent that makes a paid x402 API request and exposes its own paid endpoint — all in under 10 minutes. What you’ll need:
  • Node 22.16+ (Node 24 recommended)
  • A funded wallet — complete wallet setup first

Install OpenClaw

1

Install the CLI

macOS / Linux:
Terminal
curl -fsSL https://openclaw.ai/install.sh | bash
Windows (PowerShell):
Terminal
iwr -useb https://openclaw.ai/install.ps1 | iex
Verify the installation:
Terminal
openclaw --version
2

Run onboarding

Terminal
openclaw onboard --install-daemon
Follow the prompts to connect your LLM provider and set up your wallet plugin.
3

Start the gateway

Terminal
openclaw gateway --port 18789
Open http://127.0.0.1:18789/ to verify the gateway is live.
Claude Code, Codex, and OpenCode users — the wallet skills and x402 payment tools below are compatible with any skills-enabled AI coding tool. Run the same npx skills add commands and the capabilities work identically.

Configure a wallet

Install the CDP Agentic Wallet skills:
Terminal
npx skills add coinbase/agentic-wallet-skills
Then authenticate:
Sign in to my wallet with your@email.com
Or use a Sponge Wallet with native x402 support — see wallet setup for all options.

Make your first x402 payment

Ask your agent to discover and call a paid API:
Find a weather API and get the forecast for New York
The search-for-service and pay-for-service skills handle discovery, payment, and retries automatically. Your agent pays in USDC, gets the data, and returns the result — no API keys, no subscriptions. To make a direct x402 request with Sponge Wallet:
Terminal
curl -X POST "https://api.wallet.paysponge.com/api/x402/fetch" \
  -H "Authorization: Bearer $SPONGE_API_KEY" \
  -H "Sponge-Version: 0.2.1" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.example.com/paid-endpoint",
    "method": "GET",
    "preferred_chain": "base"
  }'

Gate your own endpoint with x402

Ask your agent to expose a paid API:
Set up a paid endpoint for my market data at $0.01 per request
The monetize-service skill (npx skills add coinbase/agentic-wallet-skills) configures the x402 gating and deploys the endpoint. Other agents can now discover and pay for your service automatically. Or use x402-express for a custom server — see Accepting payments.

Next steps

x402 protocol

Deep dive into how x402 works, supported networks, and error handling.

Accepting payments

Set up server-side x402 gating with OpenClaw skills or custom middleware.

Wallet setup

Configure Bankr, CDP, or Sponge for your agent.

Agent registration

Register your agent for discoverability and identity verification.