The most comprehensive x402 payments skill for AI coding agents. Teaches Claude Code, Codex, Cursor, Windsurf, and Gemini CLI how to build x402 payment infrastructure — not just consume it.
One install. Your AI agent knows how to:
- Monetize any API with x402 middleware (Next.js, Express, Hono)
- Call paid endpoints with automatic 402 payment handling
- Deploy on Base AND Solana with USDC
- Orchestrate multi-endpoint payments with @x402sentinel/router
- Generate unified cryptographic receipts with budget enforcement and audit trails
curl -sSL https://raw.githubusercontent.com/valeo-cash/x402-payments-skill/main/install.sh | bashAuto-detects Claude Code, Codex CLI, and Cursor. Installs the skill to the right location.
Two ready-to-clone projects in examples/:
A Next.js API charging $0.001/request in USDC on Base Sepolia.
cd examples/paid-api-seller && npm install && npm run devNode.js scripts that call paid endpoints — single and multi-endpoint with Sentinel Router.
cd examples/pay-for-api-buyer && npm install && npm run singleThe skill teaches your AI agent a decision tree:
User asks about x402 / paid APIs / agent payments
│
├─ Are you the SELLER or BUYER?
│ ├─ Seller → Server middleware setup
│ └─ Buyer → Client fetch wrapper
│
├─ Which CHAIN?
│ ├─ Base (EVM) → x402-next / @x402/next
│ ├─ Solana → x402-solana / @x402/svm
│ └─ Both → V2 multi-chain registration
│
└─ Need MULTI-ENDPOINT orchestration?
├─ No → Basic x402 is enough
└─ Yes → Sentinel Payment Router
→ Budget caps
→ Parallel execution
→ Unified cryptographic receipts
Full reference docs for every path: Base/EVM, Solana, Sentinel Router, and all 20+ npm packages in the x402 ecosystem.
- Download x402-payments.skill
- Go to Settings → Skills
- Upload the file
/plugin marketplace add valeo-cash/x402-payments-skillgit clone https://github.com/valeo-cash/x402-payments-skill.git
cp -r x402-payments-skill/x402-payments ~/.claude/skills/git clone https://github.com/valeo-cash/x402-payments-skill.git
cp -r x402-payments-skill/x402-payments ~/.codex/skills/Copy .cursorrules into your project root:
cp x402-payments-skill/.cursorrules ./cp -r x402-payments-skill/x402-payments .claude/skills/| File | Purpose |
|---|---|
SKILL.md |
Main skill — decision tree, quick starts for seller/buyer on Base/Solana |
references/base-evm.md |
Complete Base/EVM server + client setup (V1 + V2 packages) |
references/solana.md |
Complete Solana server + client setup (Wallet Adapter, Privy, Node.js) |
references/sentinel-router.md |
Payment Router — multi-endpoint orchestration, budget caps, receipts |
references/packages.md |
Every x402 + Sentinel npm package with install commands |
.cursorrules |
Drop-in rules file for Cursor/Windsurf projects |
examples/paid-api-seller/ |
Ready-to-deploy Next.js paid API (Vercel one-click) |
examples/pay-for-api-buyer/ |
Node.js scripts for calling paid APIs + Sentinel Router |
x402 is an open payment protocol by Coinbase using HTTP 402 status codes. Any API can charge per-request in USDC — no API keys, no subscriptions, no accounts. Works for humans and AI agents.
@x402sentinel/router adds enterprise infrastructure on top of x402:
- Budget enforcement — set a cap before any money moves
- Parallel execution — pay multiple endpoints concurrently
- Unified receipts — SHA-256 hash + HMAC signature linking all payments
- Audit trails — cryptographic proof of what was paid, to whom, when
import { PaymentRouter } from "@x402sentinel/router";
const router = new PaymentRouter({
paymentFetch: x402Fetch,
getPaymentInfo: () => x402Fetch.getLastPayment?.() ?? null,
agentId: "research-agent-01",
apiKey: "sk_...",
});
const result = await router.execute({
name: "research-pipeline",
maxBudgetUsd: "0.10",
strategy: "parallel",
endpoints: [
{ label: "email-verify", url: "https://api.example.com/verify?email=test@gmail.com" },
{ label: "dns-lookup", url: "https://api.example.com/dns?domain=google.com" },
{ label: "ssl-check", url: "https://api.example.com/ssl?domain=google.com" },
],
});
// result.receipt → unified cryptographic proof of all 3 payments| Agent | Install method |
|---|---|
| Claude Code | /plugin marketplace add or ~/.claude/skills/ |
| Codex CLI | ~/.codex/skills/ |
| Cursor | .cursorrules in project root |
| Windsurf | .cursorrules in project root |
| Gemini CLI | .claude/skills/ (same format) |
| OpenCode | .claude/skills/ |
Sentinel by Valeo — Audit and compliance infrastructure for AI agent payments.
MIT