OpenClawSkills
GitHub
模型提供商 • 5 分钟阅读

Vercel AI Gateway

Vercel AI Gateway 设置(身份验证 + 模型选择)

'<a href="https://vercel.com/ai-gateway" className="text-emerald-400 hover:text-emerald-300 transition-colors">'Vercel AI Gateway'</a>' 提供统一的 API,通过单个端点访问数百个模型。

- 提供商:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'vercel-ai-gateway'</code>'

- 身份验证:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'AI_GATEWAY_API_KEY'</code>'

- API:Anthropic Messages 兼容

Tutorial.step

快速开始

1. 设置 API 密钥(推荐:为 Gateway 存储):

Bash
openclaw onboard --auth-choice ai-gateway-api-key

2. 设置默认模型:

Json5
{
  agents: {
    defaults: {
      model: { primary: "vercel-ai-gateway/anthropic/claude-opus-4.5" },
    },
  },
}
Tutorial.step

非交互式示例

Bash
openclaw onboard --non-interactive   --mode local   --auth-choice ai-gateway-api-key   --ai-gateway-api-key "$AI_GATEWAY_API_KEY"
Tutorial.step

环境说明

如果 Gateway 作为守护进程运行(launchd/systemd),请确保 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'AI_GATEWAY_API_KEY'</code>'

对该进程可用(例如,在 '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'~/.openclaw/.env'</code>' 中或通过

'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'env.shellEnv'</code>')。