Skip to content
Start here

List AI Search instances.

client.aiSearch.namespaces.instances.list(stringname, InstanceListParams { account_id, namespace, order_by, 4 more } params, RequestOptionsoptions?): V4PagePaginationArray<InstanceListResponse { id, ai_gateway_id, ai_search_model, 42 more } >
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances

List all AI Search instances in the account.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
name: string
params: InstanceListParams { account_id, namespace, order_by, 4 more }
account_id: string

Path param

namespace?: string

Query param: Filter by namespace.

order_by?: "created_at"

Query param: Field to order results by.

order_by_direction?: "asc" | "desc"

Query param: Order direction.

One of the following:
"asc"
"desc"
page?: number

Query param: Page number (1-indexed).

minimum1
per_page?: number

Query param: Number of results per page.

maximum100
minimum1
ReturnsExpand Collapse
InstanceListResponse { id, ai_gateway_id, ai_search_model, 42 more }
id: string
ai_gateway_id: string | null
ai_search_model: string | null
cache: boolean
cache_threshold: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes" | null
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl: 600 | 1800 | 3600 | 7 more
One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk: boolean
chunk_overlap: number | null
chunk_size: number | null
created_at: string
formatdate-time
created_by: string | null
custom_metadata: Array<CustomMetadata> | null
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
embedding_model: string | null
enable: boolean
engine_version: number
fusion_method: "max" | "rrf"
One of the following:
"max"
"rrf"
hybrid_search_enabled: boolean
index_method: IndexMethod { keyword, vector }
keyword: boolean
vector: boolean
indexing_options: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"
One of the following:
"porter"
"trigram"
last_activity: string | null
formatdate-time
max_num_results: number | null
metadata: Metadata | null
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_at: string
formatdate-time
modified_by: string | null
namespace: string
paused: boolean
public_endpoint_id: string | null
public_endpoint_params: PublicEndpointParams | null
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean
custom_domains?: Array<string> | null
default_domain_enabled?: boolean
enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean
rate_limit?: RateLimit { period_ms, requests, technique }
period_ms?: number
maximum3600000
minimum60000
requests?: number
minimum1
technique?: "fixed" | "sliding"
One of the following:
"fixed"
"sliding"
search_endpoint?: SearchEndpoint { disabled }
disabled?: boolean
reranking: boolean
reranking_model: string | null
retrieval_options: RetrievalOptions | null
boost_by?: Array<BoostBy>
field: string
maxLength64
minLength1
dataType?: "number" | "datetime" | "text" | "boolean"
One of the following:
"number"
"datetime"
"text"
"boolean"
direction?: "asc" | "desc" | "exists" | "not_exists"
One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"
One of the following:
"and"
"or"
rewrite_model: string | null
rewrite_query: boolean
score_threshold: number | null
source: string | null
source_params: SourceParams | null
exclude_items?: Array<string>
include_items?: Array<string>
prefix?: string
r2_jurisdiction?: string
web_crawler?: WebCrawler { discover_options, parse_options, parse_type }
discover_options?: DiscoverOptions { depth, include_external_links, include_subdomains, 3 more }
depth?: number
maximum100000
minimum1
include_subdomains?: boolean
limit?: number

Maximum number of pages to crawl. New values are capped at 100000; instances configured before that cap may report a higher stored value, which the crawler clamps at run time.

maximum100000
minimum1
max_age?: number
maximum604800
minimum0
source?: "all" | "sitemaps" | "links"
One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>
path: string
maxLength200
minLength1
selector: string
maxLength200
minLength1
include_headers?: Record<string, string>
include_images?: boolean
specific_sitemaps?: Array<string>
use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"
One of the following:
"sitemap"
"discover"
status: string
summarization: boolean
summarization_model: string | null
sync_interval: 900 | 1800 | 3600 | 5 more
One of the following:
900
1800
3600
7200
14400
21600
43200
86400
system_prompt_index_summarization: string | null
system_prompt_rewrite_query: string | null
token_id: string | null
type: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"

