Skip to main content
StellarX402 lets you monetize any HTTP API endpoint by requiring a real crypto payment with every request — no accounts, no billing dashboards, no API keys. Built on the open x402 protocol and the Stellar blockchain, it turns payment into a single HTTP header that any client — browser, mobile app, or AI agent — can attach automatically.

What Is x402?

The HTTP 402 “Payment Required” status code has been reserved since 1991, but never formally standardized — until now. The x402 protocol, governed by the x402 Foundation (a Linux Foundation project), gives 402 a concrete meaning: when a client requests a protected resource without payment, the server responds with 402 Payment Required and a PaymentRequired header that describes exactly what is owed, in what token, on which network. The client reads that header, builds and signs a payment transaction, and re-sends the original request with an X-Payment header attached. A facilitator service verifies and settles the payment on-chain. From the end user’s perspective the entire exchange collapses into a single HTTP round-trip. StellarX402 implements x402 v2 on the Stellar blockchain, using USDC (SEP-41 compliant) as the default payment token, with ~5-second settlement finality and zero network fees for end users (facilitators sponsor fees on your behalf).

Key Use Cases

API monetization — Charge per call for any REST or GraphQL endpoint. Set prices in USDC down to the fraction of a cent, and collect revenue the instant each request is served. AI agent payments — Autonomous agents can discover, negotiate, and pay for resources programmatically without human intervention or pre-loaded API keys. x402’s machine-readable payment headers are a natural fit for agentic workflows. Micropayments — Traditional payment rails make sub-dollar transactions uneconomical. Stellar’s low-cost infrastructure makes per-request charges as small as fractions of a cent viable for the first time. Machine-to-machine (M2M) payments — IoT devices, data pipelines, and microservices can pay each other for resources on demand, turning internal cost centers into auditable, metered transactions.

Who Is StellarX402 For?

Get Started

Quickstart

Protect your first endpoint and make a paid request in under five minutes.

How It Works

Walk through the full x402 payment flow from HTTP request to blockchain settlement.

Protect an Endpoint

Add x402 middleware to your Express, FastAPI, or Next.js server.

API Reference

Full reference for the StellarX402 middleware, client SDK, and facilitator API.

Key Benefits

No Accounts or Keys

Clients pay with their Stellar wallet. You never issue API keys or manage subscriber records.

Instant Settlement

Payments settle on Stellar in ~5 seconds. Revenue arrives in your wallet before the response is fully transmitted.

Zero Fee Burden

Facilitators sponsor Stellar network fees, so neither you nor your users pay gas costs on top of the resource price.

Any Client, Any Platform

Works in browsers, mobile apps, and headless agents. Compatible wallets include Freighter, Albedo, Hana, HOT, Klever, and OneKey.

Open Protocol

x402 is governed by the x402 Foundation under the Linux Foundation — no vendor lock-in, no proprietary wire format.

Testnet & Mainnet

Switch between Stellar Testnet and Mainnet with a single config flag. Build and test without spending real USDC.