senoldogann/codex-switcher/agent-payment-x402
Claude Code and agent skill by senoldogann/codex-switcher
- community
Checking that the SKILL.md file is still in the repository.
Add x402 payment execution to AI agents — per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents need to pay for APIs, services, or other agents.
Install
npx vskill@latest install senoldogann/codex-switcher/agent-payment-x402SKILL.md
The same SKILL.md was published earlier as affaan-m/everything-claude-code/agent-payment-x402.
Agent Payment Execution (x402)
Enable AI agents to make autonomous payments with built-in spending controls. Uses the x402 HTTP payment protocol and MCP tools so agents can pay for external services, APIs, or other agents without custodial risk.
When to Use
Use when: your agent needs to pay for an API call, purchase a service, settle with another agent, enforce per-task spending limits, or manage a non-custodial wallet. Pairs naturally with cost-aware-llm-pipeline and security-review skills.
How It Works
x402 Protocol
x402 extends HTTP 402 (Payment Required) into a machine-negotiable flow. When a server returns 402, the agent's payment tool automatically negotiates price, checks budget, signs a transaction, and retries — no human in the loop.
Spending Controls
Every payment tool call enforces a SpendingPolicy:
- Per-task budget — max spend for a single agent action
- Per-session budget — cumulative limit across an entire session
- Allowlisted recipients — restrict which addresses/services the agent can pay
- Rate limits — max transactions per minute/hour
Non-Custodial Wallets
Agents hold their own keys via ERC-4337 smart accounts. The orchestrator sets policy before delegation; the agent can only spend within bounds. No pooled funds, no custodial risk.
MCP Integration
The payment layer exposes standard MCP tools that slot into any Claude Code or agent harness setup.
Security note: Always pin the package version. This tool manages private keys — unpinnednpxinstalls introduce supply-chain risk.
Available Tools (agent-callable)
| Tool | Purpose | |
|---|---|---|
get_balance | Check agent wallet balance | |
send_payment | Send payment to address or ENS | |
check_spending | Query remaining budget | |
list_transactions | Audit trail of all payments |
Note: Spending policy is set by the orchestrator before delegating to the agent — not by the agent itself. This prevents agents from escalating their own spending limits. Configure policy viaset_policyin your orchestration layer or pre-task hook, never as an agent-callable tool.
Examples
Budget enforcement in an MCP client
When building an orchestrator that calls the agentpay MCP server, enforce budgets before dispatching paid tool calls.
Prerequisites: Install the package before adding the MCP config —npxwithout-ywill prompt for confirmation in non-interactive environments, causing the server to hang:npm install -g agentwallet-sdk@6.0.0
Best Practices
- Set budgets before delegation: When spawning sub-agents, attach a SpendingPolicy via your orchestration layer. Never give an agent unlimited spend.
- Pin your dependencies: Always specify an exact version in your MCP config (e.g.,
agentwallet-sdk@6.0.0). Verify package integrity before deploying to production. - Audit trails: Use
list_transactionsin post-task hooks to log what was spent and why. - Fail closed: If the payment tool is unreachable, block the paid action — don't fall back to unmetered access.
- Pair with security-review: Payment tools are high-privilege. Apply the same scrutiny as shell access.
- Test with testnets first: Use Base Sepolia for development; switch to Base mainnet for production.
Production Reference
- npm: `agentwallet-sdk`
- Merged into NVIDIA NeMo Agent Toolkit: PR #17 — x402 payment tool for NVIDIA's agent examples
- Protocol spec: x402.org
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/agent-payment-x402/SKILL.md
Popularity
- Repository stars
- 14
- Repository forks
- 2
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/senoldogann/codex-switcher/agent-payment-x402)