TAPEAPI 3.0 · v3.0.0 · 2026-11-06 · BNB 56 · X LAYER 196 · BASE 8453

每个 Agent,
都能被陌生人核验

Any agent can be
checked by a stranger

一次 AI 调用留下签名回执;一个 Agent 的身份和花钱规则,别人在自己的机器上就能重新查一遍。不用先认识它,不用相信它自己怎么说。

An AI call leaves a signed receipt. An agent's identity and its spending rules can be checked again by anyone, on their own machine. You need not know it first, and you need not take its word.

  • STABLE 3.x
  • 未经第三方审计
  • No third-party audit
  • 今天免费
  • Free today
  • 代码 MIT · 规范 CC0
  • Code MIT · Spec CC0
AGENT PASSPORT示例,不是真实 AgentExample, not a real agent
ERC-8004 身份
ERC-8004 identity
agent #… @ 0x…
TapeOut 电路
TapeOut circuit
#… @ 0x…
读取区块
Read at block
钉住在同一个区块
pinned to one block
运营方
Operators
2 家,答案必须一致
2; answers must match

UNAVAILABLE

两家运营方读到的不一致,所以结果是「不知道」,不猜。

The two operators read different answers, so the result is "unknown". It does not guess.

读不一致就说不知道,是这套机制最重要的一条。

Saying "unknown" when the reads disagree is the most important rule in this mechanism.

四层,都能自己查

Four layers, each one checkable by you

身份、工具、账、规矩

Identity, tools, accounts, rules

身份

Identity

3.0 新增 · 实验性New in 3.0 · experimental

同一钉块、两家以上运营方一致,才说这个 ERC-8004 身份和这枚 TapeOut 电路是同一个钱包持有。

Only when two or more operators agree at one pinned block does it say that one wallet holds this ERC-8004 identity and this TapeOut circuit.

tapeapi passport <名字name>

工具

Tools

1.0 起Since 1.0

MCP 工具定义的哈希钉在链上,也钉在你本机。之后定义变了,就拒绝这个服务。

The hash of an MCP server's tool definitions is pinned on chain and on your machine. If the definitions change later, that service is refused.

tapeapi-mcp

账

Accounts

2.x 起 · 3.0 加清单Since 2.x · statement in 3.0

回执和账单逐行对;3.0 加按服务、模型、天汇总的清单,和发出前拦住超额的本地预算。

Receipts are set against a bill row by row. 3.0 adds a statement by service, model and day, and a local budget that stops an over-limit call before it is sent.

tapeapi reconcile

规矩

Rules

3.0 新增 · 实验性New in 3.0 · experimental

委托人的花钱规则写成小电路,对方自己重跑;没电路、哈希不对、已撤销,一律拒绝。

The principal's spending rule is written as a small circuit that the other side re-runs. No circuit, a wrong hash, or a revoked binding: denied.

admit()

回执长什么样

What a receipt looks like

每个回答,附一张谁都能核验的回执

Every answer carries a receipt anyone can check

AI 用量回执的结构取自 TAPI-21 规范,数值为示例。

The structure of an AI usage receipt comes from the TAPI-21 spec; the values are examples.

