Private markets data for AI agents — per-call TON payments via Machine Payments Protocol
gpstakes-mpp is an early-stage Python project in the AI payments / x402 ecosystem. It currently has 0 GitHub stars and 0 forks.
Private markets intelligence for AI agents — pay per call in TON.
GP Stakes indexes 6,051 GP profiles, 8,822 fund performance records, 6,069 Oracle scores, 128 GP stakes deals, 23,238 BDC positions, and 165,539 RE transactions. This gateway exposes that data to AI agents via the Machine Payments Protocol (MPP) — pay-per-call access using TON.
Pitchbook charges $20,000+/year. Preqin charges $15,000+/year. These are annual subscriptions designed for human analysts.
AI agents need a different model: pay for what you use, per API call. GP Stakes MPP charges 0.01–0.5 TON per call (~$0.02–$1.00), with no subscription, no commitment, and no human in the loop.
┌──────────────┐ 402 / data ┌──────────────────┐ proxy ┌──────────────────┐
│ AI Agent │ ←──────────────────→ │ MPP Gateway │ ─────────→ │ GP Stakes API │
│ (any LLM) │ X-Payment-Proof │ :8800 │ │ :8000 │
└──────┬───────┘ └────────┬─────────┘ └──────────────────┘
│ │
│ pay TON │ verify tx
▼ ▼
┌──────────────┐ ┌──────────────────┐
│ TON Network │ │ TON Center API │
│ (testnet) │ │ (verification) │
└──────────────┘ └──────────────────┘
1. Agent: GET /api/search?q=blackstone
2. Server: 402 Payment Required
{
"x402Version": 1,
"accepts": [{
"network": "ton-testnet",
"recipient": "EQD...",
"amount": "10000000",
"asset": "TON",
"description": "GP Stakes directory search"
}],
"endpoint": "/api/search?q=blackstone",
"validFor": 600
}
3. Agent: sends 0.01 TON to recipient on TON testnet
4. Agent: GET /api/search?q=blackstone
Header: X-Payment-Proof: {"txHash": "<hash>", "network": "ton-testnet"}
5. Server: verifies tx on-chain → returns data
| Endpoint | Price | Description |
|---|---|---|
/api/search |
0.01 TON | Search GPs, funds, persons |
/api/fund/{id} |
0.05 TON | Fund performance & details |
/api/oracle/{gp} |
0.1 TON | GP Oracle quality score |
/api/deals |
0.1 TON | GP stakes deals & BDC positions |
/api/graph |
0.2 TON | Knowledge graph queries |
/api/bulk |
0.5 TON | Bulk data export |
# Install dependencies
pip install -r requirements.txt
# Copy and edit config
cp .env.example .env
# Run
uvicorn main:app --host 0.0.0.0 --port 8800
# Verify
curl http://localhost:8800/mpp/supported
curl http://localhost:8800/api/search?q=blackstone # → 402
GET / — Service infoGET /health — Health checkGET /docs — OpenAPI docsGET /mpp/supported — Full service catalog with pricingGET /mpp/pricing — Compact pricing tableGET /mpp/usage — Usage statisticsGET /api/search?q=<query> — Search directoryGET /api/fund/<fund_id> — Fund detailsGET /api/fund/<fund_id>/performance — Fund performance time seriesGET /api/oracle/<gp_name> — Oracle score + componentsGET /api/oracle — LeaderboardGET /api/deals?gp=<name>&type=<gp_stake|bdc> — Deal listingsGET /api/deals/<deal_id> — Deal detailsGET /api/graph?from=<entity>&relation=<type> — Knowledge graphimport httpx
import json
BASE = "http://localhost:8800"
# 1. Discover available data
catalog = httpx.get(f"{BASE}/mpp/supported").json()
print(f"Endpoints: {len(catalog['endpoints'])}")
# 2. Try a query → get 402
resp = httpx.get(f"{BASE}/api/search", params={"q": "blackstone"})
assert resp.status_code == 402
payment_info = resp.json()
# 3. Pay TON (pseudo-code — use your TON SDK)
tx_hash = send_ton(
to=payment_info["accepts"][0]["recipient"],
amount=int(payment_info["accepts"][0]["amount"]),
network="ton-testnet",
)
# 4. Retry with proof
resp = httpx.get(
f"{BASE}/api/search",
params={"q": "blackstone"},
headers={"X-Payment-Proof": json.dumps({"txHash": tx_hash, "network": "ton-testnet"})},
)
assert resp.status_code == 200
data = resp.json()
print(f"Found {data['total']} results")
All settings via environment variables (see .env.example):
| Variable | Default | Description |
|---|---|---|
TON_RECIPIENT |
EQD... |
Wallet receiving payments |
TON_NETWORK |
ton-testnet |
Network identifier |
TONCENTER_API |
testnet URL | TON Center API base |
TONCENTER_API_KEY |
(empty) | Optional API key for higher rate limits |
UPSTREAM_URL |
http://127.0.0.1:8000 |
GP Stakes API |
RATE_LIMIT_REQUESTS |
60 | Max requests per window per payer |
RATE_LIMIT_WINDOW_SECONDS |
60 | Rate limit window |
TX_MAX_AGE_SECONDS |
900 | Max age of accepted transactions |
python3 -m pytest tests/ -v
/opt/gpstakes-mpp/
├── main.py # FastAPI app with lifespan
├── config.py # Settings from env
├── mpp/
│ ├── middleware.py # Payment gate middleware
│ ├── verify.py # On-chain TON tx verification
│ ├── pricing.py # Pricing tiers
│ ├── usage.py # Billing, replay protection, rate limiting
│ ├── proxy.py # Upstream API proxy
│ └── types.py # Pydantic models
├── routes/
│ ├── discovery.py # /mpp/* — catalog, pricing, usage
│ ├── search.py # /api/search
│ ├── fund_data.py # /api/fund/*
│ ├── oracle.py # /api/oracle/*
│ ├── deals.py # /api/deals/*
│ ├── graph.py # /api/graph
│ └── _mock.py # Mock data (fallback)
├── data/
│ └── usage.db # SQLite billing database (auto-created)
├── tests/
│ └── test_mpp.py # 29 tests
├── requirements.txt
├── .env.example
└── README.md
TypeScript Interface for Machine Payments Protocol
Alephant is an open-source AI Agent Gateway for routing, tracking, and controlling LLM usage across AI agents, members, and workflows, and for publishing agent capabilities as paid endpoints with x402 and MPP payment rails.
Specifications for the Machine Payments Protocol - powered by the "Payment" HTTP authentication scheme
Rust SDK for the Machine Payments Protocol
Website for the Machine Payments Protocol
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.