AI Gateway Integrates DeepSeek Search and Fetch Tools, Enabling Web Retrieval with a Single API Key

AI Gateway launches DeepSeek Search and Fetch tools, enabling cross-model web access with one key.
Vercel AI Gateway adds two tools, DeepSeek Search and DeepSeek Fetch, letting developers give any tool-calling model web search and page-fetching capabilities with just one AI Gateway API key and no DeepSeek account. Search returns titles, URLs, and summaries; Fetch converts page bodies to Markdown, and the two can be chained into a search-then-fetch workflow. The core value is decoupling: tool configuration doesn't need rewriting when switching model providers. Integration requires AI SDK 6.0.321+ on the v6 line or 7.0.160+ on the v7 line, passing the helpers into streamText's tools. An official fallback across DeepSeek, Exa, and Parallel is offered, but fallback is model-directed and best-effort. Billing is $0.75 per 1,000 billable requests, with failures, timeouts, and empty results free.
AI Gateway Integrates DeepSeek Search and Fetch Tools, Enabling Web Retrieval with a Single API Key
Vercel AI Gateway has recently launched two new tools — DeepSeekAd Search and DeepSeek Fetch — allowing developers to add web search and page-fetching capabilities to any tool-calling-capable model through a unified AI Gateway API key, without needing a separate DeepSeek account. According to an RSS source, this update directly targets the pain point of "tools being bound to vendors" in multi-model development.

