Set up Vercel AI Gateway
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.
Aperture routes requests based on the model name, not the LLM client. Any LLM client configured to use Aperture can access any provider your admin has set up. Refer to the provider compatibility reference for the full list of supported providers and API formats.
Prerequisites
Before you begin, you need:
- An Aperture gateway accessible from your device. Refer to get started with Aperture if you have not set this up.
- A Vercel API token.
Configure the provider
Add Vercel AI Gateway as a provider in your Aperture configuration:
{
"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
}
}
}
}
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 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 thevercelcost basis whenbaseurlis the officialhttps://ai-gateway.vercel.shhost andauto_cost_basisis enabled. The example setscost_basisexplicitly, 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 for the full list of flags.
Verify the provider
The best way to verify a connection to a specific model is to send a test request through the Models tab of the Aperture dashboard.
- Open the Aperture dashboard and select the Models tab.
- Find the model you want to test in the list of configured models. If the model is not listed, check your provider configuration and ensure the model name is correct.
- Select the Play icon to the left of the model name to send a test request. If the request succeeds, the icon changes to a green check mark. If it fails, the icon changes to a red "X".
This sends a request from your web browser to the tailnet to verify that Aperture can successfully route requests to the model through the configured provider and that your user account has the necessary permissions to access the model.
Next steps
- Grant model access: Control which models each user or group can access through Aperture.
- Set up the chat UI: Let users talk to your configured models from their browser.
- Set up LLM clients: Connect coding tools to route requests through Aperture.