Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words

AgentPay — trust routing + spend caps for x402 agents

by romudille-bitversion 2.8.1i★ 4iComputer or cloud
Registry nameio.github.romudille-bit/agentpay

How to install

What it does

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

  • Connects Computer or cloud
  • Account or key Cloud: No key needed · Local: Needs AGENTPAY_BASE_KEY
  • Category Other

Install

Pick the AI app you use, then copy the settings.

Passed 4/5 checks · What you ask goes through the maker’s server (agentpay.tools) · ✓ Commands checked Nov 13, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude · about 2 min

No key, nothing to install · Set it up once on claude.ai or the desktop app, then use it in chat · free accounts can add 1 · on Team/Enterprise an Owner adds it

  1. Open Claude’s Connectors page

    CustomizeConnectors

    CustomizeConnectors1Add2https://…3Add4
  2. Click “Add” → “Custom” → “Web” and fill in these 2 fields

    Copy each value into the field with the same name in Claude, then click Continue

    Name · NameAgentPay — trust routing + spend caps for x402 agents
    Remote MCP server URL · Addresshttps://agentpay.tools/mcp

    Click Continue past the sign-in settings Claude detected · under Authentication choose what the maker says (Sign in now, Sign in when needed or No sign in), then click Add

  3. Turn it on in a chat

    +ConnectorsAgentPay — trust routing + spend caps for x402 agents

  4. Try it

    Use AgentPay — trust routing + spend caps for x402 agents and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using AgentPay — trust routing + spend caps for x402 agents or shows a AgentPay — trust routing + spend caps for x402 agents tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with ChatGPT, depending on your plan

Full MCP: ChatGPT Business, Enterprise or Edu on the web · Pro: connects with read/fetch permissions, so tools that change data may not work · Plus: not confirmed in OpenAI’s docs; if you see an add-custom-MCP option on the Plugins page you can try these steps · web only

  1. Open ChatGPT’s add-MCP page on the web

    Plugins+Add custom MCP server

    ChatGPTPlugins1+2https://…3Create4
  2. Fill in the name and address

    Enter a name, paste the address under Connection, tick the risk warning and click Create as a plugin

    Name · NameAgentPay — trust routing + spend caps for x402 agents
    Connection · Addresshttps://agentpay.tools/mcp
  3. Pick AgentPay — trust routing + spend caps for x402 agents in a chat

    Start a new chat and pick AgentPay — trust routing + spend caps for x402 agents from your plugins before typing

  4. Try it

    Use AgentPay — trust routing + spend caps for x402 agents and tell me what you can do for me, then show me one thing

    ✓ If ChatGPT says it is using AgentPay — trust routing + spend caps for x402 agents or shows a AgentPay — trust routing + spend caps for x402 agents tool in the answer, you are connected

Menu names checked against OpenAI’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Claude Code · about 2 min

No key, nothing to install

  1. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  2. Paste this command and press Enter

    claude mcp add --transport http --scope user agentpay https://agentpay.tools/mcp
  3. Type /mcp in Claude Code

    You should see AgentPay — trust routing + spend caps for x402 agents listed as connected

  4. Try it

    Use AgentPay — trust routing + spend caps for x402 agents and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using AgentPay — trust routing + spend caps for x402 agents or shows a AgentPay — trust routing + spend caps for x402 agents tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor · about 2 min

No key, nothing to install

  1. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  2. Open the AI chat in Cursor in Agent mode

  3. Try it

    Use AgentPay — trust routing + spend caps for x402 agents and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using AgentPay — trust routing + spend caps for x402 agents or shows a AgentPay — trust routing + spend caps for x402 agents tool in the answer, you are connected

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code · about 2 min

No key, nothing to install

  1. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  2. Open the AI chat in VS Code in Agent mode

  3. Try it

    Use AgentPay — trust routing + spend caps for x402 agents and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using AgentPay — trust routing + spend caps for x402 agents or shows a AgentPay — trust routing + spend caps for x402 agents tool in the answer, you are connected

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

Address for apps that connect over the web

Addresshttps://agentpay.tools/mcp

JSON settings are under “For developers” below

