Files
zeekay acaeda400a Eradicate OpenClaw — resolve merge conflicts and finish the rebrand
Three coordinated things:

1. Resolve the committed upstream/main merge conflicts. 94 files were
   sitting with raw <<<<<<< HEAD ... >>>>>>> upstream/main blocks. Every
   conflict had HanzoBot/Bot on HEAD and OpenClaw on upstream. Resolved
   by keeping HEAD everywhere — 540 conflict blocks.

2. Rewrite remaining OpenClaw text refs.
     OPENCLAW   → HANZO_BOT
     OpenClaw   → HanzoBot          (PascalCase type identifiers)
     openclaw   → bot               (codebase convention — botToken,
                                    botUsername etc.; avoids invalid
                                    hyphenated JS identifiers)
     openclaw[_]/openclaw[A-Z] → bot[_]/bot[A-Z]   (compound)
     ai.openclaw.x → ai.hanzo.bot.x  (JVM package path)

3. Delete or rename openclaw-named file paths (116 of them). Dead
   duplicates with a Bot-named canonical from the partial migration:
   deleted. Otherwise renamed.
     ai/openclaw/**           → deleted (ai/hanzo/bot/** canonical)
     Sources/OpenClaw*/       → deleted (Sources/Bot* canonical)
     Tests/OpenClawIPCTests/  → deleted (Tests/BotIPCTests canonical)
     OpenClawKit/             → deleted (BotKit canonical)
     openclaw-tools.*.ts      → deleted (bot-tools.*.ts canonical)
     openclaw-root.ts etc.    → deleted (bot-root.ts canonical)
     types.openclaw.ts        → deleted (types.bot.ts canonical)
     extensions/*/openclaw.plugin.json → renamed hanzo-bot.plugin.json
     docs/start/openclaw.md   → renamed hanzo-bot.md (+ zh-CN)
     docs/assets/openclaw-*.png, whatsapp-openclaw*.jpg → deleted
     scripts/.../openclaw-*   → deleted (bot/hanzo-bot parallels)
     openclaw.mjs             → deleted (hanzo-bot.mjs is package.bin)

Then patched 65 broken JS/TS import strings where hanzo-bot had ended
up inside an import path ('./types.hanzo-bot.js' → './types.bot.js'
etc., since the on-disk filename uses the brand-neutral bot- prefix).

Pre-existing lint debt cleaned up to get oxlint --type-aware to 0/0:
removed the dead i18n test that referenced a path no longer existing;
defined the missing DIDConfig and WalletConfig types in types.base.ts
(they were imported but never declared); dropped unused imports;
collapsed redundant type assertion and a tautological meta.bot lookup
that the openclaw→bot rename made redundant.

The a2ui.bundle.js generated artifact is kept at its pre-rebrand
contents — it gets regenerated by 'pnpm canvas:a2ui:bundle' from
sources I cannot rebuild in this commit; the source side is clean.

Verified: 0 occurrences of openclaw (case-insensitive) in tree source
content, 0 file or directory paths with openclaw in the name; oxlint
--type-aware src test reports 0/0.
2026-05-11 17:56:29 -07:00

4.9 KiB
Raw Permalink Blame History

read_when, summary, title, x-i18n
read_when summary title x-i18n
你想了解哪些功能可能调用付费 API
你需要审核密钥、费用和用量可见性
你正在解释 /status 或 /usage 的费用报告
审核哪些功能会产生费用、使用了哪些密钥以及如何查看用量 API 用量与费用
generated_at model provider source_hash source_path workflow
2026-02-01T21:37:08Z claude-opus-4-5 pi 807d0d88801e919a8246517820644db1e6271d165fa376b2e637f05a9121d8b1 reference/api-usage-costs.md 15

API 用量与费用

本文档列出了可能调用 API 密钥的功能及其费用的显示位置。重点介绍 HanzoBot 中可能产生提供商用量或付费 API 调用的功能。

费用显示位置(聊天 + CLI)

每会话费用快照

  • /status 显示当前会话模型、上下文用量和上次响应的 token 数。
  • 如果模型使用 API 密钥认证,/status 还会显示上次回复的预估费用。

每条消息费用页脚

  • /usage full 在每条回复后附加用量页脚,包括预估费用(仅限 API 密钥)。
  • /usage tokens 仅显示 token 数;OAuth 流程会隐藏美元费用。

CLI 用量窗口(提供商配额)

  • hanzo-bot status --usage 和 hanzo-bot channels list 显示提供商用量窗口(配额快照,非每条消息的费用)。

详情和示例请参阅 Token 用量与费用。

密钥的发现方式

HanzoBot 可以从以下来源获取凭据:

  • 认证配置文件(按智能体配置,存储在 auth-profiles.json 中)。
  • 环境变量(例如 OPENAI_API_KEY、BRAVE_API_KEY、FIRECRAWL_API_KEY)。
  • 配置文件(models.providers.*.apiKey、tools.web.search.*、tools.web.fetch.firecrawl.*、memorySearch.*、talk.apiKey)。
  • Skills(skills.entries.<name>.apiKey),可能会将密钥导出到 Skills 进程的环境变量中。

可能消耗密钥的功能

1)核心模型响应(聊天 + 工具)

每次回复或工具调用都使用当前模型提供商(OpenAI、Anthropic 等)。这是用量和费用的主要来源。

定价配置请参阅模型,显示方式请参阅 Token 用量与费用。

2)媒体理解(音频/图像/视频)

入站媒体可以在回复生成前进行摘要/转录。这会使用模型/提供商 API。

  • 音频:OpenAI / Groq / Deepgram(当密钥存在时自动启用)。
  • 图像:OpenAI / Anthropic / Google。
  • 视频:Google。

请参阅媒体理解。

3)记忆嵌入 + 语义搜索

语义记忆搜索在配置为远程提供商时使用嵌入 API:

  • memorySearch.provider = "openai" → OpenAI 嵌入
  • memorySearch.provider = "gemini" → Gemini 嵌入
  • 本地嵌入失败时可选回退到 OpenAI

你可以使用 memorySearch.provider = "local" 保持本地运行(无 API 用量)。

请参阅记忆。

4)网页搜索工具(Brave / 通过 OpenRouter 使用 Perplexity)

web_search 使用 API 密钥,可能产生使用费用:

  • Brave Search API:BRAVE_API_KEY 或 tools.web.search.apiKey
  • Perplexity(通过 OpenRouter):PERPLEXITY_API_KEY 或 OPENROUTER_API_KEY

Brave 免费套餐(额度充裕):

  • 每月 2,000 次请求
  • 每秒 1 次请求
  • 需要信用卡进行验证(除非升级否则不会收费)

请参阅网页工具。

5)网页抓取工具(Firecrawl)

web_fetch 在存在 API 密钥时可以调用 Firecrawl:

  • FIRECRAWL_API_KEY 或 tools.web.fetch.firecrawl.apiKey

如果未配置 Firecrawl,该工具会回退到直接抓取 + 可读性提取(无付费 API)。

请参阅网页工具。

6)提供商用量快照(状态/健康检查)

某些状态命令会调用提供商用量端点以显示配额窗口或认证健康状态。这些通常是低频调用,但仍会访问提供商 API:

  • hanzo-bot status --usage
  • hanzo-bot models status --json

请参阅模型 CLI。

7)压缩保护摘要

压缩保护功能可以使用当前模型对会话历史进行摘要,运行时会调用提供商 API。

请参阅会话管理 + 压缩。

8)模型扫描/探测

hanzo-bot models scan 可以探测 OpenRouter 模型,启用探测时会使用 OPENROUTER_API_KEY。

请参阅模型 CLI。

9)语音对话(Talk)

语音对话模式在配置后可以调用 ElevenLabs:

  • ELEVENLABS_API_KEY 或 talk.apiKey

请参阅语音对话模式。

10)Skills(第三方 API)

Skills 可以在 skills.entries.<name>.apiKey 中存储 apiKey。如果 Skills 使用该密钥调用外部 API,则会根据 Skills 的提供商产生费用。

请参阅Skills。