Configure public endpoints to expose your AI Search instance directly to users without requiring authentication. This enables you to share your AI Search functionality with external users, or to integrate it into public-facing applications.
You can enable a public endpoint on a single instance or on a whole namespace, which searches across several instances and merges the results. Everything on this page applies to both. For what is specific to namespaces, such as choosing which instances the endpoint can reach, refer to Namespace public endpoints.
An instance or a namespace can expose three public endpoints:
| Endpoint | Description |
|---|---|
/mcp |
Model Context Protocol endpoint for AI agents |
/chat/completions |
OpenAI-compatible chat completion endpoint |
/search |
Search endpoint that returns relevant chunks |
For details on how to use these endpoints, refer to Public endpoint usage.
Cloudflare generates the hostname when you enable the endpoint. It is not the instance or namespace name.
| Hostname | Serves |
|---|---|
<PUBLIC_ENDPOINT_ID>.search.ai.cloudflare.com |
A single instance. |
ns-<NAMESPACE_ENDPOINT_ID>.search.ai.cloudflare.com |
A namespace, searching across several instances. |
For example:
https://abc123.search.ai.cloudflare.com/searchhttps://ns-abc123.search.ai.cloudflare.com/search
The identifier is generated the first time you enable the endpoint and is never rotated. Disabling the endpoint keeps the identifier, so re-enabling it reuses the same URL.
You can also serve the same endpoints from a hostname that you own, such as https://search.example.com/search. Refer to Custom domains.
You can enable or disable each public endpoint independently:
- Log in to your Cloudflare account, and go to AI Search. Go to AI Search ↗
- Select your AI Search instance or namespace.
- Go to Settings > Public Endpoints.
- Toggle on Public Endpoints to enable the feature, then toggle each individual endpoint on or off as needed.
Each endpoint has its own configuration panel for granular control.
To enable a namespace endpoint through the API, refer to Namespace public endpoints.
Configure rate limits to control usage across all public endpoints:
| Setting | Description | Default |
|---|---|---|
| Requests per period | Maximum number of requests allowed | 120 |
| Time period | Time window for the rate limit | 1 minute |
| Period type | Rate limiting technique: fixed or sliding |
fixed |
Rate limits apply across all enabled public endpoints for the AI Search instance.
Cross-Origin Resource Sharing (CORS) is enabled by default to support browser-based applications.
The default allowed origins depend on your data source type:
- Website data sources: The source domain is automatically added as an allowed origin.
- Other data sources: All origins (
*) are allowed by default.
You can customize allowed origins in the Public Endpoints settings by adding specific hostnames to Authorized hosts.
The Tool Description field allows you to customize how your AI Search instance is described to MCP clients. The default description is Finds exactly what you're looking for. This description helps AI agents understand what content is available, and when to use your search tool. A good tool description should explain what type of content is indexed, and what kinds of questions it can answer.
For example:
Search the Acme product documentation for information about
installation, configuration, API references, and troubleshooting
guides. Use this tool when users ask questions about how to set up
or use Acme products.A public endpoint does not require authentication. Anyone who knows the URL can query your indexed content.
To restrict who can query the endpoint, add a custom domain and protect it with Cloudflare Access. Users then authenticate with your identity provider before any request reaches AI Search.
If you keep the endpoint open:
- Only index content that is safe to expose publicly.
- Set a rate limit to limit abuse.
- Disable the endpoints you do not use, such as
/mcp. - Monitor usage through your dashboard analytics.