x402 is an open, neutral standard for internet-native payments. It absolves the Internet's original sin by natively making payments possible between clients and servers, creating win-win economies that empower agentic payments at scale. x402 exists to build a more free and fair internet.
Accept payments with a single line of code
app.use(
paymentMiddleware(
{
"GET /weather": {
accepts: [...], // As many networks / schemes as you want to support
description: "Weather data", // What your endpoint does
},
},
)
);That's it. Add one line of code to require payment for each incoming request. If a request arrives without payment, the server responds with HTTP 402, prompting the client to pay and retry.
What's x402?
Payments on the internet are fundamentally flawed. Credit cards are high friction, hard to accept, have minimum payments that are far too high, and don't fit into the programmatic nature of the internet. It's time for an open, internet-native form of payments. A payment rail that doesn't have high minimums plus a percentage fee. Payments that are amazing for humans and AI agents.
HTTP-native. It's built-in to the internet.
x402 is built-in to existing HTTP requests, with no additional communication required.
It's how the internet should be: open, free, and effortless
Zero protocol fees
x402 is free for the customer and the merchant—just pay nominal payment network fees
Zero wait
Money moves at the speed of the internet
Zero friction
No accounts or personal information needed
Zero centralization
Anyone on the internet can build on or extend x402
Zero restrictions
x402 is a neutral standard, not tied to any specific network
We need a new way to transfer value on the internet...
The old way of doing payments is barely working for a human world, let alone an agentic future. x402 does in moments what existing systems can't do at all.
The old way
Create account with new API provider
Time consuming setup
Add payment method to API provider
KYC required, delaying access and requiring approval
Buy credits or subscription
Prepaid commitment → overpay or run out of funds
Manage API key
Security risk → must store and rotate keys
Make payment
Slow transactions, chargebacks, fees
With x402
AI agent sends HTTP request and receives 402: Payment Required
No account setup, instant onboarding
AI agent pays instantly with stablecoins
No signups or approvals required
API access granted
No API key management and related security risks
...so it's time to start building something better




Join a global community of thousands of builders contributing to an open codebase, faster financial system, and freer internet.
Learn how to get started