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 分

    請在儲存庫或註冊中心條目中宣告授權條款。