Skip to content

Commit 8454389

Browse files
Backport: docs: update gateway provider to show provider executed tools (#9679)
This is an automated backport of #9647 to the release-v5.0 branch. Co-authored-by: Nico Albanese <49612682+nicoalbanese@users.noreply.github.com>
1 parent 8edfb1b commit 8454389

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

content/providers/01-ai-sdk-providers/00-ai-gateway.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ tokens](https://vercel.com/docs/oidc) without API Keys.
153153

154154
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).
155155

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+
156164
## Language Models
157165

158166
You can create language models using a provider instance. The first argument is the model ID in the format `creator/model-name`:
@@ -284,6 +292,32 @@ const { text } = await generateText({
284292
});
285293
```
286294

295+
### Provider-Executed Tools
296+
297+
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 = await generateText({
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+
287321
### Usage Tracking with User and Tags
288322

289323
Track usage per end-user and categorize requests with tags:

0 commit comments

Comments
 (0)