Skip to main content
agent x402-pay calls an x402 endpoint, reads the price from its 402 response, pays from the agent wallet, and returns the service’s response. Payments come out of the allowance in session mode. For how x402 works, see x402 payments. The wallet needs USDC on the network the service uses. Services in the Agentic Services catalog all settle in USDC on Polygon.
1

Find the service and its price

Read the live catalog. Each route lists its URL, method, price, and payTo address:
You can also browse and test services at agent-discovery.polygon.org/discover.
2

Preview the payment

The preview shows the price, the token, and where the payment goes. Nothing is paid.
3

Pay and get the response

Run the same command with --broadcast:
The output has the service’s response and the payment transaction.
Request bodies and query parameters follow the upstream service’s own API. Use --header Key:Value for extra headers. The network and token come from the 402 response.

Spending limits

These sit inside the wallet’s allowance: a payment the allowance doesn’t cover fails even when it’s under these limits.

Test your own endpoint

Point x402-pay at a route you’ve priced with x402 middleware to check the whole flow. See Accept x402 payments.