Radius Facilitator
Networks and assets
One facilitator for mainnet and one for testnet. Each settles on Radius, Base and Tempo.
| Network | CAIP-2 | Asset | Address | Decimals |
|---|---|---|---|---|
Mainnet https://facilitator.radiustech.xyz | ||||
| Radius | eip155:723487 | SBC | 0x33ad9e4BD16B69B5BFdED37D8B5D9fF9aba014Fb | 6 |
| Base | eip155:8453 | USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | 6 |
| Base | eip155:8453 | SBC | 0xfdcC3dd6671eaB0709A4C0f3F53De9a333d80798 | 18 |
| Tempo | eip155:4217 | OUSD | 0x20c0000000000000000000006a37DA5C996874BE | 6 |
Testnet https://facilitator.testnet.radiustech.xyz | ||||
| Radius Testnet | eip155:72344 | SBC | 0x33ad9e4BD16B69B5BFdED37D8B5D9fF9aba014Fb | 6 |
| Base Sepolia | eip155:84532 | USDC | 0x036CbD53842c5426634e7929541eC2318f3dCF7e | 6 |
| Base Sepolia | eip155:84532 | SBC | 0xf9FB20B8E097904f0aB7d12e9DbeE88f2dcd0F16 | 6 |
| Tempo Moderato | eip155:42431 | OUSD | 0x20c0000000000000000000006a37DA5C996874BE | 6 |
Schemes
exact runs on every network above and upto on all but Tempo. The facilitator pays the gas on each.
| Scheme | What the client signs | What settles | Transfer methods |
|---|---|---|---|
exact | An authorization for the stated price | That amount, once | EIP-3009, Permit2 |
upto | A Permit2 authorization for a maximum | The actual amount, up to the maximum and as low as 0, once within the validity window | Permit2 |
Access
Start without signing up.
| Settlements | Price | Key |
|---|---|---|
| First 1,000 | Free | None |
| After 1,000 | — | API key required |
Why Radius
Radius isn't a typical blockchain. Its execution model is built for real-time payments, and this facilitator is designed to take full advantage.
- Synchronous settlementRadius confirms a payment before the call returns. No polling and no waiting on confirmations: the payment is final when you get the response.
- Gas paid for youPayers and sellers only ever hold stablecoins. The facilitator pays the gas on Radius, Base and Tempo.
- Parallel settlementPayments settle side by side instead of queuing behind one another, so throughput holds as traffic grows.
- Sub-second finalityRadius settles in milliseconds, so a paid request takes a few hundred milliseconds end to end. Base now produces a block every 200 ms, so payments there confirm quickly too.
- Scales with demandCapacity grows automatically under load. There is nothing to provision or tune.
- Settles at most onceEach payment settles at most once, and pending settlements resume after a restart.
How x402 payments work
x402 adds payment to HTTP. A server answers 402 Payment Required, the client signs a stablecoin payment, and the facilitator settles it.
- Client requests a paid resourceThe server responds with
402 Payment Requiredand aPAYMENT-REQUIREDheader listing the payments it accepts: price, asset, network, and recipient. - Client signs a paymentThe client signs one of the offers and retries with a
PAYMENT-SIGNATUREheader. Signing is off-chain: the client sends no transaction and pays no gas. - Server forwards it to the facilitatorThe server sends the signed payment to
POST /settle, or toPOST /verifyfirst to check it without settling. - Facilitator settles on-chainThe facilitator checks the payment, submits it on the network the client chose, and pays the gas.
- Client gets the resourceThe server returns the resource with a
PAYMENT-RESPONSEheader carrying the transaction hash. On Radius, the whole exchange completes in under a second.
Endpoints
The facilitator exposes a minimal HTTP API. Integrate with any language or framework.
| Method | Path | Description |
|---|---|---|
POST | /settle | Verify and settle a signed payment on-chain |
POST | /verify | Validate a payment signature without settling |
GET | /supported | List supported payment kinds, networks, assets, and transfer methods |
GET | /health | Service status |
Getting started
Charge for a route with x402 middleware, then pay for it. Every example runs on testnet.
1. Check what the facilitator supports
curl https://facilitator.radiustech.xyz/supported
curl https://facilitator.testnet.radiustech.xyz/supported
2. Charge for a route
import express from "express";
import { paymentMiddleware } from "@x402/express";
import { createRadiusServer } from "radius-sdk/server";
const radius = createRadiusServer({ network: "testnet" });
const app = express();
app.use(
paymentMiddleware(
radius.routes({
payTo: "0xYourWalletAddress",
routes: { "GET /api/lookup": "0.001 SBC" },
}),
radius.server,
),
);
app.get("/api/lookup", (_request, response) => response.json({ result: "ok" }));
app.listen(8787);
import { Hono } from "hono";
import { radiusPayments, type RadiusPaymentVariables } from "radius-sdk/hono";
type Env = { Bindings: { PAY_TO: `0x${string}` }; Variables: RadiusPaymentVariables };
const app = new Hono<Env>();
app.use(
"/api/*",
radiusPayments<Env>({
network: "testnet",
payTo: (c) => c.env.PAY_TO,
routes: {
"GET /api/lookup": { price: "0.001 SBC", description: "One lookup" },
},
}),
);
app.get("/api/lookup", (c) => c.json({ result: "ok" }));
export default app;
import { radiusPayments } from "radius-sdk/server";
const pay = radiusPayments({
network: "testnet",
payTo: "0xYourWalletAddress",
routes: {
"GET /api/lookup": { price: "0.001 SBC", description: "One lookup" },
},
});
// A Worker, Bun or Deno server. In a Next.js or Astro route
// handler, call pay(request, handler) instead.
export default {
fetch: pay.wrap((request, payment) =>
Response.json({ result: "ok", paidBy: payment?.payer }),
),
};
from typing import Any
from fastapi import FastAPI
from x402.http import FacilitatorConfig, HTTPFacilitatorClient, PaymentOption
from x402.http.middleware.fastapi import PaymentMiddlewareASGI
from x402.http.types import RouteConfig
from x402.mechanisms.evm.exact import ExactEvmServerScheme
from x402.schemas import Network
from x402.server import x402ResourceServer
app = FastAPI()
NETWORK: Network = "eip155:84532" # Base Sepolia, paid in USDC
facilitator = HTTPFacilitatorClient(
FacilitatorConfig(url="https://facilitator.testnet.radiustech.xyz")
)
server = x402ResourceServer(facilitator)
server.register(NETWORK, ExactEvmServerScheme())
routes: dict[str, RouteConfig] = {
"GET /api/lookup": RouteConfig(
accepts=[
PaymentOption(
scheme="exact",
pay_to="0xYourWalletAddress",
price="$0.001",
network=NETWORK,
),
],
mime_type="application/json",
description="One lookup",
),
}
app.add_middleware(PaymentMiddlewareASGI, routes=routes, server=server)
@app.get("/api/lookup")
async def lookup() -> dict[str, Any]:
return {"result": "ok"}
const FACILITATOR = "https://facilitator.testnet.radiustech.xyz";
// What this route costs. The facilitator checks every payment against it.
const requirements = {
scheme: "exact",
network: "eip155:72344", // Radius Testnet
amount: "1000", // 0.001 SBC (6 decimals)
asset: "0x33ad9e4BD16B69B5BFdED37D8B5D9fF9aba014Fb",
payTo: "0xYourWalletAddress",
maxTimeoutSeconds: 300,
extra: { assetTransferMethod: "eip3009", name: "Stable Coin", version: "1" },
};
export async function handle(request: Request): Promise<Response> {
const signed = request.headers.get("PAYMENT-SIGNATURE");
// No payment yet: answer 402 with the challenge.
if (!signed) {
const challenge = {
x402Version: 2,
error: "Payment required",
resource: { url: request.url, description: "One lookup" },
accepts: [requirements],
};
return new Response(null, {
status: 402,
headers: { "PAYMENT-REQUIRED": btoa(JSON.stringify(challenge)) },
});
}
// Paid retry: settle, then serve.
const settle = await fetch(FACILITATOR + "/settle", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
x402Version: 2,
paymentPayload: JSON.parse(atob(signed)),
paymentRequirements: requirements,
}),
});
const receipt = await settle.json();
if (!receipt.success) return new Response("Payment failed", { status: 402 });
return Response.json(
{ result: "ok" },
{ headers: { "PAYMENT-RESPONSE": btoa(JSON.stringify(receipt)) } },
);
}
3. Pay for a request
import { createRadiusFetch } from "radius-sdk/client";
const payFetch = createRadiusFetch({
network: "testnet",
signer: process.env.RADIUS_PRIVATE_KEY as `0x${string}`,
maxPerRequest: "0.01 SBC", // hard ceiling per request
});
const response = await payFetch("https://seller.example/api/lookup");
console.log(response.status, await response.text());
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));
// Retries a 402 with a signed payment automatically.
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment("https://seller.example/api/lookup");
console.log(response.status, await response.text());
RADIUS_HOME=.radius RADIUS_NETWORK=testnet \
npx radius-cli wallet pay get https://seller.example/api/lookup \
--threshold 0.01 \
-y
import { toHex } from "viem";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const url = "https://seller.example/api/lookup";
// 1. Ask without paying and read the challenge.
const unpaid = await fetch(url);
const challenge = JSON.parse(atob(unpaid.headers.get("PAYMENT-REQUIRED")!));
const offer = challenge.accepts.find(
(o: any) => o.scheme === "exact" && o.extra.assetTransferMethod === "eip3009",
);
// 2. Sign an EIP-3009 authorization for that offer.
const authorization = {
from: account.address,
to: offer.payTo,
value: offer.amount,
validAfter: "0",
validBefore: String(Math.floor(Date.now() / 1000) + offer.maxTimeoutSeconds),
nonce: toHex(crypto.getRandomValues(new Uint8Array(32))),
};
const signature = await account.signTypedData({
domain: {
name: offer.extra.name,
version: offer.extra.version,
chainId: Number(offer.network.split(":")[1]),
verifyingContract: offer.asset,
},
types: {
TransferWithAuthorization: [
{ name: "from", type: "address" },
{ name: "to", type: "address" },
{ name: "value", type: "uint256" },
{ name: "validAfter", type: "uint256" },
{ name: "validBefore", type: "uint256" },
{ name: "nonce", type: "bytes32" },
],
},
primaryType: "TransferWithAuthorization",
message: {
...authorization,
value: BigInt(authorization.value),
validAfter: 0n,
validBefore: BigInt(authorization.validBefore),
},
});
// 3. Retry with the signed payment.
const payment = { x402Version: 2, accepted: offer, payload: { signature, authorization } };
const paid = await fetch(url, {
headers: { "PAYMENT-SIGNATURE": btoa(JSON.stringify(payment)) },
});
console.log(paid.status, atob(paid.headers.get("PAYMENT-RESPONSE") ?? ""));
More ways to build
Two options if you would rather not write the integration by hand.
- radius-sdkThe open source SDK for x402 v2 on Radius and Base. Accept or make payments from any web-standard runtime, Hono, Express or Next.js, in place of the hand-written steps above. MIT licensed.
pnpm add radius-sdk @x402/coregithub.com/radiustechsystems/tools - Merchant ConsoleCharge agents for your API, data, and content. Set a price per request, decide which agents pay, and get paid in stablecoins. Recommended if you want more capabilities without running your own facilitator and server logic. app.radiustech.xyz