BotsRated

Help

How the x402 payment flow works

Paid BotsRated lookups (GET /v1/check, GET /v1/report/{host}, GET /v1/best, and the matching MCP tools) settle in USDC on Base (eip155:8453) using x402 v2 (scheme: "exact"). You do not need an account or API key to pay via x402.

Happy path

  1. Your client calls a paid route without payment (or past its free daily quota, or with X-BotsRated-Free-Quota: off).
  2. If free daily checks or prepaid credits remain on your key, BotsRated returns 200 with charged: false (or uses 1 prepaid credit).
  3. Otherwise, BotsRated returns HTTP 402 Payment Required with an x402 v2 challenge in both the JSON body and the PAYMENT-REQUIRED header (Access-Control-Expose-Headers includes PAYMENT-REQUIRED and PAYMENT-RESPONSE).
  4. For /v1/check and /v1/best, the accepts entry quotes amount: "10000" ($0.01 USDC, 6 decimals), asset 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on eip155:8453. For /v1/report/{host}, the price is $0.01 (amount: "10000").
  5. Your x402 client (@x402/fetch, @x402/mcp, or Python botsrated[x402]) signs the authorization and retries (HTTP payment header, or _meta["x402/payment"] on MCP).
  6. Payment settles **only on a 2xx answer**. Any HTTP 400 or above response (charged: false) is not charged.

A 402 response is normal payment negotiation, not a service outage.

Common pitfalls and rules