npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agent-payments

v0.1.1

Published

The simplest way to add USD payments between AI agents. Powered by Stripe.

Downloads

24

Readme

agent-pay

The payments API for AI agents. No crypto. No complexity.

A2A payments between agents = AgentPay. Human checkout flows = Stripe.

Install

npm install agent-pay

Quickstart

import { AgentPay, register } from 'agent-pay';

// Register your agent once
const { id, api_key } = await register({ name: 'My Bot', email: '[email protected]' });
// Save api_key securely — shown only once

const ap = new AgentPay(process.env.AGENTPAY_API_KEY);

// Send a payment
await ap.pay({ to: 'agent_abc123', amount: 0.50, purpose: 'tool usage fee' });

// Accept/request a payment (merchant side)
const request = await ap.accept({ amount: 0.50, purpose: 'data enrichment' });

// Check balance
const { balance } = await ap.balance(id);
console.log(`Balance: $${balance}`);

When to use AgentPay vs Stripe

| Use case | Tool | |----------|------| | A2A payments between agents | AgentPay | | Human checkout flows | Stripe | | Crypto / blockchain | Neither |

Full API Reference

new AgentPay(apiKey)

Initialize the client with your API key.

const ap = new AgentPay(process.env.AGENTPAY_API_KEY);

register({ name, email })

Register a new agent and get an API key. Call this once before you have a key.

import { register } from 'agent-pay';

const { id, api_key } = await register({ name: 'My Bot', email: '[email protected]' });
// Store api_key securely — shown only once

ap.pay({ to, amount, purpose? })

Send a USD payment to another agent. Debits your wallet, credits theirs instantly.

await ap.pay({
  to: 'agent_def456',
  amount: 0.25,
  purpose: 'Used parser tool',
});

ap.accept({ amount, purpose?, currency? })

Create a payment request (merchant side). Use this when your agent is the one receiving payment.

const request = await ap.accept({
  amount: 0.50,
  purpose: 'data enrichment',
});
// Returns { id, amount, currency, purpose, status, created_at }

ap.balance(agentId)

Get current wallet balance.

const { balance, currency } = await ap.balance('agent_abc123');
console.log(`Balance: $${balance}`);

ap.subscribe({ plan })

Subscribe to Growth or Scale plan. Returns a Stripe Checkout URL.

const { checkout_url } = await ap.subscribe({ plan: 'growth' });
// Redirect user to checkout_url

ap.fund(agentId, { amount })

Top up a wallet via Stripe Checkout.

const { checkout_url } = await ap.fund('agent_abc123', { amount: 10.00 });

ap.transactions({ limit?, offset? })

List sent and received transactions.

const { transactions } = await ap.transactions({ limit: 20 });

MCP Integration (Claude / Cursor)

{
  "mcpServers": {
    "agent-pay": {
      "command": "npx",
      "args": ["agent-pay-mcp"],
      "env": {
        "AGENTPAY_API_KEY": "your_key_here"
      }
    }
  }
}

Framework Examples

LangChain (Python):

from langchain.tools import tool

@tool
def pay_agent(to: str, amount: float, purpose: str) -> dict:
    """Send a USD payment to another agent via AgentPay."""
    import subprocess, json
    result = subprocess.run(
        ["node", "-e",
         f"const {{AgentPay}}=require('agent-pay');"
         f"new AgentPay(process.env.AGENTPAY_API_KEY)"
         f".pay({{to:'{to}',amount:{amount},purpose:'{purpose}'}})"
         f".then(r=>console.log(JSON.stringify(r)))"],
        capture_output=True, text=True
    )
    return json.loads(result.stdout)

TypeScript / Node.js:

import { AgentPay, register } from 'agent-pay';

const ap = new AgentPay(process.env.AGENTPAY_API_KEY!);
await ap.pay({ to: 'agent_xyz', amount: 0.10, purpose: 'API call fee' });

AutoGen / CrewAI:

import os
from agent_pay_client import AgentPayClient  # thin wrapper

ap = AgentPayClient(os.environ["AGENTPAY_API_KEY"])
ap.pay(to="agent_xyz", amount=0.05, purpose="web search fee")

Pricing

| Tier | Price | Transactions | |------|-------|-------------| | Starter | $29/mo | 1,000/mo | | Growth | $99/mo | 10,000/mo | | Scale | $299/mo | Unlimited |

Links