A-Pay Protocol

Official registry AI and agents

Universal HTTP 402 Micropayment Protocol & Autonomous Economic Settlement Engine for AI Agents

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

Remote (streamable-http)
Claude Code
claude mcp add --transport http a-pay-protocol 'https://apay-network.vercel.app/api/mcp'
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "a-pay-protocol": {
            "type": "http",
            "url": "https://apay-network.vercel.app/api/mcp"
        }
    }
}
PYPI package apay
Claude Code
claude mcp add a-pay-protocol -e 'APAY_PRIVATE_KEY=<your apay_private_key>' -e 'APAY_NETWORK=base-mainnet' -e 'APAY_CURRENCY=DUAL' -e 'APAY_MAX_PER_CALL=0.05' -e 'APAY_DAILY_BUDGET=2.0' -- uvx apay==0.1.8 mcp
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "a-pay-protocol": {
            "command": "uvx",
            "args": [
                "apay==0.1.8",
                "mcp"
            ],
            "env": {
                "APAY_PRIVATE_KEY": "<your apay_private_key>",
                "APAY_NETWORK": "base-mainnet",
                "APAY_CURRENCY": "DUAL",
                "APAY_MAX_PER_CALL": "0.05",
                "APAY_DAILY_BUDGET": "2.0"
            }
        }
    }
}

Environment variables

  • APAY_PRIVATE_KEY secret Agent private key for signing EIP-712 payment authorizations (auto-generates non-custodial session wallet if omitted)
  • APAY_NETWORK Base network (base-mainnet or base-sepolia)
  • APAY_CURRENCY Preferred payment token (USDC, APAY, or DUAL)
  • APAY_MAX_PER_CALL Maximum allowed spend per single HTTP 402 request in USDC (default: 0.05)
  • APAY_DAILY_BUDGET Maximum 24-hour spending limit in USDC (default: 2.00)

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. ⚡ A-Pay Protocol (AgentPay)
  2. 🌐 Live Production Network & On-Chain Addresses
  3. 🎯 Vision & Identity
  4. 🚀 1-Command Experience
  5. 📦 Directory Structure
  6. 🛠️ Installation & Quickstart

⚡ A-Pay Protocol (AgentPay)

The Universal Micropayment & Economic Layer for Autonomous AI Agents

[]() []()


🌐 Live Production Network & On-Chain Addresses


🎯 Vision & Identity

A-Pay is an ultra-lightweight, zero-latency, open economic rail designed for the machine-to-machine (M2M) economy. Just as UPI revolutionized human digital payments in India, A-Pay enables autonomous AI software agents to discover, consume, and pay for data, compute, APIs, and micro-services on the fly—without credit cards, human KYC, or seed phrase friction.


🚀 1-Command Experience

1. Website / API Owners (The Sellers)

Scaffold a fullstack monetized AI Agent app (Next.js, FastAPI, or Express) in 60 seconds:

npx create-apay-app my-paid-agent

Or protect ANY existing website or API with an instant HTTP 402 crypto paywall proxy—zero code modifications required:

apay protect --target http://localhost:8000 --price 0.001 --wallet 0xYourWalletAddress
  • Incoming requests from AI bots will automatically receive an HTTP 402 Payment Required challenge.
  • Once the AI agent's cryptographic micropayment is verified (<15ms), the request is forwarded to your server and data is unlocked!

2. AI Agent Developers (The Buyers)

Give your AI agent an in-memory wallet and strict spending guardrails with 2 lines of code:

from apay import APaySession, AgentWallet

# Generate or load wallet with daily safety limit
wallet = AgentWallet(private_key="0x...", max_per_call_usdc=0.01, daily_budget_usdc=5.0)
session = APaySession(wallet)

# Automatically handles HTTP 402 challenges & settles on the fly
response = session.get("https://protected-api.com/market-data")
print(response.json())

3. Claude Desktop & Cursor (Model Context Protocol / MCP)

Equip Claude Desktop, Cursor, Antigravity, or Cline with an autonomous A-Pay micro-wallet in 1 click via Smithery.ai:

npx -y @smithery/cli install apay --client claude

Or add directly to claude_desktop_config.json or .cursor/mcp.json (zero-setup via uvx):

{
  "mcpServers": {
    "apay": {
      "command": "uvx",
      "args": ["apay", "mcp"],
      "env": {
        "APAY_NETWORK": "base-mainnet",
        "APAY_CURRENCY": "DUAL",
        "APAY_MAX_PER_CALL": "0.05",
        "APAY_DAILY_BUDGET": "2.0"
      }
    }
  }
}

Now your assistant can autonomously inspect balances, probe paywalls, and settle HTTP 402 micropayments on Base L2!


📦 Directory Structure

apay/
├── src/
│   └── apay/
│       ├── __init__.py      # Package exports
│       ├── cli.py           # ⚡ 1-Command CLI (`apay protect`, `apay wallet new`, `apay pay`)
│       ├── client.py        # 🤖 Auto-settling HTTP client (sync & async)
│       ├── wallet.py        # 🔐 In-memory wallet + local spending limits
│       ├── proxy.py         # 🛡️ Ultra-light reverse proxy paywall (Starlette + EIP-712)
│       ├── relayer.py       # 📊 Settlement journal & batch relayer
│       └── integrations/    # 🔗 LangChain & CrewAI agent wrappers
├── contracts/               # Base Sepolia Smart Contracts (APAYToken & APayRouter)
├── tests/                   # Automated integration & security test suite
├── spec/                    # RFC wire format & security model specifications
└── pyproject.toml           # Hatchling packaging configuration

🛠️ Installation & Quickstart

# 1. Install A-Pay via pip
pip install apay

# 2. Generate a new Agent Wallet with spending limits
apay wallet new

# 3. Protect any website or API with an instant HTTP 402 Paywall
apay protect --target http://localhost:8000 --price 0.001 --wallet 0xYourPayoutWalletAddress

A-Pay is an open-source decentralized economic protocol for autonomous machine agents. Built on Base L2.

Frequently asked questions

What is A-Pay Protocol?

Universal HTTP 402 Micropayment Protocol & Autonomous Economic Settlement Engine for AI Agents

How do I install A-Pay Protocol?

It runs as a remote server. In Claude Code: claude mcp add --transport http a-pay-protocol 'https://apay-network.vercel.app/api/mcp'. For other clients, paste the JSON configuration from this page into their MCP settings.

Does A-Pay Protocol need an API key?

Yes. It expects APAY_PRIVATE_KEY, which you set in its configuration.

Is A-Pay Protocol open source?

Its code is public on GitHub, but the repository does not declare a standard license.

Who maintains A-Pay Protocol?

It is published by neuralaisofficial-lang. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.