x402 Payment Protocol for Openclaw

A protocol and toolset for discovering, inspecting, and making automated USDC payments to API endpoints directly via an AI agent.

0xrag
v0.1.0
Feb 12, 2026
1
1.7k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install x402-2

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-2 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 Payment Protocol?

The x402 protocol is a specialized skill for AI agents that enables seamless discovery and consumption of paid API services. It leverages the Openclaw Skills ecosystem to allow agents to browse a decentralized bazaar of available services, inspect payment requirements, and execute requests with automatic USDC settlements on the Base network. This skill eliminates the need for manual API key management and credit card subscriptions for individual services, providing a programmatic way for agents to access premium data and compute.

By using this skill, developers can grant their agents the autonomy to search for niche tools (like weather data or sentiment analysis) and pay for them on-demand. The integration ensures that agents only spend what is necessary by allowing for strict payment limits and providing detailed schema inspections before any transaction occurs.

x402 Payment Protocol Use Cases

  • Searching for specialized niche APIs when no free tool is available for a specific task.
  • Automating micropayments for high-frequency API usage in multi-agent workflows.
  • Discovering price points and data schemas for paid services without upfront costs or commitments.
  • Executing paid requests with strict spending limits using the robust budget controls within Openclaw Skills.

How x402 Payment Protocol Works

  1. The agent searches the x402 bazaar using keywords to find relevant paid services based on user intent.
  2. The agent inspects a specific endpoint to retrieve price, payment schemes, and input/output schemas using the details command.
  3. Upon decision, the pay command is executed, which handles the cryptographic handshake and USDC transfer on the Base network.
  4. The service responds with the requested data payload after the payment is verified on-chain.

x402 Payment Protocol Setup

To start using this skill within the Openclaw Skills framework, ensure you have the Awal CLI installed and your wallet funded.

# Check available commands
npx awal@latest x402 --help

# Log in to enable payment capabilities
awal auth login <your-email>

# Check your USDC balance on Base
awal balance

x402 Payment Protocol Data Schema & Taxonomy

The skill manages service metadata and payment logs to ensure efficient operation and cost tracking.

Data Component Format Description
Bazaar Cache JSON Local index of services stored at ~/.config/awal/bazaar/
Atomic Units Integer USDC values represented with 6 decimals (e.g., 1,000,000 = $1.00)
Request Schema JSON Schema Definitions for input parameters required by a specific x402 endpoint
Correlation ID String Unique identifier used to group and track related payment operations

x402 Payment Protocol Advanced Features

  • Automated HTTP method detection that identifies the correct request type (GET, POST, etc.) for payment triggers.
  • Support for custom headers and query parameters to satisfy complex API integration requirements.
  • Strict budget controls via the max-amount flag to prevent agents from overspending on any single request.
  • Full JSON output support for all commands, enabling programmatic integration within larger Openclaw Skills automation pipelines.
  • Local caching of the bazaar index with a 12-hour auto-refresh cycle to optimize performance.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*