What Each Tool Solves
DeepSeek Search handles information discovery: it returns the titles, URLs, and summaries of relevant pages, letting the model first judge which results are worth pursuing. DeepSeek Fetch handles content retrieval: it converts the body of a target page into Markdown format for the model to read and cite directly.
This two-stage "search first, fetch later" design matches real-world retrieval scenarios — search APIs typically provide only summaries, and the model needs the full body text to produce a reliable summary. The two tools can be used independently or chained into a complete workflow.
Tool Calling (Function Calling) is a capability of large models: when generating a response, the model can declare, according to a predefined JSON Schema, that it wants to call an external function with specific parameters; the host program executes it and passes the result back to the model to continue reasoning. It is the general mechanism that lets models "go online" — search and fetch are essentially functions triggered on demand by the model. AI Gateway wraps DeepSeek Search/Fetch as standard tool definitions, so any model with tool-calling capability can reuse them — this is the protocol-level basis for "decoupling tools from models." Note that the model only decides what to call and what parameters to pass; the actual network requests and result parsing are handled by the Gateway.
One API Key, Tools Reusable Across Models
The core value of this toolset is decoupling. Official documentation states that any model supporting tool calling can be used with DeepSeek Search and Fetch, with only one AI Gateway API key throughout and no separate DeepSeek account. More importantly, developers can keep their tool configuration unchanged when switching model providers.
For projects that need routing, retries, and failover across multiple models, this means the tool layer no longer needs to be rewritten whenever the model layer changes. The unified model invocation, usage and cost tracking, and routing and failover configuration that AI Gateway itself provides thus extend down to the tool-calling layer.
How to Integrate at the Code Level
Before use, upgrade AI SDK to the appropriate version: 6.0.321 or above on the v6 line, 7.0.160 or above on the v7 line, update via pnpm add ai@latest, and set AI_GATEWAY_API_KEY.
A typical way to combine search and fetch is to pass both helpers in the tools field of streamText:
import { gateway, streamText } from 'ai';
const result = streamText({
model: 'deepseek/deepseek-v4.1-flash-1017',
prompt: 'Find the latest Vercel AI Gateway announcement, fetch it, and summarize it.',
tools: {
deepseek_search: gateway.tools.deepseekSearch({ count: 3 }),
deepseek_fetch: gateway.tools.deepseekFetch(),
},
});
for await (const text of result.textStream) {
process.stdout.write(text);
}
Interestingly, the model in the example is not a DeepSeek model yet can still call these two tools, confirming the tool-model decoupling design.
The relationship between AI SDK and AI Gateway: AI SDK is an open-source TypeScript utility library from Vercel; functions such as streamText and generateText orchestrate the prompt, model, and tools into a single call and handle incremental parsing of streamed output. AI Gateway is the managed service layer that uniformly handles requests, authentication, and billing for various model providers. In the code, gateway.tools.deepseekSearch() returns a helper that conforms to the AI SDK tool interface; it declares the parameter schema and internally proxies to the Gateway's tool endpoint, so developers don't need to write their own fetch logic or manage DeepSeek keys. The version requirements (6.0.321+ on the v6 line, 7.0.160+ on the v7 line) exist because the gateway tools helper is a relatively recently introduced API, and older versions lack the corresponding exports.
Multi-Tool Fallback Strategy When Search Fails
A single search source always carries failure risk. The official alternative is to mount DeepSeek Search, Exa Search, and Parallel Search in the tool list simultaneously, and use the system prompt to instruct the model to try them in order — first deepseek_search, then fall back to exa_search and parallel_search on error, and finally use deepseek_fetch to retrieve the result URLs once a search succeeds.
This fallback is decided autonomously by the model, and the official documentation openly admits that search fallback is "model-directed," so vendor order and retry counts are best-effort rather than strongly guaranteed. However, DeepSeek Fetch itself can retrieve URLs returned by any of the above search tools, which makes the combined strategy feasible in engineering terms.
The meaning of fallback and "best-effort": In traditional engineering, fallback is usually explicitly controlled by code — try/catch followed by switching in a fixed order. The difference here is that the decision-maker is the model itself: the system prompt only "suggests" the order to try, and the model may skip a source, call repeatedly, or give up after the first failure. That is why the official documentation calls it model-directed and provides no strong consistency guarantee. A safer approach is to add validation at the application layer — for example, checking whether results are empty, setting a maximum number of tool-call rounds for critical queries, or using AI Gateway's built-in routing and failover configuration to handle model-side instability. For cost-sensitive agents, you should also cap the total number of tool calls per session to prevent the model from getting stuck in a retry loop.
Billing and Cost Boundaries
Search and Fetch are each billed at $0.75 per 1,000 billable requests. Failed requests, timeouts, and empty results incur no tool fees, and model tokens are billed separately. This billing model is relatively friendly to high-retry agent scenarios — no charge for failures means a fallback retry strategy won't burn extra money due to unstable search sources.
AI Gateway also supports using a platform API key or bringing your own provider key, leaving room for teams with compliance or cost-accounting requirements.
What It Means for Developers
Making search and fetch standard tools at the Gateway layer essentially turns "web connectivity" from a private feature of model providers into infrastructure that can migrate across models. For teams building RAG, research assistants, or automated information aggregation, the stability and replaceability of the tool layer often affect long-term maintenance costs more than performance differences between individual models. The multi-search-source fallback pattern offered by this update also reflects the official pragmatic attitude toward the reliability of a single search source.
For more configuration options and pricing details, see the official documentation for DeepSeek Search and DeepSeek Fetch.
Related articles
Tech FrontiersSherlock: An Open-Source Tool for Tracking Usernames Across Social Networks
Sherlock is an open-source Python tool that tracks social accounts across networks by username. This article covers its core features, why developers love it, typical use cases, and privacy compliance considerations.
Tech FrontiersGitHub Daily·Nov 07: Agent-Ready and Context Compression
GitHub Trending Nov 07: meta's agent-ready design system astryx, billion-context's 5x context compression, sherlock nearing 100k stars, plus local-first localthings and bare-metal GPU orchestration nvke.
Tech FrontiersBuoyant Open-Sources Kinference: An Inference Control Plane for vLLM on K8s
Buoyant open-sources Kinference, an inference control plane for vLLM on Kubernetes, with declarative routing, KV-cache-aware load balancing, and per-tenant metrics—claiming 95% lower median TTFT in official benchmarks.