Skip to main content
It is built on the x402 protocol and the HTTP 402 Payment Required standard, with support for MPP (Machine Payments Protocol) via an x402v2 adapter.
pnpm add @faremeter/rides
import { payer } from "@faremeter/rides"

await payer.addLocalWallet(process.env.PAYER_KEYPAIR_PATH)
const response = await payer.fetch("https://helius.api.corbits.dev")
Faremeter handles wallet detection, payment negotiation, and settlement transparently. Your code makes HTTP requests. Faremeter handles the payments.
Want to skip setup and start experimenting? The TypeScript Playground is a pre-configured monorepo with all @faremeter/* packages ready to import. Clone it, run pnpm install, and start building under apps/.

Not a developer?

Faremeter is a reference implementation of the x402 protocol — an open standard for paying for HTTP resources. Think of it like how a web browser implements the HTTP standard: x402 defines the rules, and faremeter is one set of tools that follows them. Here is what happens when a machine pays for an API call:
  1. A program requests data from a server.
  2. The server says “that costs $0.01” (HTTP 402 response).
  3. The program signs a payment using its wallet — no human involved.
  4. The program retries the request with the payment attached.
  5. A facilitator verifies the payment and settles it on a blockchain.
  6. The server delivers the data.
This enables machine-to-machine payments without accounts, API keys, invoices, or manual approval. AI agents, IoT devices, and automated pipelines can pay for resources the same way humans pay for subscriptions — except instantly and per-request. Faremeter works with both Solana and EVM blockchains (like Base), using stablecoins like USDC so prices are predictable.

Packages

Faremeter is modular. Use what you need.
PackagePurpose
@faremeter/ridesHigh-level SDK. Three lines to pay for an API.
@faremeter/fetchFetch wrapper with pluggable payment handlers.
@faremeter/middlewareServer middleware for Express and Hono.
@faremeter/payment-solanaSolana payment schemes (SOL, SPL tokens).
@faremeter/payment-evmEVM payment schemes (EIP-3009 gasless USDC).
@faremeter/wallet-*Wallet adapters (keypair, private key, Crossmint, Squads, Ledger).
@faremeter/facilitatorRun your own payment facilitator.
@faremeter/infoNetwork and asset lookups.
@faremeter/typesTypeScript types with runtime validation.

Next steps

Why Faremeter

Design philosophy and motivation.

Quick Start

Make your first payment in three steps.

Concepts

Understand the x402 protocol and payment flow.

Recipes

Complete working examples for common use cases.