Accept payments from AI agents. Open-source. Your data, your domain, your rules. Free forever.
OpenFacilitator is a growing TypeScript project in the AI payments / x402 ecosystem, focused on x402, x402-facilitator. It currently has 21 GitHub stars and 19 forks, and sits alongside related tools like r402, facilitator, x402-facilitator.
Free, fast, open source x402 facilitator for apps and agents.
Website • Quick Start • Documentation • Contributing
OpenFacilitator is a free, public, open source x402 payment facilitator. Use pay.openfacilitator.io with no signup, no account, and no rate limits; fork the stack only when you need custom infrastructure or full control.
npm install @openfacilitator/sdk
import { OpenFacilitator } from '@openfacilitator/sdk';
// Uses https://pay.openfacilitator.io by default
const facilitator = new OpenFacilitator();
# Clone the repository
git clone https://github.com/rawgroundbeef/openfacilitator.git
cd openfacilitator
# Start with Docker
docker compose up -d
Your facilitator will be running at http://localhost:3001
openfacilitator/
├── apps/
│ └── dashboard/ # Next.js dashboard UI
├── packages/
│ ├── core/ # Facilitator logic (verify, settle, supported)
│ ├── server/ # Multi-tenant Express server
│ └── sdk/ # TypeScript SDK for integrating x402 payments
├── docker-compose.yml
├── LICENSE
└── README.md
OpenFacilitator uses Better Auth - a fully open source, self-contained authentication solution:
import { betterAuth } from 'better-auth';
export const auth = betterAuth({
database: db,
emailAndPassword: { enabled: true }
});
# Install dependencies
pnpm install
# Start development servers
pnpm dev
This starts:
# Build all packages
pnpm build
# Build specific package
pnpm turbo build --filter=@openfacilitator/server
| Endpoint | Method | Description |
|---|---|---|
/supported |
GET | List supported payment networks and tokens |
/verify |
POST | Verify a payment authorization |
/settle |
POST | Execute a payment settlement |
/discovery/resources |
GET | List available resources (products/links) |
/health |
GET | Health check |
| Endpoint | Method | Description |
|---|---|---|
/api/auth/sign-up/email |
POST | Create new account |
/api/auth/sign-in/email |
POST | Sign in with email/password |
/api/auth/sign-out |
POST | Sign out |
/api/auth/session |
GET | Get current session |
| Endpoint | Method | Description |
|---|---|---|
/api/admin/me |
GET | Get current user info |
/api/admin/facilitators |
GET | List user's facilitators |
/api/admin/facilitators |
POST | Create new facilitator |
/api/admin/facilitators/:id |
GET | Get facilitator details |
/api/admin/facilitators/:id |
PATCH | Update facilitator |
/api/admin/facilitators/:id |
DELETE | Delete facilitator |
/api/admin/facilitators/:id/export |
POST | Export self-host config |
curl https://yourdomain.com/supported
{
"kinds": [
{
"x402Version": 1,
"scheme": "exact",
"network": "base"
},
{
"x402Version": 2,
"scheme": "exact",
"network": "eip155:8453"
}
]
}
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 3001 |
HOST |
Server host | 0.0.0.0 |
DATABASE_PATH |
SQLite database path | ./data/openfacilitator.db |
NODE_ENV |
Environment | development |
BASE_RPC_URL=https://mainnet.base.org
BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
ETHEREUM_RPC_URL=https://eth.llamarpc.com
Dashboard on Vercel:
# Deploy from the apps/dashboard directory
vercel --prod
API Server on Railway:
/data for the databaseDNS Setup:
openfacilitator.io → Vercelapi.openfacilitator.io → Railway*.openfacilitator.io → Railway (wildcard for tenant subdomains)custom.openfacilitator.io → Railway (CNAME target)# Start all services
docker compose up -d
# View logs
docker compose logs -f
# Stop services
docker compose down
# Build server image
docker build -f Dockerfile.server -t openfacilitator-server .
# Run server
docker run -d \
-p 3001:3001 \
-v openfacilitator-data:/data \
openfacilitator-server
Server (.env):
NODE_ENV=production
PORT=3001
HOST=0.0.0.0
DATABASE_PATH=/data/openfacilitator.db
BETTER_AUTH_SECRET=your-secret-key-min-32-chars
DASHBOARD_URL=https://dashboard.openfacilitator.io
Dashboard:
NEXT_PUBLIC_API_URL=https://api.openfacilitator.io
OpenFacilitator uses a multi-tenant architecture:
┌─────────────────────────────────────┐
│ Load Balancer │
│ (subdomain/custom domain routing) │
└─────────────────────────────────────┘
│
┌─────────────────────────────────────┐
│ OpenFacilitator Server │
│ │
│ ┌─────────┐ ┌─────────────────┐ │
│ │ Tenant │ │ Facilitator │ │
│ │Resolver │──│ Router │ │
│ └─────────┘ └─────────────────┘ │
│ │ │
│ ┌───────────────────▼───────────┐ │
│ │ Core Logic │ │
│ │ (verify, settle, supported) │ │
│ └───────────────────────────────┘ │
│ │ │
│ ┌───────────────────▼───────────┐ │
│ │ SQLite Database │ │
│ │ (facilitators, transactions) │ │
│ └───────────────────────────────┘ │
└─────────────────────────────────────┘
Contributions are welcome! Please read our Contributing Guide for details.
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Built with ❤️ for the x402 ecosystem
Rust SDK for the x402 payment protocol.
A production-ready payment settlement service for the x402 protocol. Built with Elysia and Node.js, it verifies cryptographic payment signatures and settles transactions on-chain for EVM, SVM (Solana), and Starknet networks.
Golang implementation of an x402 payment facilitator