Charge for an HTTP resource
An x402 resource server advertises payment requirements and uses a facilitator to verify and settle supported payments. Your application still owns resource delivery, pricing, access control and recovery. If you want to pay for a resource instead, start with the client guide. For a first end-to-end example, use the quickstart.Choose your server
Use a complete framework guide for installation, environment variables and a runnable example. Use a manual flow when you need to control the payment lifecycle directly.
Batch settlement has separate SDK, funding, authentication and channel-recovery requirements. Do not apply an exact-payment example to it unchanged.
Understand the payment flow
Start paid work safely
For costlyexact requests, confirm settlement before inference or streaming.
Verification alone does not reserve funds. Funded channels reserve capacity before
work and redeem vouchers afterward. Follow the payment safety guide
for expiry checks, payment ordering and pending-payment recovery.
Configure PayAI and prepare production
- Follow your framework guide’s PayAI facilitator configuration. Review pricing: you start with 1,000 free credits, and ordinary exact payments can serve mainnet production traffic without an API key until they run out.
- For paid usage or an assigned lane, keep facilitator credentials on the server. An autonomous agent can buy credits and receive a key over x402 with no portal signup; the paying wallet gets a wallet-owned agent account programmatically. The merchant dashboard is the optional human-managed route. See facilitator authentication for package-based and direct HTTP setup.
- Configure Bazaar discovery if you want to expose supported discovery metadata. Serving an HTTP endpoint alone does not list it automatically.
- For variable charges, follow the dynamic pricing guide and validate that the payment authorization covers the accepted terms.
- Plan for capacity limits, timeouts and uncertain outcomes using the capacity and recovery guidance. A request timeout does not establish that settlement failed.
Need help?
Join our Community
Have questions or want to connect with other developers? Join our Discord server.

