You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/providers/01-ai-sdk-providers/00-ai-gateway.mdx
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,14 @@ tokens](https://vercel.com/docs/oidc) without API Keys.
153
153
154
154
Read more about using OIDC tokens in the [Vercel AI Gateway docs](https://vercel.com/docs/ai-gateway#using-the-ai-gateway-with-a-vercel-oidc-token).
155
155
156
+
## Bring Your Own Key (BYOK)
157
+
158
+
You can connect your own provider credentials to use with Vercel AI Gateway. This lets you use your existing provider accounts and access private resources.
159
+
160
+
To set up BYOK, add your provider credentials in your Vercel team's AI Gateway settings. Once configured, AI Gateway automatically uses your credentials. No code changes are needed.
161
+
162
+
Learn more in the [BYOK documentation](https://vercel.com/docs/ai-gateway/byok).
163
+
156
164
## Language Models
157
165
158
166
You can create language models using a provider instance. The first argument is the model ID in the format `creator/model-name`:
Some providers offer tools that are executed by the provider itself, such as [OpenAI's web search tool](/providers/ai-sdk-providers/openai#web-search-tool). To use these tools through AI Gateway, import the provider to access the tool definitions:
298
+
299
+
```ts
300
+
import { generateText, stepCountIs } from'ai';
301
+
import { openai } from'@ai-sdk/openai';
302
+
303
+
const result =awaitgenerateText({
304
+
model: 'openai/gpt-5-mini',
305
+
prompt: 'What is the Vercel AI Gateway?',
306
+
stopWhen: stepCountIs(10),
307
+
tools: {
308
+
web_search: openai.tools.webSearch({}),
309
+
},
310
+
});
311
+
312
+
console.dir(result.text);
313
+
```
314
+
315
+
<Note>
316
+
Some provider-executed tools require account-specific configuration (such as
317
+
Claude Agent Skills) and may not work through AI Gateway. To use these tools,
318
+
you must bring your own key (BYOK) directly to the provider.
319
+
</Note>
320
+
287
321
### Usage Tracking with User and Tags
288
322
289
323
Track usage per end-user and categorize requests with tags:
0 commit comments