跳转到内容

Vercel AI Gateway(网关)

The Vercel AI Gateway(网关) provides a unified API to access hundreds of models through a single endpoint.

属性
提供商vercel-ai-gateway
身份验证AI_GATEWAY_API_KEY
APIAnthropic Messages 兼容
模型目录通过 /v1/models 自动发现

  1. 设置 API 密钥

    运行新手引导并选择 AI Gateway(网关) 身份验证选项:

    Terminal window
    openclaw onboard --auth-choice ai-gateway-api-key
  2. 设置默认模型

    将模型添加到您的 OpenClaw 配置中:

    {
    agents: {
    defaults: {
    model: { primary: "vercel-ai-gateway/anthropic/claude-opus-4.6" },
    },
    },
    }
  3. 验证模型是否可用

    Terminal window
    openclaw models list --provider vercel-ai-gateway

对于脚本或 CI 设置,请在命令行中传递所有值:

Terminal window
openclaw onboard --non-interactive \
--mode local \
--auth-choice ai-gateway-api-key \
--ai-gateway-api-key "$AI_GATEWAY_API_KEY"

OpenClaw 接受 Vercel Claude 简写模型引用,并在 运行时将其规范化:

简写输入规范化的模型引用
vercel-ai-gateway/claude-opus-4.6vercel-ai-gateway/anthropic/claude-opus-4.6
vercel-ai-gateway/opus-4.6vercel-ai-gateway/anthropic/claude-opus-4-6

Environment variable for daemon processes

If the OpenClaw Gateway(网关) runs as a daemon (launchd/systemd), make sure AI_GATEWAY_API_KEY is available to that process.

Provider routing

Vercel AI Gateway(网关) routes requests to the upstream 提供商 based on the 模型 ref prefix. For example, vercel-ai-gateway/anthropic/claude-opus-4.6 routes through Anthropic, while vercel-ai-gateway/openai/gpt-5.5 routes through OpenAI and vercel-ai-gateway/moonshotai/kimi-k2.6 routes through MoonshotAI. Your single AI_GATEWAY_API_KEY handles authentication for all upstream providers.

Thinking levels

/think options follow trusted upstream 模型 prefixes when OpenClaw knows the upstream 提供商 contract. vercel-ai-gateway/anthropic/... uses the Claude thinking profile, including adaptive defaults for Claude 4.6 models. vercel-ai-gateway/openai/gpt-5.4, gpt-5.5, and Codex-style refs expose /think xhigh just like the direct OpenAI/OpenAI Codex providers. Other namespaced refs keep the normal reasoning levels unless their catalog metadata declares more.

模型选择

选择提供商、模型引用和故障转移行为。

故障排除

常规故障排除和常见问题。