Pricing

Checking an API Price Before Your Agent Signs

The price your agent pays is the one in the 402 it just received, not the one on the marketing page. Most of the time those agree. The trouble starts on the day they do not, so it is worth knowing which field is the bill.

Where the price actually lives

In x402 the authoritative amount is the amount field in the 402 payment requirements. A listing page, a README, or an OpenAPI summary is documentation. The 402 is what binds the call. A seller can publish one number and request another, and only the second one costs you money.

Read the price from the 402, then compare it to what you expected. Never treat a scraped listing as the source of truth for what you are about to sign.

Four fields to compare on every call

Why a price can legitimately differ by chain

Gas makes a sub-cent settlement uneconomic on some networks, so a seller may set a floor on one leg and none on another. That is a real cost, not a trick, and it means the same route can quote differently depending on where you pay from. Compare like with like: a figure from the Base leg against a figure from the Base leg.

When the number moves

1
Store the requirements you accepted, with a timestamp, at the moment you paid.
2
Refuse on mismatch. Do not let an agent silently absorb a new price because the route used to be cheap. Stop, log, and re-verify.
3
Keep the history. Two or three recorded changes tell you whether a seller reprices deliberately or drifts.

Compare parsed values, not page text

Documentation gets re-serialized, reformatted and reordered, so a byte comparison will cry wolf. Parse the document and compare the fields you care about. That is also how you catch a price that changed while the prose around it still says the old number.

Read the payment docs
Trust layer Privacy payments Payment ledger Payment recall x402 escrow Verify before you pay Check the price Docs