x-tapeapi-receipt
{ "id": "chatcmpl-v1", "ok": true,
  "container": "0x…",                             1
  "ts": 1790000000,
  "method": "openai_chat",
  "params": { "path": "/v1/chat/completions",
              "requestSha256": "<64 hex>" },      2
  "result": {
    "model": "gpt-x",                             5
    "usage": { "prompt_tokens": 1200, "completion_tokens": 300,
               "total_tokens": 1500, "cache_read_tokens": 1000,
               "reasoning_tokens": 100 },         4
    "responseSha256": "<64 hex>",                 3
    "stream": false, "complete": true, "status": 200,
    "prices": [ { "currency": "USDT", "amount": "0.00357500" },
                { "currency": "BEM",  "amount": "0.03375000" } ],  4
    "modelMatchedBy": "response" },
  "sig": "0x…" }                                  1
  1. container 与 sig:谁签的。签名能恢复出签名者,它必须是电路持有人在链上委托的密钥。
  2. container and sig: who signed. The signature recovers the signer, which must be a key the circuit's holder delegated on chain.
  3. params.requestSha256:答的是哪个请求。你发出的字节的哈希,由你的 SDK 对照。
  4. params.requestSha256: which request. The hash of the bytes you sent, compared by your SDK.
  5. result.responseSha256:回了哪些字节。
  6. result.responseSha256: which bytes came back.
  7. usage 与 prices:声称的用量,和按链上价目表算出的金额;任何人都能重算。价目表只是公开声明,不经结算,用户照旧向服务方付款。
  8. usage and prices: the claimed usage, and the amount from the on-chain price table; anyone can recompute it. The price table is a public statement, not settled: users pay the provider as before.
  9. model:只是上游报的名字。回执不证明实际跑的是哪个模型。
  10. model: only the name the upstream reported. A receipt does not prove which model actually ran.

一张回执证明什么

What one receipt proves

问题Question 回执里的依据Evidence in the receipt 证明Proven
谁回答的Who answered持有人在链上委托的签名密钥A signing key the holder delegated on chain1
回答的是哪个请求To which exact requestrequestSha2561
回答了哪些字节With which exact bytesresponseSha2561
声称的用量与价格Claimed usage and pricetoken 数,按链上价目表重算的金额Token counts; an amount anyone recomputes from the on-chain table1
实际跑的是哪个模型Which model actually ranmodel 只是上游自己报的名字model is only the name the upstream reported0

回执不证明实际跑的是哪个模型。服务方可以把便宜模型的回答标成贵的。签名带来的是可追责:回执无法抵赖,任何人发测试请求、公开结果,都会留下证据。

A receipt does not prove which model actually ran. A provider could label a cheaper model's answer as a dearer one. What the signature adds is accountability: a receipt cannot be disowned, so anyone sending test prompts and publishing the results leaves evidence.

接入方式

How it fits in

它怎么接进来

The sidecar, the receipt, the chain

Your app, the provider's signing sidecar, the receipt, the check against the chain 01020304 你的应用YOUR APP 服务方的签名旁路SIGNING SIDECAR 回执RECEIPT 对链核验CHECK ON CHAIN 官方 SDKOFFICIAL SDK 只改 base URLONLY THE BASE URL 原样转给上游SAME BYTES UPSTREAM 为每个回答签名SIGNS EVERY ANSWER 随回答返回WITH THE ANSWER 响应头或 SSE 注释HEADER OR SSE LINE 持有人委托的密钥DELEGATED SIGNER 链上价目表ON-CHAIN PRICES 核验读的是链,不是旁路 THE CHECK READS THE CHAIN, NOT THE SIDECAR 身份 · 价目表 · 签名密钥的委托 · BNB Chain · X Layer · Base IDENTITY · PRICE TABLE · SIGNER DELEGATION · BNB CHAIN · X LAYER · BASE Your app, the provider's signing sidecar, the receipt, the check against the chain 01020304 你的应用YOUR APP 服务方的签名旁路THE PROVIDER'S SIGNING SIDECAR 回执RECEIPT 对链核验CHECK ON CHAIN 官方 SDK · 只改 base URLOFFICIAL SDK · ONLY THE BASE URL 请求原样发出THE REQUEST AS WRITTEN 原样转给上游 · 为每个回答签名SAME BYTES UPSTREAM, SIGNS EVERY ANSWER 由服务方自己部署RUN BY THE PROVIDER 随回答返回:响应头或 SSE 注释WITH THE ANSWER: HEADER OR SSE LINE 只带哈希,不带提示词和回答HASHES ONLY, NO PROMPT, NO ANSWER 持有人委托的密钥 · 链上价目表DELEGATED SIGNER · ON-CHAIN PRICES 在你的 SDK 里完成,读的是链DONE IN YOUR SDK, READING THE CHAIN 核验读的是链,不是旁路 THE CHECK READS THE CHAIN, NOT THE SIDECAR BNB Chain · X Layer · Base BNB CHAIN · X LAYER · BASE
图 1请求和回答原样穿过旁路,旁路为每个回答签一张回执。签名密钥由电路持有人在链上委托,价目表写在链上清单里,所以核验读的是链,不是旁路。
Fig. 1Requests and answers pass through the sidecar unchanged; it signs a receipt for every answer. The signing key is delegated on chain by the circuit's holder and the price table is in the on-chain manifest, so the check reads the chain, not the sidecar.

