Bring Your Own Key (BYOK)
Using your own API key with an external AI provider allows the AI Gateway to authenticate requests on your behalf. This approach is useful for utilizing credits provided by the AI provider or executing AI queries that access private cloud data. If a query using your API key fails, AI Gateway will retry the query with its system credentials to improve service availability.
Integrating an API key like this with AI Gateway is sometimes referred to as Bring-Your-Own-Key, or BYOK. In the Vercel dashboard this feature is found in the AI Gateway tab under the Integrations section in the sidebar.
Provider keys are scoped to be available throughout your Vercel team, so you can use the same key across multiple projects.
First, retrieve an API key from your AI provider. This key will be used first to authenticate requests made to that provider through the AI Gateway. If a query made with your API key fails, AI Gateway will re-attempt with system credentials, aiming to provide improved availability.
- Go to the AI Gateway tab in your Vercel dashboard.
- Click on the Integrations section on the left sidebar.
- Find your provider from the list and click Add.
- In the dialog that appears, enter the key you retrieved from the provider.
- Ensure that the Enabled toggle is turned on so that the key is active.
- Click Add Key to complete the flow.
Once the key is added, it will automatically be included in your requests to the AI Gateway. You can now use this key to authenticate your requests.
Was this helpful?