Skip to content

Stop Juggling API Keys: Setting up Vercel AI Gateway

I remember spending an entire afternoon trying to get three different LLM providers to play nice together. I had to manage separate rate limits, different auth headers, and varying JSON structures. It felt like I was writing boilerplate instead of building features. When I found out OpenClaw supports the Vercel AI Gateway, I switched immediately. It lets me hit hundreds of models through one API key and a single endpoint.

Using the gateway means I don’t have to update my code every time I want to try a new model. I just change a string in my config and keep moving.

  • An active Vercel account with an AI Gateway set up.
  • The OpenClaw CLI installed on your machine.
  • Your AI_GATEWAY_API_KEY.
  • A terminal window open.

You can get this running in about two minutes. First, you need to tell OpenClaw to use the gateway for authentication.

  1. Run the onboarding command:
Terminal window
openclaw onboard --auth-choice ai-gateway-api-key
  1. Open your configuration file and set your primary model. Use the vercel-ai-gateway prefix followed by the provider and model name:
{
agents: {
defaults: {
model: { primary: "vercel-ai-gateway/anthropic/claude-opus-4.6" },
},
},
}

If you prefer to do everything in one command without the interactive prompts, use this:

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

Sometimes things don’t work on the first try. Here are the two most common hiccups:

  • API Key is missing in the background: If you run OpenClaw as a daemon (using launchd or systemd), the process might not see your shell’s environment variables. Make sure your AI_GATEWAY_API_KEY is saved in ~/.openclaw/.env so the daemon can find it.
  • Incorrect Provider String: The gateway uses an Anthropic-compatible API. Double-check that your model path follows the provider/model-name format exactly as shown in the Vercel dashboard.

If you hit a wall that isn’t covered here, you can always ask the AI Setup Assistant for a hand.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.