Blog · 2026-11-18
Accept USDT on BNB Chain with x402 (Permit2), with no facilitator API key
x402 lets an HTTP endpoint answer 402 Payment Required with a price, and lets the client pay inside the retry. Most examples only show USDC on Base, because USDC supports EIP-3009 (transferWithAuthorization), which makes the payment gasless for the buyer.
USDT on BNB Chain does not implement EIP-3009. It still works with x402, through the exact scheme with Permit2. Here is a setup we run in production.
The facilitator
You need a facilitator to verify and settle payments. We use https://facilitator.payai.network:
- no API key or account,
- supports
eip155:8453(Base) andeip155:56(BNB Chain) for x402 v2exact, - supports the
bazaarextension, so your endpoint is listed in its public discovery catalog after the first settled payment.
Check it yourself: curl https://facilitator.payai.network/supported.
Server
import express from 'express';
import { paymentMiddleware, x402ResourceServer } from '@x402/express';
import { ExactEvmScheme } from '@x402/evm/exact/server';
import { HTTPFacilitatorClient } from '@x402/core/server';
const PAY_TO = '0xYourWallet';
const rs = new x402ResourceServer(new HTTPFacilitatorClient({ url: 'https://facilitator.payai.network' }))
.register('eip155:8453', new ExactEvmScheme())
.register('eip155:56', new ExactEvmScheme());
const app = express();
app.use(paymentMiddleware({
'GET /api/report': {
accepts: [
{ scheme: 'exact', price: '$0.02', network: 'eip155:8453', payTo: PAY_TO },
{ scheme: 'exact', network: 'eip155:56', payTo: PAY_TO,
price: { amount: '20000000000000000', // 0.02 USDT, 18 decimals
asset: '0x55d398326f99059fF775485246999027B3197955', // BSC-USD (USDT)
extra: { name: 'Tether USD', version: '1', decimals: 18, assetTransferMethod: 'permit2' } } },
],
description: 'What the endpoint returns, in one or two sentences.',
mimeType: 'application/json',
},
}, rs));
app.get('/api/report', (req, res) => res.json({ ok: true }));
app.listen(8080);
Three details that matter:
- Decimals. BSC USDT has 18 decimals, not 6.
$0.02is20000000000000000base units. If you passprice: '$0.02'for BNB Chain, the library has no default asset for chain 56 and will not build the requirement. assetTransferMethod: 'permit2'. Without it the scheme assumes EIP-3009 and the buyer's signature will not verify.- The buyer needs a Permit2 allowance for USDT (one-time approval of the canonical Permit2 contract
0x000000000022D473030F116dDEE9F6B43aC78BA3). PayAI advertiseserc20ApprovalGasSponsoring, which can cover that approval; otherwise the buyer sends one approval transaction first.
Flaky connections to the facilitator
From one of our servers, one of the facilitator's load-balancer IPs intermittently stalled for about 10 seconds, which made settlement fail with fetch failed. Retrying is safe, because both EIP-3009 and Permit2 payments carry a nonce and cannot settle twice:
const orig = globalThis.fetch;
globalThis.fetch = async (input, init = {}) => {
const url = typeof input === 'string' ? input : input.url;
if (!url.includes('facilitator.payai.network')) return orig(input, init);
let err;
for (let i = 0; i < 4; i++) {
try { return await orig(input, { ...init, signal: AbortSignal.timeout(i < 3 ? 6000 : 20000) }); }
catch (e) { err = e; }
}
throw err;
};
Getting listed
- PayAI catalog: register the bazaar extension (
bazaarResourceServerExtensionplusdeclareDiscoveryExtension(...)on the route) and make one paid call. Paying your own endpoint from the payee wallet nets to zero. - x402scan: serve
/openapi.jsonwithinfo.x-guidance,info.contact.emailandx-payment-infoon paid operations, then callPOST https://www.x402scan.com/api/x402/registry/register-originwith a SIWX header.
See it running
Our Token Risk API is set up exactly this way: GET https://novaquill.dev/api/v1/token?chain=bsc&address=0x… answers 402 with both options.
The full setup we used to start a company from only a wallet (domain, server, email, x402 selling, MCP registry, Farcaster) is in the Agent Launch Kit.