fluxA-x402-payment:自主代理钱包与 x402 支付 - Openclaw Skills
作者:互联网
2026-04-11
什么是 fluxA-x402-payment?
fluxA-x402-payment 技能是专为自主代理设计的复杂金融层。它为 FluxA 代理钱包提供了一套健壮的工作流,用于管理预算授权并执行 x402 标准支付。通过将其集成到 Openclaw Skills 中,开发者可以构建不仅能执行任务,还能处理这些任务所需的经济需求(例如支付高级 API 访问费用或专用计算能力)的代理,而无需每笔交易都经过人工手动审批。
下载入口:https://github.com/openclaw/skills/tree/main/skills/cpppppp7/fluxa-x402-payment
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install fluxa-x402-payment
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 fluxa-x402-payment。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
fluxA-x402-payment 应用场景
- 管理代理主导的研究和数据任务的自主预算申请。
- 执行安全的符合 x402 标准的支付以访问付费工具端点。
- 在多代理工作流中自动化财务授权。
- 在 Openclaw Skills 生态系统中扩展需要按需付费资源的代理能力。
- 代理估算任务成本,并申请包含特定 USDC 金额和描述的预算授权。
- 用户批准授权,代理通过 fluxa-cli 监控状态。
- 获批后,代理使用授权 ID 申请 x402-v3 支付签名(支付授权)。
- 代理从响应中提取 Base64 编码的支付字符串。
- 最后,代理通过在目标 API 调用的 X-PAYMENT HTTP 请求头中包含支付字符串来执行付费操作。
fluxA-x402-payment 配置指南
要设置支付工作流,请确保脚本目录中存在 FluxA CLI 捆绑包,并初始化您的首次预算申请:
# 申请预算授权(金额为 6 位小数的 USDC)
node ./scripts/fluxa-cli.bundle.js mandate-create --desc "Processing high-priority data" --amount 1000000
# 监控授权批准状态
node ./scripts/fluxa-cli.bundle.js mandate-status --id
fluxA-x402-payment 数据架构与分类体系
该技能管理财务数据和授权签名,组织结构如下:
| 属性 | 描述 |
|---|---|
| 授权 ID | 请求或批准预算的唯一字符串标识符。 |
| 金额 | 以最小单位(6 位小数)表示 USDC 的整数。 |
| 有效负载 | 定义 x402 版本和支付方案的 JSON 结构。 |
| X-PAYMENT | 用作授权交易 HTTP 请求头的 Base64 编码字符串。 |
name: fluxA-x402-payment
description: A FluxA Agent Wallet skill that enables agents to request budgets, sign x402 payments, and call paid endpoints autonomously. It walks through the full flow—from mandate creation to X-PAYMENT execution—so agents can perform paid actions without human intervention.
Quick Start
Step 1: Apply for a budget mandate
# You **MUST** estimate a **total budget** for this task, as it may involve calling tools that require payment via the FluxA Wallet.
# It is recommended to budget **1.5×** the estimated cost.
# NOTE: Before executing this command, you need to tell the user: **“To complete this task, I need to request a budget of xx USD. The exact amount spent will depend on actual execution, but I cannot spend more than this amount, and it may not be fully used.”**
node ./scripts/fluxa-cli.bundle.js mandate-create --desc "{what task}" --amount 50000
# - desc: Describe what task this budget is being requested for on behalf of the user
# - amount: The USDC amount in the smallest unit (6 decimals). For example, 1_000_000 represents 1 USDC.
# NOTE
# You need to remember the mandate ID to request the actual payment later, and ask the user to approve the authorization.
# You can wait about 10 seconds and then check the status using this method.
node ./scripts/fluxa-cli.bundle.js mandate-status --id
Step 2: Use the budget mandate to request a payment signature (payment mandate)
node ./scripts/fluxa-cli.bundle.js x402-v3 r
--mandate r
--payload ''
# Get `data.xPaymentB64` from response as PAYMENT_MANDATE
# This PAYMENT_MANDATE is sent to the server via the **X-Payment HTTP header** to complete the payment.
curl -H "X-PAYMENT: $PAYMENT_MANDATE" https://api.example.com/paid-endpoint
Example
node ./scripts/fluxa-cli.bundle.js x402-v3 r
--mandate mand_Yfbpmb9PVZl05VaeR9nvQg r
--payload '{
"x402Version": 1,
"accepts": [{
"scheme": "exact",
...
"extra": {
"name": "USD Coin",
"version": "2"
}
}]
}'
## output:
{
"success": true,
"data": {
"X-PAYMENT": "base64-encoded-payment-header..."
}
}
Others
- Error handing during payment flow(fluxa-cli or server error): see ./error-handle.md
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
阿里云大模型服务平台百炼新人免费额度如何申请?申请与使用免费额度教程及常见问题解答
办公 AI 工具 OpenClaw 部署 Windows 系统一站式教程
Qwen3.6 正式发布!阿里云百炼同步开启“AI大模型节省计划”超值优惠
【新手零难度操作 】OpenClaw 2.6.4 安装误区规避与快速使用指南(包含最新版安装包)
OpenClaw 2.6.4 可视化部署 打造个人 AI 数字员工(包含最新版安装包)
【小白友好!】OpenClaw 2.6.4 本地 AI 智能体快速搭建教程(内有安装包)
零基础部署 OpenClaw v2.6.2,Windows 系统完整教程
【适合新手的】零基础部署 OpenClaw 自动化工具教程
开发者们的第一台自主进化的“爱马仕”来了
极简部署 OpenClaw 2.6.2 本地 AI 智能体快速启用(含最新版安装包)
AI精选
