跳轉到主要內容

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.6" },
    },
  },
}

非互動式範例

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)。