Skip to main content
ai-ml

Cloudflare Introduces Web Search API to Give AI Agents Live Web Context

Cloudflare has introduced Web Search API through AI Gateway, allowing AI agents to search the live web, retrieve structured results and use current information instead of relying only on static model knowledge.

Xcademia Team

Oct 03, 202611 min read18 views
Share:
Cloudflare Introduces Web Search API to Give AI Agents Live Web Context

Cloudflare Brings Live Web Search to AI Agents

AI agents increasingly need access to information that changes after a model's training data was collected. Current news, changing APIs, updated documentation and newly released products can all fall outside an AI model's existing knowledge.

Cloudflare is addressing this problem with its new Web Search API, introduced on October 2, 2026, through AI Gateway.

The API allows AI applications and agents to search the Internet and use structured web results as additional context. Instead of an agent attempting to guess the URL of a page and fetching it directly, the agent can submit a search query and receive relevant web results.

Cloudflare announced the launch with web search providers Ceramic.ai, Exa and Linkup. The company's documentation currently lists the Web Search API as available in open beta.


Why Web Search Matters for AI Agents

Traditional AI models operate from information available within their training data or other context supplied to them at inference time. That creates an obvious limitation when an application needs information that has changed recently.

For example, an AI coding agent may need the latest version of an API, recently published documentation or a newly released developer feature. Without an external information source, the model may provide an answer based on older information.

Cloudflare's Web Search API adds a live information layer to this workflow.

The basic flow is:

User request → AI agent → Web Search API → Search provider → Structured web results → AI model context → Response

Cloudflare says the API returns structured results that can be passed directly into an application's model context. Its documentation describes the results as including titles, URLs and descriptions.

info-1



From URL Guessing to Search-Based Retrieval

Cloudflare's announcement highlights a common problem with agent-based web retrieval.

An agent may attempt to determine the URL of the information it needs and then use a tool such as curl to retrieve that address. If the URL is wrong, the request can return a 404 Not Found.

Search provides a different approach.

Rather than requiring the model to know the exact location of a resource, the agent can describe what it needs in a search query. The search provider can then return relevant results and their source locations.

This changes the retrieval process from:

Guess the URL → Fetch the page → Handle failure

to:

Describe the information needed → Search the web → Retrieve relevant sources → Add results to model context

For AI agents that need frequently changing information, this provides a more direct mechanism for obtaining current web context.


Web Search API Runs Through AI Gateway

Cloudflare positions AI Gateway as the primary integration point for the Web Search API.

According to Cloudflare, AI Gateway provides a control layer for AI applications with capabilities including observability, unified billing, security and access controls. Web search requests can therefore be incorporated into the same operational environment used for model inference.

The current documentation also states that search requests appear in AI Gateway logs and analytics alongside model inference requests.

This means developers can monitor web search activity as part of their broader AI application workflow instead of managing a completely separate search integration.

Cloudflare also states that Web Search API usage is charged through AI Gateway credits at the providers' list API pricing, without additional markup. The platform supports bringing your own provider API key as well.


Multiple Web Search Providers

Cloudflare launched the Web Search API with Ceramic.ai, Exa and Linkup.

The current developer documentation says developers can select providers using a provider parameter, while the API returns results in a common format. This allows applications to change providers without changing the overall search integration.

This provider-based architecture is important for applications that want to keep their search layer separate from the rest of their AI application.

Cloudflare also supports Bring Your Own Key (BYOK) for web search providers, allowing organisations to use existing provider credentials within the AI Gateway setup.


Responsible Crawling and Source Visibility

Cloudflare is also tying the Web Search API to its stated requirements around web crawling.

The company says participating search providers have committed to Cloudflare's crawling standards. The crawler used by a web search provider must comply with Cloudflare's requirements for verified bots.

Cloudflare also requires web search responses to include a link to the location of crawled content.

The current documentation similarly states that participating providers commit to Cloudflare's verified-bot requirements and return a source link for every result.

Cloudflare says these requirements are intended to give website owners greater transparency and control over how their content is crawled and used.

The approach also makes source visibility part of the search workflow. An AI application receiving search results can therefore have access to the originating web location rather than receiving only an isolated piece of generated text.

info-2



Direct REST API for Backend Applications

Developers using existing backends, mobile applications or external services can access the Web Search API through a REST endpoint.

Cloudflare's announcement provides the following example:

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" }
    }
  }'

The request sends a search query to Cloudflare's Web Search API, specifies a provider and limits the number of returned results. Authentication is handled through an AI Gateway API token.

For production applications, developers would replace the example environment variables with their own Cloudflare account ID and API token.

The key architectural benefit is that applications do not need to build an entire search provider integration from scratch. They can make a request to Cloudflare's endpoint and receive search results through the AI Gateway layer.


Cloudflare Workers Integration

Applications already running on Cloudflare Workers can use the Web Search API through an AI binding.

Cloudflare provides the following example:

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()

The example calls env.AI.websearch() with a gateway ID, query, provider and result limit before converting the response into JSON.

