qvib.pro
RU

Vercel AI Gateway

What for: one endpoint to many providers — bring-your-own-key with no markup, budgets, fallbacks and load balancing on Vercel.

API платно бесплатно профи

Единый endpoint к моделям многих провайдеров, BYOK без наценки (офиц.) checked 2026-06-01

Updated: 02.07.2026

$ npm install ai

Open source ↗

Vercel AI Gateway

What it is and who it's for

Vercel AI Gateway is a managed gateway to models from many providers through a single endpoint, with BYOK at no markup, budgets, fallbacks and observability. For teams on Vercel/Next.js building AI features who want to manage keys, limits and costs centrally without standing up their own infrastructure. What sets it apart: native pairing with Vercel's AI SDK and zero markup on your own keys.

Key features

  • A single endpoint to models from OpenAI, Anthropic, Google, xAI, open providers and others.
  • Bring-your-own-key with no markup: you pay the provider at your own rates.
  • Budgets, limits and alerts at the project/team level.
  • Automatic fallbacks and retries across providers.
  • Observability: logs, latency, spend per model.
  • Deep integration with the Vercel AI SDK (the ai package) and streaming in Next.js.

How to start in 5 minutes

  1. In the Vercel dashboard, enable AI Gateway and add your provider keys (BYOK) or use credits.
  2. Install the AI SDK and call models through one interface:
npm install ai
import { generateText } from "ai";
const { text } = await generateText({ model: "anthropic/claude-3-5-sonnet", prompt: "Hello" });
  1. Swap the model string for any provider — the endpoint and the rest of the code stay the same.

When to take it, when not to

  • ✅ Take it if: you're already on Vercel/Next.js and need a managed gateway with BYOK, budgets and fallbacks without DevOps.
  • ✅ Take it if: you're building streaming AI features on the AI SDK and want unified cost tracking.
  • ❌ Don't take it → "LiteLLM" is better if you need a fully self-hosted proxy under your own control with logs in your own database.
  • ❌ Don't take it → "OpenRouter" is better if you're outside the Vercel ecosystem and want the widest possible model catalog.

The honest price

BYOK — no gateway markup (you pay the providers). If you use Vercel credits, it's at their rates; there's a free allowance to start, and beyond that it's your Vercel plan. Exact numbers are on the provider's side and change over time.

Gotchas

  • You get the most out of it inside the Vercel ecosystem; outside it the advantages fade.
  • BYOK means carefully setting up provider keys and keeping an eye on their limits.
  • The provider/model lineup keeps growing, but OpenRouter's more exotic options may not be there yet.
  • Being tied to the AI SDK is convenient, but it's still a lock-in — migrating to another stack will take rewrites.

🤖 Prompt accelerator

"I'm on Next.js + the Vercel AI SDK, using AI Gateway with BYOK. Help me set up the AI feature : pick 2-3 models by price/quality, wire up a fallback (primary → backup), turn on response streaming in the UI, and set a budget/limits for the project. Give me sample code with streamText and provider error handling."

Читать по-русски →