Vercel AI Gateway

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

  • Provider: vercel-ai-gateway
  • Auth: AI_GATEWAY_API_KEY
  • API: 兼容 Anthropic Messages

快速开始

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

非交互式示例

openclaw 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 对该进程可用(例如,在 ~/.openclaw/.env 中或通过 env.shellEnv 配置)。