On October 2, Cloudflare put a Web Search API in beta. It hit 540+ points on Hacker News within a day. Most takes are either "Cloudflare eats another layer" or "Cloudflare is a hypocrite about crawling". Both miss what you actually care about: should you wire this into your agent?
Short answer: probably yes for prototypes, and read the fine print before you ship a product on it.
What it actually is
It's not a Cloudflare search index. It's a router. Three providers at launch:
- Ceramic.ai
- Exa
- Linkup
Requests go through AI Gateway, so they show up in your gateway logs. Billing uses AI Gateway credits at each provider's standard price, no Cloudflare markup per the changelog. You can also bring your own provider keys. All three providers support Zero Data Retention for Cloudflare requests.
The pitch: one auth, one billing surface, one log stream, swappable providers. For anyone who has juggled three search API keys in an agent, that's real.
The code
REST:
curl -X POST \
"https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/websearch/" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "What are some fun things to do in Salt Lake City as fall approaches?",
"provider": "ceramic",
"limit": 5,
"options": { "gateway": { "id": "default" } }
}'
From a Worker, it's a binding call:
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();
That's it. Switching providers is changing one string. That's the whole product, and it's a good one.
A practical pattern: provider fallback
Since the provider is a parameter, you can route by cost and quality without touching your agent logic:
async function search(env: Env, query: string) {
const order = ["ceramic", "exa", "linkup"] as const;
for (const provider of order) {
try {
const res = await env.AI.websearch({
gatewayId: "default",
query,
provider,
limit: 5,
});
const data = await res.json();
if (data) return { provider, data };
} catch (e) {
console.warn(`${provider} failed`, e);
}
}
throw new Error("all search providers failed");
}
Cheap provider first, better provider as fallback. Check your gateway logs afterward to see which one actually carried the load.
The numbers (with a caveat)
The changelog says it's beta and gives no pricing tiers, rate limits or regional availability. So the numbers below are from the HN thread, not from Cloudflare. Verify before budgeting:
| Provider | Price per 1,000 requests (HN commenters) |
|---|---|
| Ceramic.ai | ~$0.25, cheapest, with quality concerns raised |
| Exa | ~$7.00 |
For context, other 2026 roundups put Brave's API around $5 per 1,000 and Exa in the $5 to $15 range depending on what you pull. The spread between Ceramic and Exa is ~28x. If your agent fires ten searches per task, picking the wrong default is a real line item.
The catch nobody puts in the demo
The most useful comment in the thread came from Simon Willison: storing search results for something like a "share transcript" button violates most providers' terms. Zero Data Retention is great for privacy and bad for product features. If you need to persist, cache, or display results later, check the provider's terms first. Another commenter noted Exa effectively charges for the "feature" of not storing your data, while Brave's API was praised for allowing storage at a premium.
So the real decision isn't "Cloudflare vs. the rest". It's:
- Do I need to store results? If yes, ZDR providers may block you. Go direct to a provider whose terms allow it.
- Do I need a spend cap? One commenter used AI Gateway to give an agent instance a limited budget. That's a legitimately good use.
- Do I trust the platform concentration? Commenters raised surveillance and antitrust angles, and the "Cloudflare blocks bots while running its own crawling" irony. That's opinion, not proof, but it's the fight you'll see in every thread.
My take
Use it if you're already on Workers or AI Gateway and want search in an agent by lunch. Observability and budget limits come free, and swapping providers costs one string.
Don't use it as your only integration if your product stores or republishes results, and don't assume pricing until Cloudflare publishes it. It's a beta with no published limits.
The interesting part isn't search. It's that AI Gateway is becoming the control plane for agent tool calls: models, now search, and probably more soon. Build your agent so the provider is a config value, and you win whichever way this goes.
Sources: Cloudflare changelog, Hacker News discussion.
Top comments (0)