旁路会经手用户的 API 密钥,所以由服务方自己部署;TapeAPI 不托管。链上价目表只是公开声明,不经结算,用户照旧向服务方付款。支持 OpenAI Chat、Responses、Anthropic Messages 和 Embeddings,流式也支持。

The sidecar handles your users' API keys, so the provider runs it; TapeAPI never hosts it. The on-chain prices are a public statement, not settled: users pay the provider as before. OpenAI Chat, Responses, Anthropic Messages and Embeddings, streams included.

你是谁,从哪开始

Who you are, where to start

三种人,三条路

Three kinds of reader, three ways in

AI 服务方

AI providers

给你的接口加签名回执

Add signed receipts to your API

在 OpenAI 或 Anthropic 兼容接口前面放一个签名旁路,你的用户只改 base URL。

Put a signing sidecar in front of an OpenAI- or Anthropic-compatible API. Your users change only the base URL.

给 AI 服务方 →For AI providers →

调用方

Callers

核验你收到的每个回答

Check every answer you receive

用 SDK 或 tapeapi-verify 对照链上记录,核验回执、对账、钉住 MCP 工具。

Use the SDK or tapeapi-verify to check receipts against the chain, reconcile bills and pin MCP tools.

调用一个服务 →Call a service →

Agent 与守门方

Agents and gatekeepers

先查它,再让它调用

Check it first, then let it call

护照查身份,策略电路重跑规则,本地预算拦住超额。3.0 新增,实验性。

The passport checks identity, a policy circuit re-runs the rule, a local budget stops overspend. New in 3.0, experimental.

Agent 护照 →Agent Passport →

NEW IN 3.0

三样新东西,都在你自己的机器上完成

Three new things, all done on your own machine

  • Agent 护照:tapeapi passport、@tapeapi/passport。在同一个钉住的区块上读链,两家以上运营方一致才下结论:这个 ERC-8004 身份和这枚 TapeOut 电路,是不是同一个钱包持有;读不一致就说「不知道」。
  • Agent Passport: tapeapi passport, @tapeapi/passport. It reads the chain at one pinned block and concludes only when two or more operators agree: whether one wallet holds this ERC-8004 identity and this TapeOut circuit. When the reads disagree it says "unknown".
  • 策略电路:@tapeapi/policy-circuit。花钱的规则写成小电路,对方自己重跑,拿不准就拒绝。
  • Policy circuits: @tapeapi/policy-circuit. A spending rule is written as a small circuit that the other side re-runs; when unsure, it denies.
  • 花费清单与本地预算:tapeapi receipts statement。按服务、模型、天汇总,并在调用发出之前拦住超额。
  • Spend statement and local budget: tapeapi receipts statement. It sums spend by service, model and day, and stops an over-limit call before it is sent.

限制,如实说

