Skip to main content

Overview

This template demonstrates how to bring your own x402 payment facilitator by providing an app/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

The app/accepts.ts file configures a custom payment facilitator:
app/accepts.ts

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.ts needed; the build pipeline picks up app/accepts.ts automatically

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

Running