How to Separate Vercel AI Gateway Across Multiple Environments (production, preview, development)
When operating a project that uses Vercel AI Gateway, you may encounter the need to separate AI Gateway settings across multiple environments (production, preview, development).
This article explains the current solution for this challenge.
There are several considerations:
Billing Separation: You may want to clearly separate costs incurred in the production environment from those in development/verification environments (preview/development). In particular, there’s a significant need to isolate unexpected cost increases from trial and error during development from production billing.
External Service Integration Settings: You may want to switch API keys for integrated LLM providers by environment. For example, you might want to use production keys in the production environment and sandbox or test keys in the development environment.
After investigating Vercel AI Gateway settings, as of November 24, 2025, there is no feature to dynamically switch Gateway settings at the project or Vercel Environment Variables level.
Vercel AI Gateway is created and associated with a Vercel Team. Therefore, the only current method to separate Gateways by environment is to separate Vercel Teams by environment.
Specifically, you could consider a configuration like this:
my-team-production Team: Team for production environmentmy-team-development Team: Team for development/preview environmentsYou would need to create separate AI Gateways for each Team and implement logic in your application to switch Gateway connection information based on environment variables.
However, this approach makes project management more complex and requires operations across Teams, which is not ideal from a developer experience perspective.
One of Vercel’s strengths is its excellent developer experience with seamless per-environment deployments and environment variable management. Similarly, if Vercel AI Gateway could easily switch Gateways and external service integration settings by environment within project settings, it would become an even more powerful and user-friendly tool.
I look forward to future feature updates that enable more granular per-environment integration.
That’s all from the Gemba on separating Vercel AI Gateway across multiple environments (production, preview, development).