x402 Quickstart: Pay-Per-Call API Deployment for Openclaw

A rapid deployment tool for creating x402-compliant pay-per-call endpoints that allow AI agents to pay in USDC on Base.

jimmyclanker
v1.0.0
Mar 31, 2026
1
720
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install x402-quickstart

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install x402-quickstart using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is x402 Quickstart: Pay-Per-Call API Deployment?

The x402 Quickstart is a powerful developer tool designed to simplify the monetization of AI services through the x402 Payment Required standard. By leveraging this tool within the ecosystem of Openclaw Skills, developers can transform any script or service into a revenue-generating endpoint that accepts machine-to-machine payments without requiring API keys, user accounts, or complex subscription models.

This skill provides a complete scaffolding system to deploy an Express server with built-in payment middleware. It specifically targets AI agents operating on the Base network, allowing them to pay for specific data or compute tasks in USDC, ensuring a frictionless and decentralized economy for autonomous agents.

x402 Quickstart: Pay-Per-Call API Deployment Use Cases

  • Monetizing specialized AI data scraping services.
  • Providing pay-per-call LLM inference routing.
  • Selling real-time trading signals or crypto market analysis to autonomous agents.
  • Offering high-value research reports or token project scoring.
  • Creating a marketplace for compute-heavy tasks like image generation or complex analysis.

How x402 Quickstart: Pay-Per-Call API Deployment Works

  1. An agent makes a standard GET request to your API endpoint without providing a payment hash.
  2. The server responds with an HTTP 402 Payment Required status, including headers for price, recipient wallet, and network (Base).
  3. The agent processes the 402 response and executes a USDC transfer on the Base network to the specified address.
  4. The agent retries the original request, this time including the transaction hash in the X-Payment-Tx header.
  5. The server uses on-chain verification to confirm the payment and then serves the requested data with a 200 OK response.

x402 Quickstart: Pay-Per-Call API Deployment Setup

First, generate your service scaffold:

bash scripts/scaffold.sh my-service "My cool API" 0.01

Next, navigate to the directory and configure your environment variables in the .env file:

WALLET_ADDRESS=0xYourBaseWalletAddress
USDC_CONTRACT=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
CHAIN_ID=8453
PORT=3402

Install dependencies and start your server:

cd my-service && npm install && node server.js

Finally, use a Cloudflare Tunnel to make your local endpoint accessible to Openclaw Skills worldwide:

cloudflared tunnel --url http://localhost:3402

x402 Quickstart: Pay-Per-Call API Deployment Data Schema & Taxonomy

Field Type Description
price string The cost per call in USDC (e.g., "0.01")
payTo string The Base wallet address of the service provider
network string The blockchain network (default: base)
X-Payment-Tx header The transaction hash provided by the agent for verification

x402 Quickstart: Pay-Per-Call API Deployment Advanced Features

  • Spraay Gateway integration for automatic discovery of your Openclaw Skills endpoints by global AI agents.
  • Automated on-chain payment verification script using free-tier Base RPCs.
  • Zero-cost hosting configuration via Cloudflare Tunnel for secure local-to-cloud exposure.
  • Flexible pricing strategies ranging from high-volume commodity data to premium research reports.
  • Native support for the Q1 2026 x402 ecosystem standard supported by major industry players.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*