{
 "kind": "api",
 "slug": "vercel-ai-gateway",
 "path": "apis/vercel-ai-gateway/",
 "name": "Vercel AI Gateway",
 "logo": "https://agentgid.com/media/avatars/vercel.png",
 "maker": "Vercel",
 "density": "full",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "LLM gateways and routers",
   "apis/llm-gateway/"
  ]
 ],
 "lead": "One key for many AI models.",
 "chips": [
  {
   "label": "LLM gateways and routers",
   "path": "apis/llm-gateway/"
  },
  {
   "label": "Up · live status",
   "live": true
  }
 ],
 "primary": {
  "label": "Copy prompt for your agent",
  "copy": "Route my app's AI calls through Vercel AI Gateway with the ai package: read AI_GATEWAY_API_KEY from .env on the server, use provider/model names, add one fallback model, and set a budget on the key."
 },
 "links": [
  {
   "label": "Website",
   "href": "https://vercel.com/ai-gateway"
  },
  {
   "label": "Pricing",
   "href": "https://vercel.com/docs/ai-gateway/pricing"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/vercel/ai"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Free credits",
   "status": "cond",
   "sub": "One-time or needs a card",
   "quote": null,
   "note": "Free tier: $5/month of AI Gateway credits (free-tier models, lower rate limits). As reported on the official pricing page, checked Nov 1, 2026.",
   "src": "https://vercel.com/docs/ai-gateway/pricing"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "With conditions",
   "status": "cond",
   "sub": "Does not train on your data",
   "quote": "You are solely responsible for any application that you offer that interacts with AI Gateway (\"Application\") and anyone who interacts with AI Gateway through your Application must comply with these AI Product Terms, including the applicable terms of any Non-Vercel Service.",
   "note": "Allowed; your app's users must follow Vercel's AI terms and each model provider's terms, and stealth models may not process personal data.",
   "src": "https://vercel.com/legal/ai-product-terms"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "API key, server only",
   "status": "info",
   "sub": "Env var AI_GATEWAY_API_KEY",
   "quote": "The AI SDK uses the AI_GATEWAY_API_KEY environment variable by default.",
   "note": "API key as a Bearer token (or a Vercel OIDC token for apps deployed on Vercel)",
   "src": "https://vercel.com/docs/ai-gateway/sdks-and-apis/ai-sdk"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "info",
   "sub": "llms.txt · OpenAPI · SDK",
   "quote": null,
   "note": " Our agent check: 5 of 6 (Nov 13, 2026).",
   "src": "https://vercel.com/llms.txt"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Nov 1, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Vercel AI Gateway does",
   "parts": [
    {
     "t": "prose",
     "text": "Vercel AI Gateway is a single online entry point to hundreds of AI models from OpenAI, Anthropic, Google and many others. Your app uses one key and one address, and can switch models by changing a name. If one provider fails it tries another, and you pay the providers' list prices with no extra markup."
    },
    {
     "t": "list",
     "items": [
      "Vercel AI Gateway is one of 8 APIs in the LLM gateways and routers category on AgentGid.",
      "It is one of 7 that can be started for free.",
      "4 of them ship an official MCP server; Vercel AI Gateway does not.",
      "Its official SDK is the 1st most downloaded in the category (47.3M a week)."
     ],
     "muted": true
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Try several AI models in one app",
       "text": "Compare answers from GPT, Claude, Gemini and others by changing only the model name, without separate accounts for each.",
       "idea": false
      },
      {
       "title": "Keep the chatbot up during outages",
       "text": "List backup models so your assistant keeps answering when the first model or its provider is down.",
       "idea": false
      },
      {
       "title": "A spending cap per project or user",
       "text": "Set a money limit for a team, a project, a key or a person, so a bug or a busy day cannot run up a large bill.",
       "idea": false
      },
      {
       "title": "See what each request cost",
       "text": "Look up the model, provider, speed, tokens and cost of every request in one place, for all providers.",
       "idea": false
      },
      {
       "title": "Move existing OpenAI code over",
       "text": "Keep code written for the OpenAI library and point it at the gateway, then use models from other companies too.",
       "idea": false
      },
      {
       "title": "Pick the cheapest model for a task",
       "text": "Read the public list of models with their prices and features, then choose a cheaper model for simple jobs.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Vercel AI Gateway popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "47.3M",
       "l": "SDK downloads a week",
       "d": null,
       "up": false
      },
      {
       "n": "55",
       "l": "public agent repos use its SDK"
      },
      {
       "n": "28.1K",
       "l": "GitHub stars, vercel/ai"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "$5/month of AI Gateway credits (free-tier models, lower rate limits)"
      },
      {
       "l": "Cheapest plan",
       "v": "No monthly plan"
      },
      {
       "l": "Usage price",
       "v": "Provider list price per token, zero markup and no platform fee (also with BYOK)"
      },
      {
       "l": "Plans",
       "v": "Paid tier = prepaid AI Gateway credits; buying credits ends the monthly free credit. Add-ons cost extra (Custom Reporting $0.075 per 1,000 writes, $5 per 1,000 queries). No AI-Gateway-specific MCP server found."
      }
     ]
    },
    {
     "t": "h3",
     "text": "What one action costs"
    },
    {
     "t": "table",
     "head": [
      "Action",
      "Price"
     ],
     "num": true,
     "rows": [
      [
       "Custom Reporting, 1,000 tag or user ID writes (add-on)",
       "$0.075"
      ],
      [
       "Custom Reporting, 1,000 queries (add-on)",
       "$5"
      ],
      [
       "Team-wide zero data retention, 1,000 requests",
       "$0.10"
      ],
      [
       "Trace Drains, 1,000 traces",
       "$0.05"
      ]
     ]
    },
    {
     "t": "more",
     "items": [
      {
       "title": "Price history",
       "items": [
        "A year of the pricing page in the Internet Archive (12 months): the lowest monthly figure went from $5 (2026-03) to $5 (2026-11)."
       ]
      }
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Nov 1, 2026. Prices change: confirm before you buy.",
     "link": "vercel.com/docs/ai-gateway/pricing",
     "href": "https://vercel.com/docs/ai-gateway/pricing"
    }
   ]
  },
  {
   "id": "limits",
   "nav": null,
   "spy_as": "pricing",
   "h2": "Limits",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "Lower per-model rate limits, free-tier models only; exact numbers are not published",
       "src": "https://vercel.com/docs/ai-gateway/rate-limits"
      },
      {
       "l": "Paid tier (purchased credits)",
       "v": "No AI Gateway rate limits; the model provider's own limits still apply",
       "src": "https://vercel.com/docs/ai-gateway/rate-limits"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official docs.",
     "link": "vercel.com/docs/ai-gateway/rate-limits",
     "href": "https://vercel.com/docs/ai-gateway/rate-limits"
    }
   ]
  },
  {
   "id": "status",
   "nav": "Status",
   "h2": "Status and incidents",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Right now",
       "v": "Up",
       "status": "yes",
       "sub": "All Systems Operational"
      },
      {
       "l": "Last 30 days",
       "v": "3 incidents, 1 of them major"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official status page, checked Nov 23, 2026.",
     "link": "vercel-status.com",
     "href": "https://www.vercel-status.com"
    }
   ]
  },
  {
   "id": "access",
   "nav": "Access and terms",
   "h2": "Key and access",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "How it signs in",
       "v": "API key as a Bearer token (or a Vercel OIDC token for apps deployed on Vercel)"
      },
      {
       "l": "Environment variable",
       "v": "AI_GATEWAY_API_KEY",
       "code": true
      },
      {
       "l": "Safe in browser code",
       "v": "No, keep it on your server",
       "status": "no"
      },
      {
       "l": "Card at sign-up",
       "v": "Yes"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Steps only a person can do"
    },
    {
     "t": "list",
     "items": [
      "Sign up for Vercel, add a payment method to the team, and create an AI Gateway API key. Put the key in .env.local as AI_GATEWAY_API_KEY; the ai package reads it automatically.",
      "Buy AI Gateway Credits if you need models outside the free tier, BYOK or higher limits. No code change; the same key moves to the paid tier.",
      "Set a budget for the team, project or key. Handle 402 quota_for_entity_exceeded in the app with a friendly message."
     ]
    }
   ]
  },
  {
   "id": "terms",
   "nav": null,
   "spy_as": "access",
   "h2": "Commercial use and your data",
   "parts": [
    {
     "t": "prose",
     "text": "It is a paid Vercel service with a small monthly free credit. You own your inputs and outputs, but each AI company's own terms also apply to the models you use. Test-only stealth models may train on what you send."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "With conditions",
       "status": "cond",
       "sub": "Allowed; your app's users must follow Vercel's AI terms and each model provider's terms, and stealth models may not process personal data.",
       "quote": "You are solely responsible for any application that you offer that interacts with AI Gateway (\"Application\") and anyone who interacts with AI Gateway through your Application must comply with these AI Product Terms, including the applicable terms of any Non-Vercel Service.",
       "src": "https://vercel.com/legal/ai-product-terms"
      },
      {
       "l": "In monetized videos",
       "v": "With conditions",
       "status": "cond",
       "sub": "You own the outputs as far as Vercel is concerned; the chosen model provider's terms decide the rest.",
       "quote": "As between you and Vercel, and to the extent permitted by applicable law, you own Customer Content and Vercel assigns to you Vercel's rights, if any, in the Output.",
       "src": "https://vercel.com/legal/ai-product-terms"
      },
      {
       "l": "client-work",
       "v": "With conditions",
       "status": "cond",
       "sub": "Allowed when you have the rights and consents for the client's inputs.",
       "quote": "You are responsible for your Input, including ensuring that it does not violate any applicable laws or the AI Product Terms.",
       "src": "https://vercel.com/legal/ai-product-terms"
      },
      {
       "l": "Trains on what you send",
       "v": "“Vercel represents and warrants that it shall not use AI Gateway Customer Content to train or improve the AI Products and Services.”",
       "quote": null,
       "src": "https://vercel.com/legal/ai-product-terms"
      },
      {
       "l": "Keeps your data",
       "v": "Prompts and answers are not kept after the request; request metadata and routing attempts are kept 30 days.",
       "quote": "Inspect this metadata in Logs, where routing attempt details are kept for 30 days",
       "src": "https://vercel.com/docs/ai-gateway/faq"
      }
     ]
    }
   ]
  },
  {
   "id": "errors",
   "nav": null,
   "spy_as": "access",
   "h2": "Errors to handle",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "401",
       "v": "The API key or OIDC token is missing, invalid, or revoked.",
       "sub": "Check AI_GATEWAY_API_KEY, create a new key if needed, then retry."
      },
      {
       "l": "402",
       "v": "No credit left, or (with quota_for_entity_exceeded) a budget limit was reached.",
       "sub": "Top up credits, or wait for the budget period to refresh or raise the budget; do not retry in a loop."
      },
      {
       "l": "403 customer_verification_required / free tier",
       "v": "No payment method on the team, or the model is not in the free tier.",
       "sub": "Add a payment method, choose a free-tier model, or buy credits."
      },
      {
       "l": "429",
       "v": "A gateway or provider rate limit was exceeded.",
       "sub": "Retry after the retry-after time with bounded exponential backoff."
      }
     ]
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "5 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP no, status page yes, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "None found",
       "sub": null
      },
      {
       "l": "npm",
       "v": "npm install @ai-sdk/gateway",
       "code": true
      }
     ]
    },
    {
     "t": "h3",
     "text": "Instructions in its docs to check first"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "The docs say",
       "v": "“Set up AI Gateway and make one text-generation request from this environment. Use the AI Gateway skill for this task. If it is unavailable, run npx skills add vercel/vercel-plugin --skill ai-gateway, then find and read its SKILL.md before continuing.”",
       "sub": "Ask the person first; it installs an unpinned skill and tells the assistant to follow it."
      },
      {
       "l": "The docs say",
       "v": "“npx vercel@latest ai-gateway setup”",
       "sub": "Ask the person first; it runs an unpinned @latest CLI that creates or reuses a key and changes coding agent settings."
      },
      {
       "l": "The docs say",
       "v": "“npx plugins add vercel/vercel-plugin”",
       "sub": "Ask the person first; it installs an unpinned plugin into the assistant."
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Vercel AI Gateway",
       "me": true,
       "facts": [
        "Free plan",
        "Free tier"
       ]
      },
      {
       "name": "OpenRouter",
       "why": "Pick OpenRouter when you want one OpenAI-compatible key for 500+ models across 80+ providers, outside the Vercel account.",
       "path": "apis/openrouter/",
       "facts": [
        "Free plan",
        "Free tier",
        "Official MCP"
       ]
      },
      {
       "name": "LiteLLM",
       "why": "Pick LiteLLM when you want an open-source proxy you run yourself, with keys, budgets and logging under your control.",
       "path": "apis/litellm/",
       "facts": [
        "Free (open source)",
        "Free tier"
       ]
      },
      {
       "name": "Cloudflare AI Gateway",
       "why": "Pick Cloudflare AI Gateway when you already use Cloudflare and want caching, rate limiting and logs in front of your own provider keys.",
       "path": "apis/cloudflare-ai-gateway/",
       "facts": [
        "Free plan",
        "Free tier",
        "Official MCP"
       ]
      }
     ],
     "more": "All llm gateways and routers APIs",
     "more_path": "apis/llm-gateway/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Route my app's AI calls through Vercel AI Gateway with the ai package: read AI_GATEWAY_API_KEY from .env on the server, use provider/model names, add one fallback model, and set a budget on the key."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Create a Vercel account and an AI Gateway API key; to use the free monthly credit, add a payment method to the team.",
       "code": "export AI_GATEWAY_API_KEY=\"your_ai_gateway_api_key\"",
       "src": "https://vercel.com/docs/ai-gateway/getting-started"
      },
      {
       "text": "Install the AI SDK (or keep your OpenAI client and change its address).",
       "code": "pnpm add ai@latest",
       "src": "https://vercel.com/docs/ai-gateway/sdks-and-apis/ai-sdk"
      },
      {
       "text": "Send a first request with a provider/model name such as openai/gpt-6-astra and check it in AI Gateway Logs.",
       "code": "curl https://ai-gateway.vercel.sh/v1/chat/completions \\\n -H \"Authorization: Bearer $AI_GATEWAY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"openai/gpt-6-astra\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Invent a new holiday and describe its traditions.\"\n }\n ]\n }'",
       "src": "https://vercel.com/docs/ai-gateway/getting-started"
      }
     ]
    },
    {
     "t": "h3",
     "text": "First request"
    },
    {
     "t": "tabs",
     "label": "First request",
     "items": [
      {
       "tab": "Request",
       "code": "curl -X POST \"https://ai-gateway.vercel.sh/v1/chat/completions\" \\\n -H \"Authorization: Bearer $AI_GATEWAY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"anthropic/claude-opus-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write a one-sentence bedtime story about a unicorn.\"\n }\n ],\n \"stream\": false\n }'",
       "intro": null
      },
      {
       "tab": "Response",
       "code": "{\n \"id\": \"chatcmpl-123\",\n \"object\": \"chat.completion\",\n \"model\": \"anthropic/claude-opus-5\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Once upon a time, a gentle unicorn with a shimmering silver mane danced through moonlit clouds, sprinkling stardust dreams upon sleeping children below.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 15,\n \"completion_tokens\": 28,\n \"total_tokens\": 43\n }\n}"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "Expecting the free credit to work right after creating a key, without a payment method.",
       "fix": "Add a payment method to the Vercel team first, or the request fails with 403 customer_verification_required.",
       "why": "The free credit needs a verified team."
      },
      {
       "dont": "Sending personal data or private code to a model labeled stealth.",
       "fix": "Use stealth models only for throwaway tests; pick a named model, and turn on zero data retention for sensitive data.",
       "why": "Stealth model providers may train on your inputs and the usual data protections do not apply."
      },
      {
       "dont": "Treating a budget as a hard stop that also covers your own provider keys.",
       "fix": "Also set spending limits at each provider when you use BYOK.",
       "why": "Budgets count only spend on Vercel's credentials; BYOK spend is metered separately."
      },
      {
       "dont": "Editing or giving up on a request that returned 429.",
       "fix": "Retry the same request after the retry-after time, with bounded exponential backoff.",
       "why": "The docs say a 429 can succeed later without changes; the AI SDK already retries twice by default."
      },
      {
       "dont": "Installing ai 7 on Node.js 20 or in a CommonJS project.",
       "fix": "Use Node.js 22 or later and ES modules (.mjs/.mts or \"type\":\"module\").",
       "why": "AI SDK 7 requires Node.js 22 and ESM."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Is there a free tier?",
       "a": "Yes, a monthly included credit for a subset of models with lower rate limits. It is not a time-limited trial, but it needs a payment method on the team.",
       "evidence": {
        "url": "https://vercel.com/docs/ai-gateway/faq",
        "quote": "No. The free tier is a monthly included credit, not an expiring trial."
       }
      },
      {
       "q": "Does Vercel train on my prompts or keep them?",
       "a": "No. Vercel says it does not train on prompts and deletes prompt and response content after the request; the model provider's own policy still applies.",
       "evidence": {
        "url": "https://vercel.com/docs/ai-gateway/faq",
        "quote": "Vercel does not train on your prompts, and AI Gateway itself does not retain prompt or response content"
       }
      },
      {
       "q": "Do I have to host my app on Vercel?",
       "a": "No. An AI Gateway key works from local development, CI and other clouds; apps on Vercel can use OIDC tokens instead of a key.",
       "evidence": {
        "url": "https://vercel.com/docs/ai-gateway/faq",
        "quote": "An AI Gateway API key authenticates requests from any environment, including local development, CI, and other cloud providers."
       }
      },
      {
       "q": "How do I see the list of models and prices?",
       "a": "The public model list returns every model with pricing and capabilities, and needs no key.",
       "evidence": {
        "url": "https://vercel.com/llms.txt",
        "quote": "AI Gateway model list API: Live JSON list of every model ID with pricing and capabilities. No API key required."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "Vercel"
  ],
  [
   "Category",
   "LLM gateways and routers"
  ],
  [
   "Status",
   "Up · 3 incidents in 30 days"
  ],
  [
   "Price",
   "Free plan"
  ],
  [
   "Official SDK",
   "npm @ai-sdk/gateway"
  ],
  [
   "Latest SDK",
   "7.0.166 on npm"
  ],
  [
   "Agent check",
   "5 of 6"
  ],
  [
   "Pricing checked",
   "Nov 1, 2026"
  ]
 ],
 "good": [
  "The free tier covers only some models, with lower limits; other models need purchased credits.",
  "Buying credits moves you to the paid tier, and the monthly free credit stops.",
  "Purchased credits expire one year after purchase."
 ],
 "checked_line": "Read by AgentGid from 21 official pages, card checked Nov 10, 2026; usage numbers update daily."
}