A-Pay Protocol

io.github.neuralaisofficial-lang由 GitHub 账号 neuralaisofficial-lang 发布v0.1.8更新于 Oct 24, 2026

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

已验证Streamable HTTP可网页运行金融开发者工具

概览

AI 生成的概览

为 AI 助手提供非托管加密钱包,在预算上限内探测并自动支付 Base L2 上的 HTTP 402 小额付款。

可以做什么
  • 检查端点是否需要 A-Pay 小额支付,查看报价、币种与收款地址,且不花费资金
  • 在预设限额内自动以 USDC 或 $APAY 支付 Base L2 上的 HTTP 402 小额付款
  • 查看代理钱包地址、网络、支出护栏与累计支出
  • 查询链上 ETH、USDC 与 $APAY 实时余额
  • 设置每日预算与单次调用支出上限
适用场景
当助手需要调用返回 HTTP 402 的付费 API 或数据服务,并希望它在硬性预算上限内自主完成小额加密支付、无需逐次人工确认时使用。
运行要求
可作为远程端点,或作为本地 Python 包(uvx/pip,stdio)运行。需选择 Base 网络(base-mainnet 或 base-sepolia)、币种偏好与预算限额;私钥可通过 APAY_PRIVATE_KEY 提供,省略时会自动生成会话钱包。支付需要链上资金,gas 需要 ETH。
安装前请注意
会花费真实加密货币:付款经签名并在链上结算,请谨慎设置 APAY_DAILY_BUDGET 与 APAY_MAX_PER_CALL。APAY_PRIVATE_KEY 是钱包签名私钥;自动生成的会话钱包虽为非托管,但仍持有资金。检查端点不花钱,但发起支付会把资金转给第三方收款方。

安装

在 SourceWeft 中

  1. 打开 控制台中的 A-Pay Protocol,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.neuralaisofficial-lang%2Fapay/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "a-pay-protocol": {
      "type": "http",
      "url": "https://apay-network.vercel.app/api/mcp"
    }
  }
}

README

⚡ A-Pay Protocol (AgentPay)

The Universal Micropayment & Economic Layer for Autonomous AI Agents

[Python 3.11+] [Status] [Tests] [Live Console]


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

bash
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:

bash
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:

python
from apay import APaySession, AgentWallet
# Generate or load wallet with daily safety limitwallet = 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 flyresponse = 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:

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

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

json
{  "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

text
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

bash
# 1. Install A-Pay via pippip install apay
# 2. Generate a new Agent Wallet with spending limitsapay wallet new
# 3. Protect any website or API with an instant HTTP 402 Paywallapay 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.

来源:README.md,提交 cbab6ab

工具

5

apay_request

Probe and automatically pay HTTP 402 crypto micropayments on Base Layer 2 with USDC or $APAY within pre-configured budget limits.

输入参数url必填methodheadersjson_body

apay_get_wallet_status

Inspect the agent's active non-custodial wallet address, network, current spending guardrails, and total spent in USDC and $APAY.

无需输入参数。

apay_set_budget

Configure agent safety invariants and spending guardrails. Prevents runaway loops or overcharging.

输入参数daily_budget_apaydaily_budget_usdcmax_per_call_apaymax_per_call_usdc

apay_inspect_endpoint

Inspect an endpoint to check if it requires an A-Pay micropayment, inspect the exact price quote, currency, and payout receiver without spending any funds.

输入参数url必填

apay_get_balance

Inspect the agent's live on-chain balances on Base Layer 2, including native ETH (for gas), USDC, and $APAY tokens.

输入参数address

版本历史

1
  1. v0.1.8最新Sep 27, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。