The open-source payment layer for AI agents.
Give your agent a virtual card. Fund it with your card. Set spending rules. Done.
AI agents are spending money β APIs, subscriptions, domains, services. But giving them payment access today is painful:
| Solution | Problem |
|---|---|
| Crypto wallets (Skyfire, x402) | Requires stablecoins β not mass-market |
| US-only cards (Privacy.com, Slash) | Doesn't work in Europe |
| Enterprise APIs (Visa, PayPal) | Not built for individual developers |
| Sharing your card | No controls, no limits, no visibility |
LetPay fills the gap: real money, real cards, real controls. Open source. Works in EU + US.
User LetPay Card Provider
β β β
βββ Sign up βββββββββββββββββββΊβ β
βββ Create wallet βββββββββββββΊβββ Issue virtual card βββββββββΊβ
βββ Fund wallet (Stripe) ββββββΊβββ Credit balance β
β β β
Agent β β
βββ letpay_pay(β¬15, OpenAI) βββΊβββ Check rules β
β βββ β
Auto-approve (< threshold)β
ββββ Card details (PAN/CVV) βββ€ β
βββ Uses card at checkout ββββββΌβββββββββββββββββββββββββββββββΊβ
β ββββ Webhook: charge confirmed β
β βββ Record transaction β
β βββ Notify user (Telegram) β
- π³ Virtual Visa cards β one per agent, isolated spending
- π Spending rules β monthly limits, per-transaction caps, merchant category controls
- π€ MCP server β works with any MCP-compatible agent (Claude, OpenClaw, etc.)
- π€ Human-in-the-loop β approve big purchases via Telegram
- π Dashboard β real-time transactions, wallet management, API keys
- β‘ Instant alerts β Telegram notifications on every spend
- π Kill switch β freeze any wallet instantly
- π EU + US β multi-provider architecture (Stripe, Wallester, more coming)
- π Provider-agnostic β swap card issuers without changing your agent code
git clone https://github.com/albertsalgueda/letpay.git
cd letpay
pnpm installcp .env.example .env
# Edit .env with your credentials (or use USE_MOCKS=true for local dev)# Start the database
docker compose up -d postgres
# Push the schema
cd packages/db && DATABASE_URL=postgresql://letpay:letpay@localhost:5432/letpay npx drizzle-kit push && cd ../..
# Start the API
pnpm --filter @letpay/api dev
# Start the dashboard (separate terminal)
pnpm --filter @letpay/web devAPI runs on http://localhost:3001, dashboard on http://localhost:3000.
{
"mcpServers": {
"letpay": {
"command": "npx",
"args": ["@letpay/mcp-server"],
"env": {
"LETPAY_API_KEY": "your-api-key",
"LETPAY_API_URL": "http://localhost:3001"
}
}
}
}Your agent now has 4 tools: letpay_balance, letpay_pay, letpay_history, letpay_request_topup.
letpay/
βββ apps/
β βββ api/ # REST API (Hono + Node.js)
β βββ web/ # Dashboard (Next.js 15)
β βββ telegram-bot/ # Notifications + approval bot (grammy)
βββ packages/
β βββ core/ # Business logic, rules engine, provider interfaces
β βββ db/ # Database schema + migrations (Drizzle + Postgres)
β βββ mcp-server/ # MCP server for agent integration
LetPay uses a provider interface pattern β card issuers and payment processors are pluggable:
// packages/core/src/cards/interface.ts
interface CardIssuingService {
createVirtualCard(params): Promise<CardInfo>;
getCardDetails(cardId): Promise<CardDetails>;
freezeCard(cardId): Promise<void>;
approveAuthorization(authId): Promise<void>;
declineAuthorization(authId, reason): Promise<void>;
// ...
}Current implementations:
MockCardIssuingServiceβ for local development- Stripe Issuing β coming soon
- Wallester β coming soon
- Your provider β implement the interface, submit a PR
Every transaction is evaluated against configurable rules:
1. Sufficient balance? β Decline if not
2. Per-transaction limit? β Decline if exceeded
3. Monthly limit? β Decline if exceeded
4. Merchant category blocked? β Decline if MCC in blocklist
5. Merchant category allowed? β Decline if MCC not in allowlist
6. Above approval threshold? β Route to human approval
7. All clear β Auto-approve β
| Layer | Technology |
|---|---|
| API | Node.js, TypeScript, Hono |
| Database | PostgreSQL + Drizzle ORM |
| Dashboard | Next.js 15, Tailwind CSS |
| Auth | Supabase Auth |
| Agent Integration | MCP (Model Context Protocol) |
| Notifications | Telegram Bot (grammy) |
| Payments | Stripe (funding) |
| Card Issuing | Provider-agnostic interface |
| Monorepo | pnpm workspaces + Turborepo |
| CI | GitHub Actions |
POST /v1/agent/pay # Request a payment
GET /v1/agent/balance # Check wallet balances
GET /v1/agent/history # Recent transactions
POST /v1/wallets # Create wallet
GET /v1/wallets # List wallets
GET /v1/wallets/:id # Get wallet
PATCH /v1/wallets/:id # Update wallet
POST /v1/wallets/:id/freeze # Freeze wallet
POST /v1/wallets/:id/unfreeze # Unfreeze wallet
POST /v1/wallets/:id/topup # Fund wallet
GET /v1/wallets/:id/balance # Get balance
GET /v1/wallets/:id/rules # Get spending rules
PUT /v1/wallets/:id/rules # Update spending rules
GET /v1/approvals # List pending approvals
POST /v1/approvals/:id/approve # Approve
POST /v1/approvals/:id/deny # Deny
| Tool | Description |
|---|---|
letpay_balance |
Check wallet balance and monthly spending |
letpay_pay |
Request a payment (returns card details if approved) |
letpay_history |
View recent transactions |
letpay_request_topup |
Ask the user to add funds |
docker compose upThis starts PostgreSQL, the API, the web dashboard, and the Telegram bot.
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string |
SUPABASE_URL |
For auth | Supabase project URL |
SUPABASE_ANON_KEY |
For auth | Supabase publishable key |
SUPABASE_SERVICE_ROLE_KEY |
For auth | Supabase secret key |
STRIPE_SECRET_KEY |
For payments | Stripe secret key |
STRIPE_WEBHOOK_SECRET |
For payments | Stripe webhook signing secret |
TELEGRAM_BOT_TOKEN |
For notifications | Telegram bot token from @BotFather |
USE_MOCKS |
No | Set to true for local dev without real APIs |
cd apps/web
vercel deployThe API and Telegram bot need long-running processes. Deploy to Railway, Fly.io, or any container platform.
# API
docker build -f apps/api/Dockerfile -t letpay-api .
# Bot
docker build -f apps/telegram-bot/Dockerfile -t letpay-bot .We're building in the open. Contributions welcome!
- Implement
CardIssuingServiceinterface inpackages/core/src/cards/ - Add tests in
packages/core/__tests__/cards/ - Register in
apps/api/src/deps.ts - Submit a PR
pnpm install
pnpm build # Build all packages
pnpm test # Run all tests
pnpm dev # Start API + web in dev mode- Core rules engine
- MCP server (4 tools)
- REST API with auth
- Web dashboard
- Telegram bot (notifications + approvals)
- Stripe payment integration
- Mock mode for local dev
- Stripe Issuing provider
- Wallester provider
- Slash API provider (US)
- Multi-agent wallets
- Receipt/invoice capture
- Team accounts
- OpenClaw skill (ClawHub)
- AP2 protocol support
- x402 support
MIT β use it however you want.
Built by Albert Salgueda
Every AI agent will need a wallet. This is the open-source one.