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

# Self-Facilitation

> The rare case where a seller acts as its own facilitator, and why you almost certainly should not do it.

Self-facilitation is the case where a resource server verifies and settles its own payments without a third-party facilitator. The x402 protocol allows it. StellarX402 does not encourage it.

## What you give up

* **Fee sponsorship.** Buyers now need XLM in addition to USDC. That kills most agent use cases.
* **Bazaar discovery.** Listings come from the facilitator's index. A self-facilitating server has to publish elsewhere, or be handed to agents out-of-band.
* **Neutral verification.** Buyers are trusting the seller with the verify decision. This raises the trust bar significantly — acceptable for internal APIs, uncomfortable for public ones.
* **Ops surface.** You now run a Stellar RPC client, a Soroban submit loop, and a sponsor account. See [Operator Guides](/guides/operators/configuration-reference).

## When it makes sense

* **Private internal APIs** where the caller and callee share a security context and payment is more accounting than commerce.
* **Regulated environments** where a third-party facilitator is not acceptable and buyers already trust the seller.
* **Research and demos** where the facilitator distinction adds noise you do not want.

## The interface

The `@stellarx402/facilitator` package exports the same verify/settle logic that the standalone facilitator uses. You can embed it:

```typescript theme={null}
import { LocalFacilitator } from "@stellarx402/facilitator";
import { requirePayment } from "@stellarx402/express";

const facilitator = new LocalFacilitator({
  network: "stellar:pubnet",
  rpcUrl: "https://mainnet-soroban.stellar.org",
  sponsorSecretKey: process.env.SPONSOR_SECRET_KEY!,
});

app.get("/data", requirePayment({
  facilitator, // pass the instance, not a URL
  ...
}), handler);
```

## The honest recommendation

Do not self-facilitate unless one of the three cases above applies to you. Use the hosted facilitator, or run your own [dedicated facilitator instance](/getting-started/quickstart-operators) that your servers point at over the network. It gives you almost all the control with none of the coupling.
