Skip to content
Skill

Agent payment x402

Lets an AI agent make x402 payments within per-task budgets and spending policies

Agent payment x402 is an open-source agent skill for finance and payments. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
66
Last commit
License
MIT
Listing updated

Similar skills

About Agent payment x402

This skill guides an agent toward paying for HTTP 402-gated APIs and services without a custodial wallet. It lays out which integration path fits the target network: an MCP payment server backed by agentwallet-sdk for Base, OKX Agent Payments Protocol for X Layer, or upstream x402 client packages for Solana and EVM networks. It also covers the seller side, where an API charges agents using upstream middleware for Express, Hono, Next.js, Fastify, FastAPI or Go.

The guidance centers on spending controls. Budgets, allowlisted recipients and rate limits are set by the orchestrator before delegation, and the agent's payment calls are expected to fail closed if the budget check cannot run. The examples validate the server's payment requirements against network, asset, recipient and amount limits before any signature is created, and they require explicit user confirmation before paid requests are made.

It also includes operational notes for sellers, such as checking that a Solana recipient's associated token account exists and guarding payment authorizations against replay with a shared claim store. Expect to supply your own wallet keys, RPC access, a facilitator choice and a Redis or similar store for replay protection. Package versions are pinned in the examples.

When your agent uses it

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk, X Layer through OKX Payments / OKX Agent Payments Protocol, and Solana plus multi-network EVM through the upstream x402 packages with facilitator-based settlement. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 2 files (36 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the rea-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath

Or copy only this skill to ~/.claude/skills/agent-payment-x402:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/agent-payment-x402 &&
cp -R "$tmp/.agents/skills/agent-payment-x402" ~/.claude/skills/agent-payment-x402 &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/agent-payment-x402 inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/agent-payment-x402 to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/agent-payment-x402 &&
cp -R "$tmp/.agents/skills/agent-payment-x402" ~/.agents/skills/agent-payment-x402 &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/agent-payment-x402 inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/agent-payment-x402 to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/agent-payment-x402 &&
cp -R "$tmp/.agents/skills/agent-payment-x402" ~/.cursor/skills/agent-payment-x402 &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/agent-payment-x402 inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/agent-payment-x402

Or copy the folder to ~/.gemini/skills/agent-payment-x402 yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/agent-payment-x402:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/agent-payment-x402 &&
cp -R "$tmp/.agents/skills/agent-payment-x402" ~/.copilot/skills/agent-payment-x402 &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/agent-payment-x402 inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git

Then copy REA_Skill/.agents/skills/agent-payment-x402 into your agent's skills folder as agent-payment-x402. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Per-task and session budgets
Caps spending per agent action and across a whole session, enforced before any payment is signed.
Non-custodial wallet setup
Describes keeping signing keys with the orchestrator and holding funds in the agent's own accounts.
Multi-network buyer client
Shows wrapping an HTTP client so it pays x402 challenges on Base, Solana and other EVM networks.
Payment requirement filtering
Filters server challenges by network, token, recipient and amount so out-of-policy requests are refused.
Seller replay protection
Explains claiming each payment authorization once so a handler does not run repeatedly for one payment.
Facilitator selection guidance
Compares self-hosted, testnet and hosted facilitators for settlement and notes their mainnet limits.

Good for

  • Let my agent pay per call for a paid data API within a fixed daily budget
  • Set up an MCP payment server so an agent can check its balance and send payments
  • Charge agents per request for my Express endpoint using x402 middleware
  • Check that a Solana recipient has the USDC token account needed to receive x402 payments
  • Audit what an agent spent during a task using a transaction list

Agent payment x402 FAQ

Does the skill include scripts I can run directly?

No, the skill has no scripts. It contains instructions and code examples that you adapt into your own project.

Which networks does Agent payment x402 cover?

It covers Base through agentwallet-sdk, X Layer through OKX Payments, and Solana plus EVM networks through the upstream x402 packages. Coverage of each facilitator should be confirmed before production use.

Can the agent raise its own spending limit?

The skill says no. The orchestrator sets the policy before delegation, and the policy is not exposed as a tool the agent can call.

Which package versions does Agent payment x402 use?

It pins versions such as agentwallet-sdk@6.0.0 and @x402/fetch@2.22.0 and recommends pinning in production.

How do I install Agent payment x402 in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/agent-payment-x402 to use it in all your projects, or to .claude/skills/agent-payment-x402 in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

Does Agent payment x402 run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Agent payment x402?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Agent payment x402?

The closest alternatives to Agent payment x402 are Accept agent payments, Pay via agent wallet, Agent wallet policy, Trust wallet MCP and Use agent wallet.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from smartworldarafath/REA_Skill

  1. Guides building and auditing UI to WCAG 2.2 AA across web, iOS and Android

    • Open source
    • 66 GitHub stars
    • Developer tools
  2. Diagnoses agent and LLM stacks for hidden failures and ranks the fixes by severity

    • Open source
    • 66 GitHub stars
    • Developer tools
  3. Compare coding agents head-to-head on your own tasks by pass rate, cost and time

    • Open source
    • 66 GitHub stars
    • Developer tools
  4. Guides an agent to design tool sets, observations and error recovery for better completion

    • Open source
    • 66 GitHub stars
    • Developer tools
  5. Gives agents read-only access to social, video, code and web platforms via one CLI

    • Open source
    • 66 GitHub stars
    • Web search and scraping