Agents can't sign up, can't hold a credit card, and can't wait for an invoice. stellarpay is
a set of npm packages that let them just pay: one config object gates a route behind
x402 or MPP, and one client auto-pays any 402 it meets, within
spend limits you set.
@stellarpay-sdk.
The demos below exist to prove the SDK works against real testnet money; they're not the
product.
# one seller and one buyer, both real npm install @stellarpay-sdk/express # or /hono, /fastify npm install @stellarpay-sdk/client
Request → Response handler.app.use(stellarpayExpress(cfg)).createPayingFetch() — a fetch that transparently pays any 402, x402 or MPP, with hard spend caps.import { stellarpay } from "@stellarpay-sdk/core"; import { stellarpayExpress } from "@stellarpay-sdk/express"; const paywall = stellarpay({ network: "stellar:testnet", payTo: "G…", routes: { "GET /weather": { price: "$0.001" }, }, }); app.use(stellarpayExpress(paywall)); // before routes
import { createPayingFetch } from "@stellarpay-sdk/client"; const payFetch = createPayingFetch({ secret: process.env.AGENT_SECRET, network: "stellar:testnet", limits: { maxPerCall: "$0.01", maxTotal: "$1.00" }, }); // 402 → pays → retries. Your code never sees it. await payFetch("https://api.example/weather");
Change scheme on a route to settle over MPP instead of x402 — including
server-sponsored gas, so the buyer pays no fees. Nothing else in your app changes.
All seven run live on Stellar testnet right now, selling real Horizon data for real money. Press the button on the dashboard and an autonomous agent goes shopping across them.
The flagship seller: a free route, an x402 route, and an MPP route with sponsored gas — all from one config. Asset reports and account forensics.
visit ↗Whale alerts, paywalled in a six-line diff. The proof that adding payments to an existing API is a config change, not a rewrite.
visit ↗Live fee and congestion stats over MPP — a third framework, to show the adapter layer is genuinely thin.
visit ↗An MCP server with individually priced tools. The payment is the tool call — no API keys, no subscription, settled in-protocol.
visit ↗A Claude-driven buyer with a funded wallet and a hard budget. It decides what intel it needs and buys it — the only service here that consumes the SDK rather than exposing it.
drive it ↗Mission control: a live receipt feed, a per-example runner, a chat you can talk to the agent through, and an on-chain verify link on every row.
open ↗Getting paid without learning who paid you. Payment arrives from a shielded pool, so the seller can prove it was paid and still can't identify its customer. One shielded transfer opens a credit line; requests then cost 0.4s and nothing on-chain. Pick the shielded ◆ target on the dashboard and watch a full cycle settle.
run it live ↗ · read the writeup ↗onPayment hook fires with a receipt carrying the real transaction hash — verifiable on any block explorer.An autonomous agent, a live feed, and a transaction hash you can check yourself.
▶ TRY IT YOURSELF