Source:
examples/agent-byo-facilitatorOverview
This template demonstrates how to bring your own x402 payment facilitator by providing anapp/accepts.ts file. Instead of using the default facilitator at x402.org, you can point to a custom facilitator URL for payment verification.
Project Structure
Custom Facilitator
Theapp/accepts.ts file configures a custom payment facilitator:
Key Features
- Custom facilitator URL — Point to any x402-compatible facilitator service
- Environment-driven — Facilitator URL configurable via
X402_FACILITATOR_URL - Fallback to default — Uses the default x402.org facilitator if no env var is set
- Auto-generated server — No custom
server.tsneeded; the build pipeline picks upapp/accepts.tsautomatically
When to Use
Use a custom facilitator when you need to:- Run your own x402 facilitator service for payment verification
- Use a third-party facilitator other than the default
- Test payments against a local or staging facilitator
Payment
The agent charges$0.005 per request via x402 on Base Sepolia.
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key |
X402_FACILITATOR_URL | Custom facilitator URL (defaults to x402.org) |