Using Vercel AI Gateway With Roo Code
The AI Gateway provides a unified API to access hundreds of models through a single endpoint. It gives you the ability to set budgets, monitor usage, load-balance requests, and manage fallbacks.
Useful links:
- Team dashboard: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai
- Models catalog: https://vercel.com/ai-gateway/models
- Docs: https://vercel.com/docs/ai-gateway
Getting an API Key
An API key is required for authentication.
- Sign Up/Sign In: Go to the Vercel Website and sign in.
- Get an API Key: Go to the API Key page in the AI Gateway tab. Create a new key.
- Copy the Key: Copy the API key.
Available Models
Roo Code automatically fetches all available models from Vercel AI Gateway's API (hundreds of models from various providers).
For the complete, up-to-date model catalog with capabilities, see Vercel's AI Gateway models page.
Configuration in Roo Code
- Open Roo Code Settings: Click the gear icon () in the Roo Code panel.
- Select Provider: Choose "Vercel AI Gateway" from the "API Provider" dropdown.
- Enter API Key: Paste your Vercel AI Gateway API key into the "Vercel AI Gateway API Key" field.
- Select Model: Choose your desired model from the "Model" dropdown.
Prompt Caching
Vercel AI Gateway supports automatic prompt caching for select models including Anthropic Claude and OpenAI GPT models. This reduces costs by caching frequently used prompts.
Tips and Notes
- Model Selection: The Vercel AI Gateway offers a wide range of models. Experiment to find the best one for your needs.
- Pricing: The Vercel AI Gateway charges based on the underlying model's pricing, including costs for cached prompts. See the Vercel AI Gateway Models page for details.
- Temperature: The default temperature is
0.7and is configurable per model. - Bring Your Own Key (BYOK): The Vercel AI Gateway has no markup if you decide to use your own key for the underlying service.
- More info: Vercel does not add rate limits. Upstream providers may. New accounts receive $5 credits every 30 days until the first payment.