Skip to content

How to Enable PayAI x402 Facilitator for USDC (2026)

Wire @payai/facilitator into Express paymentMiddleware, prove a real settle, and scale past PayAI's free credit allowance for USDC x402.

Table of Contents

AI agents that sell HTTP resources still need a facilitator that verifies a signed stablecoin payment and settles it on-chain before the response leaves the server.

The named object is the PayAI x402 Facilitator at facilitator.payai.network: a production verify/settle service for exact (and related) x402 payments across Solana, Base, Polygon, Avalanche, Arbitrum, Sei, X Layer, and SKALE. Wire it with @payai/facilitator plus HTTPFacilitatorClient and Express paymentMiddleware. That is not Nevermined plan metering with nvm:erc4337, not Circle's public facilitator alone, not Coinbase AgentKit as a buyer client, not Cloudflare Agents MCP paywalls, and not Alchemy gateway auth.

📌
Stablecoin Insider's framing: use this guide when the job is enabling the PayAI x402 Facilitator as your merchant verify/settle backend for USDC (and Solana USDC) exact payments. Use How to Enable Nevermined x402 USDC Payments when you need plans, credits, and createDelegation. Use How to Enable Circle x402 Facilitator when you want Circle's facilitator URL. Use How to Pay for an x402 API with Coinbase AgentKit when your agent only pays someone else's 402.

Facts below come from PayAI's x402 quickstart, facilitator introduction, Express server quickstart, facilitator pricing, and accept payments from AI agents docs, plus live GET /supported and GET /pricing on facilitator.payai.network as of October 1, 2026. Rates, free-credit counts, network lists, package names, and endpoint paths are taken from those sources. No invented fee schedules.

Key Takeaways

  • Point Express paymentMiddleware at PayAI via @payai/facilitator and HTTPFacilitatorClient (no manual facilitator URL).
  • Start on free allowance: 1,000 lifetime free credits per receiving wallet; testnets do not consume it.
  • Register ExactEvmScheme / ExactSvmScheme for the networks in your accepts array (e.g. Base Sepolia + Solana Devnet).
  • Beyond free, cost-plus is network gas × 1.30 in credits (1 credit = $0.001); set PAYAI_API_KEY_ID/SECRET.
  • Named downside: shared host/IP pools can burn the free allowance early; get a key before production bursts.
⚠️
Named downside: PayAI documents that free credits are per receiving wallet, and requests from shared hosts or IP addresses also draw from a shared pool. Serverless or shared-cloud deploys can hit free_tier_exhausted (HTTP 403) sooner than a dedicated IP. Treat API-key + credits as a ship gate before you load-test mainnet.

Who this is for

Use this path if you expose an API, SaaS operation, or agent-facing HTTP resource, you want buyers (including AI agents) to pay in USDC or Solana USDC under the x402 exact scheme, and you can run TypeScript Express (or Hono/FastAPI/Flask/Gin with the matching PayAI guides).

Skip it if you need Nevermined plan objects and capped createDelegation (see How to Enable Nevermined x402 USDC Payments for AI Agents), only Circle's facilitator without PayAI packages (see How to Enable Circle x402 Facilitator for USDC), buyer-side AgentKit payments (see How to Pay for an x402 API with Coinbase AgentKit), MCP tool paywalls on Cloudflare (see How to Charge for MCP Tools with Cloudflare Agents x402), or Alchemy RPC auth (see How to Authenticate Alchemy APIs with x402 USDC). For picking among facilitators, see How to Choose an x402 Facilitator for USDC. For generic accept-side patterns, see How to Accept x402 USDC Payments from AI Agents.

What the PayAI x402 Facilitator does

x402 revives HTTP 402 Payment Required. The resource server advertises payment requirements; the client signs a stablecoin payment; the facilitator verifies the payload and settles on-chain so the server never holds a merchant private key or runs its own RPC wallet loop.

PayAI's production origin is https://facilitator.payai.network. Documented endpoints include GET /supported, POST /verify, POST /settle, and GET /discovery/resources (the Bazaar). Ordinary exact payments can start without portal signup or an API key within the free allowance. PayAI does not custody merchant balances and is not a card/fiat checkout processor.

Stablecoin Insider's working definition: enable the facilitator when middleware can call verify before work and settle after success, with network coverage and rate limits you can operate against. Discovery via Bazaar is optional; it helps agents find priced routes but does not replace your own docs.

Prerequisites

You need a receiving wallet address on each network you price (an EVM hex address and/or a Solana base58 address), Node.js with TypeScript (or another documented stack), and a disposable funded buyer wallet to prove settle, not just a 402 response. On Solana, PayAI notes the merchant USDC ATA must exist; creating it needs a setup fee payer with SOL, separate from settlement gas PayAI sponsors.

You do not need a PayAI portal account for the ordinary exact starter flow. Do not add signup friction just because the SDK can take PAYAI_API_KEY_ID / PAYAI_API_KEY_SECRET. If buyers need USDC first, see How to Fund an AI Agent Wallet with USDC.

