Article summary — original

Cloudflare Introduces Web Search API via AI Gateway Cloudflare has launched a Web Search API integrated into AI Gateway, partnering with search providers to supply AI agents with real-time web context while enforcing bot crawling standards. Partnership launches with Ceramic.ai, Exa, and Linkup to provide live context injection for AI models. Partner crawlers must comply with Cloudflare's 'Verified bots' requirements, respect robots.txt, and link crawled sources. Integrated directly into AI Gateway with unified billing, BYOK support, observability logging, and no price markup over partner list rates. Accessible via standard REST endpoints, Workers bindings, and manual tool-calling implementations. Grounding Agents with Web Search Traditional AI agents often guess URLs and run curl tool calls, frequently triggering 404 errors. Cloudflare's Web Search API allows models to perform search queries to fetch fresh, structured snippets directly into their inference pipeline, overcoming knowledge cutoffs and static context limitations. Crawler Compliance Standards Participating search partners—Ceramic.ai, Exa, and Linkup—must adhere to Cloudflare's verified bot crawling requirements. Responses must link to source locations, identify their crawlers, and respect robots.txt rules, granting site creators control and visibility over crawled data. AI Gateway Integration and Pricing The Web Search API serves as a control plane within AI Gateway, featuring observability logs, access controls, and credit drawdown at partner list pricing without markup. It supports Bring-Your-Own-Key (BYOK) configurations and identifies partners adhering to Zero Data Retention (ZDR). Developer Integration Options Developers can invoke web search via a standard REST endpoint or use native Cloudflare Worker bindings (`env.AI.websearch`). The functionality can also be orchestrated into LLM function-calling workflows, with Cloudflare actively developing built-in native Server Tools for AI Gateway.

Article summary — zh

Cloudflare推出AI Gateway网络搜索API,为AI代理接入实时网络数据 Cloudflare宣布与Ceramic.ai、Exa及Linkup等搜索提供商合作,在AI Gateway中推出Web Search API。该功能让AI代理能够突破知识库截止日期的限制,直接获取实时的网络结构化信息,同时严格遵循网络爬虫规范与透明度要求。 首批合作伙伴包括Ceramic.ai、Exa和Linkup,以动态上下文弥补模型训练数据的时间滞后。 搜索提供商必须符合Cloudflare的“验证爬虫”标准,遵守robots.txt并返回抓取内容来源链接。 AI Gateway提供统一计费、无加价的原厂API价格、BYOK自带密钥支持以及零数据保留(ZDR)标识。 支持通过标准REST API和Cloudflare Workers原生绑定调用,未来还将内置服务器端工具(Server Tools)。 解决AI代理实时信息获取难题 传统AI代理在获取实时网页时常靠盲猜URL,容易导致404错误。通过引入网络搜索API,模型可以在推理流程中直接注入来自互联网的最新结构化摘要,解决知识库截止日期带来的信息滞后问题,为用户提供有据可依的实时回答。 规范爬虫标准与保障透明度 Cloudflare强调爬虫必须诚实透明并尊重站点规则。合作伙伴承诺遵循Cloudflare的“验证爬虫”规范,识别自身爬虫身份,遵守robots.txt规则,并在搜索响应中附带原始内容位置的链接,确保网站创建者对自身数据拥有控制权与可见性。 深度整合AI Gateway与灵活接入 Web Search API作为AI Gateway控制平面的核心能力,支持统一日志可观测性、扣除Gateway额度,并按原厂无加价API价格收费,同时支持自带密钥(BYOK)和零数据保留(ZDR)标识。开发者可通过标准REST接口直接调用,也能在Cloudflare Workers中利用单行绑定代码集成,未来还将提供原生内置的服务器端工具。

Saved original article

