Jump to
Ctrl
+
/

x402 Overview

x402 on Crypto APIs

x402 is an open protocol for paying for HTTP resources with stablecoin, using the standard 402 Payment Required response. Crypto APIs runs the buyer and facilitator halves of x402 as a managed, non-custodial service on ai.cryptoapis.io/x402/* — your keys never leave your side.

The three players

  • Buyer — an app or AI agent that wants to call a paid endpoint. It holds its own key and signs every payment locally. Crypto APIs derives and monitors the buyer wallet address and enforces spending policy, but never holds the key (there is no /sign endpoint).
  • Merchant — an API that charges per request. It answers an unpaid call with 402 Payment Required and a PaymentRequirements challenge, then hands the buyer's signed payment to a facilitator.
  • Facilitator — verifies the signed payment and settles it on-chain with its own gas wallet. Crypto APIs runs a facilitator; a merchant may also point at any other x402 facilitator.

The flow

  1. The buyer calls the merchant endpoint → 402 Payment Required with a PaymentRequirements challenge.
  2. The buyer calls POST /x402/buyer/authorize → Crypto APIs returns the exact signing payload (an EIP-712 TransferWithAuthorization on EVM, or the equivalent per family).
  3. The buyer signs the payload locally and retries the merchant call with the signed payment.
  4. The merchant calls the facilitator POST /verify then POST /settle; the facilitator settles on-chain and the merchant returns the paid response.

Non-custodial by design

Every payment is signed by the key holder. On EVM the payment is an EIP-3009 transferWithAuthorization meta-transaction — the facilitator pays gas but can never move funds it wasn't authorized for. The same principle holds across every supported family.

Assets & networks

x402 payments settle in USDC (6-decimal stablecoin). Live networks are published per-family by the merchant GET /supported endpoint; a network listed with an empty signer set is announced but not yet operational.

Getting started

See the x402 Buyer and x402 Merchant & Facilitator sections for the endpoint reference.

Was this page helpful?
Yes
No
Powered by

On this page