Build an agent that makes and accepts x402 payments on Base in under 10 minutes
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:
Follow the prompts to connect your LLM provider and set up your wallet plugin.
3
Start the gateway
Terminal
Report incorrect code
Copy
Ask AI
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.
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:
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.