> ## 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.

# StellarX402: Per-Request HTTP Payments on Stellar Network

> StellarX402 lets you monetize any API endpoint with per-request crypto payments on Stellar — no accounts, no billing systems, no API keys required.

StellarX402 brings the x402 payment protocol to the Stellar blockchain, enabling any API or web service to charge per HTTP request. Clients — whether browsers, mobile apps, or AI agents — pay in USDC and receive the resource, all within a single HTTP round-trip. No signup flows, no subscription management, no billing integration.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Build a payment-gated endpoint and make your first paid request in minutes.
  </Card>

  <Card title="How It Works" icon="diagram-project" href="/how-it-works">
    Understand the x402 payment flow from HTTP request to Stellar settlement.
  </Card>

  <Card title="Protect an Endpoint" icon="lock" href="/guides/protect-an-endpoint">
    Add x402 middleware to your Express API and start charging per request.
  </Card>

  <Card title="AI Agent Payments" icon="robot" href="/guides/ai-agent-payments">
    Let AI agents discover and pay for services autonomously within spending limits.
  </Card>
</CardGroup>

## Why StellarX402?

StellarX402 turns any endpoint into a monetizable service. There's no billing dashboard to set up, no platform account for your customers to create, and no invoicing to manage. A client sends a payment-signed request; Stellar settles the transaction in roughly 5 seconds; your server delivers the resource.

<CardGroup cols={3}>
  <Card title="No Accounts Required" icon="user-slash">
    Clients pay directly with a compatible wallet — no registration or API key management.
  </Card>

  <Card title="5-Second Settlement" icon="bolt">
    Stellar finalizes transactions in \~5 seconds, making real-time micropayments practical.
  </Card>

  <Card title="AI-Native" icon="microchip">
    Designed for AI agents that need to autonomously discover and pay for services.
  </Card>

  <Card title="Any SEP-41 Token" icon="coins">
    Accept USDC or any SEP-41 compliant token on Testnet or Mainnet.
  </Card>

  <Card title="Sponsored Fees" icon="hand-holding-dollar">
    Facilitators sponsor Stellar network fees so your clients only pay the resource price.
  </Card>

  <Card title="Open Protocol" icon="lock-open">
    Built on the open x402 standard, governed by the x402 Foundation under Linux Foundation.
  </Card>
</CardGroup>

## Get Started

<Steps>
  <Step title="Install the x402 middleware">
    Add the x402 npm package to your Node.js API server.
  </Step>

  <Step title="Protect an endpoint">
    Wrap your route handler with the x402 middleware, set a price, and configure your Stellar address.
  </Step>

  <Step title="Choose a facilitator">
    Point your server at a facilitator — use the Coinbase facilitator on Testnet for zero-configuration testing, or deploy your own.
  </Step>

  <Step title="Make a paid request">
    Use a compatible wallet (Freighter, Albedo, or any auth-entry signing wallet) to pay and access protected content.
  </Step>
</Steps>

<Note>
  Not sure where to start? Follow the [Quick Start guide](/quickstart) to build a working paywall in under 10 minutes.
</Note>
