---
title: Create AI Search instances programmatically via REST API
description: Create AI Search instances programmatically using the REST API.
image: https://developers.cloudflare.com/changelog-preview.png
---

[Skip to content](#%5Ftop) 

# Changelog

New updates and improvements at Cloudflare.

[ Subscribe to RSS ](https://developers.cloudflare.com/changelog/rss/index.xml) [ View RSS feeds ](https://developers.cloudflare.com/fundamentals/new-features/available-rss-feeds/) 

![hero image](https://developers.cloudflare.com/_astro/hero.CVYJHPAd_26AMqX.svg) 

[ ← Back to all posts ](https://developers.cloudflare.com/changelog/) 

## Create AI Search instances programmatically via REST API

Jan 20, 2026 

[ AI Search ](https://developers.cloudflare.com/ai-search/) 

You can now create [AI Search](https://developers.cloudflare.com/ai-search/) instances programmatically using the [API](https://developers.cloudflare.com/ai-search/get-started/api/). For example, use the API to create instances for each customer in a multi-tenant application or manage AI Search alongside your other infrastructure.

If you have created an AI Search instance via the [dashboard](https://developers.cloudflare.com/ai-search/get-started/dashboard/) before, you already have a [service API token](https://developers.cloudflare.com/ai-search/configuration/indexing/service-api-token/) registered and can start creating instances programmatically right away. If not, follow the [API guide](https://developers.cloudflare.com/ai-search/get-started/api/) to set up your first instance.

For example, you can now create separate search instances for each language on your website:

Terminal window

```

for lang in en fr es de; do

  curl -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/ai-search/instances" \

    -H "Authorization: Bearer $API_TOKEN" \

    -H "Content-Type: application/json" \

    --data '{

      "id": "docs-'"$lang"'",

      "type": "web-crawler",

      "source": "example.com",

      "source_params": {

        "path_include": ["**/'"$lang"'/**"]

      }

    }'

done


```

Explain Code

Refer to the [REST API reference](https://developers.cloudflare.com/api/resources/ai%5Fsearch/subresources/instances/methods/create/) for additional configuration options.