agent-payment-x402

Adds x402 payment execution with spending controls to AI agents via MCP tools.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/freedom909/real-estate-saas --skill agent-payment-x402-freedom909
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-payment-x402
Source: https://github.com/freedom909/real-estate-saas/tree/main/.trae/skills/agent-payment-x402
Command: npx skills add https://github.com/freedom909/real-estate-saas --skill agent-payment-x402-freedom909

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires agentwallet-sdk, @modelcontextprotocol/sdk.

What problem does it solve? AI agents that need to pay for APIs, services, or other agents lack a safe way to transact autonomously. This Skill implements the x402 HTTP payment protocol with per-task budgets, allowlisted recipients, and non-custodial wallets so agents can pay without human intervention or custodial risk. ## Core Features & Use Cases - x402 Protocol Negotiation: Automatically handles HTTP 402 Payment Required responses by negotiating price, checking budget, signing transactions, and retrying requests. - Spending Controls: Enforces per-task budgets, per-session limits, allowlisted recipients, and rate limits set by the orchestrator before delegation. - Non-Custodial Wallets: Agents hold their own keys via ERC-4337 smart accounts, eliminating pooled funds and custodial risk. - Use Case: An orchestrator spawns a research agent that must call a paid data API. The orchestrator sets a $0.50 per-task budget via set_policy, and the agent pays for each API call through the agentpay MCP server without ever exceeding its limit. ## Quick Start Configure the agentpay MCP server with a pinned agentwallet-sdk version and set a spending policy before delegating any paid task to your agent.

Frequently Asked Questions about agent-payment-x402

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I let an AI agent pay for API calls automatically?▼

Use the x402 protocol with the agentpay MCP server. When a server returns HTTP 402, the payment tool negotiates price, checks the budget, signs a transaction, and retries the request without human involvement.

How to set spending limits for autonomous AI agents?▼

The orchestrator calls set_policy before delegating, defining per_task_budget, per_session_budget, and allowlisted_recipients. Agents cannot modify their own policy, preventing them from escalating spending limits.

What MCP tools does the agentpay server expose?▼

The server exposes get_balance, send_payment, check_spending, and list_transactions as agent-callable tools. The set_policy tool is reserved for the orchestration layer and must never be agent-callable.

Why does the agentpay MCP server hang on startup?▼

Running npx without -y prompts for install confirmation in non-interactive environments, causing a hang. Install the package first with npm install -g [email protected] and always pin the exact version.

Can agents access my main wallet funds with x402 payments?▼

No. Agents use non-custodial ERC-4337 smart accounts holding their own keys, with spending bounded by the orchestrator-set policy. There are no pooled funds, so the main wallet is never exposed.

What happens if the payment service is unreachable during a task?▼

The recommended pattern fails closed: the preToolCheck hook throws an error and blocks the paid action when check_spending fails, the response is malformed, or the budget is exceeded, never falling back to unmetered access.