Total unique visitors
Browse by category Chatbots Image Generation Video Generation Audio & Voice Coding Writing Productivity Research AI Agents Free Tier Table
Home page Ask Cat on AI

Ask CatAI Tool Summaryv0

One Key, Hundreds of Models: A Practical Vercel AI Gateway Setup, With Zero Token Markup

🐾 Quick facts
  • Free tier:There is
  • Cheapest paid plan:US$30/mo and up
  • Free quota:The free plan is US$0/month, with a quota that is a dual limit of …
  • Last checked:2026-09-21

Article last updated:2026-09-08

If you juggle OpenAI, Anthropic and Google keys and rewrite code every time you switch, Vercel AI Gateway exists for that: one key, hundreds of models. Based on the official docs (page marked last updated 2026-09-07), read 2026-09-08.

1. The shortest working example

Straight from the docs:

curl https://ai-gateway.vercel.sh/v1/chat/completions \
  -H "Authorization: Bearer $AI_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-6-astra",
    "messages": [
      {
        "role": "user",
        "content": "Invent a new holiday and describe its traditions."
      }
    ]
  }'

Three things to remember:

  1. Base URL: https://ai-gateway.vercel.sh/v1/chat/completions
  2. Auth: Authorization: Bearer <your AI_GATEWAY_API_KEY>
  3. Model naming: provider/model, e.g. openai/gpt-6-astra, anthropic/claude-sonnet-5

Switching models means editing a string. That is the whole pitch — not a new SDK, base URL or auth scheme.

2. It speaks three existing interfaces

Per the docs:

InterfaceUse
AI SDKVercel’s own SDK
OpenAI Chat CompletionsExisting OpenAI SDK code works by changing the base URL
OpenAI ResponsesThe newer OpenAI interface
Anthropic MessagesExisting Anthropic SDK code

Rows two and four are the practical ones: no logic changes, just base URL and key.

3. On money: the docs say zero markup

The line worth quoting: “No markup on tokens. Tokens cost the same as they would from the provider directly, with zero markup, including with Bring Your Own Key (BYOK).”

Plainly: calling through the Gateway costs what buying direct costs, BYOK included.

Compare with another tool we verified the same day: Zed charges overage at API list price +10%. Neither model is wrong — you just need to know which one you are in.

⚠️ Caveat: zero markup refers to tokens. The docs carry a separate AI Gateway pricing page covering token costs, credits, add-on charges and payment fees — and payment fees are not zero. If you are costing this precisely, read that page rather than this one sentence.

4. Two things to do before launch

1. Set spend limits

The docs list Budgets and spend limits, configurable per team, project, API key and user, with alerts.

Do this before the first line of code. A key that can call hundreds of models has no brakes if it leaks or your loop runs away.

2. Handle 429

There is a dedicated Rate limits page covering request limits and 429 responses.

Minimum bar: back off and retry on 429. Do not treat it as a hard error, and do not hammer without a delay.

5. The real reasons beyond “one key”

Two capabilities in the docs matter more than convenience:

  • Reliability: requests automatically retry to other providers when one fails. Wiring a single provider yourself cannot do that.
  • Spend monitoring: total spend across providers. Wire three providers separately and you reconcile three invoices at month end.

The docs also cover connecting a coding agent directly:

vercel ai-gateway coding-agents setup

6. When not to use it

Honestly:

  • One provider and no plans to switch → going direct is simpler; one fewer layer.
  • Compliance constraints on data flow → a proxy is another hop to review. Read the docs’ Security and compliance section first (data retention, prompt training policy, model and provider access control).
  • You need day-one support for a provider’s newest feature → intermediaries usually lag.

7. Five-minute start

  1. Get an AI Gateway API key on Vercel and export it as AI_GATEWAY_API_KEY.
  2. Make the first call with the curl from section 1.
  3. Set spend limits (section 4) before writing application code.
  4. Point existing code at the new base URL and key, then run your regression tests.
  5. When you want a different model, change only the model string — the one thing genuinely worth verifying here.

Related: deadlines on Gateway discounts and the promo still running: Ling 3.0 Flash Sante free through October 4.


Source read directly on 2026-09-08: the official Vercel AI Gateway docs (page marked last_updated 2026-09-07). Base URL, curl example, model naming, the four compatible interfaces, the zero-markup statement including BYOK, budgets, rate limits and vercel ai-gateway coding-agents setup are all as documented. We did not create an account and execute calls; Vercel publishes a separate pricing page covering credits and payment fees which we did not verify line by line — check it before costing this precisely. Section 6 is our own guidance.

Let's take a look at these

More verified articles on this tool

Go to the official website

Affiliate Links Notice