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

> ## Agent Instructions
> Rail402 is an x402 payment facilitator, Stellar-native Bazaar discovery layer, and agent tooling for the Stellar network. It currently targets stellar:testnet.
> The live testnet facilitator is https://facilitator.rail402.dev with endpoints /verify, /settle, /supported, /health, and /discovery/*.
> Payment amounts use 7-decimal SEP-41 integer (stroop) arithmetic. Never use floating-point math for amounts.
> Every rejection returns a machine-readable error code and a non-null human-readable reason. When explaining a failure, surface both.

# Rail402

> Settle pay-per-request x402 payments on Stellar, publish services that agents can find, and pay for them from code, the terminal, or an agent runtime.

Rail402 turns any HTTP endpoint into a paid resource on Stellar. A buyer sees the price, pays per
request, and gets access, with no checkout page, no API key, and no account. The buyer is usually an
agent. Rail402 settles the payment, catalogs the paid service into a searchable Bazaar, and lets
agents discover and pay for services they have never seen before.

It runs on `stellar:testnet` today at [`facilitator.rail402.dev`](https://facilitator.rail402.dev/supported),
free and with no API key.

## Why Stellar

A settlement costs a fraction of a cent, so a per-request micropayment is worth settling even when
the amount is tiny. USDC and other stablecoins are reachable from Soroban through the Stellar Asset
Contract, and the facilitator sponsors the network fee, so a buyer needs only the payment asset and
no XLM.

## What Rail402 gives you

<CardGroup cols={3}>
  <Card title="Facilitator" icon="circle-check">
    `verify`, `settle`, and `supported` for the `exact` and `upto` schemes. Sponsored fees,
    non-custodial settlement, any SEP-41 asset.
  </Card>

  <Card title="Bazaar" icon="magnifying-glass">
    A catalog and natural-language search over paid services. A resource is listed automatically when
    its first payment settles. No registration step.
  </Card>

  <Card title="SDK, CLI, and MCP" icon="cube">
    One SDK for buyers and sellers, a `rail402` command-line tool, and an MCP server so an agent can
    discover and pay from inside its runtime.
  </Card>
</CardGroup>

## Choose your path

<CardGroup cols={3}>
  <Card title="Buyers and agents" icon="wallet" href="/buyers/quickstart">
    Discover a service and pay for it per request, from code, the terminal, or an agent runtime.
  </Card>

  <Card title="Sellers" icon="store" href="/sellers/quickstart">
    Put a paid, x402-protected endpoint online and make it discoverable in the Bazaar.
  </Card>

  <Card title="Operators" icon="server" href="/operators/run">
    Run the facilitator, hosted for others or self-hosted for your own services.
  </Card>
</CardGroup>

New to x402 on Stellar? Read [How Rail402 works](/start/how-it-works) first. It defines the payment
loop, the `exact` and `upto` schemes, and the four addresses in play, in one page.

## Install and search in one minute

Every package is published under the `@rail402.dev` scope. The SDK is the front door for buyers and
sellers. Search needs no account; paying needs a funded testnet account (see the
[buyer quickstart](/buyers/quickstart)).

<CodeGroup>
  ```bash SDK theme={null}
  npm install @rail402.dev/sdk
  ```

  ```bash CLI theme={null}
  npx @rail402.dev/cli search "summarize a web page"
  ```
</CodeGroup>

See [Install and first payment](/start/quickstart) for the full five-minute walkthrough, or the
[Packages reference](/reference/packages) for the map of every package and which to use.

## What the facilitator advertises

The `/supported` endpoint is the ground truth for what a facilitator can do. This is the live response
from `facilitator.rail402.dev`:

```json theme={null}
{
  "kinds": [
    { "x402Version": 2, "scheme": "exact", "network": "stellar:testnet", "extra": { "areFeesSponsored": true } },
    { "x402Version": 2, "scheme": "upto", "network": "stellar:testnet", "extra": { "uptoContract": "CCMM3FMGEH7FHRYXZ3WQDQCTIWDXGZBGW7D4UT7NKH34SUQACYC3U54X", "areFeesSponsored": true } }
  ],
  "extensions": ["bazaar"],
  "signers": { "stellar:*": ["GBRVXNCL55KOEB7WU3BPSEL34PSUH63UCIFPZDUBIVJBRRG5ZB7V4YR7"] }
}
```

`areFeesSponsored: true` means the buyer needs no XLM. The `bazaar` extension means the facilitator
catalogs the services it settles. The `upto` kind carries the on-chain contract that enforces the
metered scheme.

## Built for interoperability

Rail402 builds verify and settle on the Apache-2.0 [`@x402/stellar`](https://www.npmjs.com/package/@x402/stellar)
package and speaks the x402 v2 wire format. A stock x402 client pays a Rail402 endpoint with no
Rail402-specific code, and reads the Bazaar through the same interface it uses for any facilitator.
The `@rail402.dev` helpers add convenience on top. You never have to use them to interoperate.

## See it live

The [Explorer](https://explorer.rail402.dev) shows x402 payments settled on Stellar across
facilitators, not only Rail402's, with the facilitator that settled each one. It is the fastest way
to watch a payment you just made land on chain.
