agentbox-bootstrap

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AgentBox Operating Instructions

AgentBox 操作说明

You are running on a dedicated AgentBox agent - a single-tenant cloud instance with OpenClaw gateway, HTTPS, web terminal, and a Solana wallet for x402 micropayments.
你当前运行在专属的AgentBox agent上——这是单租户云实例,搭载OpenClaw网关、HTTPS、网页终端,以及用于x402微支付的Solana钱包。

Services

服务

ServicePortManaged by
OpenClaw gateway:18789 (loopback)
openclaw gateway restart
Caddy (HTTPS reverse proxy):443
sudo systemctl restart caddy
ttyd (web terminal):7681 (loopback)
sudo systemctl restart ttyd
Caddy routes HTTPS traffic to the gateway and terminal. Do NOT modify Caddy or systemd configs directly.
服务端口管理方式
OpenClaw 网关:18789 (环回地址)
openclaw gateway restart
Caddy (HTTPS 反向代理):443
sudo systemctl restart caddy
ttyd (网页终端):7681 (环回地址)
sudo systemctl restart ttyd
Caddy会将HTTPS流量路由到网关和终端。请勿直接修改Caddy或systemd配置。

Key paths

关键路径

WhatPath
OpenClaw config
~/.openclaw/openclaw.json
Solana wallet
~/.openclaw/agentbox/wallet-sol.json
EVM wallet
~/.openclaw/agentbox/wallet-evm.key
Mnemonic (root secret)
~/.openclaw/agentbox/mnemonic
Workspace
~/.openclaw/workspace/
Skills (managed)
~/.openclaw/skills/
x402 plugin
~/.openclaw/extensions/openclaw-x402/
Gateway logs
~/.openclaw/logs/
项目路径
OpenClaw 配置
~/.openclaw/openclaw.json
Solana 钱包
~/.openclaw/agentbox/wallet-sol.json
EVM 钱包
~/.openclaw/agentbox/wallet-evm.key
助记词 (根密钥)
~/.openclaw/agentbox/mnemonic
工作区
~/.openclaw/workspace/
Skills (托管)
~/.openclaw/skills/
x402 插件
~/.openclaw/extensions/openclaw-x402/
网关日志
~/.openclaw/logs/

x402 payment plugin

x402 支付插件

The
openclaw-x402
plugin patches
globalThis.fetch
to handle HTTP 402 Payment Required responses automatically. When an LLM inference call returns 402, the plugin signs a USDC payment on Solana and retries. This is transparent - you don't need to do anything special.
The wallet at
~/.openclaw/agentbox/wallet-sol.json
must have USDC balance for payments to work. Check balance with
/x_wallet
or:
bash
spl-token balance --owner $(solana address) EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
openclaw-x402
插件会对
globalThis.fetch
进行补丁,自动处理HTTP 402 需要付款的响应。当LLM推理调用返回402时,该插件会在Solana上签署USDC支付并重试请求。整个过程是透明的,你无需进行任何特殊操作。
路径
~/.openclaw/agentbox/wallet-sol.json
对应的钱包必须有USDC余额才能正常完成支付。你可以通过
/x_wallet
或以下命令查询余额:
bash
spl-token balance --owner $(solana address) EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

Commands and tools

命令与工具

Slash commands:
  • /x_wallet
    - wallet dashboard with balance, token holdings, recent transactions
  • /x_wallet send <amount|all> <address>
    - send USDC to a Solana address
  • /x_wallet history [page]
    - paginated transaction history
  • /x_status
    - system overview (version, model, pricing, wallet summary)
  • /x_update
    - update plugin and skills, restart gateway
Agent tools:
  • x_balance
    - check wallet SOL and USDC balances
  • x_swap
    - swap any Solana token for another (SOL, USDC, meme tokens, any SPL token)
  • x_launch_token
    - launch a new token on pump.fun
  • x_token_info
    - look up token price, market cap, volume, liquidity
  • x_payment
    - call any x402-enabled paid API
Swaps use Jupiter aggregator for best routing, with automatic fallback to PumpPortal for bonding curve tokens. Amount is in input token units, slippage in basis points (default: 250 = 2.5%).
斜杠命令:
  • /x_wallet
    - 钱包面板,展示余额、代币持有情况、最近交易记录
  • /x_wallet send <amount|all> <address>
    - 向Solana地址发送USDC
  • /x_wallet history [page]
    - 分页查看交易历史
  • /x_status
    - 系统概览(版本、模型、定价、钱包摘要)
  • /x_update
    - 更新插件和skills,重启网关
Agent 工具:
  • x_balance
    - 查询钱包SOL和USDC余额
  • x_swap
    - 兑换任意Solana代币(SOL、USDC、meme币、任意SPL代币)
  • x_launch_token
    - 在pump.fun上发行新代币
  • x_token_info
    - 查询代币价格、市值、交易量、流动性
  • x_payment
    - 调用任意支持x402的付费API
兑换操作使用Jupiter聚合器实现最优路由,债券曲线代币会自动回退到PumpPortal。金额单位为输入代币单位,滑点以基点计算(默认:250 = 2.5%)。

Default model provider

默认模型提供商

This instance comes with a preconfigured LLM provider (blockrun) that uses x402 for payments. To use a different provider like OpenRouter, see the OpenRouter Setup section below.
本实例预装了LLM提供商(blockrun),使用x402进行支付。要使用OpenRouter等其他提供商,请参阅下方的OpenRouter设置部分。

OpenRouter Setup

OpenRouter 设置

To configure OpenRouter as LLM provider (access to Claude, GPT, Gemini, and more via a single API key):
  1. Get an API key: Sign up at https://openrouter.ai, go to https://openrouter.ai/keys, create a key (starts with
    sk-or-
    )
  2. Configure OpenClaw:
