LIVE
Nirium← Home
Package + API + MCP

Build on
Nirium

B2B Infrastructure: TypeScript package, 86 REST endpoints, MCP server for Claude/Cursor, and native support for x402 micropayments (MPP Charge client: experimental).

bash
npm install nirium
Non-Custodial
Institutional Grade
SCF INSTAWARD
COC COMPLIANT

Provisioning: 5 Lines

Autonomous corporate rebalancing (USDC to CETES) on mainnet, invite-only while legal review concludes.

typescript
import { Agent } from "nirium"; const agent = new Agent({ apiKey: process.env.NIRIUM_API_KEY, baseUrl: "https://nirium-agent.fly.dev", }); // Live market data - rates attributed to their source const market = await agent.getMarket(); // The node catalog: what runs, on which network const nodes = await agent.getNodes(); // Anchor evidence to IPFS and get a verifiable CID back const { cid } = await agent.anchorAuditRecord({ hash: "<sha256>" });

B2B Micropayments for Agents

x402 for API-level atomic payments. MPP Charge (experimental, not available on mainnet) for per-request settlement without an external facilitator.

x402 - Atomic Per-call Payment

Linux Foundation Standard

typescript
import { Agent } from "nirium"; const agent = new Agent({ baseUrl: "https://nirium-agent-mainnet.fly.dev" }); // PAY for someone else's API. The 402, the signature and the retry // happen underneath - you just await a fetch. agent.initX402({ secretKey: process.env.STELLAR_SECRET_KEY, // or { signer } from a wallet network: "stellar:pubnet", }); const res = await agent.x402Fetch( "https://nirium-agent-mainnet.fly.dev/api/v1/premium/market", // $0.05 USDC ); const data = await res.json(); // ───────────────────────────────────────────────────────────── // CHARGE for YOUR OWN API. Same rail, other side of the counter. // Funds go payer → you. They never touch Nirium. // Third-party facilitator use is invite-only while legal review closes - // same gate as Treasury and Payouts. Request access before integrating. import { x402Serve } from "nirium"; app.use("/premium", x402Serve({ payTo: "G...", // your Stellar address routes: { "GET /signals": "$0.02" }, facilitatorApiKey: process.env.X402_FACILITATOR_API_KEY, }));
No CustodianAtomic On-chain

Known limitation: x402Serve() verifies and settles the payment; it does not deduplicate a payment proof across requests or rate-limit callers. Add your own protection if you need either. issue #91

Pay per request

The same wallet that signed you in can pay for an API call. $0.02 USDC, no card, no subscription - and no XLM: Pollar sponsors the account reserve and the x402 facilitator sponsors the network fee.

MPP - Corporate Settlement

Stripe/Tempo Spec

typescript
import { Agent } from "nirium"; // MPP Charge client (experimental): the server answers 402 with a challenge, // the client signs a full USDC transfer and retries. No external facilitator. // Nirium's hosted testnet endpoint accepts MPP Charge (verified 15 Oct 2026). // Mainnet is not tested; for paid access on mainnet, use x402. const agent = new Agent({ apiKey: "unused" }); agent.initMpp({ secretKey: process.env.STELLAR_SECRET_KEY, mode: "pull" }); // testnet key with USDC const res = await agent.mppFetch("https://nirium-agent.fly.dev/api/v1/mpp/signals");
Balance ReturnedIdeal for Agents
EndpointPriceNetwork
GET /api/v1/premium/signals$0.02Testnet onlyneeds the autonomous loop, disabled on the mainnet box
GET /api/v1/premium/market$0.05Mainnet + testnet
POST /api/v1/premium/execute$0.25Testnet onlyneeds a signing key the mainnet box deliberately does not hold
GET /api/v1/mpp/signals$0.02testnet: verified 15 Oct 2026 · mainnet: not testedsettled payments on Horizon testnet; for paid access on mainnet, use x402
GET /api/v1/mpp/market$0.05testnet: verified 15 Oct 2026 · mainnet: not testedsettled payments on Horizon testnet; for paid access on mainnet, use x402
POST /api/v1/mpp/execute$0.25implemented, not testedno MPP payment has been sent to this route yet; use x402
Featurex402MPP ChargeMPP Channel
On-chain tx per call✓✓✗
Requires SaaS facilitator✓✗✗
Institution needs XLM✗Opt.✓
Optimized forRapid IntegrationNative B2B P2PHigh-Freq Settlement

The table compares the three protocols. Nirium runs x402 today, on testnet and mainnet; MPP Charge is experimental: verified on testnet (15 Oct 2026). MPP Channel requires a funded on-chain channel contract, so it stays behind the same external-audit gate as the treasury vault - the endpoints exist and report channel mode as disabled.

Console Integration (MCP)

MCP Server
Claude & Cursor

