AgentPay

Every storefront,
open for AI agents.

讓每一家店鋪,
都能被 AI agent 讀懂並付款。

Stripe put card checkout on the web. MoonPay put fiat on-ramps on it. AgentPay puts x402 checkout on any storefront — one pasted script, and an AI agent can read your catalog, quote a price, wait for a human "yes", and settle in USDT on BNB Chain through Binance OnchainPay (B402). Built for the Binance Agent OS Mini Hackathon, Track A.

Stripe 讓網頁能刷卡,MoonPay 讓網頁能入金。 AgentPay 讓任何店鋪貼一行腳本就擁有 x402 結賬 —— AI agent 讀取商品目錄 → 報價 → 等人類確認「是」→ 透過 Binance OnchainPay(B402)在 BNB Chain 上用 USDT 結算 → 取貨連結 + 收據。為 Binance Agent OS Mini Hackathon 賽道 A 而構建。

track-a · agent-os賽道 A · Agent OS 2026-09-08 23:59 UTC ● pay.shangdian.me

Try the live demo試試在線演示 Read the code閱讀源碼

The problem問題Agents can browse. They can't buy.Agent 會逛店,但買不了單。

AI agents already research products, compare prices, and draft orders — then stall at a checkout form built for human eyes: passwords, card fields, CAPTCHAs. Meanwhile the HTTP status code for exactly this moment, 402 Payment Required, sat unused since 1997. The x402 protocol revived it; Binance brought it to BNB Chain. What was missing is the merchant side: a way for an ordinary small shop to opt in without rebuilding anything. That's AgentPay.

AI agent 早就會調研商品、比價、擬訂單 —— 然後卡死在為人眼設計的結賬表單前:密碼、卡號、驗證碼。 而 HTTP 裡專為這一刻準備的狀態碼 402 Payment Required,從 1997 年起一直閒置。 x402 協議喚醒了它,Binance 把它帶上了 BNB Chain。缺的是商家這一側: 讓一家普通小店不用重寫任何東西就能接入。這就是 AgentPay。

Innovation創新點What's actually new here到底新在哪裡

One-script merchant onboarding商家一行腳本接入

Paste <script src=".../snippet/agentpay.js"> like a Stripe or analytics tag. The shop instantly exposes a machine-readable catalog at /.well-known/agent-store.json — a convention any crawler or agent can discover. No SDK, no backend rewrite. Demo is wired read-only to a real store (store.shangdian.me).

像貼 Stripe 或統計代碼一樣貼上 <script src=".../snippet/agentpay.js">, 店鋪立即在 /.well-known/agent-store.json 暴露機器可讀的商品目錄 —— 任何爬蟲或 agent 都能按慣例發現。無 SDK、不改後端。演示只讀接入真實店鋪(store.shangdian.me)。

Human-confirm gate before money moves資金移動前的人類確認閘

Agents are eager; wallets are real. POST /agent/quote issues a one-shot confirm token (~120 s TTL). A buy without a valid token is refused with 409 — the agent must show its human the exact price and get a "yes" first. Autonomy for the boring parts, consent for the money part.

Agent 手快,錢包是真的。POST /agent/quote 簽發一次性確認令牌(約 120 秒有效)。 沒有有效令牌的購買一律 409 拒絕 —— agent 必須把準確價格拿給人類、拿到「是」才能繼續。 無聊的部分交給自治,花錢的部分保留同意權。

Full x402 v2 handshake, end to end端到端完整 x402 v2 握手

Not a mockup of the idea — the real protocol: 402 challenge with accepts[], one-shot nonce, base64 X-PAYMENT retry, X-PAYMENT-RESPONSE receipt header, order + pickup link + emailed receipt. Runs live in your browser on the demo page.

不是概念演示,是真協議:帶 accepts[]402 挑戰、一次性 nonce、 base64 X-PAYMENT 重試、X-PAYMENT-RESPONSE 回執頭、 訂單 + 取貨連結 + 郵件收據。在演示頁的瀏覽器裡可實時跑通。

Facilitator-pluggable: mock ⇄ Binance B402Facilitator 可插拔:mock ⇄ Binance B402

Settlement is one interface. Today it runs a deterministic mock (no real funds); set four env vars (B402_BASE_URL / CLIENT_ID / ACCESS_TOKEN / PRIVATE_KEY) and the same code settles through Binance OnchainPay /papi/v2/b402 verify + settle on BNB Chain. Zero code changes between demo and production.

