X Pay Gateway
The payment engine. Put it in front of any endpoint to price, verify, settle and receipt every call.
- Per route pricing rules
- Offchain verify, onchain settle
- Idempotency and replay protection
- Webhooks and receipts
Programmable payment infrastructure for APIs, AI agents and SaaS. Offchain authorization, onchain settlement, and a single HTTP status code standing between a request and its payment.
GET /v1/summarize Host: api.acme.dev
{ "amount": "0.002", "asset": "USDC", "network": "base", "payTo": "0xA1c4…9F2b" }
X-Payment: eyJzaWc… { "settled": true, "tx": "0x7d1e…" }
No account. No API key. No invoice. One round trip.
Selling an API today means assembling a stack that has nothing to do with your API. None of it works when the buyer is a machine.
An autonomous agent cannot sign up, accept terms or enter a card number. So it cannot buy anything.
Software can discover a price, agree to it and pay it inside the same request it was already making.
x402 revives a status code that has been reserved since 1997: 402 Payment Required. X Pay makes it usable in production.
A client (a browser, a script or an AI agent) calls a protected endpoint with no payment attached.
GET /v1/quote
The gateway answers 402 with a machine readable quote: amount, asset, network and recipient.
402 · X-Payment-Required
The client signs a payment authorization offchain and retries. No gas, no wallet popup, no block to wait for.
X-Payment: eyJzaWc…
X Pay verifies the authorization, releases the response immediately, then settles onchain and returns a receipt.
200 · X-Payment-Response
Waiting for a block confirmation would make every API call as slow as the chain underneath it. X Pay verifies a signed authorization in milliseconds and serves the response straight away, then batches settlement onchain. The merchant carries no chargeback risk, because the authorization is cryptographic and cannot be reversed by the payer.
Six pieces that turn a single status code into a working business.
The payment engine. Put it in front of any endpoint to price, verify, settle and receipt every call.
Operations for x402 at the standard the best payment tools set. Publish endpoints, price them, watch revenue land and withdraw it.
A wallet built for software that spends on its own. Bounded, auditable and revocable by design.
One package on each side. Sellers wrap a route, buyers swap fetch for a wallet aware client.
Publish once and get discovered. Every listing is payable the moment it is found, by humans or agents.
Pay per use is the default, not the only option. Mix models per route without changing your code.
Then let any agent pay for it without ever seeing a signup form.
import express from "express";
import { paywall } from "@xpay/sdk";
const app = express();
// price this route, that is the whole integration
app.use("/v1/summarize", paywall({
price: "$0.002",
network: "base",
payTo: "0xA1c4…9F2b",
}));
app.post("/v1/summarize", (req, res) => {
res.json({ summary: summarize(req.body.text) });
});
import { XPayWallet } from "@xpay/sdk";
const wallet = new XPayWallet({
sessionKey: process.env.XPAY_SESSION_KEY,
limits: { perCall: "$0.05", daily: "$25" },
});
// 402 is caught, paid and retried automatically
const res = await wallet.fetch(
"https://api.acme.dev/v1/summarize",
{ method: "POST", body: JSON.stringify({ text }) }
);
console.log(res.payment.amount, res.payment.tx);
// "$0.002" "0x7d1e…"
from xpay import paywall, XPayWallet
# sell, FastAPI
app.add_middleware(
paywall(price="$0.002", network="base",
pay_to="0xA1c4…9F2b")
)
# buy, any agent
wallet = XPayWallet(
session_key=os.environ["XPAY_SESSION_KEY"],
limits={"per_call": "$0.05", "daily": "$25"},
)
r = wallet.get("https://api.acme.dev/v1/quote")
print(r.payment.tx)
# 1. unpaid request
GET /v1/quote HTTP/1.1
Host: api.acme.dev
# 2. the price, in machine readable form
HTTP/1.1 402 Payment Required
X-Payment-Required: {"scheme":"exact","amount":"2000",
"asset":"USDC","network":"base","payTo":"0xA1c4…9F2b"}
# 3. retry with a signed authorization
GET /v1/quote HTTP/1.1
X-Payment: eyJzaWduYXR1cmUiOiIweGFm…
# 4. response plus settlement receipt
HTTP/1.1 200 OK
X-Payment-Response: {"settled":true,"tx":"0x7d1e…"}
Every listing carries its price in a format an agent can read, compare and pay, with no onboarding in between.
Illustrative listings and prices, shown to demonstrate the catalogue format.
The network settles in stablecoins. The token exists to align the people who route, secure and grow that traffic.
Settle protocol fees in $XPAY and pay a reduced rate. The heaviest merchants save the most.
Vote on fee parameters, supported networks, treasury spend and protocol upgrades.
Stake to back facilitators and settlement capacity, and earn a share of the fees you help secure.
Merchant incentives, integration grants and rebates that pay for real volume rather than speculation.
Token design is indicative and subject to change. Nothing on this page is an offer to sell, or a solicitation of an offer to buy, any token or security, and nothing here is investment advice.
One transparent rate on volume, plus optional layers for teams that need more.
Charged on settled volume. No monthly minimum, no setup fee, and nothing charged on failed calls.
APIs are the beachhead. The same primitive prices anything a machine can request.
An open standard that puts payment into the HTTP request itself. A server answers an unpaid request with 402 Payment Required and a machine readable quote, then the client attaches a signed payment authorization and retries. X Pay implements that standard and adds the gateway, wallet, dashboard and marketplace around it.
Your API consumers need a funded X Pay wallet or any x402 compatible client. For AI agents that means a session key with spending limits. There is no browser extension, no seed phrase prompt and no gas management.
Verification happens offchain in milliseconds, so the response is never held behind a block confirmation. Settlement follows onchain and returns a receipt. Actual latency depends on the network you settle on.
Every session key carries per call and daily ceilings, an expiry, and an optional allowlist of destinations. Limits are enforced before a payment is ever signed, and a key can be revoked instantly.
Yes. Pay per use is the default, but prepaid credits, volume tiers and monthly plans are configurable per route. Most merchants end up mixing them.
The gateway is in active development, with public beta targeted for Q3 2026. Timelines on this page are plans rather than commitments.
Ship pay per use in an afternoon. Let agents buy from you the moment they find you.