开爪技能
- 作者仓库星标 56
- 许可证 AGPL-3.0
- 作者仓库 cryptoskill
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @jiayaoqijia · AGPL-3.0
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
🛒 x402 Bazaar — 42 services found
1. 🌐 Weather API
URL: https://api.weather-x402.com/current
Type: http GET
Price: $0.001 USDC
Network: Base (eip155:8453)
Updated: 2h ago
2. 🤖 Llama 3.3 70B Inference
URL: https://api.x402network.com/llm/llama
Type: http POST
Price: $0.005 USDC
Network: Base (eip155:8453)
Updated: 4h ago
# x402 Bazaar Skill
The x402 Bazaar is the discovery layer for the x402 ecosystem — a
machine-readable catalog helping AI agents find and integrate with x402-compatible
API endpoints and MCP tools. Query, find, pay, and use with no pre-baked
integrations.
Two modes:
- **Browse only** — no wallet needed, zero cost, discover all available services
- **Browse + Pay** — requires Base wallet with USDC to call discovered endpoints
---
## Prerequisites
### Browse only (no keys needed)
```bash
python3 agent.py "list services"
python3 agent.py "find weather APIs"
```
### To call paid endpoints
1. Get a Base wallet private key (MetaMask → export, or Coinbase Wallet)
2. Fund with USDC on Base — get from coinbase.com or bridge.base.org
3. Add to `.env`:
```
EVM_PRIVATE_KEY="0xYourPrivateKeyHere"
MAX_SPEND_PER_CALL=0.10
```
### Install dependencies (run once)
```bash
pip install -r ~/clawd/skills/x402-bazaar/requirements.txt
```
---
## When to Activate This Skill
Activate when user says any of:
**Discovery**
- "What x402 services are available?"
- "Find me an API for [task] on x402"
- "Browse the x402 Bazaar"
- "What services cost less than $0.01?"
- "Find a weather API I can pay per call"
- "What MCP tools are on x402?"
- "Show me x402 services under [price]"
- "Search x402 for [keyword]"
**Paying for services**
- "Call this x402 endpoint: [url]"
- "Pay for and call [service name]"
- "Use x402 to get [data] — find and pay the cheapest service"
- "Make a paid x402 request to [url]"
Do NOT activate for:
- Checking agent's own wallet balance → use /agent-wallet skill
- Listing on the Bazaar as a seller → manual setup, see seller section below
- Alpaca or stock trading → use /alpaca-trading skill
---
## Exact Commands
### List all available services
```bash
cd ~/clawd/skills/x402-bazaar && python3 agent.py "list services"
```
### Search by keyword
```bash
python3 agent.py "find weather"
python3 agent.py "search for AI inference"
python3 agent.py "find web scraping services"
```
### Filter by max price
```bash
python3 agent.py "services under 0.01"
python3 agent.py "services under 0.001 USDC"
```
### Filter by type
```bash
python3 agent.py "list http services"
python3 agent.py "list mcp tools"
```
### Inspect a specific service
```bash
python3 agent.py "inspect https://api.example.com/x402/weather"
```
### Call a discovered service (requires EVM_PRIVATE_KEY + USDC)
```bash
python3 agent.py "call https://api.example.com/x402/weather?location=NYC"
python3 agent.py "pay and call https://api.example.com/x402/sentiment"
```
### Full autonomous flow: find + pay + use
```bash
python3 agent.py "find the cheapest weather API and get weather for London"
python3 agent.py "find a web scraping API and scrape https://example.com"
```
---
## How x402 Payment Works
1. Agent discovers a service from the Bazaar catalog
2. Calls the endpoint — gets HTTP 402 Payment Required response
3. Reads payment requirements from the 402 response headers
4. Pays via facilitator using USDC on Base
5. Retries the exact same request with payment proof header
6. Service verifies proof and returns paid result
No accounts, no subscriptions, no API keys — just USDC per request.
---
## MCP Integration
This skill can be integrated with **Model Context Protocol (MCP)** servers to enable
Claude Desktop and other MCP clients to autonomously pay for and use x402 APIs.
**See the full MCP integration guide:** [x402-MCP.md](x402-MCP.md)
Key capabilities:
- Expose x402 services as MCP tools in Claude Desktop
- Automatic payment handling when Claude calls an API
- Support for both EVM (Base) and Solana networks
- No manual payment steps — fully autonomous
Example: Claude can discover weather APIs via this skill, then call them via MCP
with automatic USDC micropayments on Base.
---
## Facilitators Queried
| Facilitator | Discovery URL | Notes |
|---|---|---|
| Coinbase CDP | `api.cdp.coinbase.com/platform/v2/x402/discovery/resources` | Largest catalog, default |
| PayAI | `facilitator.payai.network/discovery/resources` | Alternative catalog |
Both are queried and merged when you run "list services".
---
## Output Format
**Service list:**
```
🛒 x402 Bazaar — 42 services found
1. 🌐 Weather API
URL: https://api.weather-x402.com/current
Type: http GET
Price: $0.001 USDC
Network: Base (eip155:8453)
Updated: 2h ago
2. 🤖 Llama 3.3 70B Inference
URL: https://api.x402network.com/llm/llama
Type: http POST
Price: $0.005 USDC
Network: Base (eip155:8453)
Updated: 4h ago
```
**Paid call result:**
```
💸 x402 Payment Executed
Endpoint: https://api.weather-x402.com/current
Paid: $0.001 USDC
Network: Base (eip155:8453)
TxHash: 0xabc123...
Status: 200 OK
📦 Response:
{"temperature": 72, "conditions": "sunny", "humidity": 45}
```
---
## Spending Limits
Default max spend per call is $0.10 USDC. Set in `.env`:
```
MAX_SPEND_PER_CALL=0.10
```
The skill refuses any call where maxAmountRequired exceeds this limit
and asks the user to confirm before proceeding.
---
## Error Handling
| Error | Cause | Fix |
|---|---|---|
| `EVM_PRIVATE_KEY not set` | Missing .env key | Add key to .env (only needed for paid calls) |
| `Insufficient USDC balance` | Wallet underfunded | Bridge USDC to Base at bridge.base.org |
| `Spend limit exceeded` | Service costs more than MAX_SPEND_PER_CALL | Raise limit in .env or confirm manually |
| `402 verification failed` | Facilitator rejected payment | Retry or switch facilitator |
| `No services found` | Empty Bazaar result | Broaden search or try again later |
| `Network mismatch` | Service on unsupported chain | Filter by network eip155:8453 |
---
## Supported Networks (v1.0)
- Base mainnet: eip155:8453 (real USDC)
- Base Sepolia: eip155:84532 (test USDC — use for testing)
Solana support planned for v1.1.
---
## Listing Your Own API (Sellers)
To list your x402 API on the Bazaar (v2 spec-compliant):
1. Add `bazaarResourceServerExtension` to your x402 resource server
2. Use `declareDiscoveryExtension()` in your route configuration
3. Set `maxAmountRequired` in your accepts[] entries (replaces v1 `amount` field)
4. Listing is free — services set their own per-call price
The v2 discovery API returns:
```json
{
"x402Version": 2,
"items": [...],
"pagination": {...}
}
```
**Note:** This skill handles both v1 (flat list) and v2 (wrapped response) for resilience.
**MCP tool uniqueness:** For MCP servers, uniqueness is determined by `(resource_url, tool_name)`,
not just the URL, since one MCP server can host multiple tools.
Full seller guide: [docs.cdp.coinbase.com/x402/bazaar](https://docs.cdp.coinbase.com/x402/bazaar)
章节与文件索引
按说明文件中的顺序排列。
调用付费端点
何时激活该技能
x402 付款方式如何运作
MCP集成
询问协调员
文件/命令 -> .env · api.cdp.coinbase.com/platform/v2/x402/discovery/resources · facilitator.payai.network/discovery/resources · EVM_PRIVATE_KEY not set · Insufficient USDC balance · Spend limit exceeded · 402 verification failed · No services found
内容校验值 -> 69683152c410
当前原文的自动摘译,尚未人工审校。
调用付费端点
在 Base 上使用 USDC 获取 Base 钱包私钥(MetaMask → 导出,或 Coinbase 钱包)资金 — 从 coinbase.com 或bridge.base.org 获取 添加到
.env:何时激活该技能
当用户说出以下任一内容时激活:Discovery“有哪些 x402 服务可用?” “为我寻找 x402 上 [任务] 的 API”“浏览 x402 集市”
x402 付款方式如何运作
代理从 Bazaar 目录中发现服务 调用端点 — 获取 HTTP 402 Payment required 响应 从 402 响应标头中读取付款要求 使用 Base 上的 USDC 通过服务商付款 使用付款证明标头重试完全相同的请求
MCP集成
此技能可以与模型上下文协议 (MCP) 服务器集成,使 Claude Desktop 和其他 MCP 客户端能够自主付费和使用 x402 API。请参阅完整的 MCP 集成指南:x402-MCP.md 关键功能:将 x402 服务公开为 Claude Desktop 中的 MCP 工具
询问协调员
协调员 · 发现 URL · 注释 Coinbase CDP ·
api.cdp.coinbase.com/platform/v2/x402/discovery/resources· 最大目录,默认 PayAI ·facilitator.payai.network/discovery/resources· 替代目录 当您运行“列表服务”时,两者都会被查询和合并。