JSPM

@asgpay/pay

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 376
  • Score
    100M100P100Q8468F
  • License Apache-2.0

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.

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
ASG Pay

The banking layer for autonomous AI agents.
One SDK. 15 networks. Two protocols. Zero payment code.

npm version downloads 15 networks dual protocol 269 tests license

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/pay
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 },
});

// 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 Protocol

Only SDK unifying x402 (Coinbase) + MPP (Stripe).
One import covers both standards.

🌐 15 Networks

Base · Arbitrum · Optimism · Ethereum · Polygon · Stellar · Solana · Stripe + testnets

🛡️ Fail-Closed

4-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.


🌐 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.