@aifinpay/gate returns HTTP 402 with
protocol: "AIFP-1". One on-chain settlement buys a batch of billing units;
subsequent covered requests use an AIFP-Receipt header and consume quota.
Check the client before paying
@aifinpay/mcp2.2.x pays withpayable_fetchonce the owner enables it.@aifinpay/agent2.1.x pays withfetchPaid(v14 journal, gas cap and an independent POL/USD rate you supply).- Both settle AIFP-1 on Polygon splitter v1.4 in native POL and do not execute a legacy v1.2 quote. The Python SDK does not pay yet.
agent.payand AIFP-1fetchPaidare different protocol paths; one is not a fallback for a rejected deployment in the other.
Discover the resource
Read/.well-known/x402.json on the same origin as the target site. Use
its paths, prices and scopes, then read the site’s API catalog for required
parameters. Request the chosen route and inspect the 402 minimum batch.
A fresh quote supplies chain, asset, amount, merchant and expiry.
For example, dev.ratersapp.com publishes both discovery and /api/agent.
Its /api/agent/genres was priced at 0.10 minimum batch, settling on Polygon v1.4.
Receipt scope
Read the scope offered by the merchant. Do not assume that buying one endpoint
opens the whole site or that a client can widen a scope unilaterally.