官方 Official 需审批 Needs approval

Cloudflare Web Search API — 让 Agent 搜现在的网页 Cloudflare Web Search API — let an agent search the live web

Cloudflare Web Search API — let an agent search the live web

给 Agent 一个搜实时网页的接口,回答有出处。 An API so agents search the live web instead of guessing links.

Cloudflare Web Search API — 让 Agent 搜现在的网页 预览
预览:Playwright 实拍 Cloudflare changelog 首屏 Preview: Playwright capture of the Cloudflare changelog above the fold
打开原文Open source

详细介绍Details

Cloudflare Web Search API 是一个还在 beta(试用,接口以后可能改)的搜索接口。你的 AI 应用或 Agent 可以用它去搜现在的网页,给回答找依据,而不是猜一个网址,或只靠模型训练时见过的旧资料。上线时可选三家搜索服务:Ceramic.ai、Exa、Linkup。请求经过 Cloudflare 的 AI Gateway(他们的调用记录和扣费入口):会出现在网关日志里,按各家自己的标价扣 AI Gateway 额度,Cloudflare 称不加价;也可以改用你自己存在网关上的那一家密钥。需要 Cloudflare 账号和 API token。这是一条工具笔记:本库没有发出过任何搜索请求。 Cloudflare Web Search API is a search API still in beta (a trial; the interface may change). Your AI app or agent can use it to search the live web and base the answer on those pages, instead of guessing a URL or relying only on what the model saw before its training cutoff. At launch you can pick three search providers: Ceramic.ai, Exa, and Linkup. Requests go through Cloudflare AI Gateway (their log and billing front door): they show up in the gateway logs and are billed to AI Gateway credits at each provider’s list price. Cloudflare says it adds no markup. You can also use your own provider key stored on the gateway. You need a Cloudflare account and an API token. This is a tool tip: this library did not send any search request.

它是什么What it is

这是 Cloudflare 在 2026-10-02 写进更新日志的一个搜索接口,目前标成 beta。它要解决的问题很具体:Agent 回答「现在网上怎么说」时,不要自己编一个链接,也不要只靠训练截止日之前的记忆。你选一家搜索服务(Ceramic.ai、Exa 或 Linkup),把问题交过去,拿回搜索结果。请求都经过 AI Gateway:网关是 Cloudflare 放在调用前面的一层,负责记日志和扣费。changelog 写费用按各家标价走,Cloudflare 不加价;你也可以把那一家的密钥存在网关上自己付。用法有两条:任何后端发 REST 请求,或者在 Cloudflare Worker 里调用 env.AI.websearch。它和本库已经收录的 Clef 不是同一个产品——Clef 是一个给选项打分的决策模型,这个接口是去搜网页。 This is a search API Cloudflare added to the changelog on 2026-10-02. It is marked beta. The job is specific: when an agent answers “what does the web say right now,” it should not invent a link or rely only on memory from before the training cutoff. You pick a search provider (Ceramic.ai, Exa, or Linkup), send the question, and get results back. Every request goes through AI Gateway, the layer Cloudflare puts in front of the call to keep logs and handle billing. The changelog says you pay each provider’s list price with no Cloudflare markup, or you store your own provider key on the gateway. There are two ways to call it: a REST request from any backend, or env.AI.websearch inside a Cloudflare Worker. It is not the Clef model already in this library. Clef scores allowed answers. This API searches the web.

