Skip to main content
You can build agent services that charge other agents for access using x402. When a client calls your endpoint without paying, you return 402 with payment requirements. Once the client pays, the facilitator verifies the payment and your server delivers the response.

Option 1 — OpenClaw monetize-service skill (simplest)

With the CDP Agentic Wallet skills installed, expose a paid endpoint with a single prompt:
Terminal
npx skills add coinbase/agentic-wallet-skills
Then ask your agent:
Set up a paid endpoint for my market data at $0.01 per request
The monetize-service skill configures the x402 gating and deploys the endpoint. No server code required. CDP Agentic Wallet skills → Create a reusable x402 payment link that other agents pay before accessing your service:
Terminal
curl -X POST "https://api.wallet.paysponge.com/api/payment-links" \
  -H "Authorization: Bearer $SPONGE_API_KEY" \
  -H "Sponge-Version: 0.2.1" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "0.01",
    "description": "Access to my market data API"
  }'
Share the returned payment link URL with clients. Check payment status:
Terminal
curl "https://api.wallet.paysponge.com/api/payment-links/{paymentLinkId}" \
  -H "Authorization: Bearer $SPONGE_API_KEY" \
  -H "Sponge-Version: 0.2.1"
Sponge Wallet docs →

Option 3 — Custom server with x402-express

Use the x402-express package to add payment gating to any Express endpoint:
Terminal
npm install x402-express express
TypeScript
import express from "express";
import { paymentMiddleware } from "x402-express";

const app = express();

app.use(
  paymentMiddleware(
    "0xYourAgentWalletAddress",
    {
      "/api/data": {
        price: "$0.01",
        network: "base-sepolia",
      },
    }
  )
);

app.get("/api/data", (req, res) => {
  res.json({ data: "premium content" });
});

app.listen(3000);
The middleware returns 402 to unpaid callers. The CDP facilitator handles verification and onchain settlement. x402 seller quickstart →

Configuring facilitators

A facilitator is the off-chain service that verifies payment payloads and settles payments onchain. Two options:
FacilitatorWhen to use
CDP facilitator (default)Production — requires CDP API key, supports Base and Solana
Public testnet facilitatorDevelopment — no API key, Base Sepolia only
The public testnet facilitator endpoint is https://www.x402.org/facilitator. Switch to the CDP facilitator for mainnet. See contract addresses for full endpoint details.

Pricing and payment terms

  • Set prices in USD (e.g., "$0.01") — the middleware converts to the appropriate token amount
  • Payments settle in USDC on Base by default
  • There is no minimum payment — even fractions of a cent are supported
  • Your wallet receives payment directly — no platform fee from the protocol

Make your endpoint discoverable

Host a SKILL.md file at /.well-known/SKILL.md describing your endpoint’s inputs, outputs, pricing, and authentication requirements. Agents discover your service by checking this path.
SKILL.md template
# Your Agent Service

## Description
What your service does, in plain language.

## Endpoints

### GET /api/data
- **Description:** Returns premium market data
- **Payment:** $0.01 per request via x402 (Base, USDC)
- **Output:** JSON with current prices and volume

## Authentication
x402 payment required. No API key needed.
Register your service in the ERC-8004 registry so agents can discover it by category — see agent registration.

x402 protocol

How x402 works from the client side.

Contract addresses

Facilitator endpoints and protocol addresses.