{"_id":"@asgpay/pay","_rev":"2-cf7b9633f367ae7569aabb51101ed404","name":"@asgpay/pay","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@asgpay/pay","version":"1.0.0","keywords":["asg-pay","asgpay","ai-agent-payments","autonomous-agent-payments","agent-to-agent-payments","agentic-commerce","machine-to-machine-payments","x402","x402-protocol","http-402","402-payment-required","mpp","machine-payments-protocol","stripe-machine-payments","ai-agent-sdk","ai-agent-financial-identity","agent-wallet","agent-virtual-card","policy-engine","stripe","coinbase","circle","usdc","base","arbitrum","optimism","polygon","stellar","solana","evm","multi-chain","langchain","crewai","autogpt","mcp","open-wallet-standard","ai-payments","agent-banking","defi-agents"],"author":{"name":"ASG Compute","email":"aidar@asgcompute.com"},"license":"Apache-2.0","_id":"@asgpay/pay@1.0.0","maintainers":[{"name":"asgcard","email":"aidar@asgcompute.com"}],"homepage":"https://pay.asgcard.dev","bugs":{"url":"https://github.com/ASGCompute/ASGCompute-ows-agent-pay/issues"},"dist":{"shasum":"2da276f194bc47d547682421957c5c5fdfe13c83","tarball":"https://registry.npmjs.org/@asgpay/pay/-/pay-1.0.0.tgz","fileCount":4,"integrity":"sha512-vzT7XdVCTha9DIe1lXZvqvUnL71x/MGmE6hfrJIVeruin06Ye0RAVRme3LPsn5khD1sAwJUi227QyXp/Crs6Vg==","signatures":[{"sig":"MEYCIQDriEDPKbNYizllPhQBnvSlmUMtaNtL+cLLG5xEz+lnQwIhALo+V6pv7o9qH3O9TobHWRaGzLiORcsWECmkM+8bUP5P","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16359},"main":"index.js","types":"index.d.ts","engines":{"node":">=18"},"funding":{"url":"https://asgcompute.com","type":"corporate"},"scripts":{"test":"echo \"Re-exports from @asgcard/pay — run tests there\""},"_npmUser":{"name":"asgcard","email":"aidar@asgcompute.com"},"repository":{"url":"git+https://github.com/ASGCompute/ASGCompute-ows-agent-pay.git","type":"git"},"_npmVersion":"10.9.2","description":"ASG Pay — the banking layer for autonomous AI agents. Multi-chain payments (x402 + MPP), virtual cards, policy engine, 15 networks. The only SDK unifying Coinbase x402 and Stripe Machine Payments Protocol into one npm install.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@asgcard/pay":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pay_1.0.0_1775340545075_0.2255317349024215","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@asgpay/pay","version":"1.0.1","description":"ASG Pay — the banking layer for autonomous AI agents. Multi-chain payments (x402 + MPP), virtual cards, policy engine, 15 networks. The only SDK unifying Coinbase x402 and Stripe Machine Payments Protocol into one npm install.","main":"index.js","types":"index.d.ts","scripts":{"test":"echo \"Re-exports from @asgcard/pay — run tests there\""},"keywords":["asg-pay","asgpay","ai-agent-payments","autonomous-agent-payments","agent-to-agent-payments","agentic-commerce","machine-to-machine-payments","x402","x402-protocol","http-402","402-payment-required","mpp","machine-payments-protocol","stripe-machine-payments","ai-agent-sdk","ai-agent-financial-identity","agent-wallet","agent-virtual-card","policy-engine","stripe","coinbase","circle","usdc","base","arbitrum","optimism","polygon","stellar","solana","evm","multi-chain","langchain","crewai","autogpt","mcp","open-wallet-standard","ai-payments","agent-banking","defi-agents"],"author":{"name":"ASG Compute","email":"aidar@asgcompute.com"},"license":"Apache-2.0","homepage":"https://pay.asgcard.dev","repository":{"type":"git","url":"git+https://github.com/ASGCompute/ASGCompute-ows-agent-pay.git"},"bugs":{"url":"https://github.com/ASGCompute/ASGCompute-ows-agent-pay/issues"},"funding":{"type":"corporate","url":"https://asgcompute.com"},"dependencies":{"@asgcard/pay":"^0.2.1"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"_id":"@asgpay/pay@1.0.1","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-ECTdKNKGhS7h9Zx4CM4cMf5HOBOXjzLWliVVY2Yid0wZ59YkJITz1cH9u/zHl7ysUtbzZc2VbDkMcsoiLZVB+A==","shasum":"d7fa8964e8520ac29e593ce141ead48a19c4509d","tarball":"https://registry.npmjs.org/@asgpay/pay/-/pay-1.0.1.tgz","fileCount":4,"unpackedSize":16276,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGn7EHgJcdvvpNIpDe/2g6o0rcBI1w7UWwE3ifjo2KZdAiBRBLSNDk7RAiUmXCVwD9xZtNNuBMNZe7Ip5SVG+u1uKw=="}]},"_npmUser":{"name":"asgcard","email":"aidar@asgcompute.com"},"directories":{},"maintainers":[{"name":"asgcard","email":"aidar@asgcompute.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pay_1.0.1_1775341842465_0.7106385497976133"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-04T22:09:05.015Z","modified":"2026-04-04T22:30:42.739Z","1.0.0":"2026-04-04T22:09:05.197Z","1.0.1":"2026-04-04T22:30:42.609Z"},"bugs":{"url":"https://github.com/ASGCompute/ASGCompute-ows-agent-pay/issues"},"author":{"name":"ASG Compute","email":"aidar@asgcompute.com"},"license":"Apache-2.0","homepage":"https://pay.asgcard.dev","keywords":["asg-pay","asgpay","ai-agent-payments","autonomous-agent-payments","agent-to-agent-payments","agentic-commerce","machine-to-machine-payments","x402","x402-protocol","http-402","402-payment-required","mpp","machine-payments-protocol","stripe-machine-payments","ai-agent-sdk","ai-agent-financial-identity","agent-wallet","agent-virtual-card","policy-engine","stripe","coinbase","circle","usdc","base","arbitrum","optimism","polygon","stellar","solana","evm","multi-chain","langchain","crewai","autogpt","mcp","open-wallet-standard","ai-payments","agent-banking","defi-agents"],"repository":{"type":"git","url":"git+https://github.com/ASGCompute/ASGCompute-ows-agent-pay.git"},"description":"ASG Pay — the banking layer for autonomous AI agents. Multi-chain payments (x402 + MPP), virtual cards, policy engine, 15 networks. The only SDK unifying Coinbase x402 and Stripe Machine Payments Protocol into one npm install.","maintainers":[{"name":"asgcard","email":"aidar@asgcompute.com"}],"readme":"<h1 align=\"center\">\n  <br>\n  💳\n  <br>\n  ASG Pay\n  <br>\n</h1>\n\n<h3 align=\"center\">The banking layer for autonomous AI agents.<br/>One SDK. 15 networks. Two protocols. Zero payment code.</h3>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@asgpay/pay\"><img src=\"https://img.shields.io/npm/v/@asgpay/pay?style=flat-square&color=635bff&label=npm\" alt=\"npm version\" /></a>\n  <a href=\"https://www.npmjs.com/package/@asgpay/pay\"><img src=\"https://img.shields.io/npm/dm/@asgpay/pay?style=flat-square&color=22c55e\" alt=\"downloads\" /></a>\n  <img src=\"https://img.shields.io/badge/networks-15-635bff?style=flat-square\" alt=\"15 networks\" />\n  <img src=\"https://img.shields.io/badge/protocols-x402%20%2B%20MPP-7c5cfc?style=flat-square\" alt=\"dual protocol\" />\n  <img src=\"https://img.shields.io/badge/tests-269%20passing-22c55e?style=flat-square\" alt=\"269 tests\" />\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square\" alt=\"license\" /></a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://pay.asgcard.dev\">Website</a>&nbsp;&nbsp;·&nbsp;&nbsp;\n  <a href=\"#-quick-start\">Quick Start</a>&nbsp;&nbsp;·&nbsp;&nbsp;\n  <a href=\"https://github.com/ASGCompute/ASGCompute-ows-agent-pay\">GitHub</a>&nbsp;&nbsp;·&nbsp;&nbsp;\n  <a href=\"https://x.com/ASGCardx402\">𝕏 @ASGCardx402</a>\n</p>\n\n---\n\n## The Problem\n\n**$28 trillion in AI-driven commerce by 2030** — but agents can't pay.\n\nTraditional 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.\n\n**The entire agentic economy is blocked by a missing financial layer.**\n\n## The Solution\n\n**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:\n\n```bash\nnpm install @asgpay/pay\n```\n\n```typescript\nimport { OwsClient, EvmPaymentAdapter } from '@asgpay/pay';\n\nconst agent = new OwsClient({\n  baseURL: 'https://api.example.com',\n  adapter: new EvmPaymentAdapter({\n    chain: 'base',\n    asset: 'USDC',\n    privateKey: process.env.AGENT_KEY as `0x${string}`,\n  }),\n  policy: { maxAmountPerTransaction: 5, monthlyBudget: 100 },\n});\n\n// Agent pays automatically — zero payment logic needed\nconst data = await agent.performTask('/v1/inference', { model: 'gpt-4' });\n```\n\n**What happens:** Request → `402 Payment Required` → auto-detect protocol → settle on-chain → retry with proof → `200 OK`. Your agent never sees the payment.\n\n---\n\n## Why ASG Pay Wins\n\n<table>\n<tr>\n<td width=\"33%\" align=\"center\">\n<h3>🔗 Dual Protocol</h3>\n<strong>Only SDK</strong> unifying x402 (Coinbase) + MPP (Stripe).<br/>One import covers both standards.\n</td>\n<td width=\"33%\" align=\"center\">\n<h3>🌐 15 Networks</h3>\nBase · Arbitrum · Optimism · Ethereum · Polygon · Stellar · Solana · Stripe + testnets\n</td>\n<td width=\"33%\" align=\"center\">\n<h3>🛡️ Fail-Closed</h3>\n4-gate policy engine. Agents <strong>cannot</strong> overspend. No override, no bypass.\n</td>\n</tr>\n</table>\n\n---\n\n## Product Suite\n\nASG Pay is the engine behind the full ASG financial infrastructure for AI agents:\n\n| Package | What It Does | Install |\n|---------|-------------|---------|\n| **[@asgpay/pay](https://npmjs.com/package/@asgpay/pay)** | Multi-chain payment SDK (x402 + MPP) | `npm i @asgpay/pay` |\n| **[@asgpay/sdk](https://npmjs.com/package/@asgpay/sdk)** | Virtual Mastercard management | `npm i @asgpay/sdk` |\n| **[@asgpay/cli](https://npmjs.com/package/@asgpay/cli)** | Card creation & management CLI | `npx @asgpay/cli` |\n| **[@asgpay/mcp-server](https://npmjs.com/package/@asgpay/mcp-server)** | AI agent tools (Claude, Codex, Cursor) | `npx @asgpay/mcp-server` |\n| **[@asgpay/fund](https://npmjs.com/package/@asgpay/fund)** | One-link agent wallet funding | `npm i @asgpay/fund` |\n| **[@asgpay/agent-cash](https://npmjs.com/package/@asgpay/agent-cash)** | Autonomous virtual credit cards | `npm i @asgpay/agent-cash` |\n| **[@asgpay/create-app](https://npmjs.com/package/@asgpay/create-app)** | Project scaffolding | `npx @asgpay/create-app` |\n\n---\n\n## How It Works\n\n```\n┌─────────────────────────────────────────────────────────┐\n│  YOUR AI AGENT                                          │\n│  (LangChain, CrewAI, AutoGPT, custom)                  │\n│                                                         │\n│   agent.performTask('/api/data')                        │\n│         │                                               │\n│         ▼                                               │\n│  ┌──────────────────────────────────┐                   │\n│  │  ASG Pay Engine (OwsClient)      │                   │\n│  │  ┌────────────┐ ┌──────────────┐ │                   │\n│  │  │ x402 Auto  │ │  MPP Auto    │ │                   │\n│  │  │ Detection  │ │  Detection   │ │                   │\n│  │  └─────┬──────┘ └──────┬───────┘ │                   │\n│  │        │               │         │                   │\n│  │  ┌─────▼───────────────▼───────┐ │                   │\n│  │  │    Policy Engine (4-gate)   │ │                   │\n│  │  │  amount │ per-tx │ monthly  │ │                   │\n│  │  │       │ whitelist           │ │                   │\n│  │  └───────────┬─────────────────┘ │                   │\n│  │              │                   │                   │\n│  │  ┌───────────▼─────────────────┐ │                   │\n│  │  │  Settlement Adapters        │ │                   │\n│  │  │  EVM │ Stellar │ Solana │   │ │                   │\n│  │  │  Stripe MPP                 │ │                   │\n│  │  └─────────────────────────────┘ │                   │\n│  └──────────────────────────────────┘                   │\n│         │                                               │\n│         ▼                                               │\n│   200 OK — agent gets data                              │\n└─────────────────────────────────────────────────────────┘\n```\n\n---\n\n## Supported Networks\n\n| Network | Protocol | Assets | Status |\n|---------|----------|--------|:------:|\n| **Base** | x402 | ETH, USDC | ✅ Live |\n| **Arbitrum** | x402 | ETH, USDC | ✅ Live |\n| **Optimism** | x402 | ETH, USDC | ✅ Live |\n| **Ethereum** | x402 | ETH, USDC | ✅ Live |\n| **Polygon** | x402 | MATIC, USDC | ✅ Live |\n| **Stellar** | x402 + MPP | XLM, USDC | ✅ Live |\n| **Solana** | x402 | SOL, USDC | ✅ Live |\n| **Stripe** | MPP | USD (fiat) | ✅ Live |\n\n> All testnets supported. All USDC contracts are Circle's official native deployments.\n\n---\n\n## Competitive Landscape\n\n| Capability | ASG Pay | Stripe (MPP only) | Coinbase (x402 only) | Circle |\n|------------|:---:|:---:|:---:|:---:|\n| **Dual Protocol (x402 + MPP)** | ✅ | ❌ | ❌ | ❌ |\n| Virtual Cards for Agents | ✅ | Raw API | ❌ | ❌ |\n| Multi-chain (15 networks) | ✅ | ❌ | Base only | ❌ |\n| Fail-closed Policy Engine | ✅ | ❌ | ❌ | ❌ |\n| Agent Identity (DID/EAS) | ✅ | ❌ | ❌ | ❌ |\n| MCP Tools (AI-native) | ✅ | ❌ | ❌ | ❌ |\n| One-line Integration | ✅ | ❌ | ❌ | ❌ |\n| Open Source | ✅ | ❌ | Partial | ❌ |\n\n**No other SDK unifies x402 and MPP protocols, supports 15 networks, includes virtual cards, and ships with a fail-closed policy engine.**\n\n---\n\n## Market Opportunity\n\n| Metric | Value | Source |\n|--------|-------|--------|\n| Agentic AI TAM (2030) | **$28T** | Gartner 2025 |\n| Agent transactions requiring payments | **47%** | McKinsey Digital |\n| Enterprise AI agent adoption | **85% by 2027** | Deloitte |\n| x402 + MPP protocol coverage | **~90% of agent payments** | ASG Research |\n\nASG Pay is positioned as **Stripe for autonomous agents** — the default payment infrastructure for the $28T agentic economy.\n\n---\n\n## Traction\n\n| Metric | Value |\n|--------|-------|\n| NPM Packages | 7 published |\n| Test Coverage | 269 tests, 84% coverage |\n| Networks Supported | 15 (production + testnet) |\n| Protocols | 2 (x402 + MPP) |\n| MCP Tools | 11 tools for Claude/Codex/Cursor |\n| Production Deployments | [pay.asgcard.dev](https://pay.asgcard.dev) · [asgcard.dev](https://asgcard.dev) · [fund.asgcard.dev](https://fund.asgcard.dev) |\n\n---\n\n## Quick Start Examples\n\n<details>\n<summary><strong>EVM (Base, Arbitrum, Optimism, Ethereum, Polygon)</strong></summary>\n\n```typescript\nimport { OwsClient, EvmPaymentAdapter } from '@asgpay/pay';\n\nconst agent = new OwsClient({\n  baseURL: 'https://api.example.com',\n  adapter: new EvmPaymentAdapter({\n    chain: 'base',\n    asset: 'USDC',\n    privateKey: process.env.AGENT_KEY as `0x${string}`,\n  }),\n  policy: { maxAmountPerTransaction: 5, monthlyBudget: 100 },\n});\n\nconst result = await agent.performTask('/v1/data');\n```\n\n</details>\n\n<details>\n<summary><strong>Stellar (XLM, USDC)</strong></summary>\n\n```typescript\nimport { OwsClient, StellarPaymentAdapter } from '@asgpay/pay';\n\nconst agent = new OwsClient({\n  baseURL: 'https://api.example.com',\n  adapter: new StellarPaymentAdapter({\n    secretKey: process.env.STELLAR_SECRET!,\n    network: 'mainnet',\n    asset: 'USDC',\n  }),\n  policy: { monthlyBudget: 50, maxAmountPerTransaction: 2 },\n});\n```\n\n</details>\n\n<details>\n<summary><strong>Solana (SOL, USDC)</strong></summary>\n\n```typescript\nimport { OwsClient, SolanaPaymentAdapter } from '@asgpay/pay';\n\nconst agent = new OwsClient({\n  baseURL: 'https://api.example.com',\n  adapter: new SolanaPaymentAdapter({\n    secretKey: myKeypair.secretKey,\n    network: 'mainnet-beta',\n    asset: 'USDC',\n  }),\n  policy: { monthlyBudget: 50, maxAmountPerTransaction: 2 },\n});\n```\n\n</details>\n\n<details>\n<summary><strong>Stripe MPP (Fiat USD)</strong></summary>\n\n```typescript\nimport { OwsClient, StripePaymentAdapter } from '@asgpay/pay';\n\nconst agent = new OwsClient({\n  baseURL: 'https://api.example.com',\n  adapter: new StripePaymentAdapter({\n    stripeSecretKey: process.env.STRIPE_SECRET_KEY!,\n    networkId: 'my-network',\n  }),\n  policy: { monthlyBudget: 200, maxAmountPerTransaction: 10 },\n});\n```\n\n</details>\n\n<details>\n<summary><strong>402 Payment Gating (Server-side — charge agents)</strong></summary>\n\n```typescript\nimport { createPaymentGate } from '@asgpay/pay';\n\napp.post('/api/premium', createPaymentGate({\n  x402: {\n    payTo: '0xYOUR_WALLET',\n    amount: '500000',\n    asset: 'USDC',\n    network: 'eip155:8453',\n  },\n  mpp: {\n    realm: 'api.example.com',\n    method: 'onchain',\n    amount: '0.50',\n    recipient: '0xYOUR_WALLET',\n  },\n}), (req, res) => {\n  res.json({ data: 'premium content' });\n});\n```\n\n</details>\n\n---\n\n## Technology Stack\n\n| Layer | Technology |\n|-------|-----------|\n| **EVM** | [viem](https://viem.sh) — type-safe Ethereum client |\n| **Stellar** | [@stellar/stellar-sdk](https://stellar.org) |\n| **Solana** | [@solana/web3.js](https://solana.com) + [@solana/spl-token](https://spl.solana.com/token) |\n| **Payments** | Stripe API `2026-03-04.preview` (native MPP/SPT) |\n| **Build** | TypeScript strict mode, dual CJS + ESM |\n| **Test** | Vitest — 269 tests, 84% coverage |\n| **CI/CD** | GitHub Actions — Node 18/20/22 matrix |\n\n---\n\n## FAQ\n\n**Is ASG Pay free?** Yes. Apache 2.0. You only pay gas fees or Stripe fees.\n\n**Does it work with LangChain / CrewAI / AutoGPT?** Yes. Any JS/TS agent framework.\n\n**Can agents pay each other?** Yes. Pay Out + Pay In + `buildPaymentUri()` for agent-to-agent.\n\n**How do I add a new chain?** Implement `PaymentAdapter` (~40 lines of TypeScript).\n\n**Is this the same as @asgcard/pay?** Yes. `@asgpay/pay` and `@asgcard/pay` are both official packages by ASG Compute. Use whichever you prefer.\n\n---\n\n## Links\n\n| | |\n|---|---|\n| 🌐 **Website** | [pay.asgcard.dev](https://pay.asgcard.dev) |\n| 💳 **Virtual Cards** | [asgcard.dev](https://asgcard.dev) |\n| 💰 **Agent Funding** | [fund.asgcard.dev](https://fund.asgcard.dev) |\n| 📦 **NPM** | [@asgpay/pay](https://npmjs.com/package/@asgpay/pay) |\n| 🐙 **GitHub** | [ASGCompute](https://github.com/ASGCompute/ASGCompute-ows-agent-pay) |\n| 𝕏 **Twitter** | [@ASGCardx402](https://x.com/ASGCardx402) |\n\n---\n\n<p align=\"center\">\n  <strong>Built by <a href=\"https://asgcompute.com\">ASG Compute</a></strong>\n  <br><br>\n  <sub>ASG Pay — the banking layer for autonomous AI agents.</sub>\n  <br>\n  <sub>Give every agent a financial identity — in one line of code.</sub>\n</p>\n","readmeFilename":"README.md"}