ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

AgentPay — trust routing + spend caps for x402 agents

โดย romudille-bitรุ่น 2.8.0i★ –iบนเครื่องหรือคลาวด์
ชื่อใน registryio.github.romudille-bit/agentpay

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Buyer-side trust oracle + capped sessions for x402 agents: verified_route, receipts, 17 free tools.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: บนเครื่องหรือคลาวด์
  • ช่องทาง (transport): stdio, Streamable HTTP
  • หมวด: อื่น ๆ
  • ต้องใส่ค่าเหล่านี้: AGENTPAY_BASE_KEY

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • รันบนคลาวด์ไม่ต้องลงโปรแกรมเพิ่ม ต่อผ่านอินเทอร์เน็ตได้เลย
  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

ใช้ได้ทั้ง Claude บนเว็บ แอปคอมพิวเตอร์ และมือถือ:

  1. เปิด Settings → Connectors
  2. กด Add custom connector
  3. วางที่อยู่ด้านล่างแล้วกด Add
  4. ถ้าให้ล็อกอิน ให้ล็อกอินกับผู้ทำ
SettingsConnectors1+ Add2https://…3
https://agentpay.tools/mcp

หรือรันในเครื่องคุณ

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "agentpay": {
      "command": "npx",
      "args": [
        "-y",
        "@romudille/agentpay-mcp"
      ],
      "env": {
        "AGENTPAY_BASE_KEY": "ใส่ค่าของคุณ",
        "AGENTPAY_ENABLE_PAID": "ใส่ค่าของคุณ",
        "AGENTPAY_MAX_SPEND": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add --transport http agentpay https://agentpay.tools/mcp

หรือรันในเครื่องคุณ

claude mcp add agentpay --env AGENTPAY_BASE_KEY='ใส่ค่าของคุณ' --env AGENTPAY_ENABLE_PAID='ใส่ค่าของคุณ' --env AGENTPAY_MAX_SPEND='ใส่ค่าของคุณ' -- npx -y @romudille/agentpay-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "agentpay": {
      "url": "https://agentpay.tools/mcp"
    }
  }
}

หรือรันในเครื่องคุณ

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "agentpay": {
      "command": "npx",
      "args": [
        "-y",
        "@romudille/agentpay-mcp"
      ],
      "env": {
        "AGENTPAY_BASE_KEY": "ใส่ค่าของคุณ",
        "AGENTPAY_ENABLE_PAID": "ใส่ค่าของคุณ",
        "AGENTPAY_MAX_SPEND": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "agentpay": {
      "type": "http",
      "url": "https://agentpay.tools/mcp"
    }
  }
}