The limits, plainly

  • 新增的两个包是 0.1.0、实验性,不在兼容承诺之内。
  • The two new packages are 0.1.0, experimental, and outside the compatibility promise.
  • 相关的 TAP 草案(#83、#84)已提交(评审中),未合并;提交不等于被采纳。
  • The related TAP drafts (#83, #84) are submitted (in review), not merged; submitting is not adoption.
  • 主网上目前还没有已知的 CONFIRMED 护照。
  • No CONFIRMED passport is known on mainnet yet.
  • 策略电路只约束去检查它的一方。
  • A policy circuit binds only those who check it.
  • 回执只证明签名方说了什么。
  • A receipt proves only what its signer said.
  • 付费托管合约未经审计、未部署,今天不收任何费用。
  • The paid-call escrow is not audited and not deployed; nothing is charged today.
  • 3.0 有五项破坏性修改,每一项(除 Node.js 22 下限)都有保留 2.x 行为的选项。
  • 3.0 has five breaking changes; each but the Node.js 22 floor has an option that keeps the 2.x behaviour.
DEFAULT SINCE 2.0

标准即默认。不传选项,SDK 就按 TapeOut 官方 TAP 解析服务:每次解析钉一个区块,链 ID 与持有人要所有节点一致,名字未开通或未付费就得到一个明确的状态,而不是悄悄解析成功。TAP-11 与 TAP-13 由我们起草,已合并为 Draft(合并不等于被采纳)。要 1.x 的行为,传 conform: false。

Standards by default. Pass no options and the SDK resolves a service as TapeOut's official TAPs say: one pinned block, all nodes agreeing on chain and owner, and a named status for a name not opened or not paid up. TAP-11 and TAP-13 to TAP-18, drafts we wrote, are merged as Drafts (a merge is not adoption). For 1.x: conform: false.

同一版首次公开三项实验性功能——有界代理、美元报价、容器间评价。它们依赖的托管合约未经审计、未部署,主网不可用,今天只在本地链与测试中可以验证,也不收任何费用。

The same release first makes public three experimental features: bounded agents, US-dollar prices and reviews between containers. The escrow they rely on is not audited and not deployed, so they do not work on mainnet; today they are checked on local chains and in tests only, and nothing is charged.

安装

Install

从 GitHub 发布页安装

Install from the GitHub release

包还不在 npm 上,从 GitHub 发布页装进一个空目录。需要 Node.js 22 或更高版本。

The packages are not on npm yet; install them from the GitHub release into an empty directory. Node.js 22 or later is required.

shell
npm install \
  https://github.com/BruceLanLan/tapeapi/releases/download/v3.0.0/tapeapi-sdk-3.0.0.tgz \
  https://github.com/BruceLanLan/tapeapi/releases/download/v3.0.0/tapeapi-server-3.0.0.tgz

A · curl向公共服务要 BNB 价格。curl 只显示签名信封,不做任何核对;验签用 SDK 或调试台。Ask the public service for the BNB price. curl shows the signed envelope and checks nothing; the SDK or the playground verifies it.

shell
curl -s https://api.tapeapi.fun/tapeapi/v1/bnbUsd -H 'content-type: application/json' -d '{"id":"1","params":{}}'

B · SDK存为 try.mjs,在装好 SDK 的目录里运行 node try.mjs:SDK 从链上解析服务、验签,验签成功才返回结果。Save this as try.mjs and run node try.mjs in the directory where the SDK is installed: the SDK resolves the service from the chain and verifies the answer before it returns.

try.mjs
import { createTapeAPI, rpcUrlsFor } from '@tapeapi/sdk'
const api = createTapeAPI({ rpcUrls: rpcUrlsFor(56) })      // 3 家运营方的节点nodes of 3 operators
const service = await api.resolve('11.1013.tape')            // 按官方 TAP 解析resolved as the official TAPs say
const { result, verified } = await api.call(service, 'bnbUsd', {})
console.log(result.bnbUsd, verified)                         // 验签成功才为 truetrue only after the signature checked out

现已上线

Live now

我们运行的,和你自己运行的

What we run, and what you run

我们运行的 · 免费(付费托管合约未部署)· 无需注册

Run by us · free (the paid-call escrow is not deployed) · no sign-up

由你自己部署或运行

Yours to run

参考

Reference

数据手册附录,在手册里

The datasheet appendix is in the docs

  1. 极限参数Absolute maximum ratings
  2. 一致性真值表Agreement truth table
  3. 费用Cost of operation
  4. 隐私Privacy
  5. 多链Chains
  6. 路线图Roadmap
  7. 规范索引Specification index
  8. 安全说明Security note
  9. 付费通道与其它实验性功能Paid channels and other experiments

    未审计、未部署,主网不可用,仅本地链与测试,今天不收费

    not audited, not deployed, not on mainnet; local chains and tests only; nothing charged today