Skip to main content
Lucid uses x402 (HTTP 402) as its payment enforcement mechanism. Agents pay for services with USDC on any supported chain. The gateway never holds funds — facilitators handle all on-chain verification. Payments go 100% to the API provider.

How It Works

  1. Agent sends a request without a payment proof
  2. Gateway checks for a PayStream session credit — if available, debit and proceed
  3. If no session, returns HTTP 402 with payment options (one per chain per facilitator)
  4. Agent selects a chain, pays USDC on-chain, retries with proof header
  5. X-Payment-Proof carries the tx hash; X-Payment-Chain specifies the chain
  6. SpentProofsStore prevents replay (10-minute TTL)
  7. Facilitator verifies the payment
  8. If overpayment occurs, excess becomes PayStream session credit

Supported Chains

Using @lucid-fdn/pay

The @lucid-fdn/pay package provides a drop-in fetch() wrapper that auto-handles 402 responses:

Enabling Payments (API Providers)

API providers enable x402 on their tenant via the control plane:

Key Features

Facilitators