← 返回 Skills 市场
pivortex

x402 pay

作者 Owen · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
36
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install x402-pay
功能描述
A skill for making HTTP 402 (x402) micropayments in USDC on Base. It can be funded cross-chain via NEAR Intents or from onramps like Cash App, Revolut, and Robinhood. Designed to be compatible with multiple agent wallet setups.
使用说明 (SKILL.md)

x402 — HTTP-Native Payments

x402 gates API resources behind USDC micropayments using HTTP 402 Payment Required.


Step 0: Setup

Before running any script, install dependencies in the skill directory (once per environment):

cd \x3Cskills-dir>/x402-pay
npm install

No API keys required.


Step 1: Detect your wallet

Read references/detecting-wallets.md to choose which wallet to use. Once you've picked one, return here and continue from Step 2.


Step 2: Is the Service Known?

If you already have a specific service URL in mind that returned 402 payment required, skip straight to Step 3: Get the Service Details.

Otherwise continue to Step 2a: Find a Service

Step 2a: Find a Service

List all available services from x402-list and pick the most appropriate one:

node scripts/search-services.mjs search

If nothing suitable is found, try the Coinbase bazaar:

node scripts/search-services.mjs search \x3Ckeyword> --source bazaar

If still nothing, search the internet for x402 services matching the user's need.

Step 3: Get the Service Details

Once you have a service URL, get its full details (schemas, parameters, examples):

node scripts/search-services.mjs details \x3Cresource-url>

Then preview the live price — this reads the 402 challenge without paying and is wallet-independent:

node scripts/check-price.mjs \x3Curl> [--method GET|POST] [--body '{"key":"value"}']

Note this price: you'll use it in Step 4 to check whether your balance is sufficient (and, if funding, how much to deposit), and show it to the user before paying in Step 5.

Example working service

https://x402.ottoai.services/crypto-news

Step 4: Check Balance

Check your wallet's USDC balance on Base — see references/wallet-flows.md for the method for your wallet (if you don't already know it) — and compare it against the price you previewed in Step 3.

  • Balance ≥ service price → proceed to Step 5
  • Balance \x3C service price → fund it: Read references/near-intents-funding.md for the cross-chain funding flow. Always use NEAR intents to fund the wallet if the balance is low. If the user has no crypto to swap from, the onramp path (references/onramp-funding.md) funds the wallet from Cash App / Robinhood / Revolut.

Gas: No ETH needed — you sign off-chain only. The x402 facilitator submits the on-chain transaction and covers gas. This applies to all wallet types.


Step 5: Pay

Always show the price before paying. Confirm with user before paying.

Show the user the price you previewed in Step 3 (if significant time has passed, re-run check-price.mjs in case it changed). Always get their confirmation before paying — for any amount. Then pay the endpoint using your wallet — see references/wallet-flows.md for the method for your wallet (if not already known).


Step 6: Confirm

Report the response body and any transaction hash to the user.


Rules

  • Always ask the user before executing any command. Show the exact command you intend to run and wait for explicit approval before running it — this applies to wallet, payment, and funding commands.
  • Abide by configured safeguards such as wallet spend limits and allowlists.
  • When funding, always confirm the refund destination (address, chain, and origin-chain vs. NEAR Intents balance) with the user before any deposit.
  • Never pay silently — always show the decoded price first
  • Confirm with user before any payment
  • Always report the tx hash after a successful payment
安全使用建议
Install only if you intentionally want an agent to make x402 USDC payments. Use a dedicated low-balance wallet, prefer managed wallets or external wallet policies over raw private keys, avoid exposing generic PRIVATE_KEY-style secrets, require human approval for every command and payment, verify the exact URL, price, network, refund destination, and transaction result, and set external spend limits or allowlists wherever possible.
能力标签
cryptofinancial-authorityrequires-walletcan-make-purchasescan-sign-transactionsrequires-paid-servicerequires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The stated purpose and artifacts coherently match x402 USDC payments, wallet setup, service discovery, and cross-chain funding, but those are high-impact financial actions involving private keys, managed wallet credentials, signing, and real purchases.
Instruction Scope
The documentation repeatedly requires showing prices and getting user confirmation, which is good, but the trigger phrases are broad and the raw-key payment script itself signs and retries a paid request without an internal confirmation prompt, spending cap, destination allowlist, or trust policy.
Install Mechanism
Installation is disclosed as running npm install in the skill directory with a small pinned dependency set; no hidden install-time behavior or postinstall script was found, but it does require third-party network packages.
Credentials
Wallet detection is purpose-related but broad: it tells the agent to inspect context, environment variables, config, project or skill .env files, generic private-key aliases, and local wallet state, which can expose unrelated credentials unless tightly user-scoped.
Persistence & Privilege
The skill may use persistent local wallet sessions and instructs raw private keys to be stored in plaintext .env files for reuse; this is disclosed but sensitive and not well contained by the artifacts themselves.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install x402-pay
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /x402-pay 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
x402-pay v1.0.1 - Added LICENSE.txt file. - Updated documentation to clarify that no API keys are required. - Improved README.md and SKILL.md for clearer setup and compatibility instructions.
v1.0.0
Initial release of x402-pay. - Enables access to x402-protected APIs and HTTP 402 Payment Required endpoints, including USDC micropayments. - Supports multiple wallet types: Coinbase Agentic Wallet, raw private key, CDP SDK, Privy server wallets, Turnkey. - Tools to discover x402 services, fetch service details, preview prices, and pay for API access. - Includes flows for checking balances and cross-chain wallet funding using NEAR intents or onramp. - Strict rules: always preview and confirm payment amounts with users before proceeding, and report transaction hashes after payments.
元数据
Slug x402-pay
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

x402 pay 是什么?

A skill for making HTTP 402 (x402) micropayments in USDC on Base. It can be funded cross-chain via NEAR Intents or from onramps like Cash App, Revolut, and Robinhood. Designed to be compatible with multiple agent wallet setups. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 36 次。

如何安装 x402 pay?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install x402-pay」即可一键安装,无需额外配置。

x402 pay 是免费的吗?

是的,x402 pay 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

x402 pay 支持哪些平台?

x402 pay 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 x402 pay?

由 Owen(@pivortex)开发并维护,当前版本 v1.0.1。

💬 留言讨论