aixyz-on-openclaw by agentlyhq/aixyz
npx skills add https://github.com/agentlyhq/aixyz --skill aixyz-on-openclaw本指南专为希望使用 aixyz 部署一个实时、可收费的 AI 代理的 openclaw 用户编写。您无需具备先前的编码经验或加密货币基础设施知识——我们将从零开始解释每一个步骤。
快速参考: 通用的 aixyz 技能位于 skills.sh/agentlyhq/aixyz。如需完整的 CLI 标志和高级主题,请查阅该文档。本指南侧重于对 openclaw 用户最重要的路径。
一个AI代理,它:
aixyz 需要 Bun(不是 Node)。如果您已经安装了 Bun ≥ 1.3,请跳过此步骤。
# macOS / Linux
curl -fsSL https://bun.sh/install | bash
# Windows (PowerShell,需要 WSL 或 Windows 10+)
powershell -c "irm bun.sh/install.ps1 | iex"
验证安装:
bun --version # 应打印 1.3 或更高版本
为什么是 Bun? aixyz 的构建流水线使用了 Bun 的原生构建 API 和插件系统——这是一个硬性的架构要求,而非偏好。CLI(
@aixyz/cli)无法在 Node 上运行。Bun 还包含一个内置的测试运行器,这意味着不需要额外的测试框架。想了解完整的理由吗?请阅读 。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 创建一个新的代理项目(使用所有默认设置)
bunx create-aixyz-app my-agent --yes
cd my-agent
这将创建:
my-agent/
aixyz.config.ts ← 代理名称、描述、支付配置
app/
agent.ts ← 您的 AI 代理逻辑
tools/ ← 工具文件(可选)
package.json
.env.local ← API 密钥(切勿提交此文件)
打开 .env.local 并添加您的 LLM 提供商的 API 密钥。默认的初始化项目使用 @ai-sdk/openai,因此添加:
OPENAI_API_KEY=sk-...
如果您偏好其他提供商(Anthropic、Google、Amazon Bedrock 等),请在 package.json 和 app/agent.ts 中替换 @ai-sdk/* 适配器,然后设置相应的环境变量。查看 ai-sdk.dev 获取完整的提供商列表。
本地运行以进行测试:
bun run dev
# 代理现在运行在 http://localhost:3000
想用 AI 代理客户端测试吗? 安装
use-agently技能,以便您的 AI 代理可以在开发模式下调用您的本地代理:npx skills add https://github.com/agentlyhq/use-agently --skill use-agently此技能允许任何 AI 代理发现并调用您在
http://localhost:3000本地运行的代理。在本地测试时,设置"scheme": "free"以便调用者不会被收费(参见步骤 7)。在生产环境上线前,切换到"scheme": "exact"以便您的代理能从每个请求中获利。
您的代理需要一个公开的 HTTPS URL,以便其他代理和客户端能够访问它。如果您已经有偏好的托管平台,请使用它。如果您是初次尝试,以下是我们推荐的方法。
Vercel 为您提供一个免费的 HTTPS URL,无需任何配置。这是最简单的方法。
bun run build,将输出目录设置为 .vercel/outputOPENAI_API_KEY)https://my-agent.vercel.app 的 URLVercel 会在每次推送时自动部署。您的代理是无服务器的,可以自动扩展。
如果您的代理需要在请求之间保持状态或运行后台作业,请使用这些平台。
对于这三个平台:推送您的仓库,连接平台,将您的 LLM 提供商 API 密钥(例如 OPENAI_API_KEY)设置为环境变量,并按照它们的部署向导操作。它们都能自动检测 Bun。
如果您已经在云平台(AWS、GCP、Azure、DigitalOcean 等)上运行 OpenClaw,最简单的方法是通过同一平台暴露代理:
🔒 最小权限原则: 当暴露代理进程时,只开放代理监听的端口(默认为
3000)。不要授予进程超出服务 HTTP 请求所需的更广泛的网络、IAM 或文件系统访问权限。
如果您只需要一个用于本地测试的快速隧道,请使用 ngrok:
# ngrok — 创建一个公开的 HTTPS URL,转发到 localhost:3000
npx ngrok http 3000
⚠️ 安全警告: 本地隧道适用于短期的测试,但绝不应用于生产环境中的代理。任何发现该 URL 的人都可以向您的机器发送请求。对于生产流量,请始终使用合适的托管提供商。
您需要一个钱包来:
use-agently(最简单,推荐给 openclaw 用户)use-agently 是 aixyz 生态系统中最简单的钱包。它专为代理间相互支付的循环经济而设计。
在 aixyz erc-8004 register 过程中提示时,选择 "生成新钱包",CLI 将为您创建一个并显示私钥。
🔐 私钥安全 — 请仔细阅读:
- 切勿与任何人分享您的私钥。 拥有它的人可以控制您的资金。
- 切勿将其提交到 git 或在公共渠道(Discord、Slack、GitHub 等)中粘贴。
- 离线记下并安全存储(例如,密码管理器)。
- 对于赚取可观收入的生产环境代理,请考虑使用硬件钱包(Ledger、Trezor)。
0x… 开头)任何支持以太坊兼容网络的钱包都可以使用:Coinbase Wallet、Rabby、Frame 等。
您的钱包地址就是您的"银行账号"。 您可以公开分享它。您的私钥/助记词是您的密码 — 切勿分享,切勿提交到代码中。
在 ERC-8004 上注册需要支付少量 Gas 费(几美分)。您需要所选网络的原生代币。
推荐网络:Base。 x402 支付协调器主要部署在 Base 上,因此您的代理在那里接收付款最可靠。Base 的 Gas 费也非常低 — 注册通常只需几美分。以太坊主网的 Gas 费波动很大,通常不适合入门使用。所有网络的 Gas 价格都可能波动;上述金额仅为粗略参考。
为钱包充值的步骤:
还没有加密货币? 您仍然可以在本地和 Vercel 上构建和运行您的代理,无需注册。当您准备好公开被发现时再进行注册。
ERC-8004 是一个链上注册表,使您的代理能够被其他代理、平台和用户发现。它就像是 AI 代理的 DNS 条目。
一旦您的代理部署完成(步骤 3)并且您有了资金充足的钱包(步骤 4–5),运行:
# 交互模式(将提示您输入每个设置)
aixyz erc-8004 register
# 非交互模式(所有值作为标志传递)
aixyz erc-8004 register \
--url https://my-agent.vercel.app \
--chain base \
--broadcast
CLI 将询问(或接受作为标志):
| 提示 | 标志 | 输入内容 |
|---|---|---|
| 代理 URL | --url | 您在步骤 3 中部署的 URL |
| 链 | --chain | base(推荐)、ethereum、bsc、polygon |
| 钱包私钥 | --private-key | 来自您钱包的私钥(切勿分享此信息) |
| 信任机制 | --trust | 接受默认值 |
| 广播 | --broadcast | 传递此标志以实际在链上提交 |
查看所有标志:
aixyz erc-8004 register --help
注册后,您的代理将出现在 ERC-8004 注册表中,并可被生态系统发现。
在 app/agent.ts 中添加一个 accepts 导出,以便调用者按请求付费:
import type { Accepts } from "aixyz/accepts";
// 本地测试期间 — 调用者不收费
export const accepts: Accepts = { scheme: "free" };
// 生产环境 — 调用者每个请求支付 $0.005
// export const accepts: Accepts = { scheme: "exact", price: "$0.005" };
测试提示: 在本地开发和测试时使用
"scheme": "free"(安装use-agently技能以便从 AI 客户端调用您的本地代理)。在生产环境上线前,切换到带有price的"scheme": "exact",以便您的代理能从每个请求中获利。
在 aixyz.config.ts 中设置接收付款的钱包地址:
export default {
name: "my-agent",
// ...
x402: {
payTo: "0xYourWalletAddress", // ← 粘贴您从步骤 4 获得的地址
},
} satisfies AixyzConfig;
或者在初始化时传递:
bunx create-aixyz-app my-agent --yes --pay-to 0xYourWalletAddress
付款直接流向您的钱包 — 没有平台抽成。
在宣布您的代理之前,请验证:
bun run dev 在本地正常工作,代理响应正确OPENAI_API_KEY)和其他任何密钥都已设置为平台上的环境变量,未提交到您的仓库aixyz.config.ts 中的 name、description 和 payTo 地址正确accepts 导出已设置,以便您的代理能从请求中获利注册只是工作的一半。 上链并不会自动带来用户。您需要积极推广您的代理。
aixyz.config.ts 中编写清晰、具体的 description — 这将出现在 A2A 代理卡片和链上注册表中app/icon.png — 一个好的图标能让您的代理在列表中脱颖而出/.well-known/agent-card.json URL — 这是代理间发现的标准入口点$0.001–$0.01 开始,并根据需求调整aixyz erc-8004 update --help安装 Bun 后重启终端,或运行 source ~/.bashrc(Linux)/ source ~/.zshrc(macOS)。
将您的 LLM 提供商的 API 密钥添加到 .env.local(本地开发)或您平台的环境变量设置中(生产环境)。
您的钱包 Gas 不足。添加几美元的相关代币并重试。
检查您平台的构建命令是否为 bun run build,并且所有环境变量都已设置。检查平台的部署日志以查找错误。
验证 aixyz.config.ts 中的 payTo 地址是否正确,并且在更改后是否已重新构建和重新部署。
每周安装量
171
仓库
GitHub Stars
65
首次出现
7 天前
安全审计
安装于
gemini-cli170
github-copilot170
codex170
kimi-cli170
amp170
cline170
This guide is written for openclaw users who want to ship a live, paid AI agent using aixyz. You do not need prior coding experience or knowledge of crypto infrastructure — every step is explained from scratch.
Quick reference: The general aixyz skill lives at skills.sh/agentlyhq/aixyz. Consult it for full CLI flags and advanced topics. This guide focuses on the path that matters most to openclaw users.
An AI agent that:
aixyz requires Bun (not Node). If you already have Bun ≥ 1.3, skip this step.
# macOS / Linux
curl -fsSL https://bun.sh/install | bash
# Windows (PowerShell, requires WSL or Windows 10+)
powershell -c "irm bun.sh/install.ps1 | iex"
Verify:
bun --version # should print 1.3 or higher
Why Bun? The aixyz build pipeline uses Bun's native build API and plugin system — this is a hard architectural requirement, not a preference. The CLI (
@aixyz/cli) cannot run on Node. Bun also includes a built-in test runner, which means no extra test framework is needed. Curious about the full rationale? Read Why Bun.
# Create a new agent project (uses all defaults)
bunx create-aixyz-app my-agent --yes
cd my-agent
This creates:
my-agent/
aixyz.config.ts ← agent name, description, payment config
app/
agent.ts ← your AI agent logic
tools/ ← tool files (optional)
package.json
.env.local ← API keys (never commit this file)
Open .env.local and add your LLM provider's API key. The default scaffold uses @ai-sdk/openai, so add:
OPENAI_API_KEY=sk-...
If you prefer a different provider (Anthropic, Google, Amazon Bedrock, etc.), swap the @ai-sdk/* adapter in package.json and app/agent.ts, then set the corresponding env var instead. See ai-sdk.dev for the full list of providers.
Run locally to test:
bun run dev
# Agent is now live at http://localhost:3000
Testing with an AI agent client? Install the
use-agentlyskill so your AI agent can call your local agent in dev mode:npx skills add https://github.com/agentlyhq/use-agently --skill use-agentlyThis skill lets any AI agent discover and call your locally running agent at
http://localhost:3000. While testing locally, set"scheme": "free"so callers are not charged (see Step 7). Before going to production, switch to"scheme": "exact"so your agent earns from every request.
Your agent needs a public HTTPS URL so other agents and clients can reach it. If you already have a preferred hosting platform, use it. If you are starting fresh, here are our recommendations.
Vercel gives you a free HTTPS URL with zero configuration. It is the easiest path.
bun run build and the Output Directory to .vercel/outputOPENAI_API_KEY) in the Vercel dashboard under Settings → Environment Variableshttps://my-agent.vercel.appVercel auto-deploys on every push. Your agent is serverless and scales automatically.
Use these if your agent needs to hold state between requests or run background jobs.
| Platform | Free tier | Notes |
|---|---|---|
| Railway | 5 USD/month credit | Easiest Docker-free deploy |
| Render | Generous free tier | Sleeps after inactivity |
| Fly.io | Free allowance | More control, steeper learning curve |
For all three: push your repo, connect the platform, set your LLM provider API key (e.g., OPENAI_API_KEY) as an environment variable, and follow their deploy wizard. They all detect Bun automatically.
If you are already running OpenClaw on a cloud platform (AWS, GCP, Azure, DigitalOcean, etc.), the simplest path is to expose the agent through that same platform:
🔒 Least-privilege rule: When exposing the agent process, only open the port the agent listens on (default
3000). Do not grant the process broader network, IAM, or filesystem access than it needs to serve HTTP requests.
If you just need a quick tunnel for local testing , use ngrok:
# ngrok — creates a public HTTPS URL that forwards to localhost:3000
npx ngrok http 3000
⚠️ Security warning: Local tunnels are fine for short-lived testing but should never be used for a production agent. Anyone who discovers the URL can send requests to your machine. Always use a proper hosting provider for live traffic.
You need a wallet to:
use-agently (simplest, recommended for openclaw users)use-agently is the simplest wallet for the aixyz ecosystem. It is designed for the circular economy of agents paying agents.
When prompted during aixyz erc-8004 register, select "Generate a new wallet" and the CLI will create one for you and display the private key.
🔐 Private key security — read this carefully:
- Never share your private key with anyone. Anyone who has it controls your funds.
- Never commit it to git or paste it in public channels (Discord, Slack, GitHub, etc.).
- Write it down offline and store it somewhere safe (e.g., a password manager).
- For a production agent that earns significant income, consider a hardware wallet (Ledger, Trezor).
0x…)Any wallet that supports Ethereum-compatible networks works: Coinbase Wallet, Rabby, Frame, etc.
Your wallet address is your "bank account number." You share it publicly. Your private key / seed phrase is your password — never share it, never commit it to code.
Registering on ERC-8004 costs a small gas fee (a fraction of a dollar). You need the native coin of your chosen network.
| Network | Coin needed | Where to get it |
|---|---|---|
| Ethereum mainnet | ETH | Coinbase, Binance, Kraken |
| BNB Smart Chain | BNB | Binance |
| Base | ETH | Coinbase (Base is a Coinbase L2) |
| Polygon | POL | Coinbase, Binance |
Recommended network: Base. The x402 payment facilitator is primarily deployed on Base, so your agent will receive payments most reliably there. Base also has very low gas fees — registration typically costs a few cents. Ethereum mainnet gas varies widely and is usually not worth it for getting started. Gas prices on all networks can fluctuate; the amounts above are rough guides only.
Steps to fund your wallet:
No crypto yet? You can still build and run your agent locally and on Vercel without registration. Register once you are ready to be publicly discoverable.
ERC-8004 is an on-chain registry that makes your agent discoverable by other agents, platforms, and users. It is like a DNS entry but for AI agents.
Once your agent is deployed (Step 3) and you have a funded wallet (Steps 4–5), run:
# Interactive mode (will prompt you for each setting)
aixyz erc-8004 register
# Non-interactive mode (all values as flags)
aixyz erc-8004 register \
--url https://my-agent.vercel.app \
--chain base \
--broadcast
The CLI will ask for (or accept as flags):
| Prompt | Flag | What to enter |
|---|---|---|
| Agent URL | --url | Your deployed URL from Step 3 |
| Chain | --chain | base (recommended), ethereum, bsc, polygon |
| Wallet private key | --private-key | The key from your wallet (never share this) |
See all flags:
aixyz erc-8004 register --help
After registration, your agent appears in the ERC-8004 registry and becomes discoverable by the ecosystem.
Add an accepts export to app/agent.ts so callers are charged per request:
import type { Accepts } from "aixyz/accepts";
// During local testing — callers are not charged
export const accepts: Accepts = { scheme: "free" };
// Production — callers pay $0.005 per request
// export const accepts: Accepts = { scheme: "exact", price: "$0.005" };
Testing tip: Use
"scheme": "free"while developing and testing locally (install theuse-agentlyskill to call your local agent from an AI client). Before going to production , switch to"scheme": "exact"with apriceso your agent earns from every request.
Set the wallet address that receives payments in aixyz.config.ts:
export default {
name: "my-agent",
// ...
x402: {
payTo: "0xYourWalletAddress", // ← paste your address from Step 4
},
} satisfies AixyzConfig;
Or pass it at scaffold time:
bunx create-aixyz-app my-agent --yes --pay-to 0xYourWalletAddress
Payments flow directly to your wallet — no platform takes a cut.
Before announcing your agent, verify:
bun run dev works locally and the agent responds correctlyOPENAI_API_KEY) and any other secrets are set as environment variables on the platform, not committed to your repoaixyz.config.ts has the correct name, description, and payTo addressaccepts export is set so your agent earns from requestsRegistration is only half the work. Getting on-chain doesn't automatically bring users. You need to actively promote your agent.
description in aixyz.config.ts — this appears in the A2A agent card and on-chain registryapp/icon.png — a good icon makes your agent stand out in listings/.well-known/agent-card.json URL — it is the standard entry point for agent-to-agent discovery$0.001–$0.01 per request and adjust based on demandaixyz erc-8004 update --helpRestart your terminal after installing Bun, or run source ~/.bashrc (Linux) / source ~/.zshrc (macOS).
Add your LLM provider's API key to .env.local (local dev) or to your platform's environment variable settings (production).
Your wallet does not have enough gas. Add a few more dollars of the relevant coin and retry.
Check that your platform's build command is bun run build and that all environment variables are set. Check the platform's deploy logs for errors.
Verify your payTo address in aixyz.config.ts is correct and that you rebuilt and redeployed after changing it.
Weekly Installs
171
Repository
GitHub Stars
65
First Seen
7 days ago
Security Audits
Gen Agent Trust HubPassSocketFailSnykFail
Installed on
gemini-cli170
github-copilot170
codex170
kimi-cli170
amp170
cline170
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
109,600 周安装
| Trust mechanisms | --trust | Accept the default |
| Broadcast | --broadcast | Pass this flag to actually submit on-chain |