Virtual MasterCards for AI agents - pay with USDC via x402 on Stellar
ASG Card
Your AI agent needs a credit card. ASG Card gives it one โ programmatically, in seconds, with USDC or Stripe.
ASG Card is an agent-first virtual card platform. AI agents programmatically issue and manage MasterCard virtual cards, paying via Stellar x402 (USDC) or Stripe Machine Payments Protocol (card).
Quick Start โ First Card
# One-step onboarding (creates wallet, configures MCP, installs skill)
npx @asgcard/cli onboard -y --client codex
Fund your wallet with USDC on Stellar (address shown by onboard)
Then:
npx @asgcard/cli card:create -a 10 -n "AI Agent" -e you@email.com
SDK Usage
import { ASGCardClient } from "@asgcard/sdk";
const client = new ASGCardClient({ privateKey: "S...", // Stellar secret key rpcUrl: "https://mainnet.sorobanrpc.com" });
// Automatically handles: 402 โ USDC payment โ card creation const card = await client.createCard({ amount: 10, // $10 card load nameOnCard: "AI Agent", email: "agent@example.com" });
// card.detailsEnvelope = { cardNumber, cvv, expiryMonth, expiryYear }
SDK Methods
| Method | Description | |--------|-------------| | createCard({amount, nameOnCard, email, phone?}) | Issue a virtual card with x402 payment | | fundCard({amount, cardId}) | Top up an existing card | | listCards() | List all cards for this wallet | | getTransactions(cardId, page?, limit?) | Get card transaction history | | getBalance(cardId) | Get live card balance | | getPricing() | Get current pricing | | health() | API health check |
MCP Server (AI Agent Integration)
@asgcard/mcp-server exposes 11 tools for Codex, Claude Code, and Cursor:
| Tool | Description | |------|-------------| | getwalletstatus | Use FIRST โ wallet address, USDC balance, readiness | | create_card | Create virtual card (x402 payment) | | fund_card | Fund existing card (x402 payment) | | list_cards | List all wallet cards | | get_card | Get card summary | | getcarddetails | Get PAN, CVV, expiry | | freeze_card | Freeze a card | | unfreeze_card | Unfreeze a card | | get_pricing | View pricing | | get_transactions | Card transaction history (real 4payments data) | | get_balance | Live card balance from 4payments |
MCP Setup
npx @asgcard/cli install --client codex # or claude, cursor
Architecture
graph TB
subgraph Clients
SDK["@asgcard/sdk<br>(npm, TypeScript)"]
CLI["@asgcard/cli<br>onboard + card ops"]
MCP["@asgcard/mcp-server<br>11 tools"]
TG["Telegram Bot<br>@ASGCardbot"]
WEB["asgcard.dev"]
STRIPE_WEB["stripe.asgcard.dev"]
end
subgraph ASG Infrastructure API["ASG Card API<br>api.asgcard.dev"] FAC["x402 Facilitator"] DB["PostgreSQL"] end
subgraph Payment Rails STELLAR["Stellar Pubnet<br>USDC"] STRIPE["Stripe<br>MPP"] end
subgraph External ISSUER["Card Issuer<br>(MasterCard)"] end
SDK -->|"x402 HTTP"| API CLI -->|"x402 HTTP"| API MCP -->|"x402 HTTP"| API TG -->|"Webhook"| API WEB -->|"Pricing"| API STRIPE_WEB -->|"MPP"| API API -->|"verify/settle"| FAC API -->|"SQL"| DB API -->|"REST"| ISSUER FAC -->|"Soroban RPC"| STELLAR API -->|"PaymentIntent"| STRIPE SDK -->|"Sign TX"| STELLAR
Payment Rails
ASG Card supports two payment rails. The card product is identical โ only the payment method differs.
Stellar Edition (x402)
- Agent requests a card โ API returns
402 Payment Requiredwith USDC amount - Agent signs a Stellar USDC transfer via the SDK
- x402 Facilitator verifies and settles the payment on-chain
- API issues a MasterCard via the card issuer
- Card details returned immediately in the response
Stripe Edition (MPP)
- Agent creates a payment request โ API returns
approval_required+approvalUrl - Owner opens the approval page at
stripe.asgcard.dev/approve - Owner reviews and approves โ Stripe Elements form with real-time pricing
- Owner pays via Stripe โ card/Apple Pay/Google Pay
- Card created โ agent polls until
completed
X-STRIPE-SESSION). Human-in-the-loop approval.
Workspace
| Directory | Description | |-----------|-------------| | /api | ASG Card API (Express + x402 + Stripe MPP) | | /sdk | @asgcard/sdk TypeScript client | | /cli | @asgcard/cli CLI with onboarding | | /mcp-server | @asgcard/mcp-server MCP server (11 tools) | | /web | Marketing website (asgcard.dev) | | /web-stripe | Stripe edition site (stripe.asgcard.dev) | | /docs | Internal documentation and ADRs |
API Endpoints
Public
| Route | Method | Description | |-------|--------|-------------| | /health | GET | Health check | | /pricing | GET | Pricing info | | /cards/tiers | GET | Pricing info | | /supported | GET | x402 capabilities |
Stellar x402 (Payment Required)
| Route | Method | Description | |-------|--------|-------------| | /cards/create/tier/:amount | POST | Create a virtual card | | /cards/fund/tier/:amount | POST | Fund an existing card |
Wallet Authenticated
| Route | Method | Description | |-------|--------|-------------| | /cards/ | GET | List wallet's cards | | /cards/:id | GET | Card details | | /cards/:id/details | GET | Sensitive data (nonce required) | | /cards/:id/transactions | GET | Card transaction history | | /cards/:id/balance | GET | Live card balance | | /cards/:id/freeze | POST | Freeze card | | /cards/:id/unfreeze | POST | Unfreeze card |
Stripe MPP (Beta)
| Route | Method | Description | |-------|--------|-------------| | /stripe-beta/session | POST | Create managed session | | /stripe-beta/payment-requests | POST | Create payment request | | /stripe-beta/payment-requests/:id | GET | Poll request status | | /stripe-beta/approve/:id | GET/POST | Approval page data / approve or reject | | /stripe-beta/approve/:id/complete | POST | Complete payment (MPP credential) | | /stripe-beta/cards | GET | List session's cards | | /stripe-beta/cards/:id/details | GET | Card details (nonce required) |
Pricing
Simple, transparent, no hidden fees.
- $10 flat card creation (no initial load required)
- 3.5% on every top-up
Create card with no load โ $10. Create card loaded with $100 โ $113.50. Top up $200 later โ just $207.
Same pricing on both Stellar and Stripe rails.
Telegram Bot (@ASGCardbot)
Link your wallet to Telegram for card management:
| Command | Description | |---------|-------------| | /start | Welcome / Link account | | /mycards | List your cards | | /faq | FAQ | | /support | Support |
Security
- Card details encrypted at rest with AES-256-GCM
- Agent nonce-based anti-replay protection (5 reads/hour)
- Wallet signature authentication (Stellar edition)
- Session-based authentication with beta gates (Stripe edition)
- Stripe session keys redacted from logs
- Telegram webhook secret validation
- Ops endpoints protected by API key + IP allowlist
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines and check out issues labeled good first issue to get started.
This project follows our Code of Conduct.
License
MIT