Files
openclaw/docs/providers/vercel-ai-gateway.md

59 lines
1.4 KiB
Markdown
Raw Normal View History

2026-01-16 14:40:56 +01:00
---
title: "Vercel AI Gateway"
2026-01-16 14:40:56 +01:00
summary: "Vercel AI Gateway setup (auth + model selection)"
read_when:
2026-01-30 03:15:10 +01:00
- You want to use Vercel AI Gateway with OpenClaw
2026-01-16 14:40:56 +01:00
- You need the API key env var or CLI auth choice
---
2026-01-31 21:13:13 +09:00
# Vercel AI Gateway
2026-01-16 14:40:56 +01:00
2026-01-31 21:13:13 +09:00
The [Vercel AI Gateway](https://vercel.com/ai-gateway) provides a unified API to access hundreds of models through a single endpoint.
2026-01-16 14:40:56 +01:00
- Provider: `vercel-ai-gateway`
- Auth: `AI_GATEWAY_API_KEY`
- API: Anthropic Messages compatible
## Quick start
2026-01-31 21:13:13 +09:00
1. Set the API key (recommended: store it for the Gateway):
2026-01-16 14:40:56 +01:00
```bash
2026-01-30 03:15:10 +01:00
openclaw onboard --auth-choice ai-gateway-api-key
2026-01-16 14:40:56 +01:00
```
2. Set a default model:
2026-01-16 14:40:56 +01:00
```json5
{
agents: {
defaults: {
model: { primary: "vercel-ai-gateway/anthropic/claude-opus-4.6" },
2026-01-31 21:13:13 +09:00
},
},
2026-01-16 14:40:56 +01:00
}
```
## Non-interactive example
```bash
2026-01-30 03:15:10 +01:00
openclaw onboard --non-interactive \
2026-01-16 14:40:56 +01:00
--mode local \
--auth-choice ai-gateway-api-key \
--ai-gateway-api-key "$AI_GATEWAY_API_KEY"
```
## Environment note
If the Gateway runs as a daemon (launchd/systemd), make sure `AI_GATEWAY_API_KEY`
2026-01-30 03:15:10 +01:00
is available to that process (for example, in `~/.openclaw/.env` or via
2026-01-16 14:40:56 +01:00
`env.shellEnv`).
## Model ID shorthand
OpenClaw accepts Vercel Claude shorthand model refs and normalizes them at
runtime:
- `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`