When AI agents need to retrieve current web pages, they typically resort to URL guessing followed by HTTP requests—a process that frequently fails with 404 errors when the predicted address proves incorrect. This inefficient approach wastes resources and limits agent reliability.
A more effective strategy mirrors human information-seeking behavior: starting with a search query. Web search functionality allows agents to locate relevant content across the internet and anchor their responses in real-time data rather than relying on stale training data or failed URL predictions.
Cloudflare announced today a partnership with web search providers Ceramic.ai, Exa, and Linkup to deliver this capability through its AI Gateway platform. The Web Search API enables developers to ground their AI applications with current information from across the web.
What can I do with the Web Search API?
Language models operate within the constraints of their training data, frozen at a specific point in time. This limitation makes it challenging to discuss recent developments, evolving APIs, or breaking news with these systems.
Embedding Web Search API into an inference pipeline furnishes agents with a continuously updated context layer. Applications can inject fresh, structured data snippets directly into the model's context window, providing access to live information. An agent built with Cloudflare developer tools, for instance, could miss new products and features released during Cloudflare's Birthday Week without web search capability—but with it, developers can retrieve the latest documentation and announcements to accelerate development.
Elevating the industry standard for web search
Cloudflare maintains that crawlers must operate with honesty, transparency, and respect for bot exclusion rules, while site owners deserve meaningful oversight and control regarding content usage. The company announced that its launch partners have committed to meeting Cloudflare's bot crawling standards.
Web search providers must ensure their crawlers comply with Cloudflare's publicly documented requirements for "Verified bots," and search responses must include links to the original content sources. These standards promote a fair internet ecosystem and grant creators agency over their data.
Cloudflare stated it is "extremely excited to be taking another step in setting the bar for what it means to be a good crawler on the Internet, and even more proud of the web search partners who have risen to the challenge to uphold these standards with us." When using Cloudflare's web search, users access search results from operators that identify their crawlers, respect robots.txt files, and disclose content sources.
Using Web Search API via AI Gateway
AI Gateway serves as the primary integration point for the Web Search API. The platform functions as a control plane offering observability, unified billing, security, and access management. Web search integrates naturally into this architecture: queries consume AI Gateway credits, request logs capture web search activity, and administrators can manage provider access permissions.
Web search requests appear in standard AI Gateway observability logs, with queries deducted from the credit balance. Cloudflare will identify partners offering Zero Data Retention (ZDR) to assure users their data remains unretained. Web search is available at list API pricing from partners without additional markup. Developers can also implement Bring-Your-Own-Key (BYOK) arrangements with web search providers, enabling quick integration with existing organizational infrastructure.

Direct REST API
Backend systems, mobile applications, and external services can access web search through a standard REST endpoint by passing an AI Gateway authentication token and specifying the preferred provider in the request payload.
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/websearch/ \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"query": "What are some fun things to do in Salt Lake City as fall approaches?",
"provider": "ceramic",
"limit": 5,
"options": {
"gateway": { "id": "default" }
}
}'
Workers Bindings
Developers building on Cloudflare Workers can integrate web search with minimal code. A standalone worker binding enables web search functionality for agent applications.
const response = await env.AI.websearch({
gatewayId: "default",
query: "What are some fun things to do in Salt Lake City as fall approaches?",
provider: "exa",
limit: 5,
})
const results = await response.json()
Coming soon: Server tools
Cloudflare is developing native Server Tools directly within AI Gateway. Soon developers will access pre-built tools through the control plane rather than defining them manually, reducing orchestration overhead. Web search will be among the first tools incorporated into this server tools stack.
Developers who want to orchestrate web search as a server tool today can do so with the following Worker code:
const completion = await env.AI.run(
"@cf/google/gemma-4-26b-a4b-it",
{
messages: [{ role: "user", content: "What happened in the last Cloudflare Birthday Week in 2025?" }],
tools: [{
type: "function",
function: {
name: "web_search",
description: "Search the web for current information.",
parameters: {
type: "object",
properties: { query: { type: "string" } },
required: ["query"],
},
},
}],
},
{ gateway: { id: "default" } },
)
const toolCall = completion.tool_calls?.[0]
if (toolCall?.name === "web_search") {
const response = await env.AI.websearch({
gatewayId: "default",
query: toolCall.arguments.query,
limit: 5,
})
const searchResults = await response.json()
const finalResponse = await env.AI.run(
model,
{
messages: [
{ role: "user", content: prompt },
{
role: "tool",
name: "web_search",
content: JSON.stringify(searchResults),
},
],
},
{ gateway: { id: "default" } },
)
}
Try it out today!
Cloudflare is launching web search alongside partners committed to responsible internet stewardship. Developers can access the new web search capabilities through AI Gateway, the standalone REST API, and additional formats coming in the future. The developer documentation and AI Playground are available for testing with an AI Gateway account and API key.