A proxy service for LLM APIs (Claude/Anthropic) with micropayment support via Sui Tunnel.
- 🔐 Sui Wallet Authentication: Use your Sui private key as API key
- 💰 Micropayments: Pay-per-request with Tunnel escrow system
- 🔄 Anthropic Compatible: Drop-in replacement for
api.anthropic.com - 📊 Dashboard: Track usage and manage API keys
┌─────────────────────────────────────────────────────┐
│ Client (LuLuAI Mac App) │
│ x-api-key: mateapikey1... │
└─────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ LLM Service (Express) │
│ ├─ Verify signature │
│ ├─ Check balance │
│ ├─ Sign StateReceipt │
│ ├─ Proxy to Anthropic │
│ └─ Update usage │
└─────────────────┬───────────────────────────────────┘
│
┌─────────┴─────────┐
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Anthropic │ │ Sui Tunnel │
│ API │ │ (On-chain) │
└───────────────┘ └───────────────┘
# Install dependencies
npm install
# Setup database
npx prisma generate
npx prisma db push
# Run development server
npm run devPOST /v1/messages
Headers:
x-api-key: mateapikey1...
Body: (same as Anthropic API)# Generate new API key
POST /api/keys/generate
Body: { "suiAddress": "0x..." }
# Register existing key
POST /api/keys/register
Body: { "suiAddress": "0x...", "apiKey": "mateapikey1..." }
# List keys
GET /api/keys/:suiAddress# Register tunnel (after on-chain creation)
POST /api/tunnel/register
Body: { "suiAddress": "0x...", "tunnelObjectId": "0x...", "totalDeposit": "1000000" }
# Get status
GET /api/tunnel/status/:suiAddress
# Claim pending funds
POST /api/tunnel/claim
Body: { "tunnelObjectId": "0x..." }# Get dashboard data
GET /api/dashboard/:suiAddress
# Get usage logs
GET /api/dashboard/:suiAddress/usageThe API key is a Sui Ed25519 private key with prefix changed:
Original: suiprivkey1qr...
Our format: mateapikey1qr...
The key is used to:
- Derive public key for identity
- Sign StateReceipts for micropayments
Default: 0.1 USDC per request (configurable in pricing_configs table)
DATABASE_URL=postgresql://...
ANTHROPIC_API_KEY=sk-ant-...
PORT=3100
SUI_NETWORK=mainnet
PROVIDER_PRIVATE_KEY=suiprivkey...
TUNNEL_PACKAGE_ID=0x...
CREATOR_CONFIG_ID=0x...MIT