agent-payment-x402
Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets.
Skill by Jamkris
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jamkris-agent-payment-x402
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity, finance, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/agent-payment-x402
What's inside
- Skill name
agent-payment-x402- Description
- Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol.
- License
- MIT
- Instructions
- 220 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Agent Payment Execution (x402)
Enable AI agents to make policy-gated 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.
## Decision Tree
Choose the integration path based on whether your agent is buying access to a paid API or charging others for one:
| Need | Recommended path |
|------|------------------|
| Agent pays a 402-gated API on Base or another agentwallet-supported chain | Use `agentwallet-sdk` as an MCP payment server with strict spending policy |
| Agent pays a 402-gated API on X Layer | Use OKX Agent Payments Protocol from `okx/onchainos-skills`; `okx-x402-payment` is a deprecated legacy alias |
| TypeScript API charges agents | Use OKX Payments TypeScript seller SDK docs for Express, Hono, Fastify, or Next.js |
| Go API charges agents | Use OKX Payments Go seller SDK docs for Gin, Echo, or `net/http` |
| Rust API charges agents | Use OKX Payments Rust seller SDK docs for Axum |
| Java API charges agents | Use OKX Payments Java seller SDK docs for Spring Boot 2/3, Java EE, or Jakarta |
| Python API charges agents | Check the current OKX Payments repository before implementation; a Python seller guide may not be available |
## Supported Networks
- `agentwallet-sdk`: use the package docs to confirm current network coverage before production. Base Sepolia is the safest development default; Base mainnet is the production path called out by the original skill.
- OKX Payments / X Layer: current seller docs target X Layer (`eip155:196`) and USDT0 settlement. Fetch current SDK docs before generating production code because payment packages and facilitator behavior can change quickly.
## 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 negotiates price, checks budget, signs a transaction, and retries only inside the policy and confirmation boundary set by the orchestrator.
### 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 Gemini CLI or agent harness setup.
> **Security note**: Always pin the package version. This tool manages private keys — unpinned `npx` installs introduce supply-chain risk.
### Option A: agentwallet-sdk (Base / multi-chain)
```json
{
"mcpServers": {
"agentpay": {
"command": "npx",
"args": ["-y", "agentwallet-sdk@6.0.0"]
}
}
}
```
### 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 via `set_policy` in your orchestration layer or pre-task hook, never as an agent-callable tool.
### Option B: OKX Agent Payments Protocol (X Layer)
Use this path for X Layer x402, Multi-Party Payment (MPP), session payment, charge, and A2A charge flows.
For buyer-side agent flows:
1. Install or reference the current [`okx/onchainos-skills`](https://github.com/okx/onchainos-skills) repository — these skills live in that external repo, not in EGC.
2. Use [`okx-agent-payments-protocol`](https://github.com/okx/onchainos-skills/tree/main/skills/okx-agent-payments-protocol) (in the `okx/onchainos-skills` repo) as the dispatcher.
3. Treat [`okx-x402-payment`](https://github.com/okx/onchainos-skills/tree/main/skills/okx-x402-payment) (same repo) as a deprecated compatibility alias, not as the canonical skill.
4. Require explicit user confirmation before wallet status checks or payment actions. Do not hide payment execution behind a generic tool call.
For seller-side API flows, fetch the latest language-specific guide before generating code:
| Runtime | Current guide |
|---------|---------------|
| TypeScript | `https://raw.githubusercontent.com/okx/payments/main/typescript/SELLER.md` |
| Go | `https://raw.githubusercontent.com/okx/payments/main/go/x402/SELLER.md` |
| Rust | `https://raw.githubusercontent.com/okx/payments/main/rust/x402/SELLER.md` |
| Java | `https://raw.githubusercontent.com/okx/payments/main/java/SELLER.md` |
Do not copy examples from older docs without checking the current OKX repository. Current OKX guidance uses `okx-agent-payments-protocol` as the dispatcher, and Java seller docs are now available.
## 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 — `npx` without `-y` will prompt for confirmation in non-interactive environments, causing the server to hang: `npm install -g agentwallet-sdk@6.0.0`
```typescript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
async function main() {
// 1. Validate credentials before constructing the transport.
// A missing key must fail immediately — never let the subprocess start without auth.
const walletKey = process.env.WALLET_PRIVATE_KEY;
if (!walletKey) {
throw new Error("WALLET_PRIVATE_KEY is not set — refusing to start payment server");
}
// Connect to the agentpay MCP server via stdio transport.
// Whitelist only the env vars the server needs — never forward all of process.env
// to a third-party subprocess that manages private keys.
const transport = new StdioClientTransport({
command: "npx",From Jamkris/everything-gemini-code, MIT.
More from Jamkris/everything-gemini-code
- 0.588score
brand-voice
Jamkris
Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and…
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
click-path-audit
Jamkris
Trace every user-facing button/touchpoint through its full state change sequence to find bugs where functions individually work but cancel each other out…
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
carrier-relationship-management
evos
Codified expertise for managing carrier portfolios, negotiating freight rates, tracking carrier performance, allocating freight, and maintaining strategic…
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
council
Jamkris
Convene a four-voice council for ambiguous decisions, tradeoffs, and go/no-go calls.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
accessibility
Jamkris
Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA standards.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
api-connector-builder
Jamkris
Build a new API connector or provider by matching the target repo's existing integration pattern exactly.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
connections-optimizer
Jamkris
Reorganize the user's X and LinkedIn network with review-first pruning, add/follow recommendations, and channel-specific warm outreach drafted in the user's…
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
codebase-onboarding
Jamkris
Analyze an unfamiliar codebase and generate a structured onboarding guide with architecture map, key entry points, conventions, and a starter GEMINI.md.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
automation-audit-ops
Jamkris
Evidence-first automation inventory and overlap audit workflow for ECC.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
autonomous-agent-harness
Jamkris
Transform Gemini CLI into a fully autonomous agent system with persistent memory, scheduled operations, computer use, and task queuing.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
crosspost
Jamkris
Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
customer-billing-ops
Jamkris
Operate customer billing workflows such as subscriptions, refunds, churn triage, billing-portal recovery, and plan analysis using connected billing tools like…
SkillCFreshness: C★ 91Claude Code +9
Signals
- Stars
- 91
- Forks
- 23
- Open issues
- 1
- Last commit (this folder)
- May 12, 2026 (5 months ago)
- Last release
- May 26, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.336score
agent-payment-x402
sakuradairong
Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets.
SkillCFreshness: C★ 48Claude Code +9 - 0.307score
agent-payment-x402
krataia
Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets.
SkillBFreshness: BClaude Code +9 - 0.280score
agent-payment-x402
jaysonpantollana
Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets.
SkillCFreshness: CClaude Code +9 - 0.280score
agent-payment-x402
LongHuynh712
Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets.
SkillCFreshness: CClaude Code +9
More from Jamkris
- 0.588score
brand-voice
Jamkris
Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and…
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
api-connector-builder
Jamkris
Build a new API connector or provider by matching the target repo's existing integration pattern exactly.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
automation-audit-ops
Jamkris
Evidence-first automation inventory and overlap audit workflow for ECC.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
autonomous-agent-harness
Jamkris
Transform Gemini CLI into a fully autonomous agent system with persistent memory, scheduled operations, computer use, and task queuing.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
accessibility
Jamkris
Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA standards.
SkillCFreshness: C★ 91Claude Code +9 - 0.583score
click-path-audit
Jamkris
Trace every user-facing button/touchpoint through its full state change sequence to find bugs where functions individually work but cancel each other out…
SkillCFreshness: C★ 91Claude Code +9
Cite this page
agent-payment-x402 skill. Agent Mart. https://agentmart.dev/skills/jamkris-agent-payment-x402 (last updated 2026-10-24)