List AI Search instances.

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const instanceListResponse of client.aiSearch.namespaces.instances.list('my-namespace', {
  account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22',
})) {
  console.log(instanceListResponse.id);
}
{
  "result": [
    {
      "id": "id",
      "ai_gateway_id": "ai_gateway_id",
      "ai_search_model": "ai_search_model",
      "cache": true,
      "cache_threshold": "super_strict_match",
      "cache_ttl": 600,
      "chunk": true,
      "chunk_overlap": 0,
      "chunk_size": 0,
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": "created_by",
      "custom_metadata": [
        {
          "data_type": "text",
          "field_name": "field_name"
        }
      ],
      "embedding_model": "embedding_model",
      "enable": true,
      "engine_version": 0,
      "fusion_method": "max",
      "hybrid_search_enabled": true,
      "index_method": {
        "keyword": true,
        "vector": true
      },
      "indexing_options": {
        "keyword_tokenizer": "porter"
      },
      "last_activity": "2019-12-27T18:11:19.117Z",
      "max_num_results": 0,
      "metadata": {
        "created_from_aisearch_wizard": true,
        "worker_domain": "worker_domain"
      },
      "modified_at": "2019-12-27T18:11:19.117Z",
      "modified_by": "modified_by",
      "namespace": "namespace",
      "paused": true,
      "public_endpoint_id": "public_endpoint_id",
      "public_endpoint_params": {
        "authorized_hosts": [
          "string"
        ],
        "chat_completions_endpoint": {
          "disabled": true
        },
        "custom_domains": [
          "x"
        ],
        "default_domain_enabled": true,
        "enabled": true,
        "mcp": {
          "description": "description",
          "disabled": true
        },
        "rate_limit": {
          "period_ms": 60000,
          "requests": 1,
          "technique": "fixed"
        },
        "search_endpoint": {
          "disabled": true
        }
      },
      "reranking": true,
      "reranking_model": "reranking_model",
      "retrieval_options": {
        "boost_by": [
          {
            "field": "x",
            "dataType": "number",
            "direction": "asc"
          }
        ],
        "keyword_match_mode": "and"
      },
      "rewrite_model": "rewrite_model",
      "rewrite_query": true,
      "score_threshold": 0,
      "source": "source",
      "source_params": {
        "exclude_items": [
          "string"
        ],
        "include_items": [
          "string"
        ],
        "prefix": "prefix",
        "r2_jurisdiction": "r2_jurisdiction",
        "web_crawler": {
          "discover_options": {
            "depth": 1,
            "include_external_links": true,
            "include_subdomains": true,
            "limit": 1,
            "max_age": 0,
            "source": "all"
          },
          "parse_options": {
            "content_selector": [
              {
                "path": "x",
                "selector": "x"
              }
            ],
            "include_headers": {
              "foo": "string"
            },
            "include_images": true,
            "specific_sitemaps": [
              "https://example.com"
            ],
            "use_browser_rendering": true
          },
          "parse_type": "sitemap"
        }
      },
      "status": "status",
      "summarization": true,
      "summarization_model": "summarization_model",
      "sync_interval": 900,
      "system_prompt_ai_search": "system_prompt_ai_search",
      "system_prompt_index_summarization": "system_prompt_index_summarization",
      "system_prompt_rewrite_query": "system_prompt_rewrite_query",
      "token_id": "token_id",
      "type": "r2"
    }
  ],
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}
Returns Examples
{
  "result": [
    {
      "id": "id",
      "ai_gateway_id": "ai_gateway_id",
      "ai_search_model": "ai_search_model",
      "cache": true,
      "cache_threshold": "super_strict_match",
      "cache_ttl": 600,
      "chunk": true,
      "chunk_overlap": 0,
      "chunk_size": 0,
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": "created_by",
      "custom_metadata": [
        {
          "data_type": "text",
          "field_name": "field_name"
        }
      ],
      "embedding_model": "embedding_model",
      "enable": true,
      "engine_version": 0,
      "fusion_method": "max",
      "hybrid_search_enabled": true,
      "index_method": {
        "keyword": true,
        "vector": true
      },
      "indexing_options": {
        "keyword_tokenizer": "porter"
      },
      "last_activity": "2019-12-27T18:11:19.117Z",
      "max_num_results": 0,
      "metadata": {
        "created_from_aisearch_wizard": true,
        "worker_domain": "worker_domain"
      },
      "modified_at": "2019-12-27T18:11:19.117Z",
      "modified_by": "modified_by",
      "namespace": "namespace",
      "paused": true,
      "public_endpoint_id": "public_endpoint_id",
      "public_endpoint_params": {
        "authorized_hosts": [
          "string"
        ],
        "chat_completions_endpoint": {
          "disabled": true
        },
        "custom_domains": [
          "x"
        ],
        "default_domain_enabled": true,
        "enabled": true,
        "mcp": {
          "description": "description",
          "disabled": true
        },
        "rate_limit": {
          "period_ms": 60000,
          "requests": 1,
          "technique": "fixed"
        },
        "search_endpoint": {
          "disabled": true
        }
      },
      "reranking": true,
      "reranking_model": "reranking_model",
      "retrieval_options": {
        "boost_by": [
          {
            "field": "x",
            "dataType": "number",
            "direction": "asc"
          }
        ],
        "keyword_match_mode": "and"
      },
      "rewrite_model": "rewrite_model",
      "rewrite_query": true,
      "score_threshold": 0,
      "source": "source",
      "source_params": {
        "exclude_items": [
          "string"
        ],
        "include_items": [
          "string"
        ],
        "prefix": "prefix",
        "r2_jurisdiction": "r2_jurisdiction",
        "web_crawler": {
          "discover_options": {
            "depth": 1,
            "include_external_links": true,
            "include_subdomains": true,
            "limit": 1,
            "max_age": 0,
            "source": "all"
          },
          "parse_options": {
            "content_selector": [
              {
                "path": "x",
                "selector": "x"
              }
            ],
            "include_headers": {
              "foo": "string"
            },
            "include_images": true,
            "specific_sitemaps": [
              "https://example.com"
            ],
            "use_browser_rendering": true
          },
          "parse_type": "sitemap"
        }
      },
      "status": "status",
      "summarization": true,
      "summarization_model": "summarization_model",
      "sync_interval": 900,
      "system_prompt_ai_search": "system_prompt_ai_search",
      "system_prompt_index_summarization": "system_prompt_index_summarization",
      "system_prompt_rewrite_query": "system_prompt_rewrite_query",
      "token_id": "token_id",
      "type": "r2"
    }
  ],
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}