为什么推荐Why we recommend it changelog 写明上线供应商为 Ceramic.ai、Exa、Linkup,三家都支持经 Cloudflare 的 Zero Data Retention(零数据保留:对方称请求做完后不留下你的搜索内容),并承诺遵守 Cloudflare 的 verified bot 抓取标准。用法文档写明:provider 只能是 ceramic、exa、linkup,不填则默认 ceramic;limit 为 1 到 10,默认 10;query 最长 1024 字符。Workers 是 env.AI.websearch({ gatewayId, query, provider, limit })。每个账号有一个名叫 default 的网关。收录理由:Agent 要搜现在的网页时,这是官方刚公开的接口。和本库已有的 Cloudflare Clef 决策模型不是同一件事。边界:beta;要账号、额度和 token;按各家标价扣费。本库未创建 token、未发出任何搜索请求。未改 models.json。 The changelog says the launch providers are Ceramic.ai, Exa, and Linkup, that all three support Zero Data Retention for requests made through Cloudflare (they say the search text is not kept after the request), and that they committed to Cloudflare’s verified-bot crawling standards. The how-to says provider must be ceramic, exa, or linkup, and defaults to ceramic; limit is 1 to 10, default 10; query max length is 1024 characters. The token needs Account → Workers AI → Read and Account → AI Gateway → Read. Workers is env.AI.websearch({ gatewayId, query, provider, limit }). Every account has a gateway named default. Why: an official, just-published way for an agent to search the live web. It is not the same product as Cloudflare Clef, the decision model already in this library. Boundary: beta; needs an account, credits, and a token; billed at each provider’s list price. This library did not create a token and did not send a search. Unrated. models.json was not edited.

核验记录:来源、抓取与截图说明Verification log: sources, checks, and captures

主源是 Cloudflare changelog https://developers.cloudflare.com/changelog/post/2026-10-02-introducing-web-search-api/(页内日期 October 2, 2026,撰写时 HTTP 200)与用法文档 https://developers.cloudflare.com/web-search/how-to-use/(HTTP 200;页内 Last updated Oct 2, 2026,markdown 的 dateModified 为 2026-10-02)。HN item 49963171(标题 Web Search API,作者 tosh,2026-10-05T10:47:06.000Z / 约 2026-10-05 18:47 CST,链接指向上述 changelog)。撰写时该帖仍在 HN 首页 HTML 中;撰写时 HN 页面 score 为 65pts,Algolia 为 61pts(两边不一致,都写上,不并成一个数)。REST 是 POST https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/websearch/ ,token 需要 Account → Workers AI → Read 和 Account → AI Gateway → Read。Cases 没有 relatedModelIds 字段,所以在来源和试步骤里链到已上线的 /models/clef/(撰写时该页 HTTP 200)和 Clef 官博。预览为 Playwright 实拍 changelog 首屏裁 3:2 WebP。不打星。Primary sources are the Cloudflare changelog https://developers.cloudflare.com/changelog/post/2026-10-02-introducing-web-search-api/ (on-page date October 2, 2026, HTTP 200 at write time) and the how-to https://developers.cloudflare.com/web-search/how-to-use/ (HTTP 200; on-page Last updated Oct 2, 2026, markdown dateModified 2026-10-02). HN item 49963171 (title Web Search API, author tosh, 2026-10-05T10:47:06.000Z / about 18:47 CST on 2026-10-05, URL is that changelog). The thread was still in the HN front-page HTML at write time. The HN page score was 65pts and Algolia was 61pts (the counters disagreed, so both numbers are written). REST is POST https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/websearch/ . Cases have no relatedModelIds field, so the sources and the try-steps link the live /models/clef/ page (HTTP 200 at write time) and the Clef blog. Preview is a Playwright capture of the changelog above the fold, cropped to 3:2 WebP.

对照Contrast

左列是 changelog 和用法文档写明的事实。右列是本站口径:为什么单独收一条,以及不要和 Clef 或「已经替你调通」搞混。 Left: what the changelog and the how-to state. Right: this library’s framing — why this is its own entry, and why it is not Clef or a call we already made.

Web Search API Web Search API 对照本站口径 This library’s framing

是什么 What it is

Web Search API Web Search API

给 Agent 用的网页搜索接口。beta。三家供应商:Ceramic.ai、Exa、Linkup。 A web search API for agents. Beta. Three providers: Ceramic.ai, Exa, Linkup.

对照本站口径 This library’s framing

Cases 工具笔记。补的是「搜现在的网页」,不是又一个聊天模型卡。 An AI tool tip in Cases. It fills “search the live web,” not another chat-model card.

