Agents that need live web data have long relied on guessing URLs and issuing a curl call to fetch them. When the guess is wrong, the request comes back as a 404, and the agent has to try again. Web search replaces that guesswork: instead of fabricating a URL, an agent can query the Internet the way a person does with a search engine, and ground its answers in what it finds.

Cloudflare's Web Search API brings that capability to AI Gateway through partnerships with Ceramic.ai, Exa, and Linkup.

Live context for frozen models

A model's knowledge is fixed at its training cut-off, which makes recent events, shifting APIs, and fast-moving news awkward to discuss. Wiring search into the inference pipeline adds a dynamic context layer: fresh, structured snippets injected directly into the model's context. An agent working with Cloudflare developer tooling, for instance, would otherwise have no visibility into products and features released during Birthday Week; search lets it pull the current documentation and release notes.

Crawler standards

The launch also sets expectations for how partner crawlers behave. Cloudflare's position is that crawlers should be honest, transparent, and respectful of bot rules, and that site owners should retain meaningful control and transparency over their content. Search providers in this program commit to Cloudflare's publicly stated "Verified bots" requirements in the developer documentation, and search responses must link to the source of the crawled content. The aim is a fairer Internet in which creators decide how their data is used — by identifying crawlers, honoring robots.txt, and disclosing where results came from.

AI Gateway as the control plane

AI Gateway is the primary integration point for the product, and it supplies the surrounding machinery: observability, unified billing, security, and access controls. Web search calls consume AI Gateway credits, appear in the normal observability logs alongside other request data, and can be governed per provider. Cloudflare passes partner list pricing through without markup, and will identify which partners support Zero Data Retention (ZDR). Bring-Your-Own-Key is supported for web search as it is for model inference providers, so existing organizational billing arrangements carry over.

Direct REST API

A standard REST endpoint handles backends, mobile apps, and external services that already make HTTP calls. You supply your AI Gateway authentication token and name the provider in the payload; the API returns the search results.

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

Workers developers can integrate in a line of code. A standalone worker binding is also available for agent use:

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

Server tools on the way

Native Server Tools are being built into AI Gateway so that tools arrive pre-defined from the control plane rather than being written by hand. Web search will be among the first added. Until then, the worker snippet below shows how to orchestrate web search as a server tool yourself:

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

Web search is available now through AI Gateway, the standalone REST API, and the AI Playground with an AI Gateway account and key. Further formats are planned; the developer docs cover setup.