Multi-agent AI marketplace on Stellar Testnet with x402-protected premium endpoints, budget guardrails, and on-chain payment verification.
StellarMind demonstrates a production-style pattern for agent commerce:
- agents can call each other through paid APIs
- payment is enforced by protocol (
x402), not trust alone - spending is controlled with explicit budget policies
- every paid step can be verified on-chain
- Orchestrator that decomposes tasks and routes work to specialized agents
- Premium agent endpoints protected by
@x402/express - Automatic payment handling via
@x402/fetchand Stellar settlement - Real-time event stream (SSE) in the web dashboard
- Demo automation pipeline for recording and narrated video export
Client Task + Budget
|
v
Orchestrator (plan, select agents, enforce spend limits)
|
v
/api/premium/* endpoints (x402-protected)
|
v
402 challenge -> signed payment -> facilitator verification
|
v
Agent execution + streamed updates + tx proof links
git clone https://github.com/Flamki/stellarmind.git
cd stellarmind
npm installcp .env.example .envWindows PowerShell:
Copy-Item .env.example .envThen either:
- run
npm run setupto generate testnet wallets automatically, or - manually fill wallet fields in
.env
Add your Anthropic key:
ANTHROPIC_API_KEY=sk-ant-your-keyOptional for deployments:
# Defaults to http://localhost:3001 in local dev
INTERNAL_BASE_URL=http://server:3001npm run setup:usdcnpm run devOpen http://localhost:3001.
Because INTERNAL_BASE_URL defaults to http://localhost:$PORT, local demo setup stays one-command simple: npm run dev.
The orchestrator uses INTERNAL_BASE_URL for its paid internal calls to /api/premium/*.
- Local development: leave
INTERNAL_BASE_URLunset and runnpm run dev - Single container / Docker Compose: set
INTERNAL_BASE_URL=http://<service-name>:3001 - Remote or reverse-proxied deployment: set
INTERNAL_BASE_URLto the server origin the orchestrator can actually reach, for examplehttps://stellarmind.example.com
Examples:
# Local
PORT=3001
# Docker Compose
PORT=3001
INTERNAL_BASE_URL=http://stellarmind:3001
# Remote deployment behind HTTPS
PORT=3001
INTERNAL_BASE_URL=https://stellarmind.example.comStellarMind exposes lightweight endpoints for deployment tooling and load balancer probes:
GET /healthz- returns
200andstatus: okwhen the process is alive - no external dependency checks are performed
- returns
GET /readyz- returns
200when the configured critical components are ready - returns
503when required configuration is missing
- returns
Example /readyz response:
{
"status": "ready",
"ready": true,
"timestamp": "2026-05-28T12:00:00.000Z",
"components": {
"app": { "ready": true, "description": "Core HTTP server initialized" },
"anthropic": { "configured": true, "ready": true, "description": "Anthropic API key is configured for Claude-powered agents" },
"x402": { "enabled": true, "ready": true, "description": "x402 payment wallet is configured" }
}
}| Command | Purpose |
|---|---|
npm run dev |
Start local server |
npm run demo |
Run end-to-end demo flow |
npm run preflight |
Validate readiness (x402, wallets, model, payment path) |
npm run setup |
Generate/fund Stellar testnet wallets |
npm run setup:usdc |
Add USDC trustlines for settlement |
npm run record:video |
Capture website-only demo video |
npm run voiceover |
Generate narration track |
npm run record:narrated |
Full narrated demo render pipeline |
npm run preflightreaches ready state- main run shows live orchestration events
- at least one transaction hash resolves in Stellar Expert
- low-budget run demonstrates step skipping
- final narrated video is exported and reviewed
Before pushing to GitHub:
- Do not commit
.envor wallet secrets. - Rotate any key that was ever exposed in terminal logs or screenshots.
- Keep only
.env.examplein version control. - Review staged files with
git statusandgit diff --staged. - Verify no private keys are present in docs, recordings, or commits.
This repo includes:
- strict secret-ignore defaults in
.gitignore - a GitHub Actions secret scan workflow (
.github/workflows/secret-scan.yml) - a dedicated security policy (
SECURITY.md)
src/
agents/
orchestrator.js
registry.js
services.js
stellar/
wallet.js
config.js
server.js
demo.js
demo-preflight.js
setup-wallets.js
setup-usdc.js
record-demo-video.js
generate-demo-voiceover.js
render-narrated-demo.js
public/
index.html
Read CONTRIBUTING.md before opening a PR.
MIT. See LICENSE.