Accept x402 payments
Sell API access per request. Receive USDC directly in your wallet.
Not available here
The facilitator is not set up on this site yet (it needs a database).
Register a service
Connect the wallet that gets paid
Sign one message to register your payTo wallet. No funds are transferred.
Registration is closed
This facilitator is not taking new merchants right now.
Put a price on a route
official x402 packagesInstall @x402/core and @x402/svm with the package for your framework. Prices are USDC in atomic units (6 decimals): 10000 is 0.01 USDC. Keep the key in an environment variable, never in the code.
import express from "express";
import { paymentMiddleware, x402ResourceServer } from "@x402/express";
import { HTTPFacilitatorClient } from "@x402/core/server";
import { ExactSvmScheme } from "@x402/svm/exact/server";
const auth = { Authorization: `Bearer ${process.env.FACILITATOR_KEY}` };
const facilitator = new HTTPFacilitatorClient({
url: "https://www.plinthcity.com/api/facilitator",
createAuthHeaders: async () => ({ verify: auth, settle: auth, supported: {} }),
});
const server = new x402ResourceServer(facilitator).register("solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", new ExactSvmScheme());
const app = express();
app.use(paymentMiddleware({
"GET /weather": {
accepts: [{
scheme: "exact",
network: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
payTo: process.env.PAY_TO, // the wallet you registered
price: { amount: "10000", asset: "7k8RSp2TLduCfVJKyMsjMWHCoc3cYQQJrJm6pF44B5c7" }, // extra.feePayer is filled in from the facilitator
}],
description: "Weather report",
},
}, server));
app.get("/weather", (req, res) => res.json({ forecast: "sunny" }));
app.listen(4021);import { Hono } from "hono";
import { paymentMiddleware, x402ResourceServer } from "@x402/hono";
import { HTTPFacilitatorClient } from "@x402/core/server";
import { ExactSvmScheme } from "@x402/svm/exact/server";
const auth = { Authorization: `Bearer ${process.env.FACILITATOR_KEY}` };
const facilitator = new HTTPFacilitatorClient({
url: "https://www.plinthcity.com/api/facilitator",
createAuthHeaders: async () => ({ verify: auth, settle: auth, supported: {} }),
});
const server = new x402ResourceServer(facilitator).register("solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", new ExactSvmScheme());
const app = new Hono();
app.use(paymentMiddleware({
"GET /weather": {
accepts: [{
scheme: "exact",
network: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
payTo: process.env.PAY_TO, // the wallet you registered
price: { amount: "10000", asset: "7k8RSp2TLduCfVJKyMsjMWHCoc3cYQQJrJm6pF44B5c7" }, // extra.feePayer is filled in from the facilitator
}],
description: "Weather report",
},
}, server));
app.get("/weather", (c) => c.json({ forecast: "sunny" }));
export default app;// app/api/weather/route.ts
import { NextResponse } from "next/server";
import { withX402, x402ResourceServer } from "@x402/next";
import { HTTPFacilitatorClient } from "@x402/core/server";
import { ExactSvmScheme } from "@x402/svm/exact/server";
const auth = { Authorization: `Bearer ${process.env.FACILITATOR_KEY}` };
const facilitator = new HTTPFacilitatorClient({
url: "https://www.plinthcity.com/api/facilitator",
createAuthHeaders: async () => ({ verify: auth, settle: auth, supported: {} }),
});
const server = new x402ResourceServer(facilitator).register("solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", new ExactSvmScheme());
export const GET = withX402(
async () => NextResponse.json({ forecast: "sunny" }),
{
"/api/weather": {
accepts: [{
scheme: "exact",
network: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
payTo: process.env.PAY_TO, // the wallet you registered
price: { amount: "10000", asset: "7k8RSp2TLduCfVJKyMsjMWHCoc3cYQQJrJm6pF44B5c7" }, // extra.feePayer is filled in from the facilitator
}],
description: "Weather report",
},
},
server,
);For whole pages, @x402/next also has paymentProxy for middleware.ts.
Merchants
0 listedNo merchants yet
Registered services appear here with what they have settled.
Recent settlements
latest 0Nothing settled yet
Every payment this facilitator settles is listed here with its transaction.