agent-payment-x402

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

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill agent-payment-x402-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-payment-x402
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/agent-payment-x402
Command: npx skills add https://github.com/ibytechaos/claude --skill agent-payment-x402-ibytechaos

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 without custodial risk or uncontrolled spending. This Skill integrates the x402 HTTP payment protocol with MCP tools so agents can negotiate and execute payments while staying within enforced budgets. ## Core Features & Use Cases - x402 Protocol Integration: 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 budgets, 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. Before delegation, the orchestrator sets a $0.50 per-task budget and allowlists the API domain; the agent pays per request and cannot exceed 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 via 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 do I set spending limits for an AI agent wallet?

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 x402 payment 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 orchestrator and should never be agent-callable.

Why does the agentpay MCP server hang on startup?

Running npx without a pinned, pre-installed package prompts for confirmation in non-interactive environments, causing the server to hang. Install the exact version first with npm install -g [email protected].

Can I test x402 agent payments without real funds?

Yes, use the Base Sepolia testnet for development and testing. Switch to Base mainnet only for production deployments after validating spending policies and audit trails.

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

The recommended pattern is fail-closed: the pre-tool check throws an error and blocks the paid action. The agent never falls back to unmetered access when budget verification fails.