Stuck? Ask people who use AgentPay — trust routing + spend caps for x402 agents💬 Discussion →
For developers: Terminal commands and JSON settings

Over the web

Claude Code

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

Cursor (~/.cursor/mcp.json)

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

VS Code (mcp.json)

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

Installed on your computer

Claude Code

claude mcp add --scope user agentpay --env AGENTPAY_BASE_KEY=your-value --env AGENTPAY_ENABLE_PAID=your-value --env AGENTPAY_MAX_SPEND=your-value -- npx -y @romudille/agentpay-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "agentpay": {
      "command": "npx",
      "args": [
        "-y",
        "@romudille/agentpay-mcp"
      ],
      "env": {
        "AGENTPAY_BASE_KEY": "your-value",
        "AGENTPAY_ENABLE_PAID": "your-value",
        "AGENTPAY_MAX_SPEND": "your-value"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "agentpay": {
      "command": "npx",
      "args": [
        "-y",
        "@romudille/agentpay-mcp"
      ],
      "env": {
        "AGENTPAY_BASE_KEY": "your-value",
        "AGENTPAY_ENABLE_PAID": "your-value",
        "AGENTPAY_MAX_SPEND": "your-value"
      }
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "agentpay": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@romudille/agentpay-mcp"
      ],
      "env": {
        "AGENTPAY_BASE_KEY": "your-value",
        "AGENTPAY_ENABLE_PAID": "your-value",
        "AGENTPAY_MAX_SPEND": "your-value"
      }
    }
  }
}

Values you fill in

  • AGENTPAY_BASE_KEY secret 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).

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
444/wk
Licencei
No licence stated
Connection
Computer or cloud
Transport
stdio, streamable-http
Latest versioni
2.8.1
Categoryi
Other
Published to registryi
Nov 9, 2026
Code last changedi
Nov 12, 2026
Maker
romudille-bit
Packages
npm: @romudille/agentpay-mcp
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Connect over the internet in

ClaudeChatGPTGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatOpen WebUIRaycast

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Tool names and descriptions exactly as the server reported them on Nov 12, 2026. The maker wrote them, not us; we show them as plain text.

  • 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

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 13, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account romudille-bit, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed yesterday

  • ! Caution

    Has a licence

    GitHub could not identify the licence type; open the file to check

  • ✓ Pass

    Endpoint responds

    Responded in 442 ms (HTTP 200)

  • – Not applicable

    Sign-in with OAuth

    No sign-in needed

  • ✓ Pass

    No hidden instructions in tool descriptions

    Read 25 tool descriptions and found no hidden instructions to the AI

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in with Google to post

User reviews

No reviews yet

Sign in with Google to write a review

Compared with others in Otheri

  • More stars than 94% of the other 19639 servers in this category
  • Published to the registry more recently than 90% of the other 19639 servers in this category
  • Basic checks equal to or better than 60% of the other 19639 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is AgentPay — trust routing + spend caps for x402 agents safe?

It passed 4 of 5 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

You need to fill in: AGENTPAY_BASE_KEY

Does it run on my computer or in the cloud?

Either way works: install it on your computer or connect to the cloud version.

Is it still maintained?

The GitHub repo last changed yesterday, and the latest version (2.8.1) reached the registry 4 days ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. It connects by URL, so apps that accept remote MCP servers work too, such as ChatGPT on the web (full MCP on Business and above; Pro read-only).

What can I use instead?

In the same category: World Monitor, Claude Flow, Windmill

Others in the same category

Servers in the same category from other makers, sorted by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

World Monitor

Real-time global intelligence on conflict, markets, energy, trade, shipping and cyber. 102 tools.

by koala73Widely used★ 90.5KUpdated today

Runs in the cloud✓ service owner · worldmonitor.app

Claude Flow

AI orchestration with hive-mind swarms, neural networks, and 87 MCP tools for enterprise dev.

by ruvnetWidely used↓ 13.5K/wk★ 81.6KUpdated 14 months ago

Runs on your computer

Windmill

Run Windmill scripts and flows and manage jobs, schedules, resources and variables.

by windmill-labsWidely used★ 18.6KUpdated yesterday

Runs in the cloud

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

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)

Only the beginning is shown; read the rest in the repo