หรือรันในเครื่องคุณ

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "agentpay": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@romudille/agentpay-mcp"
      ],
      "env": {
        "AGENTPAY_BASE_KEY": "ใส่ค่าของคุณ",
        "AGENTPAY_ENABLE_PAID": "ใส่ค่าของคุณ",
        "AGENTPAY_MAX_SPEND": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ChatGPT ต่อได้เฉพาะ server ที่อยู่บนอินเทอร์เน็ต:

  1. เปิด ChatGPT บนเว็บ → Settings → Connectors (Apps)
  2. กด Create หรือ Add (บางแพ็กเกจต้องเปิด Developer mode ใน Advanced ก่อน)
  3. วางที่อยู่ด้านล่าง ตั้งชื่อ แล้วบันทึก
  4. ถ้าให้ล็อกอิน ให้ล็อกอินกับผู้ทำ
SettingsConnectors1+ Create2https://…3
https://agentpay.tools/mcp

ชื่อเมนูอาจต่างกันเล็กน้อยตามแพ็กเกจและรุ่นของแอป

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • AGENTPAY_BASE_KEY ความลับ env
    Optional EVM private key for wallet mode: settle paid tools in-place (gasless EIP-3009 on Base). Keyless free-tools mode works without it.
  • AGENTPAY_ENABLE_PAID env
    Set to 1 to settle paid tools from the wallet the server mints on first run (fund it with USDC on Base first). Off by default.
  • AGENTPAY_MAX_SPEND env
    Hard per-session spend cap in USD when wallet mode is enabled (default 0.10).

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

ชื่อและคำอธิบายเครื่องมือตามที่ server ตอบมาเมื่อ 6 พ.ย. 2569 ผู้ทำเป็นคนเขียน ไม่ใช่เรา แสดงเป็นข้อความล้วน

  • session_create

    Open a budget-capped agent session on AgentPay. Pay $0.01 USDC once — get a session_id, budget config, and gateway URL. Enforces a hard max_spend cap across all subsequent tool calls via the AgentPay SDK. The entry point for agents discovering AgentPay on Base Bazaar. Use when: Y

  • pre_trade_check

    One-call pre-trade sanity check: 'I want to long $X of SYMBOL — is now sane?' Combines live orderbook slippage at YOUR size, cross-exchange funding (carry cost), open-interest crowding, and contract security (GoPlus) into a single ok/caution/avoid verdict with a per-factor breakd

  • verified_route

    Paid buyer-side trust oracle: 'I need X, budget $Y — which x402 tool is real?' Sweeps the WHOLE x402 marketplace across many queries (a single search shows only a slice), collapses sybil/factory clusters (one wallet stamping many fake-distinct listings → one entry), ranks the gen

  • funding_spread

    Cross-venue perp funding divergence for one asset — the basis/carry read, not the raw rates. Reads Binance, Bybit, OKX, Gate.io, Bitget, Hyperliquid, dYdX, MEXC and KuCoin in parallel, normalises every rate to a per-8h figure (hourly venues scaled), and returns the spread (max mi

  • sbtc_peg

    The sBTC peg as an agent-readable feed — the one dataset only Stacks state can answer. Live sBTC supply (and share of the peg cap), peg-in and peg-out flows for 24h and 7d (sats, counts, unique recipients, net), in-flight bridge requests (pending and accepted deposits with the ol

  • token_price

    Get the current USD price of any cryptocurrency token Use when: You need the current USD price, 24h change, or market cap of any cryptocurrency. Not for: you need volume, ATH or a pair quote — token_market_data; a one-call macro + crypto overview — market_snapshot; pool depth or

  • gas_tracker

    Get current Ethereum gas prices (slow, standard, fast) Use when: You need to know current Ethereum gas prices before submitting a transaction or estimating costs. Not for: you need gas as part of a broader read — market_snapshot already includes standard gwei; only Ethereum mainn

  • yield_scanner

    Find best DeFi yield opportunities across protocols for a given token Use when: You need to find the best yield/APY for a token across DeFi protocols. Not for: you need a protocol's total TVL rather than pool APYs — defi_tvl; risk_level is a heuristic, run token_security on the p

  • open_interest

    Get total open interest in perpetual futures for any asset, with 1h and 24h change rates. Pairs with funding_rates to complete the derivatives picture — rising OI with high funding = overcrowded position. Use when: You need to know total open interest in perpetual futures and whe

  • orderbook_depth

    Get real bid/ask depth and slippage estimates at $10k, $50k, and $250k notional from Binance, Bybit and OKX. Use before sizing a position to know if you can execute without moving the market. Use when: You need to estimate slippage before executing a large trade. Tells you how mu

  • wallet_balance

    Get the token balances for any Ethereum or Stellar wallet address Use when: You need to look up the token holdings of an Ethereum or Stellar wallet address. Not for: you want a token's price or market data rather than one address's holdings — token_price / token_market_data; larg

  • fear_greed_index

    Crypto Fear & Greed Index (0=extreme fear, 100=extreme greed) with optional history Use when: You need to gauge overall crypto market sentiment or mood — whether the market is fearful or greedy. Not for: you want token-specific sentiment — crypto_news (per-token headlines) or fun

  • crypto_news

    Latest crypto news and community sentiment from r/CryptoCurrency for any token Use when: You need recent news headlines or community sentiment for one or more crypto tokens. Not for: you need general web news or documentation — web_search; a specific article's text — url_reader;

  • defi_tvl

    DeFi protocol Total Value Locked from DeFiLlama. Returns top 10 or a specific protocol. Use when: You need the Total Value Locked in a specific DeFi protocol or want to compare the top protocols by TVL. Not for: you want the best yield for a token — yield_scanner; protocol revenu

  • token_market_data

    Get market cap, 24h volume, ATH, and price change for any token. Note: does NOT return pool depth or slippage — for pre-trade liquidity estimates, use a dedicated orderbook tool. Use when: You need 24h trading volume, market cap, or all-time high for a token pair on decentralized

  • token_security

    Scan any token contract for honeypot, rug pull, and security risks Use when: You need to check if a token contract is safe before trading or investing. Not for: the asset is a native coin (BTC, ETH, SOL) with no contract — nothing to scan; you want liquidity or price — orderbook_

  • funding_rates

    Get perpetual futures funding rates across Binance, Bybit, and OKX Use when: You need funding rates to gauge leveraged market sentiment or cost of holding a perp position. Not for: you need open interest or long/short ratio — open_interest; one verdict combining funding, OI, slip

  • dune_query

    Run any Dune Analytics query and return live onchain results by query ID. Use fast_only=True for live bots — returns cached result instantly or raises immediately, never blocks. Use when: You need deep onchain analytics from a specific Dune query — protocol revenue, user counts,

  • url_reader

    Convert any URL to clean, LLM-ready markdown. Strips ads, nav, and boilerplate — returns just the content. No API key needed. Use when: You need to read the content of a web page or article and get clean, structured text for further processing. Not for: you do not have a URL yet

  • web_search

    Search the web and return the top 5 results with their full content as clean markdown. Better than DIY because zero setup and results include page content, not just links. Use when: You need to find current information on any topic — news, documentation, prices, events, or anythi

  • market_snapshot

    Fed rate, inflation proxy, S&P 500, BTC, ETH, and gas in one call. Replaces three separate API integrations with a single normalized response — the only tool that gives you macro + crypto in one shot. Use when: You need a combined macro + crypto market overview in one call: S&P 5

  • whale_activity

    Detect recent large wallet movements for a token (whale tracking) Use when: You need to detect large token transfers that may signal institutional moves, accumulation, or sell-offs. Not for: you need one address's holdings — wallet_balance; exchange order-book size rather than on

  • verified_route_preview

    Buyer-side trust oracle for the x402 marketplace: "I need X, budget $Y — which tool is real?" Vets Coinbase Bazaar (discover → drop stubs/factory clones → rank by real unique-payer usage → budget-gate). This MCP runs the FREE single-query PREVIEW: it returns the vetted pick (name

  • route

    Legacy alias of verified_route (kept for back-compat). Find and judge the best paid x402 tool for a need, within a budget. Discovers across Coinbase Bazaar, drops stubs (no schema / factory clones), ranks survivors by real usage (unique payers × 3 + calls + recency bonus), enforc

  • estimate_plan

    Price a multi-tool plan BEFORE spending anything. Submits the tool calls an agent intends to make to the gateway's free /v1/plan/estimate and returns per-step cost, total, a fits-budget verdict, and a cheaper alternative per paid step. No payment, no wallet needed. Use when: plan

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub romudille-bit ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • ✓ ผ่าน

    endpoint ตอบ

    ตอบกลับใน 471 ms (HTTP 200)

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ไม่ต้องล็อกอิน

  • ✓ ผ่าน

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    อ่านคำอธิบายเครื่องมือ 25 ตัวแล้ว ไม่พบคำสั่งแอบแฝงถึง AI

เทียบกับตัวอื่นในหมวด อื่น ๆi

  • ดาวมากกว่า 0% ของอีก 32461 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 89% ของอีก 32461 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 32461 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

AgentPay — trust routing + spend caps for x402 agents ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 3 จาก 3 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: AGENTPAY_BASE_KEY

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

ได้ทั้งสองแบบ จะลงในเครื่องหรือต่อผ่านคลาวด์ก็ได้

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (2.8.0) เข้า registry 4 วันที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต่อผ่าน URL จึงใช้กับโปรแกรมที่รับ remote MCP ได้ เช่น ChatGPT ที่เปิดโหมดนักพัฒนา

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, dotnet-mcp

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Spec Driven Development

โดย formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

รันบนเครื่อง★ 440MITอัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

Remote Desktop Commander

โดย desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

รันบนคลาวด์★ 211อัปเดต เมื่อวาน
ติดตั้ง

dotnet-mcp

โดย Skymly

MCP server for .NET symbols, XAML, source generators, and restricted workspace edit

รันบนเครื่องอัปเดต วันนี้
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

AgentPay

*Most agent-payment tools are a wallet — they move money. AgentPay is the layer that decides whether to spend it at all.*

AgentPay is the economic intelligence layer for MCP servers and AI agents.

Agents spend money. Most don't know how much, or why, until the session ends and the bill arrives.

AgentPay gives agents economic intelligence — the ability to reason about cost while they work, not after.

It starts with a budget. Every session opens with a hard cap enforced at the payment layer — not in code a model can ignore, but at the point where money moves. The agent knows from the first call exactly what it has to spend.

Before calling a tool, it knows what that call costs. Mid-task, it can check what's left and route to a cheaper alternative if the math doesn't work. When the session ends, a receipt captures every call, every cost, every decision — not a debug log, but proof of economic accountability.

The developer sees all of it: spending patterns per agent, anomaly flags when something loops or spikes, policy controls that enforce exactly which tools an agent can use and how much it can spend on each.

The result is an agent that doesn't just have a budget. It knows how to use one.

Start free: 22 tools (17 free), no USDC needed, no wallet setup required. Live gateway: https://agentpay.tools Settles in: USDC on Base and Stellar, sBTC on Stacks mainnet (walkthrough)


Install

pip install agentpay-x402            # core (Stellar + Stacks/sBTC)

pip install "agentpay-x402[base]" # + pay tools that settle on Base pip install "agentpay-x402[stacks]" # same as core, spelled out — pay in sBTC on Stacks


Quickstart — 3 lines, zero setup

17 free tools. No USDC, no wallet, no API keys, no human. quickstart() registers an agent, mints a wallet, and returns a ready, budget-capped session.

from agentpay import quickstart

s = quickstart() # registers + mints a wallet print(s.call("token_price", {"symbol": "ETH"})"result") print(s.spending_summary()) # receipt: every call, cost, tx

Set a hard budget, or bring your own funded wallet to pay for tools:

s = quickstart(max_spend="0.50")                   # cap this run at $0.50

s = quickstart(secret_key="S...", base_key="0x...") # your wallet (Stellar + Base)

Every call is session-tracked, and the cap is enforced before any payment is signed.


20 Tools (17 Free + 3 Paid)

Every call is session-tracked — you get a receipt showing every tool called, every cost, and every timestamp.

ToolParametersReturns
url_readerurlClean markdown content of any web page
web_searchqueryTop 5 results with full content
market_snapshot—S&P 500, Treasury yield, BTC, ETH, gas in one call
token_pricesymbol (BTC, ETH, SOL…)price_usd, change_24h_pct, market_cap_usd
gas_tracker—slow/standard/fast gwei, base_fee_gwei
fear_greed_indexlimit (days of history, default 1)value 0–100, value_classification, history[]
token_market_datatoken_a, token_bvolume_24h_usd, market_cap_usd, price_usd
wallet_balanceaddress, chain (ethereum/stellar)token balances
whale_activitytoken, min_usd (default 100k)large_transfers[] (full from/to + tx_hash), total_volume_usd
defi_tvlprotocol (optional, e.g. "uniswap")tvl, change_1d, change_7d, chains[]
token_securitycontract_address, chainrisk_level, is_honeypot, buy_tax, sell_tax
open_interestsymbol (BTC, ETH…)total_oi_usd, oi_change_1h/24h_pct, long_short_ratio
orderbook_depthsymbol (e.g. ETHUSDT)best_bid/ask, spread_pct, slippage at $10k/$50k/$250k
funding_ratesasset (optional)funding_rate_pct, annualized_rate_pct, sentiment per exchange
crypto_newscurrencies (e.g. "ETH,BTC"), filterheadlines[] with title, url, sentiment, score
yield_scannertoken, chain (optional), min_tvltop 10 pools by APY with protocol, tvl_usd, risk_level
dune_queryquery_id, limit, fast_onlyrows[], columns[], row_count from Dune Analytics
session_createagent_address, max_spend, labelsession_id, budget config, gateway_url, receipt — $0.01
pre_trade_checksymbol, size_usd, side, venue?, token_address?one-call trade verdict (ok/caution/avoid): slippage at YOUR size, side-aware funding carry, OI crowding, optional security; Stacks tokens add the Bitflow venue (price impact at size, route, pool TVL) — $0.01
funding_spreadsymbol, notional_usd?cross-venue perp funding divergence: nine venues normalised to 8h, spread (cheapest/dearest), 7-day percentile, carry estimate net of taker fees — $0.01
sbtc_peg—the sBTC peg: supply vs cap, 24h/7d peg-in and peg-out flows, in-flight and failed bridge requests, last peg events, signer set and threshold, rolling withdrawal headroom — $0.01
verified_routeneed, budget_usd?, chain?buyer-side trust oracle: sweeps the x402 marketplace, collapses sybil/factory clusters, ranks real providers by usage × delivery scores → one vetted recommendation + ready_to_pay challenge — $0.01

Session Intelligence

This is the economic intelligence layer in practice. The Session gives your agent — and you — real visibility into what happened, what it cost, and why.

from agentpay import quickstart, BudgetExceeded

quickstart() registers + mints a wallet; the returned session is also a

context manager, so you can with it for a printed receipt on exit.

Budget caps are exact: max_spend=0.10 (float) == "0.10" (str).

with quickstart(max_spend=0.10) as session:

Price an entire multi-tool plan BEFORE spending anything (free, no wallet)

plan = session.estimate_plan(["token_price", "pre_trade_check", "session_create"]) plan["total_usdc"], plan["fits_budget"] # per-step costs + cheaper alternatives inside

Reason about cost before committing (use the *_usd Decimals for comparisons)

if session.would_exceed(session.tool_cost_usd("dune_query")): alt = session.suggest_cheaper("dune_query") # {"name": ..., "price": ...}

Call a tool — budget enforced before any payment is signed

r = session.call("token_price", {"symbol": "ETH"}) r.data["price_usd"] # inner tool output (r"result" still works) r.cost # payment amount, e.g. "0" r.network # settlement chain, e.g. "stellar-mainnet" / "base"

session.remaining_usd() # Decimal('0.10')

For an external x402 tool that offers several chains, pick one:

session.call("https://some-x402-tool/endpoint", {}, chain="base")

Full receipt — every call, cost, tx hash, and settlement chain

print(session.spending_summary())

{

"calls": 1, "spent": "$0", "remaining": "$0.1", "budget": "$0.1",

"breakdown": [

{"tool": "token_price", "cost": "Free", "tx_hash": "", "network": "stellar-mainnet"}

]

}

Policy parameters

Control exactly what your agent is allowed to do:

from agentpay import AgentWallet, Session

wallet = AgentWallet(secret_key="S...", network="mainnet") # or quickstart()'s minted wallet with Session(wallet, gateway_url="https://agentpay.tools", max_spend=0.10, allowed_tools=["token_price", "gas_tracker", "web_search"], max_per_tool={"dune_query": 0.02}, rate_limit=10, # max 10 calls/min prefer_chain="base", # Base is the default; "stellar" or "stacks" to override allowed_recipients=["0x…", "SP…"], # only these payees may be paid (any rail) max_per_call="0.02", # no single payment above this approve_above="0.01", # payments above this need the approver's yes approver=lambda req: ask_human(req)) as session: ...

BudgetExceeded fires before any payment goes out if a tool would push you over the cap, isn't on the allowlist, or exceeds its per-tool limit. The recipient allowlist, per-call maximum and approval gate are checked against the 402 itself — the payee and amount that would actually be signed — on every rail, and raise PolicyRejected / ApprovalRequired (both BudgetExceeded subclasses) with nothing signed. Every refusal is listed under spending_summary()["anomalies"], alongside flags for repeated identical paid calls, a single call taking half the cap, and unconfirmed legs. budget_policy() picks the cap itself from an explicit value, an env var, a rule (share of balance) or a prompt, clamped to what the wallet holds — wallet.get_sbtc_balance_usd(rate) gives that ceiling for an sBTC payer.


Example: Market intelligence agent

Five free tools, one session, full receipt.

from agentpay import quickstart

with quickstart() as session:

snapshot = session.call("market_snapshot", {}) rates = session.call("funding_rates", {"asset": "ETH"}) oi = session.call("open_interest", {"symbol": "ETH"}) fg = session.call("fear_greed_index", {}) whales = session.call("whale_activity", {"token": "ETH", "min_usd": 500_000})

m = snapshot["result"] print(f"S&P: {m['sp500_price']:,.0f} ({m['sp500_change_pct']:+.2f}%)") print(f"ETH: ${m['eth_price_usd']:,.0f}") print(f"Gas: {m['gas_standard_gwei']} gwei")

avg_rate = sum(e["funding_rate_pct"] for e in rates"result") / len(rates"result") print(f"Funding: {avg_rate:+.4f}%/8h") print(f"OI 24h: {oi'result':+.2f}%") print(f"Sentiment: {fg'result'}") print(f"Whale vol: ${whales'result':,.0f}")

print(session.spending_summary())


Use it in your agent

Agent Skills (one command, any agent)
npx skills add romudille-bit/agentpay

Installs the `agentpay-route` skill (find, judge, and pay for the best paid x402 tool within a budget) and `agentpay-session` (hard spend cap + verifiable receipts) into Claude Code, Codex, Droid, OpenCode, or any skills-CLI-compatible runtime. Pair with the MCP below for keyless routing out of the box; add AGENTPAY_BASE_KEY + AGENTPAY_MAX_SPEND for capped, in-place paid calls.

Claude Code plugin (one command)
/plugin marketplace add romudille-bit/agentpay

/plugin install agentpay@agentpay

Installs the `agentpay-route` skill — your agent finds, judges, and pays for the best paid x402 tool within a budget — plus the 17 free tools. No keys needed to route.

MCP server (any runtime)

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx