agent-payment-x402

Execute programmatic payments via x402 negotiation with ERC-4337 smart accounts.

1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/riftzen-bit/gemini-setup --skill agent-payment-x402-riftzen-bit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-payment-x402
Source: https://github.com/riftzen-bit/gemini-setup/tree/main/skills/agent-payment-x402
Command: npx skills add https://github.com/riftzen-bit/gemini-setup --skill agent-payment-x402-riftzen-bit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable automated agents to perform paid actions without manual intervention while preventing runaway spend, custodial risk, and opaque transaction trails.

Core Features & Use Cases

  • x402 payment negotiation: Automatically handle HTTP 402 responses, negotiate price, sign transactions, and retry on success.
  • Spending controls: Enforce per-task and per-session budgets, allowlisted recipients, and rate limits to prevent overspend.
  • Non-custodial wallets: Use ERC-4337 smart accounts so agents hold keys locally while orchestration layers set strict policies.
  • MCP integration & auditability: Expose MCP tools (get_balance, send_payment, check_spending, list_transactions) for programmatic checks and post-task audits.
  • Use Case: Let an orchestrator safely delegate a paid API call to an agent while guaranteeing the call cannot exceed predefined budgets.

Quick Start

Set a SpendingPolicy in your orchestrator and instruct the agent to execute a single paid API call to api.example.com under a $0.01 per-task limit.

Frequently Asked Questions about agent-payment-x402

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

FAQPage Schema
How do I enable autonomous payments for AI agents without custodial wallet risk?

Enable autonomous agent payments safely by using ERC-4337 smart accounts for non-custodial wallet management, allowing agents to hold keys locally while orchestration layers enforce strict spending policies.

How does HTTP 402 payment negotiation work for automated agents?

HTTP 402 payment negotiation works by having the agent automatically handle 402 responses, negotiate the price, sign the transaction, and retry the original request upon successful payment.

How do I prevent runaway spending when agents execute programmatic payments?

Prevent runaway programmatic spending by defining a SpendingPolicy in your orchestrator to enforce per-task budgets, per-session limits, allowlisted recipients, and rate limits.

Can I audit agent transactions after executing paid API calls?

You can audit agent transactions using exposed MCP tools like list_transactions and check_spending, which provide programmatic checks and post-task auditability for signed actions.

Does this agent payment system work with ERC-4337 smart accounts?

Yes, the system uses ERC-4337 smart accounts for key handling, ensuring that agents execute signed, auditable transactions with non-custodial wallet management and fail-closed behavior.

What are the limitations of using non-custodial wallets for agent payments?

The fail-closed behavior of non-custodial agent payments means transactions will halt if predefined spending policies, budgets, or allowlisted recipient checks are violated.