闲社服务运行正常AI智能体自动化平台
o

x402服务市场

技能标识:openclaw-x402-skill

Discover, browse, filter, and pay for x402-compatible API endpoints and MCP tools from the x402 Bazaar — the autonomous discovery layer for agentic payments. Browse all available services, filter by price or type, inspect payment requirements, and call any discovered endpoint using USDC micropayments on Base with no API keys or account setup. Use when the agent needs to find a payable API service, check what x402 services exist for a given task (web scraping, AI inference, weather data, market d

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 0.1.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

x402服务市场

x402 Bazaar 技能

x402 Bazaar 是 x402 生态系统的发现层——一个机器可读的目录,帮助 AI 代理发现并集成兼容 x402 的 API 端点和 MCP 工具。无需预先集成即可查询、发现、支付和使用。

两种模式:

  • - 仅浏览 — 无需钱包,零成本,发现所有可用服务
  • 浏览 + 支付 — 需要持有 USDC 的 Base 钱包来调用已发现的端点



前置条件

仅浏览(无需密钥)

bash python3 agent.py list services python3 agent.py find weather APIs

调用付费端点

  1. 1. 获取 Base 钱包私钥(MetaMask → 导出,或 Coinbase 钱包)
  2. 在 Base 上存入 USDC — 从 coinbase.com 或 bridge.base.org 获取
  3. 添加到 .env:

EVMPRIVATEKEY=0xYourPrivateKeyHere
MAXSPENDPER_CALL=0.10

安装依赖(运行一次)

bash pip install -r ~/clawd/skills/x402-bazaar/requirements.txt

何时激活此技能

当用户说出以下任何内容时激活:

发现

  • - 有哪些 x402 服务可用?
  • 帮我找一个用于 [任务] 的 x402 API
  • 浏览 x402 Bazaar
  • 哪些服务价格低于 $0.01?
  • 找一个按次付费的天气 API
  • x402 上有哪些 MCP 工具?
  • 显示价格低于 [价格] 的 x402 服务
  • 在 x402 上搜索 [关键词]

支付服务

  • - 调用这个 x402 端点:[url]
  • 支付并调用 [服务名称]
  • 使用 x402 获取 [数据] — 找到并支付最便宜的服务
  • 向 [url] 发起付费的 x402 请求

不要激活的情况:

  • - 检查代理自身钱包余额 → 使用 /agent-wallet 技能
  • 在 Bazaar 上作为卖家发布 → 手动设置,见下方卖家部分
  • Alpaca 或股票交易 → 使用 /alpaca-trading 技能



精确命令

列出所有可用服务

bash cd ~/clawd/skills/x402-bazaar && python3 agent.py list services

按关键词搜索

bash python3 agent.py find weather python3 agent.py search for AI inference python3 agent.py find web scraping services

按最高价格筛选

bash python3 agent.py services under 0.01 python3 agent.py services under 0.001 USDC

按类型筛选

bash python3 agent.py list http services python3 agent.py list mcp tools

检查特定服务

bash python3 agent.py inspect https://api.example.com/x402/weather

调用已发现的服务(需要 EVMPRIVATEKEY + 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

全自动流程:发现 + 支付 + 使用

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

x402 支付工作原理

  1. 1. 代理从 Bazaar 目录中发现服务
  2. 调用端点 — 收到 HTTP 402 Payment Required 响应
  3. 从 402 响应头中读取支付要求
  4. 通过促进器使用 Base 上的 USDC 进行支付
  5. 使用支付证明头重试完全相同的请求
  6. 服务验证证明并返回付费结果

无需账户、无需订阅、无需 API 密钥——只需按请求支付 USDC。



MCP 集成

此技能可与 模型上下文协议(MCP) 服务器集成,使 Claude Desktop 和其他 MCP 客户端能够自主支付并使用 x402 API。

查看完整的 MCP 集成指南: x402-MCP.md

关键能力:

  • - 在 Claude Desktop 中将 x402 服务暴露为 MCP 工具
  • Claude 调用 API 时自动处理支付
  • 支持 EVM(Base)和 Solana 网络
  • 无需手动支付步骤 — 完全自主

示例:Claude 可以通过此技能发现天气 API,然后通过 MCP 调用它们,在 Base 上自动进行 USDC 微支付。



查询的促进器


促进器发现 URL备注
Coinbase CDPapi.cdp.coinbase.com/platform/v2/x402/discovery/resources最大目录,默认
PayAI
facilitator.payai.network/discovery/resources | 备选目录 |

运行 list services 时会查询并合并两者。



输出格式

服务列表:

🛒 x402 Bazaar — 找到 42 个服务

1. 🌐 天气 API
URL: https://api.weather-x402.com/current
类型: http GET
价格: $0.001 USDC
网络: Base (eip155:8453)
更新: 2小时前

2. 🤖 Llama 3.3 70B 推理
URL: https://api.x402network.com/llm/llama
类型: http POST
价格: $0.005 USDC
网络: Base (eip155:8453)
更新: 4小时前

付费调用结果:

💸 x402 支付已执行
端点: https://api.weather-x402.com/current
支付: $0.001 USDC
网络: Base (eip155:8453)
交易哈希: 0xabc123...
状态: 200 OK

📦 响应:
{temperature: 72, conditions: sunny, humidity: 45}



消费限额

每次调用的默认最高消费为 $0.10 USDC。在 .env 中设置:

MAXSPENDPER_CALL=0.10

当 maxAmountRequired 超过此限额时,技能会拒绝任何调用,并在继续前要求用户确认。



错误处理


错误原因修复
EVMPRIVATEKEY not set缺少 .env 密钥将密钥添加到 .env(仅付费调用需要)
Insufficient USDC balance
钱包资金不足 | 在 bridge.base.org 将 USDC 桥接到 Base |
| Spend limit exceeded | 服务费用超过 MAXSPENDPER_CALL | 在 .env 中提高限额或手动确认 |
| 402 verification failed | 促进器拒绝支付 | 重试或切换促进器 |
| No services found | Bazaar 结果为空 | 扩大搜索范围或稍后重试 |
| Network mismatch | 服务在不支持的链上 | 按网络 eip155:8453 筛选 |


支持的网络(v1.0)

  • - Base 主网:eip155:8453(真实 USDC)
  • Base Sepolia:eip155:84532(测试 USDC — 用于测试)

Solana 支持计划在 v1.1 中推出。



发布你自己的 API(卖家)

要在 Bazaar 上发布你的 x402 API(符合 v2 规范):

  1. 1. 将 bazaarResourceServerExtension 添加到你的 x402 资源服务器
  2. 在路由配置中使用 declareDiscoveryExtension()
  3. 在 accepts[] 条目中设置 maxAmountRequired(替代 v1 的 amount 字段)
  4. 发布免费 — 服务自行设置每次调用的价格

v2 发现 API 返回:
json
{
x402Version: 2,
items: [...],
pagination: {...}
}

注意: 此技能同时处理 v1(扁平列表)和 v2(包装响应)以保证健壮性。

MCP 工具唯一性: 对于 MCP 服务器,唯一性由 (resourceurl, toolname) 决定,而不仅仅是 URL,因为一个 MCP 服务器可以托管多个工具。

完整卖家指南:docs.cdp.coinbase.com/x402/bazaar

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 openclaw-x402-skill-1776274862 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 openclaw-x402-skill-1776274862 技能

通过命令行安装

skillhub install openclaw-x402-skill-1776274862

下载

⬇ 下载 openclaw-x402-skill v0.1.0(免费)

文件大小: 18.03 KB | 发布时间: 2026-4-16 17:31

v0.1.0 最新 2026-4-16 17:31
- Initial release of openclaw-x402-skill.
- Enables discovery, browsing, and filtering of x402-compatible API endpoints and MCP tools from the x402 Bazaar.
- Supports paying for and calling APIs using USDC micropayments on Base with no API keys or account setup (requires EVM_PRIVATE_KEY for paid calls).
- Allows listing and searching services by price, type, and keywords; includes autonomous find + pay + use flows.
- Handles discovery via multiple facilitators (Coinbase CDP, PayAI), supporting both v1 and v2 discovery specs.
- Includes robust error handling and spending limits; browsing requires no keys or wallet.
返回顶部