402 Payment Required, signs a payment, and gets the response back. Each settled call lands USDC in a wallet you control.
The motion is additive. Your existing customers see no change. Agent traffic becomes a measurable line item without a procurement cycle.
Who this is for:
- SaaS platforms looking to open an agent-buyer channel without disrupting enterprise contracts
- Data and API companies that want a per-call self-serve tier alongside their existing plans
- Product and revenue leaders evaluating whether agentic commerce fits their API surface
How it works
Middleware runs after your existing auth. Calls with a valid API key flow through the existing path unchanged. Unauthenticated calls fall through to the x402 path. The Polygon-hosted facilitator (x402.polygon.technology for mainnet, x402-amoy.polygon.technology for Amoy) handles verification and settlement, so you do not run that infrastructure.
Get started
Add x402 v2 middleware in front of the routes you want priced. The Polygon-hosted facilitator handles verification and settlement, so you do not run that infrastructure. Existing API-key traffic flows through your existing path unchanged.Install
- Express
- Next.js
- Hono
Price a route
Each priced route declares anaccepts block. Amounts are in the smallest unit of the currency (USDC has six decimals, so 1000 = $0.001).
Test as a buyer
Verify the loop end-to-end with the Polygon Agent CLI:Implementation
x402 Quickstart for Sellers
Add x402 v2 middleware to Express, Next.js, or Hono.
x402 How It Works
Protocol mechanics, accepts block shape, receipts.
Polygon Agent CLI
Test the loop end-to-end as an agent buyer.
Using the Polygon facilitator
Configure middleware against the Polygon-hosted facilitator.