|
| 1 | +--- |
| 2 | +description: Configure the Vercel AI Gateway in Roo Code to robustly access 100+ language models from various providers through a centralized interface. |
| 3 | +keywords: |
| 4 | + - roo code |
| 5 | + - vercel ai gateway |
| 6 | + - ai provider |
| 7 | + - language models |
| 8 | + - api configuration |
| 9 | + - model selection |
| 10 | + - prompt caching |
| 11 | + - usage tracking |
| 12 | + - byok |
| 13 | +sidebar_label: Vercel AI Gateway |
| 14 | +image: /img/social-share.jpg |
| 15 | +--- |
| 16 | + |
| 17 | +# Using Vercel AI Gateway With Roo Code |
| 18 | + |
| 19 | +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. |
| 20 | + |
| 21 | +Useful links: |
| 22 | +- Team dashboard: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai |
| 23 | +- Models catalog: https://vercel.com/ai-gateway/models |
| 24 | +- Docs: https://vercel.com/docs/ai-gateway |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Getting an API Key |
| 29 | + |
| 30 | +An API key is required for authentication. |
| 31 | + |
| 32 | +1. **Sign Up/Sign In:** Go to the [Vercel Website](https://vercel.com/) and sign in. |
| 33 | +2. **Get an API Key:** Go to the [API Key page](https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys&title=AI+Gateway+API+Key) in the AI Gateway tab. Create a new key. |
| 34 | +3. **Copy the Key:** Copy the API key. |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## Supported Models |
| 39 | + |
| 40 | +The Vercel AI Gateway supports a large and growing number of models. Roo Code automatically fetches the list of available models from the `https://ai-gateway.vercel.sh/v1/models` endpoint. Only language models are shown. |
| 41 | + |
| 42 | +The default model is `anthropic/claude-sonnet-4` if no model is selected. |
| 43 | + |
| 44 | +Refer to the [Vercel AI Gateway Models page](https://vercel.com/ai-gateway/models) for the complete and up-to-date list. |
| 45 | + |
| 46 | +### Model Capabilities |
| 47 | + |
| 48 | +- **Vision Support**: Many models support image inputs. |
| 49 | +- **Tool/Computer Use**: Select models support function calling and computer use. |
| 50 | + |
| 51 | +Check the model description in the dropdown for specific capabilities. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Configuration in Roo Code |
| 56 | + |
| 57 | +1. **Open Roo Code Settings:** Click the gear icon (<Codicon name="gear" />) in the Roo Code panel. |
| 58 | +2. **Select Provider:** Choose "Vercel AI Gateway" from the "API Provider" dropdown. |
| 59 | +3. **Enter API Key:** Paste your Vercel AI Gateway API key into the "Vercel AI Gateway API Key" field. |
| 60 | +4. **Select Model:** Choose your desired model from the "Model" dropdown. |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## Prompt Caching |
| 65 | +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. |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## Tips and Notes |
| 70 | + |
| 71 | +* **Model Selection:** The Vercel AI Gateway offers a wide range of models. Experiment to find the best one for your needs. |
| 72 | +* **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](https://vercel.com/ai-gateway/models) for details. |
| 73 | +* **Temperature:** The default temperature is `0.7` and is configurable per model. |
| 74 | +* **Bring Your Own Key (BYOK):** The Vercel AI Gateway has **no markup** if you decide to use your own key for the underlying service. |
| 75 | +* **More info:** Vercel does not add rate limits. Upstream providers may. New accounts receive $5 credits every 30 days until the first payment. |
0 commit comments