Quickstart
Three paths. Start with the hosted edge flow, then drop to local development only if you are contributing or self-hosting.
MCP server (~2 min)
Get an API key
Register with one curl call - no Solana wallet, no Stripe account needed to start.
curl -s -X POST https://api.agentpay.so/api/merchants/register \
-H "Content-Type: application/json" \
-d '{ "name": "My Agent", "email": "you@example.com" }'{ "merchantId": "mer_...", "apiKey": "apk_..." }Save both values. The API key is shown once.
Add to Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"agentpay": {
"command": "npx",
"args": ["-y", "@agentpayxyz/mcp-server"],
"env": {
"AGENTPAY_API_KEY": "apk_your_key_here",
"AGENTPAY_MERCHANT_ID": "mer_your_merchant_id"
}
}
}
}Restart Claude Desktop.
Try it
Ask Claude any of these:
Claude calls the AgentPay tools and returns the result. No dashboard. No copy-pasting credentials.
https://api.agentpay.so/api/mcpPass your API key as Authorization: Bearer apk_...Full MCP reference -> with all 30+ tools, parameters, and examples.
REST API (~5 min)
Register
curl -s -X POST https://api.agentpay.so/api/merchants/register \
-H "Content-Type: application/json" \
-d '{ "name": "My Agent", "email": "you@example.com" }'Create a governed mandate
A mandate captures what the agent is allowed to do, the budget cap, and the approval policy.
curl -s -X POST https://api.agentpay.so/api/mandates \
-H "Authorization: Bearer apk_..." \
-H "Content-Type: application/json" \
-d '{
"merchantId": "mer_...",
"objective": "Book a train London to Bristol",
"budgetCap": 50,
"currency": "GBP",
"approvalThreshold": 20,
"agentId": "my-agent-01"
}'{
"success": true,
"intentId": "mnd_...",
"status": "pending_approval",
"recommendation": "Cheapest direct service: 24.50 GBP, 07:04 depart"
}Approve and execute
# Approve
curl -s -X POST https://api.agentpay.so/api/mandates/mnd_.../approve \
-H "Authorization: Bearer apk_..."
# Execute
curl -s -X POST https://api.agentpay.so/api/mandates/mnd_.../execute \
-H "Authorization: Bearer apk_..."
# Get receipt
curl -s https://api.agentpay.so/api/receipt/mnd_...Capability Vault flow
Start a connect session. The user opens the connect URL, enters their key once, and AgentPay vaults it for future governed execution.
curl -s -X POST https://api.agentpay.so/api/capabilities/connect-sessions \
-H "Authorization: Bearer apk_..." \
-H "Content-Type: application/json" \
-d '{ "provider": "firecrawl", "merchantId": "mer_...", "agentId": "my-agent-01" }'{
"sessionId": "cap_sess_...",
"status": "auth_required",
"connectUrl": "https://api.agentpay.so/connect/cap_sess_..."
}Local development (~20 min)
For contributors or self-hosters. Requires Node.js 20+, Docker, and Wrangler.
git clone https://github.com/Rumblingb/Agentpay.git
cd Agentpay
npm ci
cp .env.example .envRequired secrets to start the API:
DATABASE_URL=postgresql://...
ANTHROPIC_API_KEY=sk-ant-...
WEBHOOK_SECRET=<any-32-char-string>Everything else is optional. Missing integrations should fail closed on their own routes, not block first boot.
# Workers API on :8787
cd apps/api-edge && npx wrangler dev
# Dashboard on :3000
cd dashboard && npm run dev
# MCP server pointing at local API
AGENTPAY_API_URL=http://localhost:8787 \
AGENTPAY_API_KEY=apk_dev_test \
npx -y @agentpayxyz/mcp-server