Ask Cat › AI Tool Summary › v0
One Key, Hundreds of Models: A Practical Vercel AI Gateway Setup, With Zero Token Markup
- 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:
- Base URL:
https://ai-gateway.vercel.sh/v1/chat/completions - Auth:
Authorization: Bearer <your AI_GATEWAY_API_KEY> - 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:
| Interface | Use |
|---|---|
| AI SDK | Vercel’s own SDK |
| OpenAI Chat Completions | Existing OpenAI SDK code works by changing the base URL |
| OpenAI Responses | The newer OpenAI interface |
| Anthropic Messages | Existing 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
- Get an AI Gateway API key on Vercel and export it as
AI_GATEWAY_API_KEY. - Make the first call with the curl from section 1.
- Set spend limits (section 4) before writing application code.
- Point existing code at the new base URL and key, then run your regression tests.
- When you want a different model, change only the
modelstring — 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 setupare 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
- v0 Comprehensive Introduction: Pricing, Features, and Actual Limitations
- v0 Is the free quota enough?
- v0 Alternatives
- Comprehensive Free Quota List for All Tools
More verified articles on this tool
- Vercel Flat Rate CDN Hits GA for Pro: Traffic Spikes Stop Becoming Surprise Bills — Should You Switch?
- Vercel Made Production Deployment Protection Free: The US$150/Month Add-On Is Gone (Setup Steps Inside)
- Vercel Sandbox Domain Lookups Got 18x Faster: Median 62ms Down to 3.4ms, Biggest Gains in Sydney and Cape Town

