---
title: New AI Search REST API endpoints for /search and /chat/completions
description: AI Search introduces new OpenAI-compatible API endpoints.
image: https://edgetunnel-b2h.pages.dev/changelog-preview.png
---

> Documentation Index  
> Fetch the complete documentation index at: https://edgetunnel-b2h.pages.dev/changelog/llms.txt  
> Use this file to discover all available pages before exploring further. 

[Skip to content](#%5Ftop) 

# Changelog

New updates and improvements at Cloudflare.

[ Subscribe to RSS ](https://edgetunnel-b2h.pages.dev/changelog/rss/index.xml) [ View RSS feeds ](https://edgetunnel-b2h.pages.dev/fundamentals/new-features/available-rss-feeds/) 

![hero image](https://edgetunnel-b2h.pages.dev/_astro/hero.CVYJHPAd_26AMqX.svg) 

[ ← Back to all posts ](https://edgetunnel-b2h.pages.dev/changelog/) 

## New AI Search REST API endpoints for /search and /chat/completions

Mar 23, 2026 

[ AI Search ](https://edgetunnel-b2h.pages.dev/ai-search/) 

[AI Search](https://edgetunnel-b2h.pages.dev/ai-search/) now offers new [REST API](https://edgetunnel-b2h.pages.dev/ai-search/api/search/rest-api/) endpoints for search and chat that use an OpenAI compatible format. This means you can use the familiar `messages` array structure that works with existing OpenAI SDKs and tools. The messages array also lets you pass previous messages within a session, so the model can maintain context across multiple turns.

| Endpoint         | Path                                                                     |
| ---------------- | ------------------------------------------------------------------------ |
| Chat Completions | POST /accounts/{account\_id}/ai-search/instances/{name}/chat/completions |
| Search           | POST /accounts/{account\_id}/ai-search/instances/{name}/search           |

Here is an example request to the Chat Completions endpoint using the new `messages` array format:

```bash
curl https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai-search/instances/{NAME}/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -d '{
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful documentation assistant."
      },
      {
        "role": "user",
        "content": "How do I get started?"
      }
    ]
  }'
```

For more details, refer to the [AI Search REST API guide](https://edgetunnel-b2h.pages.dev/ai-search/api/search/rest-api/).

#### Migration from existing AutoRAG API (recommended)

If you are using the previous AutoRAG API endpoints (`/autorag/rags/`), we recommend migrating to the new endpoints. The previous AutoRAG API endpoints will continue to be fully supported.

Refer to the [migration guide](https://edgetunnel-b2h.pages.dev/ai-search/api/migration/rest-api/) for step-by-step instructions.

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://edgetunnel-b2h.pages.dev/changelog/post/2026-03-23-ai-search-new-rest-api/#page","headline":"New AI Search REST API endpoints for /search and /chat/completions · Changelog","description":"AI Search introduces new OpenAI-compatible API endpoints.","url":"https://edgetunnel-b2h.pages.dev/changelog/post/2026-03-23-ai-search-new-rest-api/","inLanguage":"en","image":"https://edgetunnel-b2h.pages.dev/changelog-preview.png","dateModified":"2026-03-23","datePublished":"2026-03-23","publisher":{"@type":"Organization","name":"Cloudflare","url":"https://www.cloudflare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://edgetunnel-b2h.pages.dev/#website","name":"Cloudflare Docs","url":"https://edgetunnel-b2h.pages.dev/"}}
```