钱和日志 Money and logs

Web Search API Web Search API

走 AI Gateway。按各家标价扣额度,Cloudflare 称不加价。也可以自带密钥。请求出现在网关日志里。 Runs through AI Gateway. Billed at each provider’s list price; Cloudflare says no markup. Bring-your-own key is supported. Requests show in the gateway logs.

对照本站口径 This library’s framing

会花钱。本库没有账号、没有 token、没有打过这个接口,也不知道你的网关里还剩多少额度。 It can spend money. This library has no account, no token, and did not call the API. It does not know your remaining credits.

和 Clef 的关系 Relation to Clef

Web Search API Web Search API

同一家公司的另一件产品。Clef 是决策模型;这个接口是搜索。 Another product from the same company. Clef is a decision model; this API is search.

对照本站口径 This library’s framing

本库模型页已有 Clef。Cases 不能写 relatedModelIds,所以在来源和下面的步骤里放上那张卡的链接。 Clef is already on this library’s model page. Cases cannot store a relatedModelIds field, so the card is linked from the sources and from the step below.

怎么试Try it

  1. 先读更新日志和讨论 Read the changelog and the thread first

    changelog 日期是 October 2, 2026,标题 Introducing Web Search API。HN 讨论是 item 49963171。点数涨得快,以你打开当天为准。 The changelog is dated October 2, 2026, titled Introducing Web Search API. The HN thread is item 49963171. Points move quickly — use the count on the day you open it.

  2. 按文档看怎么调用,先别贴真密钥 Read the how-to before you paste a real key

    用法文档写两条路。REST:向 /accounts/{账号}/ai/websearch/ 发 POST,正文里有 query、provider(ceramic、exa 或 linkup)、limit,以及 options.gateway.id。Workers:env.AI.websearch({ gatewayId, query, provider, limit })。token 需要 Workers AI 的 Read 和 AI Gateway 的 Read。文档写 query 最长 1024 字,limit 为 1 到 10。本库没有发过请求。 The how-to shows two paths. REST: POST /accounts/{account}/ai/websearch/ with query, provider (ceramic, exa, or linkup), limit, and options.gateway.id. Workers: env.AI.websearch({ gatewayId, query, provider, limit }). The token needs Workers AI Read and AI Gateway Read. The docs say query maxes at 1024 characters and limit is 1 to 10. This library did not send a request.

  3. 不要和 Clef 决策模型搞混 Do not mix it up with the Clef decision model

    如果你是从本库的 Cloudflare 条目点过来的:Clef / Clef-Flash 是开源决策模型,回答是概率而不是网页链接。Web Search API 是搜网页。两张卡都留着,各管一件事。 If you arrived from this library’s Cloudflare entries: Clef / Clef-Flash are open-weight decision models. They return probabilities, not web links. Web Search API searches the web. Both cards stay, and each covers one job.

边界Boundaries

  • beta。文档和字段以后可能改。本库未创建 token,也未发出任何搜索请求。 Beta. The docs and fields may change. This library did not create a token and did not send a search request.
  • 需要 Cloudflare 账号。REST 的 token 要有 Workers AI Read 和 AI Gateway Read。额度不够或没配自带密钥时,调用会失败或扣费——以你账号里的实际账单为准。 Needs a Cloudflare account. The REST token needs Workers AI Read and AI Gateway Read. If credits are empty or your own key is missing, the call fails or spends money — your account’s bill is the source of truth.
  • 「不加价」和「零数据保留」是 Cloudflare 与供应商的说法。本库没有审计账单,也没有审计他们是否真的不留数据。 “No markup” and “zero data retention” are claims from Cloudflare and the providers. This library did not audit a bill or whether the search text is actually discarded.
  • 不是 Clef,也不是 Grok Bot 里的一个现成技能。接进自己的 Agent 之前,先在文档里的示例上自己试一次。 This is not Clef, and it is not a ready-made skill inside Grok Bot. Try the sample in the docs yourself before you wire it into an agent.

相关案例Related cases