Open-source payment infrastructure for AI agents.
x402 Β· AP2 Β· MCP Β· KYA Β· Multi-Gateway Β· Self-hosted
β Star us on GitHub β help AI agents pay each other.
NullState is open-source (MIT) and self-hosted. Support independent AI infrastructure:
- GitHub Sponsors: github.com/sponsors/NullStateGGH
- Direct USDC: x402 to
34.173.171.16:8080 - Star the repo β helps us get discovered
All sponsor funds go toward GCP server costs ($30/mo) and free-tier AI inference for indie devs.
NullState is a self-hosted, open-source payment and commerce layer purpose-built for AI agents. It lets agents discover work, execute tasks, and settle payments β automatically β across crypto (x402/USDC) and fiat (Stripe/PayPal/Google Pay) rails.
Think "Stripe for AI agents" β but open source, self-hosted, and you keep 100% of your revenue.
| Feature | Description |
|---|---|
| Google Pay | Pay with Google Wallet β backs into Stripe for processing |
| GCP Marketplace | List NullState on Google Cloud Marketplace for enterprise billing |
| Multi-Gateway Payments | Stripe, PayPal, Coinbase Commerce, Solana USDC β all in one interface |
| Finance/BDM Subagent | Autonomous revenue tracking, pricing optimization, API key provisioning |
| Instant Paid AI Tasks | $5 analysis, $10 content gen, $15 research, $25 email campaigns |
| RapidAPI Integration | Ready-to-list OpenAPI spec for 4M+ developer marketplace |
| OpenRouter Provider | Sell self-hosted inference through 400+ model marketplace |
# Clone
git clone https://github.com/NullStateGGH/nullstate.git
cd nullstate
# Start all services
docker compose up -d
# Check health
curl http://localhost:8080/health
# Run the AP2 handshake demo
curl -X POST http://localhost:8080/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"execute_ap2_handshake","arguments":{"caller_identity":"demo_agent"}}}'
# See settlement in the ledger
curl http://localhost:8080/health | jq .ledger ββββββββββββββββββββββββββββββββββββββββββββββββ
β NullState Gateway (:8080) β
β x402 Β· AP2 Β· MCP Β· KYA Β· Multi-Gateway β
ββββββββ¬βββββββββββββββ¬βββββββββββββββ¬ββββββββββ
β β β
ββββββββββββββΌβββββββ ββββββΌβββββββ βββββΌβββββββββββ
β Model API β β MCP Serverβ β Finance/BDM β
β (:8082) β β (:8081) β β Subagent β
β Ollama-backed β β 5 tools β β Revenue Ops β
βββββββββββββββββββββ βββββββββββββ ββββββββββββββββ
β β
ββββββββ¬ββββββββ
βΌ
ββββββββββββββββββββββββββββ
β Payment Gateways β
β Stripe Β· PayPal Β· Coinbaseβ
β Solana Β· Google Pay Β· GCPβ
ββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββ
β Revenue Ledger β
β SQLite Β· auto-backup β
β 5-deep rotation Β· WAL β
ββββββββββββββββββββββββββββ
| Gateway | Fiat/Crypto | Fee | Status |
|---|---|---|---|
| Stripe | Cards (USD) | 2.9% + $0.30 | β Live (mock fallback) |
| PayPal | PayPal balance | 3.49% + $0.49 | β Live (mock fallback) |
| Google Pay | Google Wallet | 2.9% + $0.30 | β Live (mock fallback) |
| Coinbase | USDC (Base) | 0% | β Live (mock fallback) |
| Solana | USDC (native) | 0% | β Always live |
| GCP Marketplace | GCP billing | 5% | β Enterprise |
All gateways fall back gracefully when API keys are not configured β your endpoints always work.
| Product | Price | Margin | Description |
|---|---|---|---|
| AI Analysis | $5/task | ~99% | Deep document/code analysis via Ollama |
| Content Gen | $10/task | ~99% | SEO-optimized content generation |
| Research | $15/task | ~99% | Competitive intelligence reports |
| Email Campaign | $25/task | ~99% | Full campaign with Mail relay |
| Model Inference | $0.0005/1K tok | ~99% | General-purpose LLM (Ollama, $0 cost) |
| AP2 Settlement | $0.025/task | ~99% | Agent-to-agent payment protocol |
Infrastructure cost: $0 for inference (self-hosted Ollama) Β· $5/mo for VPS
| Protocol | Use Case | Endpoint | Status |
|---|---|---|---|
| x402 | Crypto micropayments (HTTP 402) | GET /get_solution β 402 β POST /webhook |
β Live |
| AP2 | Enterprise agent-to-agent payments | POST /api/v1/ap2/checkout Β· /charge |
β Live |
| MCP | AI agent tool integration | POST /mcp (JSON-RPC proxy) |
β Live |
| KYA | Agent identity (RSA-2048 challenge) | GET /kya/challenge |
β Live |
See it running in production at greensol.me/nullstate:
- π 12 systemd services Β· 9 active
- π 2,179 tasks processed Β· 2,338 ledger entries
- π° $90.16 USDC settled
- π€ Self-hosted Ollama (gemma4:31b, 131K context)
# Live instance health
curl -sk https://localhost:8080/health
# Get KYA identity token
curl -sk https://localhost:8080/kya/challenge
# Browse paid AI tasks
curl -sk https://localhost:8080/api/v1/tasks/catalog
# List available payment gateways
curl -sk https://localhost:8080/api/v1/gateways- Multi-gateway payments (Stripe, PayPal, Coinbase, Solana, Google Pay)
- GCP Marketplace integration
- Finance/BDM autonomous subagent
- Instant paid AI tasks
- KYA identity + rate limiting
- AP2 3-way handshake protocol
- MCP server with 5 tools
- RapidAPI marketplace listing
- OpenRouter model provider
- Enterprise SSO / SAML
- Multi-tenant agent workspace
- On-chain Solana settlement verification
Copy .env.example and set your keys:
cp .env.example .env
# Required: nothing β runs fully in mock mode
# Optional: add STRIPE_SECRET_KEY, PAYPAL_CLIENT_ID, etc. for live paymentsKeys are optional β NullState runs fully in mock/demo mode without any API keys. Add them when you're ready to go live.
Full docs at greensol.me/nullstate/docs:
See CONTRIBUTING.md to get started. We welcome PRs, issues, and feedback.
Quick ways to help:
- β Star the repo
- π Open an issue for bugs or feature requests
- π Improve documentation
- π Build an integration or extension
- π¬ Share on X, Dev.to, or Hacker News
MIT β see LICENSE.
Built for the agent economy. Agents deserve to pay each other.