Package Exports
- @asgpay/pay
- @asgpay/pay/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@asgpay/pay) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
๐ณ
ASG Pay
The banking layer for autonomous AI agents.
One SDK. 15 networks. Two protocols. Zero payment code.
Website ยท Quick Start ยท GitHub ยท ๐ @ASGCardx402
The Problem
$28 trillion in AI-driven commerce by 2030 โ but agents can't pay.
Traditional payment rails require human input: clicking checkout buttons, entering card numbers, passing CAPTCHAs. When an AI agent encounters HTTP 402 Payment Required, it stops dead. No bank account. No wallet. No identity.
The entire agentic economy is blocked by a missing financial layer.
The Solution
ASG Pay is that missing layer. It gives every AI agent a complete financial identity โ wallet, policy engine, virtual cards, and multi-chain settlement โ in one line of code:
npm install @asgpay/payimport { OwsClient, EvmPaymentAdapter } from '@asgpay/pay';
const agent = new OwsClient({
baseURL: 'https://api.example.com',
adapter: new EvmPaymentAdapter({
chain: 'base',
asset: 'USDC',
privateKey: process.env.AGENT_KEY as `0x${string}`,
}),
policy: { maxAmountPerTransaction: 5, monthlyBudget: 100 },
});
// Agent pays automatically โ zero payment logic needed
const data = await agent.performTask('/v1/inference', { model: 'gpt-4' });What happens: Request โ 402 Payment Required โ auto-detect protocol โ settle on-chain โ retry with proof โ 200 OK. Your agent never sees the payment.
Why ASG Pay Wins
๐ Dual ProtocolOnly SDK unifying x402 (Coinbase) + MPP (Stripe).One import covers both standards. |
๐ 15 NetworksBase ยท Arbitrum ยท Optimism ยท Ethereum ยท Polygon ยท Stellar ยท Solana ยท Stripe + testnets |
๐ก๏ธ Fail-Closed4-gate policy engine. Agents cannot overspend. No override, no bypass. |
Product Suite
ASG Pay is the engine behind the full ASG financial infrastructure for AI agents:
| Package | What It Does | Install |
|---|---|---|
| @asgpay/pay | Multi-chain payment SDK (x402 + MPP) | npm i @asgpay/pay |
| @asgpay/sdk | Virtual Mastercard management | npm i @asgpay/sdk |
| @asgpay/cli | Card creation & management CLI | npx @asgpay/cli |
| @asgpay/mcp-server | AI agent tools (Claude, Codex, Cursor) | npx @asgpay/mcp-server |
| @asgpay/fund | One-link agent wallet funding | npm i @asgpay/fund |
| @asgpay/agent-cash | Autonomous virtual credit cards | npm i @asgpay/agent-cash |
| @asgpay/create-app | Project scaffolding | npx @asgpay/create-app |
How It Works
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ YOUR AI AGENT โ
โ (LangChain, CrewAI, AutoGPT, custom) โ
โ โ
โ agent.performTask('/api/data') โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ ASG Pay Engine (OwsClient) โ โ
โ โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โ
โ โ โ x402 Auto โ โ MPP Auto โ โ โ
โ โ โ Detection โ โ Detection โ โ โ
โ โ โโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโโ โ โ
โ โ โ โ โ โ
โ โ โโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโ โ โ
โ โ โ Policy Engine (4-gate) โ โ โ
โ โ โ amount โ per-tx โ monthly โ โ โ
โ โ โ โ whitelist โ โ โ
โ โ โโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ โ
โ โ โโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ Settlement Adapters โ โ โ
โ โ โ EVM โ Stellar โ Solana โ โ โ โ
โ โ โ Stripe MPP โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ 200 OK โ agent gets data โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโSupported Networks
| Network | Protocol | Assets | Status |
|---|---|---|---|
| Base | x402 | ETH, USDC | โ Live |
| Arbitrum | x402 | ETH, USDC | โ Live |
| Optimism | x402 | ETH, USDC | โ Live |
| Ethereum | x402 | ETH, USDC | โ Live |
| Polygon | x402 | MATIC, USDC | โ Live |
| Stellar | x402 + MPP | XLM, USDC | โ Live |
| Solana | x402 | SOL, USDC | โ Live |
| Stripe | MPP | USD (fiat) | โ Live |
All testnets supported. All USDC contracts are Circle's official native deployments.
Competitive Landscape
| Capability | ASG Pay | Stripe (MPP only) | Coinbase (x402 only) | Circle |
|---|---|---|---|---|
| Dual Protocol (x402 + MPP) | โ | โ | โ | โ |
| Virtual Cards for Agents | โ | Raw API | โ | โ |
| Multi-chain (15 networks) | โ | โ | Base only | โ |
| Fail-closed Policy Engine | โ | โ | โ | โ |
| Agent Identity (DID/EAS) | โ | โ | โ | โ |
| MCP Tools (AI-native) | โ | โ | โ | โ |
| One-line Integration | โ | โ | โ | โ |
| Open Source | โ | โ | Partial | โ |
No other SDK unifies x402 and MPP protocols, supports 15 networks, includes virtual cards, and ships with a fail-closed policy engine.
Market Opportunity
| Metric | Value | Source |
|---|---|---|
| Agentic AI TAM (2030) | $28T | Gartner 2025 |
| Agent transactions requiring payments | 47% | McKinsey Digital |
| Enterprise AI agent adoption | 85% by 2027 | Deloitte |
| x402 + MPP protocol coverage | ~90% of agent payments | ASG Research |
ASG Pay is positioned as Stripe for autonomous agents โ the default payment infrastructure for the $28T agentic economy.
Traction
| Metric | Value |
|---|---|
| NPM Packages | 7 published |
| Test Coverage | 269 tests, 84% coverage |
| Networks Supported | 15 (production + testnet) |
| Protocols | 2 (x402 + MPP) |
| MCP Tools | 11 tools for Claude/Codex/Cursor |
| Production Deployments | pay.asgcard.dev ยท asgcard.dev ยท fund.asgcard.dev |
Quick Start Examples
EVM (Base, Arbitrum, Optimism, Ethereum, Polygon)
import { OwsClient, EvmPaymentAdapter } from '@asgpay/pay';
const agent = new OwsClient({
baseURL: 'https://api.example.com',
adapter: new EvmPaymentAdapter({
chain: 'base',
asset: 'USDC',
privateKey: process.env.AGENT_KEY as `0x${string}`,
}),
policy: { maxAmountPerTransaction: 5, monthlyBudget: 100 },
});
const result = await agent.performTask('/v1/data');Stellar (XLM, USDC)
import { OwsClient, StellarPaymentAdapter } from '@asgpay/pay';
const agent = new OwsClient({
baseURL: 'https://api.example.com',
adapter: new StellarPaymentAdapter({
secretKey: process.env.STELLAR_SECRET!,
network: 'mainnet',
asset: 'USDC',
}),
policy: { monthlyBudget: 50, maxAmountPerTransaction: 2 },
});Solana (SOL, USDC)
import { OwsClient, SolanaPaymentAdapter } from '@asgpay/pay';
const agent = new OwsClient({
baseURL: 'https://api.example.com',
adapter: new SolanaPaymentAdapter({
secretKey: myKeypair.secretKey,
network: 'mainnet-beta',
asset: 'USDC',
}),
policy: { monthlyBudget: 50, maxAmountPerTransaction: 2 },
});Stripe MPP (Fiat USD)
import { OwsClient, StripePaymentAdapter } from '@asgpay/pay';
const agent = new OwsClient({
baseURL: 'https://api.example.com',
adapter: new StripePaymentAdapter({
stripeSecretKey: process.env.STRIPE_SECRET_KEY!,
networkId: 'my-network',
}),
policy: { monthlyBudget: 200, maxAmountPerTransaction: 10 },
});402 Payment Gating (Server-side โ charge agents)
import { createPaymentGate } from '@asgpay/pay';
app.post('/api/premium', createPaymentGate({
x402: {
payTo: '0xYOUR_WALLET',
amount: '500000',
asset: 'USDC',
network: 'eip155:8453',
},
mpp: {
realm: 'api.example.com',
method: 'onchain',
amount: '0.50',
recipient: '0xYOUR_WALLET',
},
}), (req, res) => {
res.json({ data: 'premium content' });
});Technology Stack
| Layer | Technology |
|---|---|
| EVM | viem โ type-safe Ethereum client |
| Stellar | @stellar/stellar-sdk |
| Solana | @solana/web3.js + @solana/spl-token |
| Payments | Stripe API 2026-03-04.preview (native MPP/SPT) |
| Build | TypeScript strict mode, dual CJS + ESM |
| Test | Vitest โ 269 tests, 84% coverage |
| CI/CD | GitHub Actions โ Node 18/20/22 matrix |
FAQ
Is ASG Pay free? Yes. Apache 2.0. You only pay gas fees or Stripe fees.
Does it work with LangChain / CrewAI / AutoGPT? Yes. Any JS/TS agent framework.
Can agents pay each other? Yes. Pay Out + Pay In + buildPaymentUri() for agent-to-agent.
How do I add a new chain? Implement PaymentAdapter (~40 lines of TypeScript).
Is this the same as @asgcard/pay? Yes. @asgpay/pay and @asgcard/pay are both official packages by ASG Compute. Use whichever you prefer.
Links
| ๐ Website | pay.asgcard.dev |
| ๐ณ Virtual Cards | asgcard.dev |
| ๐ฐ Agent Funding | fund.asgcard.dev |
| ๐ฆ NPM | @asgpay/pay |
| ๐ GitHub | ASGCompute |
| ๐ Twitter | @ASGCardx402 |
Built by ASG Compute
ASG Pay โ the banking layer for autonomous AI agents.
Give every agent a financial identity โ in one line of code.