← Back to the A-Z glossary
AI glossary · P1

Model gateway

A model gateway is a central layer that routes AI calls, applies rules, tracks usage, and protects your keys.

API 4 min read Updated 2026-05-22
— Definition

Model gateway, in plain words

A model gateway is a central layer that routes AI calls, applies rules, tracks usage, and protects your keys.

Present the model gateway as a single point of passage to all your models, not as one specific product.

A concrete example

My gateway sees every call to Claude, GPT, and Gemini. I watch the costs, log the prompts, and switch models from one place.

Why it matters

The moment you use 3+ models, a gateway becomes essential for steering costs, security, and fallbacks.

You'll run into it in stacks using Vercel AI Gateway, LiteLLM, OpenRouter, or in companies that want control over their model calls.

Don't mix it up with

OpenRouter: OpenRouter gives you access to many models through a single API, making it much easier to switch providers.

Model fallback: Model fallback switches to another model when the first one fails, costs too much, or answers too slowly.

Common mistakes

  • Building a homemade gateway when OpenRouter or LiteLLM would do the job.
  • Storing prompts in it with no retention policy.
  • Forgetting rate limiting at the gateway level.

Quick checklist

  • First I check whether the word names a concept, a tool, a risk, or a metric.
  • I tie it to a concrete case: My gateway sees every call to Claude, GPT, and Gemini. I watch the costs, log the prompts, and switch models from one place.
  • I keep the main trap in mind: Building a homemade gateway when OpenRouter or LiteLLM would do the job.

Quick questions

What is Model gateway in AI?

A model gateway is a central layer that routes AI calls, applies rules, tracks usage, and protects your keys.

Where will I run into Model gateway?

You'll run into it in stacks using Vercel AI Gateway, LiteLLM, OpenRouter, or in companies that want control over their model calls.

Which word should I read next?

Start with OpenRouter, Model fallback, Provider routing.

Want to keep going in order?

Head back to the full glossary, search a word, then open only the pages that deserve more than a short definition.

Open the AI glossary