Connect your Claude Desktop or Cursor instance to your infrastructure in 2 minutes. Enable your node to manage corporate capital securely and auditably.

json
// Claude Desktop config (~/.claude/claude_desktop_config.json) { "mcpServers": { "nirium": { "command": "npx", "args": ["-y", "nirium-mcp"], "env": { "NIRIUM_API_KEY": "your_key_here" } } } }

11 Base Operations

get_market_state

Get live tickers: XLM/USDC price, base fee, Blend supply rate

get_loop_status

Check autonomous loop status, scan count, and uptime

start_loop

Start the autonomous market scanning loop (Auth)

stop_loop

Stop the autonomous market scanning loop (Auth)

execute_demo

Simulate a strategy via Soroban dry-run (Free)

get_premium_signals

Market signals from the autonomous loop, testnet only - factual data, not a recommendation ($0.02 USDC)

get_premium_market

Market state with reference rates attributed to their source, via x402 ($0.05 USDC)

execute_paid_strategy

Execute strategy on-chain via x402, testnet only - needs a signing key the mainnet box does not hold ($0.25 USDC)

+ 3 MORE TOOLS IN DOCUMENTATION
Live Protocol Surface v0.16.1

Telemetry Hub

86 Endpoints architected strictly for institutional autonomous routing and forensic export (for operators subject to Fintech Law).

Core B2B Infrastructure

GET
Live
/health

Liveness probe

GET
Live
/api/info

Agent metadata, network and version

GET
Live
/api/tickers

CETES + Blend reference rates

GET
Live
/api/nodes

Execution Node catalog (status + custody)

GET
Live
/api/loop/status

Autonomous loop state + last decision

POST
Live
/api/execute-demo

Run a demo rebalance - no key required

POST
Live
/api/auth/token

Exchange credentials for a JWT

POST
Live
/api/auth/keys

Issue an API key (also GET / DELETE)

Compliance Explorer

Auth & Security

POST/api/auth/token
CORE
POST/api/auth/keys
CORE
GET/api/health
LIVE
POST/api/authenticate
LIVE

Treasury Engine

POST/api/loop/start
PREMIUM
POST/api/loop/stop
CORE
POST/api/execute
PREMIUM
GET/api/loop/status
LIVE

Compliance & IPFS

POST/api/audit/log
LIVE
GET/api/audit/info
LIVE
GET/api/reporting/summary
LIVE
GET/api/reporting/export
LIVE

Market Intelligence

GET/api/market
LIVE
GET/api/tickers
LIVE
GET/api/strategies
LIVE
GET/api/signals/recent
LIVE

Disbursement & Nodes

GET/api/nodes
LIVE
POST/api/payroll/run
CORE
POST/api/payroll/submit
CORE
POST/api/payroll/onboard
CORE
+4
+8
+12
+16

+18 Modular subsystems for Institutional Orchestration

Soroban Mainnet Readiness

Hardened Execution Nodes

Non-custodial Soroban smart contracts deployed on Stellar Testnet.

NiriumVaultCore treasury: vaults, agent delegation, strategy execution, 2-of-3 multisig
CARTJIASVFHS4JJ24GVRO3XFQD37JCJEAXVPS7SPIWB3HLBXAYQ5SICV
NiriumProtocolUnified registry: ELO reputation, strategy marketplace, agent scoring, skill gate
CBKCTMTCCZQIPEESLHHEZKXYSPWNO24NEG33T2XSAAAHPISBND5CNSXX
CETES (Mexican Bonds)Government Bond Asset (Etherfuse)
CC72F57YTPX76HAA64JQOEGHQAPSADQWSY5DWVBR66JINPFDLNCQYHIC
USDC (Stellar Testnet SAC)Primary liquidity asset
CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA
Public Usage API

The same endpoint the stats page calls

Behind nirium.xyz/stats is one public, unauthenticated endpoint. Nothing about it is internal - call it directly and it returns the exact same JSON the page renders.

bash
curl https://nirium.xyz/api/stats

Server-rendered, cached 5 minutes (Cache-Control: s-maxage=300) - this is only to keep GitHub’s search rate limit off real traffic, not to mask staleness; generatedAt is a real per-request timestamp.

Top-level fields

x402SettlementsMainnet payments - totals, distinct payers, each labeled internal/external
treasuryRebalancesTreasury Node rebalance() calls, mainnet
auditTrailAnchorsIPFS anchor count from our own reporting API
npm / pypiDownload counts, read live from npmjs.org / pypistats.org
externalMergedPRsPRs merged by maintainers we don’t control
builtWithNiriumThird-party services selling over x402Serve(), independently checked

Every metric object carries its own source URL - the exact query that produced it, not a claim.

Infrastructure Requirements?

Start on testnet in 5 minutes, with a free API key.