Fun fact: when you use an agent and it needs to fetch a live web page, the agent usually just guesses the URL of the page and then makes a tool call to curl it. This is why you’ll sometimes see web fetches come back with a 404 Not Found, which happens if the agent incorrectly guesses the URL of that information. As you can imagine, it’s not super efficient to randomly guess URLs all the time. There is a better way. What if your agent can actually browse the Internet, just like how humans start with a search engine query when we’re looking for information? This is what web search is designed to do — it enables agents to search for relevant data on the Internet and grounds an agent’s responses based on live information. Today, we’re announcing Cloudflare’s partnership with web search providers to bring you grounded intelligence via AI Gateway. We’re kicking off this launch with our partners from Ceramic.ai, Exa, and Linkup. AI models are only as good as the context you feed them. Models are typically trained and then frozen at a point in time, operating only on information that existed before their knowledge cut off date. This makes it quite hard to engage with models about recent events, changing APIs, or fast-evolving news. Integrating Web Search API directly into your inference pipeline equips your agents with a dynamic context layer. Your applications get fresh, structured snippets from the web injected straight into context, which gives your models access to live information. For example, if your agent was building with Cloudflare developer tools, it might miss all the new products and features we’re releasing during this [Birthday Week](https://www.cloudflare.com/birthday-week/)! With web search, you’ll be able to retrieve the latest and greatest documentation and releases, so you can build faster and smarter. At Cloudflare, we believe that crawlers should be honest, transparent, and respect all bot rules and preferences, and that site owners should have meaningful transparency and control over how their content is used. With our launch today, we’re excited to announce that our partners have committed to meeting Cloudflare’s bot crawling standards. The crawler used by the web search provider must comply with Cloudflare’s publicly stated requirements for “Verified bots” as [defined in our developer documentation](https://developers.cloudflare.com/bots/concepts/bot/verified-bots/), and web search responses must include a link to the location of crawled content. These rules are net-positive for a fair Internet, and allow creators to decide what they want to do with their data. We’re 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 you use web search on Cloudflare, you choose to consume search knowledge from operators committed to providing the transparency, control, and visibility that helps build a better Internet, by identifying their crawlers, respecting robots.txt, and providing the source of search results. Cloudflare’s AI Gateway is the flagship integration point for our new Web Search API product. AI Gateway is designed to be the control plane for your applications, with observability, unified billing, security, and access controls all built-in. Naturally, we thought web search would fit right in: you can consume web search with your AI Gateway credits; collect logs and request data on web search calls; and control who gets access to what web search providers. Requests show up in your normal AI Gateway observability logs, and web search queries draw down from your AI Gateway credit balance. We will identify partners supporting Zero Data Retention (ZDR), so that you know that your data is not retained. We also offer web search directly at list API pricing from our partners, without any additional markup. More details can be found on the [web search developer docs](https://developers.cloudflare.com/web-search). We also support Bring-Your-Own-Key (BYOK) with web search providers, as we do with model inference providers. This way, you’re able to bring your existing organizational setup and get started with AI Gateway and web search in a few simple steps. If you’re making HTTP calls from an existing backend, mobile app, or external service, you can query web search directly through a standard REST endpoint. Simply pass your AI Gateway authentication token, specify your preferred provider in the payload, and it will return web 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" } } }' ``` For developers building directly on Cloudflare Workers, integration takes just a line of code. We also have a standalone worker binding that you can use to do web search for your agent: ``` 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() ``` We are actively building native Server Tools directly into AI Gateway. Soon, you won’t need to define tools yourself: they will come built into our control plane so you can spend more time building rather than orchestrating the harness. Web search will be one of the first tools we incorporate into our stack of server tools, and we’re excited for you to try it. However, if you’d like to orchestrate web search as a server tool yourself today, you can easily do so with the following Worker code snippet: ``` 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" } }, ) } ``` We’re excited to bring web search to our platform and to be doing this with wonderful partners who are championing what it means to be a good steward of the Internet. Please give our new web search tools a try via AI Gateway, the standalone REST API, and other formats in the future. Get started with our [developer docs](https://developers.cloudflare.com/web-search) today, or try it out on the [AI Playground](https://playground.ai.cloudflare.com/) with your AI Gateway account and key.