結算只是一個接口。當前跑確定性 mock(無真實資金); 配好四個環境變數(B402_BASE_URL / CLIENT_ID / ACCESS_TOKEN / PRIVATE_KEY), 同一份代碼即走 Binance OnchainPay /papi/v2/b402 verify + settle 在 BNB Chain 上結算。 演示到生產,零代碼改動。

Architecture架構One purchase, seven steps一次購買,七個步驟

  1. Agent discovers the shop.MCP tool list_products reads /.well-known/agent-store.json — digital SKUs only, prices in cents, live from the real catalog. Agent 發現店鋪。MCP 工具 list_products 讀取 /.well-known/agent-store.json —— 僅數字商品、價格以分計、實時來自真實目錄。
  2. Agent quotes.quote_product → price, asset (USDT), network (BNB Chain), and a one-shot confirmToken. Agent 報價。quote_product → 價格、資產(USDT)、網絡(BNB Chain)與一次性 confirmToken
  3. Human says yes.The agent presents the quote; only a human confirmation unlocks the token. No token → HTTP 409. 人類說「是」。Agent 呈上報價;只有人類確認才解鎖令牌。沒有令牌 → HTTP 409
  4. Server challenges: HTTP 402.x402 v2 payload: accepts[] (schemes exact × eip3009 | permit2-exact), amount, payTo, fresh nonce. 服務器挑戰:HTTP 402。x402 v2 載荷:accepts[]exact × eip3009 | permit2-exact)、金額、payTo、新 nonce。
  5. Agent pays.Retries with base64 X-PAYMENT header — a signed USDT authorization for BNB Chain. Agent 付款。帶 base64 X-PAYMENT 頭重試 —— 一份面向 BNB Chain 的 USDT 簽名授權。
  6. Facilitator settles.Gateway calls Binance OnchainPay B402 verifysettle (mock in demo). Binance handles chain interaction and gas. Facilitator 結算。閘道調用 Binance OnchainPay B402 verifysettle(演示為 mock)。鏈上交互與 gas 由 Binance 處理。
  7. Delivery + receipt.200 OK with tx hash, X-PAYMENT-RESPONSE, pickup URL, and an emailed receipt. Order queryable via get_order. 交付 + 收據。200 OK 帶 tx hash、X-PAYMENT-RESPONSE、取貨 URL 與郵件收據。訂單可經 get_order 查詢。
# the whole protocol, visible in curl# 整套協議,curl 裡看得見
POST /agent/quote/apple-one          → 200 { amount: "$8.88", confirmToken }
POST /agent/buy/apple-one            → 409 confirmation required→ 409 需要確認
POST /agent/buy/apple-one  X-Confirm-Token: …  → 402 { accepts: [eip3009, permit2-exact] }
POST /agent/buy/apple-one  X-PAYMENT: base64(…) → 200 { txHash, pickupUrl }  + X-PAYMENT-RESPONSE

The stack技術棧How AgentPay uses Binance · BSC · x402 · AI agentsAgentPay 如何運用 Binance · BSC · x402 · AI agent

