Introduction

x402 CLI is a developer tool concept built around the HTTP 402 Payment Required standard applied to modern API infrastructure. It aims to provide a terminal-style workflow for scanning endpoints, inspecting payment requirements, and understanding how USDC-based micropayments on Base integrate with pay-per-request API services.

The CLI package is planned. The current version focuses on interface, documentation, and x402 flow exploration through this website and its interactive terminal preview.

What problem x402 CLI is trying to solve

As APIs adopt x402 payment models, developers and AI agents need a reliable way to:

  • Discover which endpoints require payment before access
  • Understand payment requirements (network, asset, amount, scheme)
  • Preview the full request → 402 → pay → retry flow without guesswork
  • Find x402-compatible APIs in a structured registry

x402 CLI consolidates these workflows into a single terminal-inspired interface designed for developer productivity and agent automation.

Example commands

These commands represent the planned CLI behavior. See the full command reference for details.

x402cli scan https://api.x402cli.xyz/data
# Probe endpoint and detect 402 Payment Required

x402cli inspect https://api.x402cli.xyz/data
# Parse payment requirement headers and payload

x402cli registry
# List x402-compatible APIs from the registry

x402cli demo
# Run a simulated x402 payment flow (no real payment)

Example 402 response

When an x402-compatible API requires payment, the server responds with HTTP 402 and payment metadata:

HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact",
    "network": "base",
    "maxAmountRequired": "1000",
    "resource": "https://api.x402cli.xyz/data",
    "payTo": "0x...",
    "asset": "USDC"
  }]
}

Amount values are typically expressed in the smallest unit (e.g. 1000 = 0.001 USDC with 6 decimals). Live demo endpoints are available at api.x402cli.xyz.

Planned CLI behavior

  • scan — HTTP probe with 402 detection and summary output
  • inspect — Full parse of x402 payment requirement fields
  • registry — Query the public x402 API registry
  • demo — Step-through simulation of the payment retry flow

Future versions may add payment execution, agent mode, and registry submission. No timeline is guaranteed — this is an early-stage research project.

Hosting status

This site is the early experimental version of x402 CLI. It provides:

  • Project overview and feature documentation
  • Interactive terminal UI preview
  • Registry preview with sample API entries
  • Public roadmap

The installable CLI package has not been published yet. Follow the roadmap for updates.

Disclaimer: x402 CLI is an independent experimental project. It is not affiliated with Coinbase, Base, Coinbase Developer Platform, or any official x402 organization. All references to x402, Base, and USDC are for ecosystem compatibility and educational purposes only.