Skip to main content

x402 CLI

A command-line tool for testing x402-gated API endpoints. GitHub Repository

Prerequisites

Ensure you have funds on the chain you are targeting. Create a .env file in the directory where you run the CLI, containing the KEY environment variable set to a wallet private key with sufficient balance. Alternatively, set KEY as an environment variable in your shell.

Usage

bunx @swader/x402-cli <URL>
Example:
bunx @swader/x402-cli https://fs9cqhm1.nx.link/random_joke