This provides a straightforward way for a Worker-based agent to perform a web search as part of its application logic.

A simplified architecture looks like this:

Cloudflare Worker → env.AI.websearch() → Web Search Provider → Search Results → Agent

The actual implementation will depend on how the developer processes and supplies those results to the model.


Using Web Search as an AI Tool

Cloudflare is also working on native Server Tools for AI Gateway.

The company says these tools are being developed so developers will not need to define every tool themselves. Web search is planned to be one of the first tools incorporated into the server-tool stack.

Until native server tools are available, Cloudflare demonstrates how developers can orchestrate web search themselves.

The example starts by giving a model a function named web_search:

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" } },
)

The model can then request the web_search function when it needs current information.

Cloudflare's example checks the tool call and performs the actual search:

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()
}

The resulting search data can then be supplied back to the model as tool output.

A simplified conceptual flow is:

User → Model → Tool Request → Web Search → Search Results → Model → Final Answer

This is a common pattern for agentic applications because the model determines when external information is needed while the application controls how the tool is executed.

info-3



What This Means for AI Application Developers

Cloudflare's announcement reflects a broader shift in how AI applications can access information.

A standalone language model can generate an answer from the context supplied to it. An agent with a search capability can retrieve additional information before producing that answer.

That distinction becomes particularly relevant for applications dealing with:

  • Current news and events

  • Frequently changing documentation

  • Software and API updates

  • Recently released products

  • Web-based research

  • Current technical information

  • Agent workflows that require external knowledge

Cloudflare's Web Search API is therefore not positioned as another language model. Instead, it provides a retrieval layer that can be connected to AI applications.

For enterprises, this could mean treating web search as another controlled component in an AI application's infrastructure rather than building separate integrations for each search provider.

The announcement highlights a broader industry shift toward AI systems that combine model inference with external tools and live information sources.


Observability and Access Controls

One of the notable aspects of the integration is that Cloudflare places web search inside AI Gateway rather than presenting it only as an independent API.

Cloudflare says developers can collect logs and request data for web search calls and control access to different search providers. Search requests also appear in the normal AI Gateway observability logs.

For organisations operating AI applications at scale, visibility into external tool calls can be important because an agent's behaviour is not limited to model inference.

An agent may make searches, invoke tools and retrieve information from external systems.

Putting these requests within the same control layer can make it easier for development and operations teams to understand how the application is using external information sources.

Cloudflare also says it will identify providers that support Zero Data Retention (ZDR), allowing users to identify providers where data is not retained.

Specific retention policies can vary by provider, so organisations should review the applicable provider documentation before using the service with sensitive information.


Web Search API Is Currently in Open Beta

Cloudflare's current developer documentation lists Web Search API as available in open beta.

The company has made the service available through AI Gateway, a standalone REST API and Workers integration.

Cloudflare also provides an AI Playground where developers with an AI Gateway account and key can try the service.

Native Server Tools are still described as being under development, so the currently available approach requires developers to orchestrate web search themselves when using it as an agent tool.

Additional details were not disclosed in the announcement about the timeline for general availability of native Server Tools.


What Developers Should Know

Cloudflare's Web Search API introduces a relatively simple architectural idea: give an AI agent a search capability instead of requiring it to guess where information lives on the web.

The service combines that retrieval capability with AI Gateway's existing management layer.

The main components announced by Cloudflare are:

Component

What Cloudflare announced

Web Search API

Search the Internet and provide live context to AI applications

AI Gateway

Integration point providing logging, analytics, billing and access controls

Search providers

Ceramic.ai, Exa and Linkup

REST API

Direct web search from backend and external applications

Workers binding

Search from Cloudflare Workers through env.AI.websearch()

BYOK

Support for bringing existing provider API keys

Source links

Search results include links to crawled content

Responsible crawling

Providers commit to Cloudflare's verified-bot requirements

Server Tools

Native integration is being developed

Availability

Open beta according to current documentation


The Bigger Picture

The introduction of Web Search API shows how AI infrastructure is increasingly moving beyond model inference alone.

For many applications, the model is only one part of the system. Search, retrieval, tool calls, observability, permissions and external data can all become part of the agent architecture.

Cloudflare's approach puts web search behind an API and AI Gateway control layer, while allowing developers to choose from multiple search providers.

The result is a workflow where an AI agent can request current information, retrieve structured search results and feed those results back into its model context.

That does not eliminate the need for developers to evaluate sources or design appropriate controls. Instead, it gives applications a dedicated mechanism for obtaining live web information when static model knowledge is insufficient.

For developers building AI agents, the key change is straightforward: the agent can search for information instead of trying to guess where that information lives.

Cloudflare's Web Search API is now available in open beta, with REST API and Workers integration available for developers.

#Cloudflare#WebSearchAPI#AIAgents#AIGateway#GenerativeAI#CloudComputing#DeveloperTools#AgenticAI

About the Author

X
Xcademia Team
Share:
Build the systems making these headlinesAI Engineer Bootcamp: live cohorts enrolling now, with optional Career+ support.