x402 Client for Openclaw

Automate USDC micro-payments for HTTP API requests on the Base Sepolia network.

kodos-vibe
v1.0.0
Feb 15, 2026
0
1.6k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install x402-private-search

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-private-search 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 Client?

The x402 Client is a specialized skill designed to bridge the gap between AI agents and paid web services. By implementing the x402 HTTP payment protocol, this skill allows agents to autonomously handle HTTP 402 Payment Required responses. It leverages USDC on the Base Sepolia testnet to facilitate seamless, programmatically signed micro-payments for data access, web searches, and premium API endpoints using Openclaw Skills. This tool effectively removes the manual friction of managing API keys or billing accounts by using a blockchain-based payment layer.

x402 Client Use Cases

  • Executing paid web searches via x402-enabled search gateways.
  • Accessing premium AI models or data providers that charge per-request.
  • Automating micro-transactions for pay-as-you-go developer tools.
  • Integrating decentralized finance (DeFi) payment rails into agentic workflows using Openclaw Skills.

How x402 Client Works

  1. The skill initiates a standard HTTP request to a target x402-protected URL using Openclaw Skills.
  2. When a 402 Payment Required response is received, the client parses the payment requirements from the response headers.
  3. The skill utilizes a local wallet to sign a USDC transaction on the Base Sepolia network corresponding to the requested fee.
  4. It automatically retries the original request, attaching the valid payment verification in the headers.
  5. The protected content or API response is returned to the agent once the payment is verified by the service provider.

x402 Client Setup

Install the necessary dependencies for Openclaw Skills by running:

bash <skill-dir>/scripts/setup.sh

Generate a new wallet for your payments:

node <skill-dir>/scripts/wallet-gen.mjs --out ~/.x402-client/wallet.key

Fund the generated address with Base Sepolia ETH for gas and USDC for payments. Finally, set your private key as an environment variable:

export X402_PRIVATE_KEY=$(cat ~/.x402-client/wallet.key)

x402 Client Data Schema & Taxonomy

The x402 Client manages configuration and security credentials within the local file system to ensure persistence across Openclaw Skills sessions:

Item Location Description
SDK Installation ~/.x402-client/ Contains node_modules and core x402 protocol logic.
Wallet Key ~/.x402-client/wallet.key The private key used for signing USDC payments on Base Sepolia.
Request Tool scripts/x402-fetch.mjs The primary execution script for making paid requests.

x402 Client Advanced Features

  • Automatic request retries upon 402 error detection.
  • Flexible wallet management with support for custom key paths via CLI flags.
  • Native integration with x402-compliant search gateways for real-time web data.
  • Standardized JSON output designed for seamless consumption by AI agents and Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*