Your agent pays. You stay in control.
Give your AI a funded wallet and hard spending limits. It buys the APIs it needs, on its own, and never goes past your caps.
$ npx agentpay ✓ created agent acc_8f21c4 ✓ wallet funded $25.00 (sandbox) ✓ budget set $5.00 / tx · $25.00 total ✓ api key apk_live_4c… (saved to .env) your agent can pay APIs now. try it: $ npx agentpay pay https://agentpay-gateway.fly.dev/demo/fact → 402 → paid $0.10 → 200 OK "Sea otters hold hands when they sleep so they don't drift apart."
AI can’t buy anything by itself.
Today, if Claude, ChatGPT, or an autonomous agent wants to buy a PDF, subscribe to a data feed, pay for an API call, or unlock premium content, it usually can’t. Payments need a card, a login, a checkout, and a human to approve them.
Who feels it: research agents that need data and reports, coding agents that need APIs, shopping and procurement agents, and personal assistants that buy things.
Six ways in. Pick one line.
The agent keeps its brain. APX gives it hands to pay. Use the MCP server with Claude or Cursor, drop in the SDK, or speak the raw protocol.
// Add APX to any MCP client (Claude, Cursor, ...)
{
"mcpServers": {
"agentpay": {
"command": "npx",
"args": ["agentpay-mcp"],
"env": { "AGENTPAY_API_KEY": "apk_live_..." }
}
}
}import { AgentPayClient } from "@agentpay/sdk";
const pay = await AgentPayClient.create({
apiKey: process.env.AGENTPAY_API_KEY,
});
// pay.fetch wraps fetch: on a 402 it pays within
// your caps and retries, transparently.
const res = await pay.fetch("https://api.example.com/search");from agentpay import AgentPayClient
import os
pay = AgentPayClient(api_key=os.environ["AGENTPAY_API_KEY"])
# A 402 is paid automatically, inside your budget.
res = pay.fetch("https://api.example.com/search")from agentpay.langchain import APXTool import os tools = [APXTool(api_key=os.environ["AGENTPAY_API_KEY"])] # Your LangChain agent can pay any 402 API as a tool call.
tools = [{
"type": "function",
"function": {
"name": "pay_and_fetch",
"description": "Call a paid API; pays if it returns 402.",
"parameters": {
"type": "object",
"properties": { "url": { "type": "string" } }
}
}
}]# x402-compatible. Three steps:
curl -i $MERCHANT/api/echo # 402 Payment Required
curl -s $GATEWAY/pay -d @payment.json # { receipt_id, signature }
curl -s $MERCHANT/api/echo \
-H "X-Payment-Receipt: $RECEIPT_ID" # 200 OK
A live view of everything your agent spends.
Watch payments land, see what got blocked and why, and freeze any agent the moment something looks off.
Power, with a safety net.
The reason you can actually let an agent loose: it can’t go past the rules, and you can see and stop everything.
Spend caps it can’t cross
A total budget and a per-call cap, enforced atomically before any money moves. The agent literally cannot overspend.
Auto-pause on weird behavior
Velocity spikes and unusual amounts pause the agent on their own, mid-task, before damage is done.
Every charge, and every denial
A full log of what was paid, and a separate log of every payment we blocked, with the reason.
A signed passport per agent
Each agent carries a gateway-signed identity: who it is, who owns it, its limits. Merchants verify it without asking you.
A kill switch you control
Pause one agent or stop all settlement instantly. The wallet balance stays intact; spending just stops.
Signed, single-use, expiring
Every payment returns a signed receipt that expires in minutes and can’t be replayed. Real accounting.
Give your agent a wallet.
Sandbox is free and instant. No real money moves until you flip it on.