Monetizing HTTP resources with x402: how to charge for pages, APIs and agent tools

Learn how to design a monetization gateway with x402: rules, verification, protected origin, variable pricing and reconciliation.

What x402 solves

HTTP already has the `402 Payment Required` status, but historically it did not define on its own how a server communicates price, network, asset, recipient or authorization.

A Monetization Gateway is a control layer, not just a paywall

A rule can combine domain, path, HTTP method, audience, headers, parameters and caller attributes.

`exact` and `upto`: fixed price and consumption ceiling

In the `exact` scheme, the authorized amount must match the required price.

The origin stays inside the security model

Verifying payment at the edge reduces work at the origin, but it does not authorize bypassing the origin.

Monetizing HTTP resources with x402: how to charge for pages, APIs and agent tools