它是什么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.