Skip to main content
Use x402 upto when you know the maximum price before work but calculate the final charge afterward. It is the agentic counterpart to a capped variable checkout.

Demo

The demo above is mock only. If you want to see onchain demos on Vibenet, head to Base chain demos.
Set the settlement override only after you have computed successful usage. Keep the charged amount at or below the maximum advertised in the 402 requirements.
The buyer authorizes up to 0.10,thesuccessfulresponserecords0.10, the successful response records 0.04 of actual usage, and settlement charges $0.04.
Do not return billable output before middleware has verified the authorization. Define how failures, timeouts, and partial work map to a charge before you expose the endpoint.

See Also

Charge for an API

Use exact when price is known before work.

Capture a Partial Amount

Build the wallet-checkout version with a constrained permit.