Skip to main content
Every metered endpoint accepts x402 payments as an alternative to an API token: no signup, no key — each request is paid for with a signed USDC transfer authorization that CompliAPI settles on-chain via a facilitator. The current price is $0.01 per request (always quoted authoritatively in the challenge), paid in USDC on Base. CompliAPI speaks both protocol versions: x402 v2 (the current spec — challenge in the PAYMENT-REQUIRED response header, payment in the PAYMENT-SIGNATURE request header, CAIP-2 network ids like eip155:8453) and x402 v1 (challenge in the response body, X-PAYMENT request header). Current x402 clients use v2 automatically; existing v1 integrations keep working unchanged.

How it works

  1. Call any metered endpoint with no Authorization header. Instead of a 401, you get a 402 Payment Required whose body is the x402 challenge:
maxAmountRequired is in USDC base units (6 decimals): "10000" = $0.01. asset is the USDC contract on the offered network.
  1. Sign an EIP-3009 transferWithAuthorization for that amount to payTo, and retry the same request with the payment as a base64 X-PAYMENT header. Any x402-compatible client does this loop for you — for example x402-fetch in JS/TS wraps fetch so paid retries are automatic:
  1. A successful response carries a base64 settlement receipt in the X-PAYMENT-RESPONSE header:

x402 v2

Every 402 also carries the v2 challenge, base64-encoded in the PAYMENT-REQUIRED response header. Decoded, it is the v2 PaymentRequired object — same price and receiving address, with CAIP-2 network ids, amount instead of maxAmountRequired, a top-level resource object describing the endpoint, and machine-readable input/output schemas under extensions.bazaar:
A v2 client sends its signed payment base64-encoded in the PAYMENT-SIGNATURE request header (echoing the extensions block, per spec) and receives its settlement receipt in the PAYMENT-RESPONSE response header, with the network as a CAIP-2 id.

Discovery (x402 Bazaar)

The paid endpoints are discoverable in the x402 Bazaar, Coinbase’s catalog of x402 resources for autonomous agents (browsable at agentic.market and x402scan.com). The extensions.bazaar block in each challenge carries the endpoint’s input schema (path and query parameters) and a realistic output example, so agents can construct valid calls without reading these docs.

Guarantees

  • You are never charged for a failed request. Settlement happens only after your request succeeds; if screening errors, the authorization is left unsettled and nothing moves on-chain. Retry with a fresh authorization (x402 clients sign one per attempt automatically).
  • Unsettled data is never released. If settlement fails, the response is withheld and you get a fresh 402 — pay again to retry.
  • Authorizations are single-use. Replaying an X-PAYMENT header after settlement returns a 402 asking for a fresh authorization.
  • An API token under quota always wins: if you send both a valid Authorization and an X-PAYMENT header, the request is funded by your quota and no payment is taken.

Over quota? Pay to keep going

With a valid API token but an exhausted monthly quota, the API returns a 402 (rather than the plain 429) whose options include both paying per request and upgrading your plan — so batch jobs can spill over into pay-per-request instead of failing.

MCP

The MCP server takes the same payments. Connect without an Authorization header — initialize and tools/list work anonymously — and unpaid tool calls return an error result whose structured content is the same challenge object shown above. Pay by adding the X-PAYMENT header to the MCP connection (or the x402/payment key in the request _meta for non-HTTP transports); the settlement receipt comes back in the tool result’s _meta under x402/payment-response.