Step 1: Install packages and env

PayAI's Express quickstart installs express, dotenv, @payai/facilitator, @x402/core, @x402/evm, @x402/express, @x402/extensions, and @x402/svm. Create a project, set type: module, and add those deps as in the Express server quickstart.

Set receiving addresses in .env:

EVM_ADDRESS=0x...   # EVM wallet to receive payments
SVM_ADDRESS=...    # Solana wallet to receive payments
# Optional beyond free allowance:
# PAYAI_API_KEY_ID=...
# PAYAI_API_KEY_SECRET=...

The @payai/facilitator package points at https://facilitator.payai.network automatically. No manual facilitator URL is required for the default config.

Step 2: Wire HTTPFacilitatorClient and paymentMiddleware

Construct the facilitator client once, then pass an x402ResourceServer into paymentMiddleware with route accepts. The Express docs show dual accepts on Base Sepolia and Solana Devnet at $0.001 each:

import { paymentMiddleware, x402ResourceServer } from "@x402/express";
import { ExactEvmScheme } from "@x402/evm/exact/server";
import { ExactSvmScheme } from "@x402/svm/exact/server";
import { HTTPFacilitatorClient } from "@x402/core/server";
import { declareDiscoveryExtension } from "@x402/extensions/bazaar";
import { facilitator } from "@payai/facilitator";

const facilitatorClient = new HTTPFacilitatorClient(facilitator);

