A2apay

io.github.groundhogday2011-bytev0.1.0更新于 Oct 8, 2026

Pay-per-call AI query and versioned task memory for agents. No account, no API key, via x402.

已验证STDIO仅桌面AI & MLKnowledge & Memory

概览

AI 生成的概览

让助手调用付费 AI 查询服务并保存带版本的任务检查点,附带少量每日免费额度。

功能
以 MCP 工具形式提供 ask 和 remember。ask 返回 a2apay 服务生成的 AI 回答;remember 存储带可选标签的扁平文本键值记录。底层客户端还支持 checkpoint 和 resume,用于带版本、按任务划分的状态,但 MCP 服务器只暴露 ask 和 remember,且 remember 只写不可读,没有回读工具。
适用场景
适合在助手需要偶尔获取 AI 回答或简单按任务存储文本、又不想注册账号或申请 API 密钥,且每日免费额度够用时使用。若需要通过 MCP 读回已存内容,或需要真正的文档数据库,则不太适用。
运行要求
作为本地 Python 进程运行(pip install a2apay-io[mcp],然后 python mcp_server.py)。免费额度无需钱包或凭据。超出免费额度后需设置环境变量 A2APAY_PRIVATE_KEY,填入 Base 主网钱包私钥并持有少量 USDC,同时安装付费附加依赖 eth-account。需要访问 a2apay 服务的网络连接。
安装前请注意
付费调用会从 A2APAY_PRIVATE_KEY 对应的钱包在 Base 主网上花费真实 USDC;README 称该私钥仅在本地用于签署支付授权、不会发送到任何地方,但它仍是钱包私钥,应按高度敏感信息对待。调用会把查询内容和存储值发送给第三方服务。remember 会写入数据且没有回读工具,因此无法通过 MCP 取回已存记录。

安装

在 SourceWeft 中

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

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

a2apay

Python client for a2apay.io — pay-per-call AI answers and persistent memory for autonomous agents. No account, no API key.

bash
pip install a2apay-io          # free-tier onlypip install "a2apay-io[paid]"  # adds real payment support (eth-account)

(The PyPI distribution is named a2apay-io — an unrelated package already holds the bare a2apay name. The importable module is still a2apay.)

Quick start (free tier, zero setup)

Every call tries the free tier first automatically — 5 requests/day per caller, no wallet needed:

python
from a2apay import Agent
agent = Agent()answer = agent.ask("What's 7 times 8?")print(answer)
agent.remember("last_task", "processed invoice #4471", tags=["billing"])

With real payment (once the free tier is used up)

python
from a2apay import Agent
agent = Agent(private_key="0x...")  # or set A2APAY_PRIVATE_KEYanswer = agent.ask("What's 7 times 8?")

The wallet needs a small USDC balance on Base mainnet ($0.028/call). The private key is used only to sign a payment authorization locally — it is never sent anywhere.

Checkpoint / resume (task memory)

Write versioned, task-scoped state and read it back later — even from a different process. Each checkpoint() to the same key adds a new version rather than overwriting, and resume() always returns the latest.

python
from a2apay import Agent
agent = Agent(private_key="0x...")agent.checkpoint("invoice-batch-7", key="status", value="processed rows 1-400")
# ...process dies, or a second process picks up later...
agent2 = Agent(private_key="0x...")  # same walletrecords = agent2.resume("invoice-batch-7")print(records[0]["value"])  # "processed rows 1-400"

resume() always requires payment ($0.014/call) — there's no free tier for reads yet, so it needs a configured wallet even for your first call. checkpoint() follows the same free-tier-then-paid behavior as remember().

What this honestly does and doesn't do

  • ask() returns a real AI-generated answer.
  • remember() stores a flat key/value record with optional tags — this is simple text storage, not a document database. Values are stored as text.
  • Falls back to a real payment only when the free tier returns a 402; if no private_key is configured at that point, it raises a clear A2ApayError rather than failing silently.
  • Payment signing uses eth-account (maintained by the Ethereum Foundation ecosystem), implementing the real x402 "exact" EVM scheme per the x402 protocol spec.

MCP server

An MCP server (mcp_server.py) exposes ask and remember as MCP tools for any MCP-aware agent or framework (Claude Desktop, etc.):

bash
pip install "a2apay-io[mcp]"python mcp_server.py

Add to an MCP client config:

json
{  "mcpServers": {    "a2apay": {      "command": "python",      "args": ["/absolute/path/to/mcp_server.py"],      "env": {"A2APAY_PRIVATE_KEY": "0x..."}    }  }}

Honest scope note: remember is write-only — there's no memory read-back tool because the live API doesn't have a read-back route yet.

Full API reference

See a2apay.io/openapi.yaml for the underlying HTTP API this wraps.

来源:README.md,提交 685aa4c

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.1.0最新Oct 8, 2026