What this thread does
Do first: in an existing AI SDK 6 project, run pnpm add ai@6.0.321 and configure AI_GATEWAY_API_KEY in your server environment (minimum-version announcement, 6.0.321 package release).
If your agent can generate an answer but needs current pages to support it, register DeepSeek Search for discovery and DeepSeek Fetch for Markdown page retrieval. Vercel announced this Gateway integration on November 6, 2026 (changelog).
What changed
- Any model with tool calling can use the helpers through one AI Gateway key; a separate DeepSeek account is unnecessary (announcement).
- The documented minimums are AI SDK 6.0.321 on v6 or 7.0.160 on v7. Choose the version within your application's existing major line (announcement).
Register search and page reading
Adapt the official registration example:
import { gateway, streamText } from 'ai';
const result = streamText({
model: 'deepseek/deepseek-v4.1-flash-1017',
prompt: 'Find the Vercel AI Gateway documentation, read a page, and cite its URL.',
tools: {
deepseek_search: gateway.tools.deepseekSearch({ count: 3 }),
deepseek_fetch: gateway.tools.deepseekFetch(),
},
});
for await (const part of result.fullStream) {
if (part.type === 'text-delta') process.stdout.write(part.text);
else if (part.type === 'tool-error') console.error('The page could not be fetched.');
}
Inspect tool-error events while evaluating it; successful text alone does not show that page retrieval succeeded. The Gateway guide documents these failures and fullStream handling. If you already have a known page, pin it with gateway.tools.deepseekFetch({ url: 'https://vercel.com/docs/ai-gateway' }) instead of asking the model to choose a URL.
Cost and execution limits
| Choice | Consequence |
|---|---|
| Search versus Fetch | Each costs $0.75 per 1,000 billable requests; successful nonempty results/content trigger billing. |
count: 3 | Changes search result count, not the per-request tool price. |
| Tool failure, timeout or empty result | No tool charge; host-model tokens remain separately billed. |
See request billing and parameters. If you import Gateway separately, its documented floors are @ai-sdk/gateway 3.0.227 with AI SDK 6 or 4.0.133 with AI SDK 7 (Search guide).
Evidence and limits
StackGrade's November 6 release digest separately records the integration; it is release reporting.
Adding alternative search tools and asking the model to try them in order gives best-effort fallback, not guaranteed ordering or retry counts (Vercel announcement). Fetch supports Markdown and depends on the target site's availability and policies (Fetch guide). This recipe adds retrieval within an existing SDK major; earlier API migrations remain outside its scope.
Not for: AI SDK 6 to 7 migration; see ai-sdk-6-to-7-migration-breaking-apis-and-provider-packages.
Started from a post by @Vercel / Jerilyn Zheng and Zachary Chen, packaged by the editor. Original post