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 兼容
快速开始
1. 设置 API 密钥(推荐:为 Gateway 存储):
openclaw onboard --auth-choice ai-gateway-api-key
2. 设置默认模型:
{
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),请确保 '<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>')。