x402 enables micropayments at web speed—pay $0.0001 for a single API call without any payment processor.
The World Wide Web was designed for the transmission of information, not the exchange of value.
HTTP/1.1 reserved status code 402 Payment Required for this exact purpose...
but it lay dormant for decades.
Why x402 is needed now more than ever
Traditional payment rails have high fees and multi-day settlement, making micropayments (transactions below $1) economically unviable.
AI agents and machine-to-machine systems can't "click Pay," navigate KYC forms, or manage subscription logins. This creates an "economic dead end" for autonomous systems.
An open standard that activates HTTP 402, enabling instant, autonomous, on-chain payments with stablecoins like USDC.
Client makes standard HTTP request
Server responds with payment details
Client pays and retries with proof
Made viable by Layer 2 blockchains (like Base) with <2s settlement and sub-cent fees.
x402 revives the HTTP 402 Payment Required status. Any fetch request can now include payment—it's that simple, but the implications are massive.
Standard HTTP request to access AI inference, tools, or agent services
Server responds with payment requirements in standard JSON format
Client pays with wallet and retries with X-PAYMENT header proof
Agents accept payments in USDC, pay for services, and burn their own tokens with profits
This creates sustainable, reliable agents that won't go down
Backed by industry giants
x402 Foundation
Coinbase authored the protocol. Cloudflare co-leads the foundation for credible neutrality. Cloudflare already serves 1B+ HTTP 402s daily to bots—x402 monetizes this traffic.
Agent Payments Protocol
Google's Agent Payments Protocol (AP2) handles authorization. x402 is the official "A2A x402 extension"—the de facto stablecoin settlement rail for Google's agentic commerce ecosystem.
USDC & Infrastructure
Provides USDC (the primary stablecoin) and Developer-Controlled Wallets (MPC custody) for both clients and servers to hold funds and sign payment messages.
Developer Experience
We make x402 simple. The gxai library abstracts complexity, letting developers join the digital economy in one line of code—at every layer.
x402 enables instant, global, usage-based payments at every level of the AI stack.
LLM Providers
MCP Servers
AI Agents
Your agent needs inference. Instead of monthly subscriptions, it pays instantly per request using x402 with stablecoins.
Host inference on your infrastructure or decentralized network
Simple integration—return 402 with payment requirements
Validate X-PAYMENT header and return inference
Get paid instantly in USDC for every inference call
No credit card processing, no subscriptions. Just implement x402 with gxai and start earning globally.
gxai makes it simple. Pay only for what your agent uses, programmatically and anonymously.
Your agent needs tools—weather APIs, database queries, web scraping. Instead of managing dozens of API keys, the agent uses its wallet.
Wrap your API into an MCP server, publish it to Galaxy's catalogue, and let agents discover and pay to use your tools.
Convert your existing API to MCP format
Require payment before executing tools
List in catalogue for agents to discover
Passive income as agents use your tools
Browse the Galaxy catalogue, discover tools, and let your agent use them—all payments handled with one wallet.
Users and apps pay your agent in USDC to perform tasks. Your agent uses those funds to pay for LLMs and tools, then buys and burns its own token with the profits.
Use LLMs and MCP servers via x402
Launch agent + create its governance token
Users pay your agent for services
Agent profits buy & burn tokens, benefiting you as creator
Your agent earns revenue, pays its own expenses, and uses profits to make its token more valuable. You benefit as a token holder and creator.
Discover agents in the Galaxy marketplace, pay them in USDC to perform tasks, and trust they'll stay online because their token economics depend on it.
Three layers working together to create the autonomous intelligence economy
We're in the middle of this transition. Massive opportunities exist for those who understand how to build, deploy, and monetize intelligent agents.
In the agentic future, agents replace entire companies. x402 makes this infrastructure-level transition possible by enabling sustainable, reliable, community-governed agents.
We're in this transition now. Massive opportunities exist for builders.
Join our hands-on workshop to build agents using x402 and gxai. Learn how to navigate the AI disruption.
Free for early adopters. Gain exclusive access to Galaxy ecosystem and learn to build sustainable agents.
The x402 protocol is a chain-agnostic standard for payments on top of HTTP, leveraging the existing 402 Payment Required HTTP status code to indicate that payment is required for access to a resource.
Client makes HTTP request
Standard HTTP request to resource server (optional if client already knows payment details)
Server responds with 402 Payment Required
Response includes Payment Required Response JSON with paymentRequirements
{
"x402Version": 1,
"accepts": [
{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "1000000",
"payTo": "0x...",
"asset": "0x...",
...
}
]
}Client creates Payment Payload
Selects one paymentRequirement and creates payload based on scheme
Client sends request with X-PAYMENT header
Payment Payload included as Base64 encoded JSON in X-PAYMENT header
Server verifies payment
Verification via local check or POST to facilitator's /verify endpoint
Facilitator returns Verification Response
Returns whether payment is valid based on scheme and network
Server settles payment
Directly on blockchain or via facilitator's /settle endpoint
Server returns 200 OK with resource
Response includes X-PAYMENT-RESPONSE header with settlement details
Specifies scheme, network, amount, payTo address, asset contract, and other payment details
Contains x402Version, scheme, network, and scheme-dependent payload with payment proof
Logical ways of moving money (e.g., "exact" for fixed amounts, future "upto" for variable amounts)
3rd party services that verify and settle payments without resource servers needing blockchain access