---
title: "Vercel Gateway"
description: "Access 120+ AI models through Vercel AI Gateway"
---

The Vercel gateway connects ChatJS to [Vercel AI Gateway](https://vercel.com/docs/ai-gateway), providing unified access to 120+ models from OpenAI, Anthropic, Google, xAI, Meta, and more through a single API key.

This is the **default** gateway.

## Setup

### On Vercel (zero-config)

Vercel deployments get AI Gateway access automatically via OIDC. No API key needed.

### Self-hosted or local dev

1. Go to [Vercel AI Gateway](https://vercel.com/ai-gateway)
2. Create an API key
3. Add to `.env.local`:

```bash
AI_GATEWAY_API_KEY=your_key_here
```

### Config

Set the gateway to `"vercel"` (or omit it, since it defaults to `"vercel"`):

```typescript title="chat.config.ts"
const config: ConfigInput = {
  ai: {
    gateway: "vercel",
    // ...
  },
};
```

## Authentication

The gateway authenticates using one of these (checked in order):

| Variable             | When                             |
| -------------------- | -------------------------------- |
| `AI_GATEWAY_API_KEY` | Self-hosted or local development |
| `VERCEL_OIDC_TOKEN`  | Automatic on Vercel deployments  |

## Available Models

120+ models from OpenAI, Anthropic, Google, xAI, Meta, Mistral, Cohere, DeepSeek, and more. The full list is fetched at runtime and cached for 1 hour.

## Image Generation

The Vercel gateway supports dedicated image models (e.g., `bfl/flux-pro-1.1`) through `createImageModel()`. This enables the built-in [Image Generation](/features/image-generation) feature.

## Related

- [Gateways Overview](/gateways/overview) for the full gateway comparison
- [OpenRouter](/gateways/openrouter) for an alternative multi-provider backend
