๐ LemonCake
The billing, budget & identity layer for software for agents. Private Beta ยท Open core
Monetize any MCP/API in minutes, and let AI agents pay for it safely โ each agent gets a spend-capped identity (budget, usage, pause/revoke). Buyers pay by card; no crypto wallet. First 3,000 calls free (lifetime). Then 3% only when your API earns.
๐ Get started ยท ๐ฒ 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
๐ Get started
Monetizing an MCP/API? Start here โ one command:
npx create-lemon-mcp my-paid-mcp # a paid MCP server, running in sandbox now
# then add a Seller Key in /app and set LEMONCAKE_SELLER_KEY โ it charges for real (no code change)
Pick your path:
npx -y agent-payment-mcp
{ "mcpServers": { "lemon": { "command": "npx", "args": ["-y", "agent-payment-mcp"] } } }
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
๐ณ 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, or issue a Seller Key (
sk_live_โฆ) to charge from your own server - You keep 97%. LemonCake takes 3% (Stripe Connect Direct Charge). Never holds funds.
Scaffold a paid MCP in one command โ sandbox by default, production with one env var:
npx create-lemon-mcp my-paid-mcp # demo runs with no key
# then: set LEMONCAKE_SELLER_KEY=sk_live_โฆ โ it charges for real (no code change)
Add billing to any tool with the SDK (@lemon-cake/mcp-sdk v1, no crypto):
import { createLemonCakeSDK } from "@lemon-cake/mcp-sdk";
const lc = createLemonCakeSDK(); // reads LEMONCAKE_SELLER_KEY (demo without it)
server.tool("my_premium_tool", "desc", { q: z.string() },
lc.charge({ price: 0.01 })(async ({ q }) => {
return { content: [{ type: "text", text: "result" }] };
}),
);
lc.charge wraps the handler: preflight (reserve) โ run โ settle (confirm on success, refund on failure). Or route existing traffic through https://lemoncake.xyz/g/<shortId> โ no code changes required.
๐ชช Agent Identity
Give each AI agent its own spend-capped identity โ so a fleet can pay for APIs without a shared card or runaway cost. Built on top of Pay Tokens; no balance pool, custody-free (an agent's "budget" is just the Pay Tokens bound to it).
- Bind a Pay Token to an agent when issuing it (
agentId) โ spend is attributed to that agent. - Per-agent rollup โ budget, spend, calls, last-used in the dashboard.
- Kill switch โ
pause/resume/revokean agent; bound tokens are rejected at the gateway instantly (AGENT_PAUSED/AGENT_REVOKED), even with budget remaining. - Server-authoritative โ price is set on the endpoint; agents never carry a card or a seller key.
# manage agents (owner-authenticated)
POST /api/agents # create โ { agent_id, ... }
POST /api/agents/:id/pause # kill switch (also /resume, /revoke)
GET /api/agents # list + per-agent spend rollup
โจ 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
- โ
5-min go-live โ
npx create-lemon-mcp, orlc.charge()on any tool, or route through the gateway - โ 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
For agent fleets / operators
- โ Per-agent identity โ bind Pay Tokens to an agent, attribute spend
- โ Per-agent kill switch โ pause / resume / revoke, enforced at the gateway
- โ Spend rollup โ budget / spent / calls per agent
- โ No balance pool โ custody-free; budget = the agent's bound Pay Tokens
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).
๐ Package family
๐ก 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