# Set up Vercel AI Gateway

Last validated Apr 15, 2026

Configure a Vercel AI Gateway provider in Aperture so your team can access models from multiple LLM providers through a single gateway endpoint. Vercel AI Gateway aggregates providers such as OpenAI and Anthropic behind one API, supporting both the chat completions and responses APIs.

\[Missing snippet: aperture\_any\_provider.mdx]

## Prerequisites

Before you begin, you need:

* An Aperture gateway accessible from your device. Refer to [get started with Aperture][docs-aperture-get-started] if you have not set this up.
* A [Vercel API token][xt-vercel-tokens].

## Configure the provider

Add Vercel AI Gateway as a provider in your [Aperture configuration][docs-aperture-configuration]:

```json
{
  "providers": {
    "vercel": {
      "baseurl": "https://ai-gateway.vercel.sh",
      "apikey": "<your-vercel-token>",
      "models": [
        "anthropic/claude-sonnet-4-6",
        "openai/gpt-5.4-nano"
      ],
      "cost_basis": "vercel",
      "compatibility": {
        "openai_chat": true,
        "openai_responses": true
      }
    }
  }
}
```

> **Warning:**
>
> Do not include `/v1` in the Vercel AI Gateway `baseurl`. Set it to `https://ai-gateway.vercel.sh` (without `/v1`). Including `/v1` produces the incorrect upstream URL `https://ai-gateway.vercel.sh/v1/v1/chat/completions`. Refer to [how Aperture builds upstream URLs][docs-aperture-url-construction] for details.

Model names use a `provider/model` prefix format.

The configuration fields work as follows:

* **`cost_basis`**: Controls how Aperture calculates token-rate estimates. Aperture automatically uses the `vercel` cost basis when `baseurl` is the official `https://ai-gateway.vercel.sh` host and `auto_cost_basis` is enabled. The example sets `cost_basis` explicitly, which produces the same result. Set it explicitly for resolver-based pricing when you use a custom gateway host. Gateway-supplied authoritative costs do not require this field.
* **`openai_chat`**: Enables the chat completions API used by most OpenAI-compatible tools.
* **`openai_responses`**: Enables the Responses API used by tools such as OpenAI Codex.

Refer to the [provider compatibility reference][docs-provider-compatibility] for the full list of flags.

## Verify the provider

\[Missing snippet: aperture\_verify\_provider.mdx]

\[Missing snippet: aperture\_provider\_next\_steps.mdx]

[docs-aperture-configuration]: /docs/aperture/configuration

[docs-aperture-get-started]: /docs/aperture/get-started

[docs-aperture-url-construction]: /docs/aperture/configuration#how-aperture-builds-upstream-urls

[docs-provider-compatibility]: /docs/aperture/provider-compatibility

[xt-vercel-tokens]: https://vercel.com/account/tokens
