MARKET
x402 on Stellar · testnet + mainnet

Payment, audit and execution rails on Stellar.

For apps, backends and AI agents. Decide before you sign, charge per request, prove every move. Non-custodial: your keys, your funds.

2 SCF Instawards

How it works

One payment, end to end

  1. 1
    Step 1/5

    An app, a backend or an AI agent requests your API.

  2. 2
    Step 2/5

    Before it signs anything, your policy engine says allow, wait for a human, or deny.

  3. 3
    Step 3/5

    Only on allow does it sign the payment - testnet today.

  4. 4
    Step 4/5

    x402Serve() checks it and lets the request through.

  5. 5
    Step 5/5

    It settles on Stellar in ~5 s - and if you anchor it, anyone can verify the receipt from the CID alone.

POLICY

Pay with your own policy

Before your agent signs a payment, Nirium asks your policy engine.

client.js
// excerpt - call() is your own HTTP helper to your policy engine
agent.initX402({
  signer, network: "stellar:testnet",
  policy: {
    requireExpiry: true,
    evaluate: (ctx, { signal }) =>
      call("decide", { method: "POST", body: JSON.stringify(ctx), signal }),
    currentVersion: async (_ctx, { signal }) =>
      (await call("version", { signal })).policyVersion,
    onDecision: (record) =>
      call("outcome", { method: "POST", body: JSON.stringify(record) }),
  },
});

New in 0.16.0 · experimental - the shape may change before 1.0. Tested on testnet, engine-neutral by design (no smart account required on your side).

The hook itself doesn't resolve concurrent requests - your engine does. AgentLedger's does it atomically (verified 2026-10-09, testnet). Code running in the same process as the raw signer can still sign around the hook - that gap (L02) is still open.

Three decisions, verified against Horizon

Integration test coordinated with AgentLedger.

CHARGE

Charge per request

One middleware, and your API charges per call.

server.js
import express from 'express';
import { x402Serve } from 'nirium';

const app = express();
app.use(x402Serve({
  payTo: process.env.PAY_TO,                       // your G... address
  facilitatorApiKey: process.env.FACILITATOR_KEY,  // free testnet key
  routes: { 'GET /weather': '$0.05' },             // testnet by default
}));
app.get('/weather', (_req, res) => res.json({ tempC: 21 }));
app.listen(3000);

Ran verbatim with nirium@0.18.0 on testnet (9 Nov 2026): 402, then paid, then 200.

Open to everyone on testnet. Nirium's own endpoint answers 402 on mainnet; its last payment settled on 29 Sep 2026. Charging on your own API (x402Serve) on mainnet is not something we promote for third parties while the legal review closes.

01 Install
npm i nirium express @x402/express @x402/core @x402/stellar
02 Get a key

Free testnet facilitator key from OpenZeppelin.

channels.openzeppelin.com/testnet/gen
03 Pay it

Any x402 client works, from a testnet account with USDC.

Also ships: replay guard + rate limit, opt-in since 0.15.0
PROOF

Prove every payment

Any settlement can become a receipt anyone can check from a hash alone.

audit-log.http
POST /api/audit/log

// example request, not a live anchor:
{ "hash": "sha-256:e3b0c442...", "tag": "invoice-2026-07" }

Live on mainnet · free during beta.

Verify a signed mainnet anchor (our own test, 2026-10-21)

Legal notice - Nirium is B2B software-only infrastructure and never custodies funds; financial services (SPEI onramp, CETES custody) are operated by regulated third parties. Read full legal notice →

Set the policy, charge per call, prove every payment.

Start on testnet in five minutes. Nirium's own endpoint answers 402 on mainnet; third-party mainnet use is not something we promote while legal review stays open.

See live usage

Built on Open Standards

x402•MPP (testnet)•Apache 2.0•Stellar Mainnet+Testnet

All rate data shown is protocol reference information only - not a return projection or guarantee.