openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > Pay For Service

Make a paid API request to an x402 endpoint with automatic USDC payment. Use when you or the user want to call a paid API, make an x402 request, use a paid service, or pay for an API call. Use after finding a service with search-for-service.

开发与 DevOps

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v0.1.0

统计:⭐ 0 · 733 · 5 current installs · 5 all-time installs

0

安装量(当前) 5

🛡 VirusTotal :可疑 · OpenClaw :可疑

Package:0xrag/pay-for-service

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :可疑

OpenClaw 评估

The skill's instructions match its stated purpose (making paid x402 requests) but it relies on running npx awal@latest (which fetches and executes remote code) and it fails to declare required tooling; these supply-chain and declaration gaps warrant caution before use.

目的

The SKILL.md describes exactly how to make x402 paid requests using the 'npx awal' CLI, which aligns with the skill name and description. However, the skill metadata declares no required binaries while the runtime instructions assume npx (and thus Node/npm) are available — a mismatch between declared requirements and actual runtime needs.

说明范围

Instructions stay within the stated purpose (call a paid API, check wallet status/balance, set max payment). They do, however, direct the agent to perform real monetary transactions and to send request payloads to arbitrary external endpoints, so callers must verify and trust the target URL and the payloads before invoking.

安装机制

There is no install spec, but the skill requires running 'npx awal@latest', which downloads and executes the latest package from the npm registry at runtime. Running npx @latest is a supply-chain risk (remote code execution) and should be treated with caution; the skill does not recommend pinning a vetted version or provide guidance about vetting the package.

证书

The skill declares no required environment variables or credentials, which is consistent with an instruction-only helper. In practice it requires an authenticated wallet and USDC balance (handled by the local 'awal' CLI), so sensitive wallet state or keys (outside the skill manifest) will be used — this is proportional to the payment purpose but is sensitive and not explicitly documented in the manifest.

持久

Skill is user-invocable, not always-enabled, and does not request persistent system-wide privileges or modify other skills. No elevated persistence is requested.

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Pay For Service」。简介:Make a paid API request to an x402 endpoint with automatic USDC payment. Use wh…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/0xrag/pay-for-service/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: pay-for-service
description: Make a paid API request to an x402 endpoint with automatic USDC payment. Use when you or the user want to call a paid API, make an x402 request, use a paid service, or pay for an API call. Use after finding a service with search-for-service.
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx awal@latest status*)", "Bash(npx awal@latest balance*)", "Bash(npx awal@latest x402 pay *)"]
---

# Making Paid x402 Requests

Use the `npx awal@latest x402 pay` command to call paid API endpoints with automatic USDC payment on Base.

## Confirm wallet is initialized and authed

```bash
npx awal@latest status
```

If the wallet is not authenticated, refer to the `authenticate-wallet` skill.

## Command Syntax

```bash
npx awal@latest x402 pay <url> [-X <method>] [-d <json>] [-q <params>] [-h <json>] [--max-amount <n>] [--json]
```

## Options

| Option                  | Description                                        |
| ----------------------- | -------------------------------------------------- |
| `-X, --method <method>` | HTTP method (default: GET)                         |
| `-d, --data <json>`     | Request body as JSON string                        |
| `-q, --query <params>`  | Query parameters as JSON string                    |
| `-h, --headers <json>`  | Custom HTTP headers as JSON string                 |
| `--max-amount <amount>` | Max payment in USDC atomic units (1000000 = $1.00) |
| `--correlation-id <id>` | Group related operations                           |
| `--json`                | Output as JSON                                     |

## USDC Amounts

X402 uses USDC atomic units (6 decimals):

| Atomic Units | USD   |
| ------------ | ----- |
| 1000000      | $1.00 |
| 100000       | $0.10 |
| 50000        | $0.05 |
| 10000        | $0.01 |

**IMPORTANT**: Always single-quote amounts that use `$` to prevent bash variable expansion (e.g. `'$1.00'` not `$1.00`).

## Examples

```bash
# Make a GET request (auto-pays)
npx awal@latest x402 pay https://example.com/api/weather

# Make a POST request with body
npx awal@latest x402 pay https://example.com/api/sentiment -X POST -d '{"text": "I love this product"}'

# Limit max payment to $0.10
npx awal@latest x402 pay https://example.com/api/data --max-amount 100000
```

## Prerequisites

- Must be authenticated (`npx awal@latest status` to check, see `authenticate-wallet` skill)
- Wallet must have sufficient USDC balance (`npx awal@latest balance` to check)
- If you don't know the endpoint URL, use the `search-for-service` skill to find services first

## Error Handling

- "Not authenticated" - Run `awal auth login <email>` first, or see `authenticate-wallet` skill
- "No X402 payment requirements found" - URL may not be an x402 endpoint; use `search-for-service` to find valid endpoints
- "Insufficient balance" - Fund wallet with USDC; see `fund` skill