Documentation

Sell your API by the call.

x402 Hub lets API providers monetize each request in USDC, settled directly to their wallet. No accounts, no API keys, no SaaS plans — just the open HTTP 402 standard.

Earn from your API
  • The hub collects USDC payments per request on Base and Base Sepolia. Funds settle directly to the wallet you nominate — the hub never custodies them.
  • No accounts to manage, no API keys to issue, no rate-limit tiers to design.
  • Built on an open standard (HTTP 402 + EIP-3009). Any x402-compatible client can pay your endpoint.
List your API
  1. Sign in with the magic-link email flow.
  2. Click New listing and fill in:
    • Title and description — what your API does.
    • Upstream URL — the public HTTPS endpoint to proxy to.
    • Price per call (e.g. $0.01).
    • Pay-to wallet — an EVM address (0x…).
    • Networks — Base, Base Sepolia, or both.
    • Usage markdown — how callers should use your API.
  3. Submit. The hub gives you a paid URL of the form https://<host>/paid/<id>.
  4. Share the paid URL. Callers pay you directly, per request.

Notes: your upstream must be publicly reachable (no credential forwarding), listings can be edited from your Dashboard, and provider-submitted markdown is sanitized but not moderated.

Call a paid API

The x402 flow works in three steps:

  1. Send a request to the listing's paid URL.
  2. The hub responds with 402 Payment Required and a PAYMENT-REQUIRED header describing accepted schemes, price, payTo address, and network.
  3. Sign an EIP-3009 USDC transfer and retry with a PAYMENT-SIGNATURE header. The hub verifies, forwards your request to the upstream API, settles payment on-chain, and returns the upstream response.

Discovery endpoints for clients and agents:

  • GET /api/listings — all listings as JSON.
  • GET /api/listings/<id> — one listing.
  • GET /api/listings/<id>/usage — provider-supplied usage doc as markdown.
  • /llms.txt — agent-friendly summary of the hub.

Agent integration: install the helper skills with npx skills add second-state/x402.