Files
bot/docs/zh-CN/providers/vercel-ai-gateway.md
zeekayandHanzo Dev 84e4069c2c docs name the state dir and config file the bot reads: ~/.bot/bot.json
The docs said ~/.hanzo-bot/hanzo-bot.json (and ~/.hanzo-bot-<profile>, hanzo-bot.plugin.json), which nothing reads: src/config/paths.ts resolves ~/.bot, bot.json and ~/.bot-<profile>, and plugins ship bot.plugin.json. Every such path in docs/ now names what the code opens.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-24 21:12:09 -07:00

1.3 KiB

read_when, summary, title, x-i18n
read_when summary title x-i18n
你想将 Vercel AI Gateway 与 HanzoBot 配合使用
你需要 API 密钥环境变量或 CLI 认证选择
Vercel AI Gateway 设置(认证 + 模型选择) Vercel AI Gateway
generated_at model provider source_hash source_path workflow
2026-02-03T07:53:39Z claude-opus-4-5 pi c6482f047a31b09c7a691d40babbd1f9fb3aa2042b61cc42956ad9b791da8285 providers/vercel-ai-gateway.md 15

Vercel AI Gateway

Vercel AI Gateway 提供了一个统一的 API,通过单一端点访问数百个模型。

  • 提供商:vercel-ai-gateway
  • 认证:AI_GATEWAY_API_KEY
  • API:兼容 Anthropic Messages

快速开始

  1. 设置 API 密钥(推荐:为 Gateway 网关存储它):
hanzo-bot onboard --auth-choice ai-gateway-api-key
  1. 设置默认模型:
{
  agents: {
    defaults: {
      model: { primary: "vercel-ai-gateway/anthropic/claude-opus-4.5" },
    },
  },
}

非交互式示例

hanzo-bot onboard --non-interactive \
  --mode local \
  --auth-choice ai-gateway-api-key \
  --ai-gateway-api-key "$AI_GATEWAY_API_KEY"

环境变量说明

如果 Gateway 网关作为守护进程运行(launchd/systemd),请确保 AI_GATEWAY_API_KEY 对该进程可用(例如,在 ~/.bot/.env 中或通过 env.shellEnv)。