app.use(paymentMiddleware({
  "GET /weather": {
    accepts: [
      { scheme: "exact", price: "$0.001", network: "eip155:84532", payTo: evmAddress },
      { scheme: "exact", price: "$0.001", network: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", payTo: svmAddress },
    ],
    description: "Weather data",
    mimeType: "application/json",
    serviceName: "Weather API",
    tags: ["weather", "api"],
    extensions: { ...declareDiscoveryExtension({ output: { example: { report: { weather: "sunny", temperature: 70 } } } }) },
  },
}, new x402ResourceServer(facilitatorClient)
  .register("eip155:84532", new ExactEvmScheme())
  .register("solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", new ExactSvmScheme()));

Keep health checks and public docs free. Only meter the bounded operation (report, inference, premium lookup). Payment proves payment, not permission to another customer's private data; keep normal auth on user-scoped routes.

Step 3: Prove unpaid 402, then a real settle

Run the server (npx tsx index.ts in the Express guide; default listen example is port 4021). Hit the route without payment and confirm HTTP 402 with the expected recipient, asset, network, and price. Then run a funded buyer from PayAI's fetch or Axios client quickstarts and retain evidence of a successful paid response plus finalized on-chain settlement.

PayAI's accept-payments guide is explicit: a 402 alone does not prove the integration. Reconcile ambiguous responses before retrying; settlement_pending on POST /settle means unresolved, and identical-body retries are idempotent. Optionally publish Bazaar discovery metadata so agents can find the route.

💡
Ops check before you call it done: unpaid 402 shape matches accepts; buyer spends within an explicit cap; paid HTTP 200 aligns with a finalized settlement; recovery of disposable test funds is documented if you control both wallets.

Step 4: Move to mainnet and scale past free credits

For mainnet, update each route's network and the matching .register(...) scheme together (for example Base eip155:8453 and Solana solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp). Adding credentials alone does not switch networks. PayAI documents that ordinary exact mainnet payments can run within the free allowance without an API key.

Beyond the allowance, authenticate. Autonomous agents can buy credits and a key over x402 without portal signup; humans can use merchant.payai.network. Set PAYAI_API_KEY_ID and PAYAI_API_KEY_SECRET; @payai/facilitator picks them up automatically. Exhausting free tier returns HTTP 403 with errorReason beginning free_tier_exhausted.

Pricing and free allowance (sourced)

Per PayAI's facilitator pricing page (cost-plus live since 21 September 2026): new receiving wallets get 1,000 lifetime free credits (not a monthly reset). Testnet settlements are free and do not consume the allowance. Beyond free, each settlement costs measured network gas × 1.30, billed in credits at 1 credit = $0.001. Live rates are at facilitator.payai.network/pricing and under pricing on GET /supported.

Stablecoin Insider checked live GET /pricing on October 1, 2026: Base exact EIP-3009 was 2.31 credits ($0.00231) per settlement; Solana mainnet exact was 1.62 credits ($0.00162); Base Sepolia and Solana Devnet exact were 0. Treat the live pricing table as authoritative because rates refresh with gas and token prices.

ItemPayAI documented valueOperator note
Free credits1,000 per receiving wallet (lifetime)Shared host/IP pools can drain faster
Credit unit$0.001 per creditFractional credits are normal
Beyond freegas × 1.30 in creditsFacilitator fee ≠ your API price to buyers
Testnets0 creditsUse for integration before mainnet
Edge rate limitssettle 100 rps; payments-read 200; discovery 25 (per IP)Back off on status, not a remaining header

Supported networks snapshot

PayAI's quickstart lists Arbitrum One/Sepolia, Avalanche/Fuji, Base/Base Sepolia, Polygon/Amoy, Sei/Sei Testnet, SKALE Base/Sepolia, Solana/Devnet, and X Layer/Testnet, with v1 short names and v2 CAIP-2 IDs. Always confirm against live GET /supported before you hard-code a network string. A payment kind leaving /supported is the withdrawal signal.

How PayAI compares to Circle CDP and Nevermined

StackWhat it optimizesWhen Stablecoin Insider picks it
PayAI x402 FacilitatorMulti-chain verify/settle + Bazaar; free-tier exact start; @payai/facilitator one-linerYou are the merchant; want PayAI coverage and package defaults
Circle x402 facilitatorCircle-operated facilitator for USDC-centric exact flowsYou standardize on Circle's facilitator URL and tooling
Nevermined Payments x402Plans, credits, erc4337 delegations, paymentMiddleware(planId)You need plan metering and spend-capped buyer delegations
Coinbase AgentKit x402Buyer-side agent paying third-party 402 APIsYour agent is the payer, not the merchant of record
Cloudflare Agents MCP x402MCP tool paywalls on CloudflareThe product is MCP tools, not a generic Express API
Alchemy x402 USDC authPay Alchemy APIs with x402 USDCThe merchant is Alchemy itself

PayAI wins when you want a ready multi-network facilitator with a typed npm entrypoint and optional agent-buyable credits. Nevermined wins when plan IDs and createDelegation are the product. Circle wins when your stack already centers Circle's facilitator. For a broader shortlist, use How to Choose an x402 Facilitator for USDC.

Stablecoin Insider's take

💬
Stablecoin Insider's take: enable the PayAI x402 Facilitator when you need multi-chain exact USDC settle without running your own facilitator. Ship Express paymentMiddleware against testnets first, prove a real mainnet settle inside the free allowance, then add PAYAI_API_KEY_* before shared-host load. If you need Nevermined plans and capped delegations, switch guides. If you only need Circle's facilitator URL, use Circle's path and skip @payai/facilitator.

FAQ

What is the PayAI x402 Facilitator?

It is PayAI's production x402 verify/settle service at https://facilitator.payai.network. It checks signed stablecoin payment payloads and settles them on-chain so resource servers can charge per HTTP request without holding merchant keys for every chain.

How do I enable PayAI with Express paymentMiddleware?

Install @payai/facilitator with @x402/express and scheme packages, build new HTTPFacilitatorClient(facilitator), register ExactEvmScheme/ExactSvmScheme for your networks, and wrap routes in paymentMiddleware with an accepts array (price, network, payTo).

Do I need an API key on day one?

No for ordinary exact payments inside the free allowance. PayAI documents 1,000 lifetime free credits per receiving wallet and free testnets. Set PAYAI_API_KEY_ID and PAYAI_API_KEY_SECRET when you need paid capacity, attribution, or assigned lanes.

What does free_tier_exhausted mean?

HTTP 403 with errorReason beginning free_tier_exhausted means the free credit allowance (or shared pool) is spent. Buy credits via agent x402 vending or the merchant portal, then authenticate.

How is PayAI different from Nevermined x402?

PayAI is a multi-chain facilitator for exact (and related) x402 settlements with Bazaar discovery. Nevermined adds payment plans, credits metering, and buyer createDelegation (including nvm:erc4337). Many products use a facilitator like PayAI or Circle without Nevermined plan objects.

Which networks does PayAI support?

Documented coverage includes Base, Solana, Polygon, Avalanche, Arbitrum, Sei, X Layer, and SKALE (plus testnets). Confirm live kinds on GET /supported before production.

What is the facilitator fee versus my API price?

Your accepts.price is what the buyer pays your receiving wallet. The facilitator fee (gas × 1.30 in credits beyond free) is separate settlement infrastructure cost. Do not confuse the two.

Can AI agents buy PayAI credits without a human signup?

Yes. PayAI documents programmatic key and credit purchase over x402; the paying wallet becomes the account identity. Store the returned secret immediately. Vending starts at $1 per the accept payments from AI agents guide; purchased credits are non-refundable.


Need the facilitator shortlist before you ship? Start with Stablecoin Insider's x402 facilitator comparison, then come back to this PayAI wire-up.

Choose an x402 facilitator
How to Choose an x402 Facilitator for USDC (2026)
Compare x402 facilitator options for USDC agent and API payments.

This content is provided for informational and educational purposes only and does not constitute financial, investment, legal, or tax advice; no material herein should be interpreted as a recommendation, endorsement, or solicitation to buy or sell.

Latest

How to Mint and Redeem USDG with Paxos (2026)

How to Mint and Redeem USDG with Paxos (2026)

Mint and redeem Global Dollar (USDG) at Paxos: onboard to the Global Dollar Network, deposit USD, Convert mint/redeem on the dashboard, Automate rules, and orchestration APIs that deliver USDG to a profile or external wallet.

Members Public