> ## Documentation Index
> Fetch the complete documentation index at: https://docs.faremeter.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Why Faremeter

> Design philosophy and motivation behind faremeter.

## The problem

Agent-to-agent and agent-to-API payments require too much blockchain knowledge. Developers who want to charge for an API or pay for one should not need to understand gas fees, transaction signing, or chain-specific quirks.

Existing payment libraries tend to be monolithic, opinionated about which chain to use, and tightly coupled to a single wallet or provider.

## The approach

Faremeter uses HTTP as the payment layer. When a server requires payment, it responds with `402 Payment Required`. The client handles the payment transparently and retries the request. No special protocols, no WebSockets, no SDKs on both sides. Just HTTP.

```
Client                    Server                  Facilitator
  |                         |                         |
  |--- GET /resource ------>|                         |
  |<-- 402 + requirements --|                         |
  |                         |                         |
  |  (sign payment locally) |                         |
  |                         |                         |
  |--- GET /resource ------>|                         |
  |    + X-PAYMENT header   |--- verify + settle ---->|
  |                         |<-- confirmation --------|
  |<-- 200 + data --------- |                         |
```

## Design principles

**Composable** -- Use `@faremeter/rides` for the simplest path, or compose `@faremeter/fetch` with specific wallet and payment packages for full control. Every package works independently.

**Unopinionated** -- Faremeter does not prescribe a chain, wallet, or framework. Plug in Solana, EVM, or both. Use Express, Hono, or bring your own. Swap wallets without changing business logic.

**Standards-agnostic** -- Built on the x402 protocol, compatible with Coinbase x402, Cloudflare Pay-Per-Crawl, and L402. New standards can be supported through the payment handler plugin interface.

**Pragmatic** -- Faremeter uses facilitators to abstract blockchain complexity. Merchants never touch private keys or gas fees. Clients sign locally; facilitators settle on-chain.

## Architecture

```
@faremeter/rides          (high-level, zero-config)
    |
@faremeter/fetch          (pluggable fetch wrapper)
    |
@faremeter/payment-*      (chain-specific payment schemes)
    |
@faremeter/wallet-*       (wallet adapters for signing)
```

Each layer can be used independently. `rides` composes the layers below it automatically. Developers who need control drop down to `fetch` and wire up their own handlers.

## From single API to marketplace

The same composable layers scale up to a multi-tenant proxy. The [Marketplace](/marketplace/overview) section describes the OSS components — control plane, API nodes, discovery service, and the [`@faremeter/gateway-nginx`](/marketplace/gateway) SDK — that an operator runs to host many publishers' APIs behind shared infrastructure. Clients consume marketplace APIs with the same `@faremeter/rides` they use for any other x402-protected URL.
