RelAI Documentation
Accept payments in your API in under 60 seconds.
Turn any endpoint into a paid resource using HTTP 402. No wallets. No gas. No billing infrastructure.
$ npm install @relai-fi/x402
import { relai } from "@relai-fi/x402"
app.use(relai({
price: "0.001",
wallet: "your-address"
}))Quick Start
Add payments to any endpoint:
app.get("/premium",
relai({ price: "0.002" }),
(req, res) => {
res.json({ data: "paid response" })
}
)Try it
$ curl https://your-api.com/premium
# → HTTP 402 Payment Required
# → after payment → 200 OK + responseHow it works
From HTTP request to on-chain payment in seconds.
Payments complete in seconds. No wallets in your code.
What you get
SDK Basics
Installation
$ npm install @relai-fi/x402Basic usage — protect all routes
import { relai } from "@relai-fi/x402"
app.use(relai({
price: "0.001"
}))Per-endpoint pricing
app.get("/data",
relai({ price: "0.005" }),
handler
)Full SDK docs → @relai-fi/x402 reference
Pricing & Free tier
You define the price per request. Any amount in USDC.
relai({ price: "0.001" })Allow free requests before charging
Configure a free tier per caller — no code changes needed. Uses JWT identity or IP address for tracking.
perBuyerLimit: 3 resetPeriod: none
perBuyerLimit: 10 resetPeriod: daily
perBuyerLimit: 100 globalCap: 1000
Full docs → Free Tier plugin
Facilitator
The RelAI facilitator is the backend service that handles all payment logic. You don't run any blockchain infrastructure.
Full docs → RelAI Facilitator page or Facilitator reference
API Endpoints
https://facilitator.x402.fi/verify/settle/activity/live-settlementsLive payments
Real-time settlement activity across all supported networks.
Settles (24h)
Volume (24h)
USDC settled via RelAI
Active chains
No data yet
Live feed
—
Activity Trends
Hourly · last 24h
Settlement cadence
0 settles across window
Last refresh
—
Supported networks
All payments settle in USDC.
Full list → Networks & chain IDs
Advanced
Secure API access and request validation using agent keys and JWT.
Receive real-time payment events via HTTP callbacks.
Identify and verify AI agents on-chain with non-transferable NFTs.
Track trust and behavior across API interactions on Solana.