AI & Services

How to Use the Cloudflare Web Search API: Providers, Pricing, and Workers Integration.

Cloudflare Web Search API search providers and pricing, BYOK setup, and REST and Workers call paths, plus the difference between search provider ZDR and AI Gateway logs.

· Huuush

How to Use the Cloudflare Web Search API: Providers, Pricing, and Workers Integration

Key takeaways

  1. 1The Cloudflare Web Search API is a public beta that calls Ceramic.ai, Exa, and Linkup from a REST API or the Workers AI binding.
  2. 2Ceramic.ai is the default if you omit the provider, and you can handle costs with Cloudflare credits or BYOK.
  3. 3Search-provider ZDR and AI Gateway's own logs are separate; Gateway logging is on by default but can be turned off, and the retention system depends on when it was created.
A development workspace where several search sources come together on an abstract search screen on a laptop

For an AI agent to find current web information, you need steps to wire up search yourself, read the results, and bring them into the answer. What if, instead of attaching a search provider and call path separately in each project, you used the Cloudflare Web Search API? This public beta lets you use Ceramic.ai, Exa, and Linkup search through AI Gateway, from the REST API or Workers.

The point isn't only choosing a search engine. You also have to decide which path to call it through, whether the provider bills you directly or you use Cloudflare credits, and how a search provider's data retention differs from AI Gateway's request logs.

Loading X post.

Unable to load the X post. Please try again.

Source: X @Cloudflare

Two call paths: the REST API and the Workers binding

The Web Search API is available in public beta and returns search results as a title, URL, and description. A typical application can call the per-account REST endpoint POST /accounts/{account_id}/ai/websearch/. In Cloudflare Workers, you use env.AI.websearch() on the Workers AI binding. When you call it from a Worker you also need the AI binding and settings such as a gateway ID, so it isn't a setup where you just add one line of function code.

If you don't specify a provider, the default is Ceramic.ai. You can choose Exa or Linkup as needed, and the Cloudflare docs show all three providers as supporting Zero Data Retention (ZDR). ZDR here refers to the retention conditions on the search provider's side.

Provider pricing and the BYOK option

When you call with Cloudflare credits, you are billed at the provider's public API price with no added markup. In the provider table checked on October 6, 2026, Ceramic.ai is $0.25 per 1,000 requests, Exa is $7, and Linkup is $5. Provider prices can change, so check the current amounts in the Cloudflare Web Search providers docs before you use it.

You can also use BYOK (bring your own key) with your own provider key. Register the key in AI Gateway and specify an alias, and the request uses the stored credential instead of carrying the key. In this case, the search provider bills your account directly. If you specify an alias but no key is set, it doesn't automatically switch to Cloudflare credits and returns an error. If you omit the alias, it uses the default key if there is one, and otherwise calls with gateway credits.

You can check the setup order and REST and Workers examples in the Web Search API usage guide. For another example from Cloudflare's AI platform, the post on the Clef and Clef-Flash decision models is also worth reading.

ZDR and AI Gateway logs are separate settings

The ZDR labels on the three search providers and Cloudflare AI Gateway's log retention don't mean the same thing. Gateway logging is on by default but can be turned off, and you can also adjust collection with per-request headers. Logs can include the prompt and response, provider, time, status, usage, cost, processing time, user agent, and more.

Retention also differs depending on when the gateway was created. A gateway first created after September 24, 2026 follows the Workers Logs pricing and retention system, and a gateway created before that uses the Legacy Logs system. So you shouldn't read a search provider's ZDR status as meaning Gateway logs aren't kept either. You can check log fields and settings in the AI Gateway Logging docs.

Connecting search to your existing AI flow

The Cloudflare Web Search API fetches search results through the account REST endpoint or the Workers binding and manages providers and calls in AI Gateway. You can start with the default Ceramic.ai or choose Exa or Linkup, and pick between gateway credits and BYOK for billing to suit how you operate.

Decide the call path and provider first, then check provider pricing, key setup, and gateway log collection one by one, and the setup becomes clear. In particular, look at your data flow with this in mind: ZDR is a policy on the search provider's side, and Gateway logs are a separate setting. You can start from the official Cloudflare Web Search API overview.

Frequently asked questions

What does the Cloudflare Web Search API do?
It is a public beta search API that returns web search results as a title, URL, and description. You can call it from a REST API or the Workers AI binding.
Which search providers can I use?
You can choose Ceramic.ai, Exa, or Linkup. If you don't specify a provider, Ceramic.ai is the default.
If a provider is ZDR, aren't AI Gateway logs stored either?
No. ZDR is a data retention condition on the search provider's side. AI Gateway logs are a separate setting, on by default but possible to turn off, and the retention system differs depending on when the gateway was created.
Who bills me if I use BYOK?
If you register a provider key in the Gateway and call it by alias, that search provider bills the customer directly. Using Cloudflare credits is billed at each provider's public API price.

Related articles