Skip to content

second-state/x402

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

x402 Skills for Claude Code

Claude Code skills that let your AI agent discover, pay for, and call x402-gated APIs directly from the command line. Payment is handled via MetaMask in your browser — the agent never touches your private keys.

Skills Included

Skill Description
x402-hub Browse the catalogue on an x402 Hub instance, inspect listings, and read usage docs.
x402-payment Handle the full x402 payment flow — open a browser page for MetaMask signing, then retry the request with the signed payment header.

Installation

npx skills add second-state/x402

Once installed, Claude Code will automatically use the skills when you interact with x402-compatible APIs.

Prerequisites

  • Claude Code CLI installed
  • MetaMask browser extension with a funded wallet
  • For testnet usage: wallet connected to Base Sepolia (eip155:84532) with testnet USDC

Usage

After installation, just talk to Claude Code naturally:

> What paid APIs are available on the x402 hub?

> Use the hub to compute 3 + 5

> Call https://x402-hub.secondstate.io/paid/demo-echo with POST body {"hello": "world"}

Claude Code will discover the right API, show you the price, open MetaMask for payment signing, and return the result.

How It Works

  1. Discovery — The x402-hub skill queries the hub's JSON API (/api/listings) to find and inspect available paid endpoints.
  2. Payment — The x402-payment skill sends the request. If the server responds with HTTP 402, it opens a local browser page where you sign the payment with MetaMask. The signed header is attached and the request is retried automatically.

License

Apache-2.0

About

For our own x402 skills

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors