LemonCake - Monetização de APIs com Pagamento por Chamada
evidai/agent-payment-mcp
Monetize APIs HTTP via MCP com pagamento automático de agentes IA
Ver no GitHubMCP server que permite monetizar APIs HTTP e servidores MCP através de um sistema de pagamento por chamada em USDC. Agentes de IA pagam automaticamente por chamadas de API usando tokens de gastos limitados, sem necessidade de carteira cripto ou assinaturas. Inclui 3.000 chamadas gratuitas no modo demo para experimentação.
Instalação
npx convez-ai evidai/agent-payment-mcp1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Monetizar APIs privadas ou premium para acesso via agentes IA
- Criar modelos de cobrança por uso (pay-per-call) sem infraestrutura complexa
- Integrar sistemas de pagamento automático em fluxos de agentes autônomos
Veredito

Solução inovadora para monetização de APIs com suporte nativo a x402 e pagamento automático por agentes. Destaca-se pelo zero-setup inicial (Demo Mode) e transparência de custos, embora requeira compreensão do modelo x402 e Pay Tokens para implementação completa.
README
A tradução para o português deste README ainda está na fila.
🍋 LemonCake
Monetize MCP servers and HTTP APIs in minutes. Private Beta · Open core
Paste an API URL, set a per-call price, and share a buy link. Buyers pay by card; agents call with spend-capped Pay Tokens — no crypto wallet. First 3,000 calls free (lifetime). Then 3% only when your API earns.
🚀 Quickstart · 💲 Pricing · 📚 Docs · 🌐 Live
☝️ A real AI agent buys API calls by itself ($0.01 each), stops at its cap, and the API owner earns — no human, no crypto. · demo source
🚀 Try the buyer-side MCP in 30 seconds
No signup, no card — ships 8 free demo tools (search · translate · weather · geocode · time · dictionary · fx · echo):
npx -y agent-payment-mcp
Or drop it into any MCP client:
{ "mcpServers": { "lemon": { "command": "npx", "args": ["-y", "agent-payment-mcp"] } } }
Then ask your agent to run list_demos / call_demo. To call paid APIs, set LC_PAY_TOKEN (get one at lemoncake.xyz/app).
What is LemonCake?
LemonCake is an x402 payment rail for monetizing MCP servers and HTTP APIs. Sellers register an endpoint and set a price per call. Buyers prepay by card and receive a spend-capped Pay Token. Agents call the gateway with that token, and LemonCake verifies, meters, forwards, and records usage.
sequenceDiagram
participant A as 🤖 AI Agent
participant G as 🍋 LemonCake Gateway
participant API as Your API
A->>G: POST /g/:id (no token)
G-->>A: 402 + accepts[] (price, mintUrl)
A->>G: mint Pay Token (off-session, capped)
A->>G: Bearer :jwt
G->>API: forward (upstream key hidden)
API-->>A: 200 + result
Note over A,G: budget exhausted → 402 → agent self-funds → continues
Sellers register any HTTP API and set a price per call. Buyers / agents prepay with a card → Pay Token issued automatically → agent calls the API within budget. Budget exhausted → 402 challenge → agent self-funds → continues. No humans.
🧱 Open core
| Layer | Status | Where |
|---|---|---|
Buyer-side MCP (agent-payment-mcp) | ✅ MIT | npm, src |
Seller SDK (@lemon-cake/mcp-sdk) | ✅ MIT | npm, src |
| Starter templates | ✅ MIT | examples/ |
| Docs site | ✅ Public | lemoncake.xyz/docs |
| Gateway + billing engine | 🔒 Hosted | lemoncake.xyz |
| Dashboard (analytics, usage ledger) | 🔒 Hosted | lemoncake.xyz/app |
💳 How payment works
For buyers (human or agent)
- Open a buy link (
lemoncake.xyz/buy/<shortId>) - Pay with a card → Pay Token (JWT) issued automatically
- Pass
Authorization: Bearer <token>to the gateway - Gateway verifies, meters, forwards to the real API
- Budget exhausted → 402 challenge returned with payment instructions
For agents (fully autonomous)
- Issue a Buyer Key (
bk_...) at /app → Pay Tokens pane - Save a card once at /agent/fund
- Agent calls
POST /api/lc/agent/tokens(Bearer bk_) → off-session card charge → JWT - Agent uses JWT to call gateway — hard-capped, no human in the loop
// MCP config for agent with pre-issued Pay Token
{
"mcpServers": {
"lemon": {
"command": "npx",
"args": ["-y", "agent-payment-mcp"],
"env": {
"LC_PAY_TOKEN": "<jwt from Pay Token>"
}
}
}
}
🏗 Publish your API on LemonCake (sellers)
Monetize any HTTP API or MCP server:
- Sign in at lemoncake.xyz/app
- Add API — paste your URL, set price per call (e.g.
$0.01) - Share the buy link — buyers prepay, Pay Token issued automatically
- You keep 97%. LemonCake takes 3% once at checkout (Stripe Connect Direct Charge). Never holds funds.
Add billing with the SDK (optional):
import { withPayment } from "@lemon-cake/mcp-sdk";
server.tool("my_premium_tool", withPayment({ price: 0.01 }, async (args) => {
return { content: [{ type: "text", text: "result" }] };
}));
Or route existing traffic through https://lemoncake.xyz/g/<shortId> — no code changes required.
✨ Features
For agents / buyers
- ✅ x402 native — 402 challenge returns
accepts[]with price + mintUrl - ✅ Hard-capped — per-mint / daily / monthly limits, server-enforced
- ✅ Off-session top-up — agent self-funds via Buyer Key (
bk_...), no prompts - ✅ Demo Mode — 8 free tools, try without any setup
For API providers / sellers
- ✅ Gateway in minutes — register any HTTP API, get a URL instantly
- ✅ Custody-free — Stripe Connect Direct Charge, 97% goes directly to seller
- ✅ Usage ledger — every call recorded, revenue visible in dashboard
- ✅ Buy link — share one URL, buyers self-serve
Infrastructure
- 🔧 Stripe Connect Direct Charge (no custody)
- 🔧 x402 gateway with
WWW-Authenticate: Lemoncake-Prepaid - 🔧 EN / 日本語 / Español dashboard
- 🔧 JP FSA: registration not required (confirmed 2026-06)
🏗 Architecture
┌─────────────────────────────────────────────────┐
│ Buyer / Agent │
│ ↳ prepays via card OR Buyer Key (bk_...) │
│ ↳ receives Pay Token (signed JWT) │
└──────────────────────┬──────────────────────────┘
│ Authorization: Bearer <jwt>
▼
┌─────────────────────────────────────────────────┐
│ LemonCake Gateway /g/<shortId> │
│ ↳ verify JWT signature │
│ ↳ check budget + calls + rate limit │
│ ↳ decrement spend, write to ledger │
└──────────────────────┬──────────────────────────┘
│ HTTPS + upstream_auth (hidden)
▼
┌─────────────────────────────────────────────────┐
│ Your API / MCP server (unchanged) │
└─────────────────────────────────────────────────┘
LemonCake is the middle box. It never holds funds — money flows Stripe → seller via Direct Charge.
🌍 Compliance
Japan FSA Fintech Support Desk (2026-06) confirmed: no registration required. Custody-free design (Stripe Connect Direct Charge, no pooled balance).
| Jurisdiction | Basis |
|---|---|
| 🇯🇵 Japan | FSA — registration not required |
| 🇺🇸 USA | FinCEN 2019 §4.5 — non-custodial software ≠ MSB |
| 🇪🇺 EU | MiCA — non-CASP |
| 🇬🇧 UK | FCA — Tech Service Provider |
| 🇸🇬 Singapore | MAS — DPT non-applicable |
| 🇨🇦 Canada | FINTRAC — non-custodial exemption |
| 🇨🇭 Switzerland | FINMA — non-financial intermediary |
🔌 Package family
| Package | What it does |
|---|---|
agent-payment-mcp | Main entry — x402 gateway + agent payment rail |
@lemon-cake/mcp-sdk | SDK for sellers to monetize their MCP servers |
xstocks-mcp | Buy tokenized US stocks on Solana |
alpaca-guard-mcp | Alpaca paper / live trading with hard daily cap |
tokenized-stock-mcp | Dinari dShares |
🛡 Security
- Server-side hard caps — per-mint / daily / monthly, cannot be exceeded
- Pay Token = signed JWT — HS256, verified on every gateway call
- upstream_auth never exposed — seller's real API key hidden from buyers
- RLS on all DB tables — Supabase row-level security enabled
- Stripe Connect Direct Charge — LemonCake never holds funds