Route every LLM call through one unified API on Vercel - plain "provider/model" strings via the AI SDK, automatic provider routing and model fallbacks, observability and per-key cost tracking, and zero data retention. Use when you ask "how do I add an LLM to my Vercel app", "route OpenAI and Anthropic through one API", "add model failover / fallback", "track LLM cost and spend on Vercel", "set a budget per API key", "switch providers without changing code", "AI_GATEWAY_API_KEY", or "stop installing @ai-sdk/openai and @ai-sdk/anthropic separately". Do NOT use for general AI SDK app code (chat UI, tool calling, structured output) - that is the AI SDK itself; do NOT use for deploy config, env wiring, or edge/runtime choice - use vercel-deploy-pipeline, vercel-env-management, and vercel-edge-and-isr instead; do NOT use to rate-limit or block abusive AI traffic - use vercel-firewall-and-botid; and do NOT use for app-level latency/caching tuning of the route - use next-on-vercel-perf.
Click to play with sound.
---
name: Vercel AI Gateway
description: Route every LLM call through one unified API on Vercel - plain "provider/model" strings via the AI SDK, automatic provider routing and model fallbacks, observability and per-key cost tracking, and zero data retention. Use when you ask "how do I add an LLM to my Vercel app", "route OpenAI and Anthropic through one API", "add model failover / fallback", "track LLM cost and spend on Vercel", "set a budget per API key", "switch providers without changing code", "AI_GATEWAY_API_KEY", or "stop installing @ai-sdk/openai and @ai-sdk/anthropic separately". Do NOT use for general AI SDK app code (chat UI, tool calling, structured output) - that is the AI SDK itself; do NOT use for deploy config, env wiring, or edge/runtime choice - use vercel-deploy-pipeline, vercel-env-management, and vercel-edge-and-isr instead; do NOT use to rate-limit or block abusive AI traffic - use vercel-firewall-and-botid; and do NOT use for app-level latency/caching tuning of the route - use next-on-vercel-perf.
---
# Vercel AI Gateway
You wire an app's LLM calls through **Vercel AI Gateway**: one endpoint, one API
key, every provider behind it. The opinionated rule of this pack is *never reach
for a provider-specific package by default*. Instead of `@ai-sdk/openai` +
`@ai-sdk/anthropic` + `@ai-sdk/google` (each with its own SDK, its own key, its
own billing), you pass a plain `"provider/model"` string to the AI SDK and let
the Gateway resolve it. That single decision buys you provider failover, model
fallbacks, unified cost tracking, and a one-line provider swap - for free, with
no code change at the call site.
This is the AI step of the curated *ship-a-Next.js-app-on-Vercel* path. It is
deliberately **not** a clone of the official Vercel AI Gateway docs or CLI: it
sequences the Gateway into the rest of the workflow. Provisioning the key and
promoting it across environments is `vercel-env-management`; the function it runs
in (Fluid Compute, full Node.js - the legacy Edge runtime is deprecated) is
`vercel-edge-and-isr`; shipping it is `vercel-deploy-pipeline`. Rate-limiting or
blocking abusive traffic to the AI route is `vercel-firewall-and-botid`, and
app-level latency/caching of the route is `next-on-vercel-perf`. This skill owns
exactly one thing: the call should go through the Gateway as a bare model string.