open source · MIT · built on the x402 standard

Put a fare on anything.

Farebox is a one-command x402 paywall proxy. Drop it in front of any HTTP API or MCP server and agents pay you USDC on Base — or USDG on Robinhood Chain — per request, straight to your own wallet.

terminal
$ npx farebox --target http://localhost:8080 --pay-to 0xYourWallet --price 0.005
View on GitHub Quickstart

Cloudflare's Monetization Gateway, except it's open, self-custodial, works in front of anything, and you can use it today.

How it works

Request → 402 → paid → forwarded

Farebox speaks the open x402 payment protocol over plain HTTP. No accounts, no API keys, no dashboard — just a proxy that charges a fare.

1

Agent calls your endpoint

Any x402-capable client hits the Farebox URL like a normal HTTP request.

2

Farebox answers 402

HTTP 402 Payment Required with x402 v2 payment requirements: price, asset, your payTo address.

3

Agent pays the fare

The client signs a USDC payment on Base (or Base Sepolia for testing) and retries with the payment attached.

4

Request forwarded, you get paid

Farebox verifies, settles, and proxies the request upstream. USDC lands in your own wallet.

Features

Non-custodial by construction

Farebox never holds funds and never asks you to sign up for anything. It's a proxy, not a platform.

[$]Self-custodial

Payments settle directly to the --pay-to wallet you choose. Farebox never touches, pools, or escrows your money. There is no balance to withdraw because the money was never anywhere else.

[⚡]Self-settled — no facilitator

With --settler-key, Farebox broadcasts the USDC transferWithAuthorization itself from your own gas wallet. No third-party facilitator, no API keys, no accounts. Gas on Base is a fraction of a cent.

[→]Works in front of anything

A $5 VPS, a localhost tunnel, Railway, a Python script, an MCP server — if it speaks HTTP, you can put a fare on it. No Cloudflare account, no AWS, no waitlist.

[x402]Open standard

Compatible with the open x402 standard (the Coinbase/Cloudflare x402 Foundation, now under a Linux Foundation body). Any x402-paying agent — including ones built on Cloudflare's Agents SDK — can pay a Farebox endpoint.

Comparison

The honest table

The big clouds are building agent-payment gateways too. Here's where Farebox stands, plainly.

Farebox Cloudflare Monetization Gateway AWS
Works outside their cloud Yes — any HTTP endpoint No No
Self-custodial Yes — pays your wallet directly No No
Available today, no waitlist Yes No No
Open source Yes (MIT) No No
Per-request USDC to your wallet Yes No No

Cloudflare and AWS offerings as publicly described at time of writing. No affiliation or endorsement implied.

Quickstart

Selling in one command

Install globally with npm i -g farebox, or just use npx.

Seller — put a fare in front of your API

shell
# proxy localhost:8080 at $0.005/request, paid in USDC on Base
npx farebox --target http://localhost:8080 --pay-to 0xYourWallet --price 0.005

# optional: self-settle from your own gas wallet — no facilitator at all
npx farebox --target http://localhost:8080 --pay-to 0xYourWallet --price 0.005 --settler-key 0xGasWalletKey

Buyer — any standard x402 client just works

buyer.js
import { wrapFetchWithPayment } from "@x402/fetch";

const fetchWithPay = wrapFetchWithPayment(fetch, walletClient);

// 402 is handled automatically: sign, pay, retry
const res = await fetchWithPay("https://api.example.com/data");
console.log(await res.json());

FAQ

Questions, answered

What is x402?
x402 is an open standard for machine-to-machine payments over HTTP, built around the long-reserved 402 Payment Required status code. A server answers 402 with payment requirements; the client pays (USDC on Base, in Farebox's case) and retries. It was started by Coinbase and Cloudflare and the x402 Foundation now sits under a Linux Foundation body. Farebox implements x402 v2.
Do buyers need ETH?
No. The buyer only signs a USDC transferWithAuthorization — they never submit a transaction, so they need no ETH for gas. Settlement pays the gas: in self-settle mode that's your --settler-key wallet, and gas on Base costs a fraction of a cent.
Where does the money go?
Straight to the wallet you pass as --pay-to. Farebox is non-custodial and never holds funds — there's no platform balance, no payout schedule, no withdrawal step. USDC lands in your own wallet per request.
What does it cost?
Farebox itself is free and open source (MIT). The only cost is sub-cent Base gas, and only in self-settle mode, paid from your own gas wallet.
Which chains?
USDC on Base (and Base Sepolia for testing), plus USDG on Robinhood Chain — where no public x402 facilitator exists, so Farebox's self-settlement is the only way to run x402 there. The first x402 payment on Robinhood Chain was a Farebox fare. More EVM chains are straightforward to add; the 402 response can offer several networks at once.
Does it work with MCP servers?
Yes. Farebox sits in front of any HTTP endpoint, and that includes MCP servers. If an agent can reach it over HTTP, you can charge a fare for it.