Vercel AI Gateway 提供统一 API,通过单一端点访问数百个模型。Provider ID 为 vercel-ai-gateway。
核心属性
| 属性 | 值 |
|---|---|
| Provider ID | vercel-ai-gateway |
| API | Anthropic Messages 兼容 |
| 认证环境变量 | AI_GATEWAY_API_KEY |
| 模型发现 | 自动,via /v1/models |
快速开始
# 交互式 onboarding
openclaw onboard --auth-choice ai-gateway-api-key
# 非交互式(CI/脚本)
openclaw onboard --non-interactive \
--mode local \
--auth-choice ai-gateway-api-key \
--ai-gateway-api-key "$AI_GATEWAY_API_KEY"设置默认模型:
{
agents: {
defaults: {
model: { primary: "vercel-ai-gateway/anthropic/claude-opus-4.6" },
},
},
}验证可用模型:
openclaw models list --provider vercel-ai-gateway模型 ID 简写
OpenClaw 支持 Claude 模型的简写形式,运行时自动规范化:
| 简写输入 | 规范化后 |
|---|---|
vercel-ai-gateway/claude-opus-4.6 | vercel-ai-gateway/anthropic/claude-opus-4.6 |
vercel-ai-gateway/opus-4.6 | vercel-ai-gateway/anthropic/claude-opus-4-6 |
Provider 路由
模型 ref 前缀决定上游路由,单个 AI_GATEWAY_API_KEY 处理所有上游认证:
| 模型 ref 前缀 | 路由目标 |
|---|---|
vercel-ai-gateway/anthropic/... | Anthropic |
vercel-ai-gateway/openai/... | OpenAI |
vercel-ai-gateway/moonshotai/... | MoonshotAI |
Thinking 支持
/think 选项跟随上游 provider 合约:
vercel-ai-gateway/anthropic/...— 使用 Claude thinking profilevercel-ai-gateway/openai/gpt-5.4、gpt-5.5— 支持/think xhigh- 其他命名空间 — 保持默认推理级别
注意事项
daemon 进程(launchd/systemd)需确保 AI_GATEWAY_API_KEY 对该进程可见。推荐在 ~/.openclaw/.env 或 env.shellEnv 中配置,避免仅在交互式 shell 中 export。
关联页面
- providers — 所有 Provider 概览
- provider-cloudflare-ai-gateway — 类似的 AI 网关方案
- model-providers — Provider 选择与 failover 机制