bash
jq --arg key "sk-or-USER_KEY_HERE" \
   --arg model "openrouter/anthropic/claude-sonnet-4-5" \
   '.env.OPENROUTER_API_KEY = $key | .agents.defaults.model.primary = $model' \
   ~/.openclaw/openclaw.json > /tmp/openclaw-update.json \
   && mv /tmp/openclaw-update.json ~/.openclaw/openclaw.json
  1. Restart gateway:
    openclaw gateway restart
Popular models:
openrouter/anthropic/claude-sonnet-4-5
,
openrouter/anthropic/claude-opus-4-6
,
openrouter/openai/gpt-4o
,
openrouter/google/gemini-2.5-pro
. Full list at https://openrouter.ai/models.
Switch model later (without re-entering API key):
bash
jq --arg model "openrouter/anthropic/claude-opus-4-6" \
   '.agents.defaults.model.primary = $model' \
   ~/.openclaw/openclaw.json > /tmp/openclaw-update.json \
   && mv /tmp/openclaw-update.json ~/.openclaw/openclaw.json
openclaw gateway restart
如需将OpenRouter配置为LLM提供商(可通过单个API key访问Claude、GPT、Gemini等更多模型):
  1. 配置OpenClaw
bash
jq --arg key "sk-or-USER_KEY_HERE" \
   --arg model "openrouter/anthropic/claude-sonnet-4-5" \
   '.env.OPENROUTER_API_KEY = $key | .agents.defaults.model.primary = $model' \
   ~/.openclaw/openclaw.json > /tmp/openclaw-update.json \
   && mv /tmp/openclaw-update.json ~/.openclaw/openclaw.json
  1. 重启网关
    openclaw gateway restart
热门模型
openrouter/anthropic/claude-sonnet-4-5
openrouter/anthropic/claude-opus-4-6
openrouter/openai/gpt-4o
openrouter/google/gemini-2.5-pro
。完整列表可查看https://openrouter.ai/models。
后续切换模型(无需重新输入API key):
bash
jq --arg model "openrouter/anthropic/claude-opus-4-6" \
   '.agents.defaults.model.primary = $model' \
   ~/.openclaw/openclaw.json > /tmp/openclaw-update.json \
   && mv /tmp/openclaw-update.json ~/.openclaw/openclaw.json
openclaw gateway restart

Restarting the gateway

重启网关

After any config change to
~/.openclaw/openclaw.json
:
bash
openclaw gateway restart
Check status:
bash
openclaw status
每次修改
~/.openclaw/openclaw.json
配置后执行:
bash
openclaw gateway restart
查看状态:
bash
openclaw status

Updating skills

更新Skills

To get the latest AgentBox skills:
bash
npx skills add -g cascade-protocol/agentbox
Skills are installed to
~/.openclaw/skills/
(OpenClaw's managed skills path, auto-discovered). Changes take effect on the next new session.
获取最新的AgentBox skills:
bash
npx skills add -g cascade-protocol/agentbox
Skills会安装到
~/.openclaw/skills/
(OpenClaw的托管skill路径,会自动发现)。修改会在下一次新会话生效。

Troubleshooting

故障排查

  • Gateway won't start: Check
    openclaw status
    and gateway logs at
    ~/.openclaw/logs/
  • x402 payments failing: Check USDC balance (see above). Wallet needs USDC on Solana mainnet.
  • Config changes not taking effect: Run
    openclaw gateway restart
    after editing
    ~/.openclaw/openclaw.json
  • Skills not showing: Check
    ls ~/.openclaw/skills/
    . Run
    npx skills add -g cascade-protocol/agentbox
    to refresh.
  • "Invalid API key" (OpenRouter): Verify the key starts with
    sk-or-
    and has credit on https://openrouter.ai/credits
  • Model not responding (OpenRouter): Check model availability on https://openrouter.ai/models
  • Config broken after edit: Check JSON syntax with
    cat ~/.openclaw/openclaw.json | jq .
  • 网关无法启动:查看
    openclaw status
    ~/.openclaw/logs/
    下的网关日志
  • x402支付失败:检查USDC余额(见上文),钱包需要在Solana主网有USDC
  • 配置修改未生效:编辑
    ~/.openclaw/openclaw.json
    后执行
    openclaw gateway restart
  • Skills未显示:执行
    ls ~/.openclaw/skills/
    检查,运行
    npx skills add -g cascade-protocol/agentbox
    刷新
  • OpenRouter提示「无效API key」:确认密钥前缀为
    sk-or-
    ,且https://openrouter.ai/credits页面有余额
  • OpenRouter模型无响应:查看https://openrouter.ai/models确认模型可用性
  • 编辑后配置损坏:执行
    cat ~/.openclaw/openclaw.json | jq .
    检查JSON语法

Important rules

重要规则

  • Always use
    openclaw gateway restart
    to restart the gateway. Never use systemctl directly for the gateway.
  • When editing
    ~/.openclaw/openclaw.json
    , read the current file first, modify it, write it back. Don't write partial configs.
  • The wallet keys are at
    ~/.openclaw/agentbox/
    (wallet-sol.json, wallet-evm.key, mnemonic). Never share them or display them to users.
  • 始终使用
    openclaw gateway restart
    重启网关,请勿直接使用systemctl操作网关
  • 编辑
    ~/.openclaw/openclaw.json
    时,请先读取当前文件内容,修改后再写回,不要写入部分配置
  • 钱包密钥存放在
    ~/.openclaw/agentbox/
    下(wallet-sol.json、wallet-evm.key、mnemonic),请勿共享或向用户展示