Layer What it is是什麼 How AgentPay uses itAgentPay 怎麼用
Binance
Agent OS
Binance's developer platform connecting AI apps to trading, wallet, payment and on-chain rails — MCP server, Skill Hub, Agentic Wallet, and Binance Pay x402. Binance 的開發者平台,把 AI 應用接入交易、錢包、支付與鏈上能力 —— MCP server、Skill Hub、Agentic Wallet 與 Binance Pay x402。 AgentPay is a Track A agent built on the Agent OS payment rail: it targets Binance Pay x402 as its settlement path and respects the platform's $20/day x402 limit by hard-capping every transaction at $10 in the gateway. AgentPay 是構建在 Agent OS 支付軌道上的賽道 A 代理:以 Binance Pay x402 為結算路徑,並在閘道裡把單筆硬性限制在 $10,遵守平台 $20/日的 x402 限額
Binance
OnchainPay
(B402)
Binance's x402 facilitator on BNB Chain: merchants call simple HTTP APIs (supported / verify / settle); Binance verifies signatures, submits on-chain, and pays gas. Binance 在 BNB Chain 上的 x402 facilitator:商家只調簡單 HTTP API(supported / verify / settle);驗簽、上鏈、gas 全由 Binance 處理。 The gateway's facilitator module implements the B402 API with RSA request signing (@bnb-chain/b402-compatible). Demo mode is a faithful mock; production is a config switch, not a rewrite. 閘道的 facilitator 模塊實現了帶 RSA 請求簽名的 B402 API(兼容 @bnb-chain/b402)。演示模式是忠實的 mock;切生產只是改配置,不是重寫。
BNB Chain
(BSC)
EVM chain with ~0.45 s blocks, ~1 s finality and cent-level gas — one of the largest stablecoin networks (~$14 B supply, USDT-dominant). EVM 鏈:約 0.45 秒出塊、約 1 秒最終確認、gas 以美分計 —— 最大的穩定幣網絡之一(供應約 $140 億,以 USDT 為主)。 All payments are USDT (BEP-20) on BNB Chain, declared in every quote and 402 challenge. Fast finality and near-zero fees are what make $0.5–$10 agent micro-purchases economically sane. 所有支付均為 BNB Chain 上的 USDT(BEP-20),在每次報價與 402 挑戰中聲明。快速確認 + 近零手續費,才讓 $0.5–$10 的 agent 小額購買在經濟上成立。
x402
protocol協議
Open standard (Coinbase-initiated, now Linux Foundation / x402 Foundation) that revives HTTP 402 for machine-native stablecoin payments. 開放標準(Coinbase 發起,現歸 Linux Foundation / x402 Foundation),喚醒 HTTP 402 用於機器原生穩定幣支付。 AgentPay speaks x402 v2 verbatim — 402 challenge, X-PAYMENT, X-PAYMENT-RESPONSE, facilitator verify/settle — so any x402-capable client can pay, not just ours. AgentPay 逐字實現 x402 v2 —— 402 挑戰、X-PAYMENTX-PAYMENT-RESPONSE、facilitator verify/settle —— 因此任何支持 x402 的客戶端都能付款,不限於我們自己的。
AI agents
(MCP)
Model Context Protocol — the same standard Agent OS uses to plug Binance into Claude, ChatGPT, Cursor and more. Model Context Protocol —— Agent OS 用來把 Binance 接入 Claude、ChatGPT、Cursor 等的同一標準。 Ships an MCP server with 4 tools: list_products · quote_product · buy_product · get_order. Point Claude Desktop at it and say "buy me the Apple One seat" — the agent does the rest, minus the human "yes". 內置帶 4 個工具的 MCP serverlist_products · quote_product · buy_product · get_order。把 Claude Desktop 指向它,說「幫我買 Apple One 席位」—— 剩下的 agent 全包,只留人類那聲「是」。

Compliance合規Built inside the rules在規則之內構建

Hackathon fit大賽契合

Track A — Build an AI agent using Agent OS. Submission: video/demo + GitHub repo via X (follow @Binance, repost, quote-tweet) + official survey, before 2026-09-08 23:59 UTC.

賽道 A —— 使用 Agent OS 構建 AI 代理。提交:影片/演示 + GitHub 倉庫,經 X(關注 @Binance、轉發、引用轉發)+ 官方問卷,截止 2026-09-08 23:59 UTC

Spending guardrails花費護欄

Per-tx cap $10 < the $20/day Agent OS x402 limit; human confirm token required before any 402 is even issued; one-shot nonces prevent replay.

單筆上限 $10 < Agent OS $20/日 x402 限額;發出任何 402 之前必須先有人類確認令牌;一次性 nonce 防重放。

No real funds in demo演示無真實資金

The public demo settles through a mock facilitator — deterministic fake tx hashes, no blockchain writes, no custody. Real settlement activates only with Binance-issued B402 credentials.

公開演示經mock facilitator 結算 —— 確定性的假 tx hash、不寫鏈、不託管。真實結算僅在配置 Binance 簽發的 B402 憑證後啟用。

Real store, zero risk真實店鋪,零風險

Catalog is read read-only from a genuine storefront; the production database, order flow and payment paths of the store are untouched.

商品目錄只讀取自真實店鋪;店鋪的生產數據庫、訂單流與支付路徑一概不碰。

Disclaimer. AgentPay is a hackathon prototype, not a financial product or an offer of one. Nothing here is financial advice. The Binance Agent OS Mini Hackathon is not available in the United States, United Kingdom, European Economic Area, Hong Kong, Singapore, or other prohibited jurisdictions — see Binance's official list. Crypto payments involve risk; digital asset transfers are irreversible. 免責聲明。AgentPay 是黑客松原型,不是金融產品,也不構成任何要約。 本頁內容均非財務建議。Binance Agent OS Mini Hackathon 不面向美國、英國、歐洲經濟區、香港、新加坡 及其他禁止司法轄區 —— 以 Binance 官方清單為準。加密支付有風險;數字資產轉賬不可逆。

See it眼見為實Three links, sixty seconds三個連結,六十秒

Run a mock purchase跑一次 mock 購買 See the one-line install看一行接入 Audit the code審查源碼