Payments

x402 Payments

Authorize Scanna API requests by paying per call in USDC via the x402 protocol, instead of an API key.

Four endpoints accept x402 payments as an alternative to an API key. Pay per request in USDC; no account required. For the concepts and a setup walkthrough, see the x402 guide.

Note

Live (beta). Payments settle on-chain on Base (eip155:8453) and Solana mainnet in USDC.

EndpointPrice
POST /heat$0.01
GET /hot$0.01
GET /smart-money$0.02
GET /predict$0.05

Every other endpoint requires an x-api-key. A request that carries neither a valid key nor a payment on a paid route gets a 402; on a key-only route it gets a 401.

Discovery

To learn what a paid endpoint costs, request it without payment. The API returns 402 Payment Required with the accepted requirements:

curl -i "https://api.scanna.xyz/hot?limit=5"
{
  "x402Version": 1,
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "asset": "USDC",
      "maxAmountRequired": "10000",
      "payTo": "0x…",
      "resource": "https://api.scanna.xyz/hot",
      "description": "Trending markets feed"
    }
  ]
}

Each entry in accepts is one way to pay (one per configured network — Base and, when available, Solana). maxAmountRequired is in the asset's base units (USDC has 6 decimals, so 10000 = $0.01).

Paying

Sign a USDC payment for the quoted amount with your wallet and resend the request with the signed payload in the X-PAYMENT header. In practice an x402 client (x402-fetch, x402-axios) does this for you — see the guide examples.

On success the response is 200 with your data plus an X-PAYMENT-RESPONSE header carrying the on-chain settlement receipt (transaction hash + network).

How it differs from key auth

  • No plan gating. A paid request bypasses Pro+ plan checks — paying for /predict unlocks it without a subscription.
  • Not metered. x402 traffic isn't counted against any plan's usage; payment velocity is the only limiter.
  • Mutually exclusive. A request is authorized by an API key or x402, not both. If a valid x-api-key is present, the request never reaches the payment flow.

Tip

See the x402 guide for wallet setup, funding, and full client examples.