Files
bot/docs/zh-CN/providers/openai.md
zeekay 08582cc303 Rebrand OpenClaw → Hanzo Bot across entire codebase
Complete rename of all OpenClaw/OPENCLAW/openclaw references to
Hanzo Bot/BOT/bot naming convention:

- Env vars: OPENCLAW_* → BOT_* (18 patterns)
- Config: ~/.openclaw/ → ~/.bot/, openclaw.json → bot.json
- Packages: @openclaw/* → @hanzo/bot-*
- Domains: openclaw.ai → hanzo.bot
- Mobile: OpenClawKit → BotKit, bundle IDs ai.openclaw → ai.hanzo.bot
- mDNS: _openclaw-gw._tcp → _bot-gw._tcp
- Docker: CMD hanzo-bot.mjs, BOT_PREFER_PNPM, BOT_DOCKER_APT_PACKAGES
- CI: docker-release.yml adds :latest tag on main branch
2026-02-11 11:13:08 -08:00

1.7 KiB
Raw Permalink Blame History

read_when, summary, title, x-i18n
read_when summary title x-i18n
你想在 Hanzo Bot 中使用 OpenAI 模型
你想使用 Codex 订阅认证而非 API 密钥
在 Hanzo Bot 中通过 API 密钥或 Codex 订阅使用 OpenAI OpenAI
generated_at model provider source_hash source_path workflow
2026-02-01T21:35:10Z claude-opus-4-5 pi f15365d5d616258f6035b986d80fe6acd1be5836a07e5bb68236688ef2952ef7 providers/openai.md 15

OpenAI

OpenAI 提供 GPT 模型的开发者 API。Codex 支持ChatGPT 登录进行订阅访问,或API 密钥登录进行按量计费访问。Codex 云端需要 ChatGPT 登录。

方式 A:OpenAI API 密钥(OpenAI Platform)

**适用于:**直接 API 访问和按量计费。 从 OpenAI 控制台获取你的 API 密钥。

CLI 设置

hanzo-bot onboard --auth-choice openai-api-key
# 或非交互式
hanzo-bot onboard --openai-api-key "$OPENAI_API_KEY"

配置片段

{
  env: { OPENAI_API_KEY: "sk-..." },
  agents: { defaults: { model: { primary: "openai/gpt-5.2" } } },
}

方式 B:OpenAI Code(Codex)订阅

**适用于:**使用 ChatGPT/Codex 订阅访问而非 API 密钥。 Codex 云端需要 ChatGPT 登录,而 Codex CLI 支持 ChatGPT 或 API 密钥登录。

CLI 设置

# 在向导中运行 Codex OAuth
hanzo-bot onboard --auth-choice openai-codex

# 或直接运行 OAuth
hanzo-bot models auth login --provider openai-codex

配置片段

{
  agents: { defaults: { model: { primary: "openai-codex/gpt-5.2" } } },
}

注意事项