Skip to content
Start here

AI Search

AI SearchNamespaces

List namespaces
client.aiSearch.namespaces.list(NamespaceListParams { account_id, page, per_page, search } params, RequestOptionsoptions?): V4PagePaginationArray<NamespaceListResponse { created_at, name, description, 2 more } >
GET/accounts/{account_id}/ai-search/namespaces
Create a namespace
client.aiSearch.namespaces.create(NamespaceCreateParams { account_id, name, description, public_endpoint_params } params, RequestOptionsoptions?): NamespaceCreateResponse { created_at, name, description, 2 more }
POST/accounts/{account_id}/ai-search/namespaces
Get a namespace
client.aiSearch.namespaces.read(stringname, NamespaceReadParams { account_id } params, RequestOptionsoptions?): NamespaceReadResponse { created_at, name, description, 2 more }
GET/accounts/{account_id}/ai-search/namespaces/{name}
Update a namespace
client.aiSearch.namespaces.update(stringname, NamespaceUpdateParams { account_id, description, public_endpoint_params } params, RequestOptionsoptions?): NamespaceUpdateResponse { created_at, name, description, 2 more }
PUT/accounts/{account_id}/ai-search/namespaces/{name}
Delete a namespace
client.aiSearch.namespaces.delete(stringname, NamespaceDeleteParams { account_id } params, RequestOptionsoptions?): NamespaceDeleteResponse
DELETE/accounts/{account_id}/ai-search/namespaces/{name}
Multi-Instance Search
client.aiSearch.namespaces.search(stringname, NamespaceSearchParams { account_id, ai_search_options, messages, query } params, RequestOptionsoptions?): NamespaceSearchResponse { chunks, query_kind, errors, search_query }
POST/accounts/{account_id}/ai-search/namespaces/{name}/search
Multi-Instance Chat Completions
client.aiSearch.namespaces.chatCompletions(stringname, NamespaceChatCompletionsParams { account_id, ai_search_options, messages, 2 more } params, RequestOptionsoptions?): NamespaceChatCompletionsResponse { choices, chunks, id, 3 more }
POST/accounts/{account_id}/ai-search/namespaces/{name}/chat/completions
ModelsExpand Collapse
NamespaceListResponse { created_at, name, description, 2 more }
created_at: string
formatdate-time
name: string
description?: string | null

Optional description for the namespace. Max 256 characters.

maxLength256
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams | null
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
instances_allowed?: Array<string>

Instance IDs exposed through the namespace public endpoint. Empty means nothing is searchable. Every ID must be an existing instance in this namespace, and the list cannot exceed the account’s multi-instance search limit.

mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

NamespaceCreateResponse { created_at, name, description, 2 more }
created_at: string
formatdate-time
name: string
description?: string | null

Optional description for the namespace. Max 256 characters.

maxLength256
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams | null
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
instances_allowed?: Array<string>

Instance IDs exposed through the namespace public endpoint. Empty means nothing is searchable. Every ID must be an existing instance in this namespace, and the list cannot exceed the account’s multi-instance search limit.

mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

NamespaceReadResponse { created_at, name, description, 2 more }
created_at: string
formatdate-time
name: string
description?: string | null

Optional description for the namespace. Max 256 characters.

maxLength256
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams | null
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
instances_allowed?: Array<string>

Instance IDs exposed through the namespace public endpoint. Empty means nothing is searchable. Every ID must be an existing instance in this namespace, and the list cannot exceed the account’s multi-instance search limit.

mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

NamespaceUpdateResponse { created_at, name, description, 2 more }
created_at: string
formatdate-time
name: string
description?: string | null

Optional description for the namespace. Max 256 characters.

maxLength256
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams | null
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
instances_allowed?: Array<string>

Instance IDs exposed through the namespace public endpoint. Empty means nothing is searchable. Every ID must be an existing instance in this namespace, and the list cannot exceed the account’s multi-instance search limit.

mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

NamespaceDeleteResponse = unknown
NamespaceSearchResponse { chunks, query_kind, errors, search_query }
chunks: Array<Chunk>
id: string
instance_id: string
score: number
maximum1
minimum0
text: string
type: string
item?: Item { key, metadata, timestamp }
key: string
metadata?: Record<string, unknown>
timestamp?: number
scoring_details?: ScoringDetails { fusion_method, keyword_rank, keyword_score, 3 more }
fusion_method?: "rrf" | "max"
One of the following:
"rrf"
"max"
keyword_rank?: number
keyword_score?: number
minimum0
reranking_score?: number
maximum1
minimum0
vector_rank?: number
vector_score?: number
maximum1
minimum0
query_kind: "text" | "image" | "multimodal"
One of the following:
"text"
"image"
"multimodal"
errors?: Array<Error>
instance_id: string
message: string
search_query?: string
NamespaceChatCompletionsResponse { choices, chunks, id, 3 more }
choices: Array<Choice>
message: Message { content, role }
content: string | Array<UnionMember0 { text, type } | UnionMember1 { image_url, type } | UnionMember2 { file, type } > | null
One of the following:
string
Array<UnionMember0 { text, type } | UnionMember1 { image_url, type } | UnionMember2 { file, type } >
UnionMember0 { text, type }
text: string
minLength1
type: "text"
UnionMember1 { image_url, type }
image_url: ImageURL { url }
url: string
maxLength20971520
minLength1
type: "image_url"
UnionMember2 { file, type }
file: File { filename, file_data, file_id }
filename: string
maxLength255
minLength1
file_data?: string
maxLength13981144
minLength1
file_id?: string
type: "file"
role: "system" | "developer" | "user" | 2 more
One of the following:
"system"
"developer"
"user"
"assistant"
"tool"
index?: number
chunks: Array<Chunk>
id: string
instance_id: string
score: number
maximum1
minimum0
text: string
type: string
item?: Item { key, metadata, timestamp }
key: string
metadata?: Record<string, unknown>
timestamp?: number
scoring_details?: ScoringDetails { fusion_method, keyword_rank, keyword_score, 3 more }
fusion_method?: "rrf" | "max"
One of the following:
"rrf"
"max"
keyword_rank?: number
keyword_score?: number
minimum0
reranking_score?: number
maximum1
minimum0
vector_rank?: number
vector_score?: number
maximum1
minimum0
id?: string
errors?: Array<Error>
instance_id: string
message: string
model?: string
object?: string

AI SearchNamespacesInstances

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
Create an AI Search instance.
client.aiSearch.namespaces.instances.create(stringname, InstanceCreateParams { account_id, id, ai_gateway_id, 27 more } params, RequestOptionsoptions?): InstanceCreateResponse { id, created_at, modified_at, 36 more }
POST/accounts/{account_id}/ai-search/namespaces/{name}/instances
Get an AI Search instance.
client.aiSearch.namespaces.instances.read(stringid, InstanceReadParams { account_id, name } params, RequestOptionsoptions?): InstanceReadResponse { id, created_at, modified_at, 36 more }
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}
Update an AI Search instance.
client.aiSearch.namespaces.instances.update(stringid, InstanceUpdateParams { account_id, name, ai_gateway_id, 31 more } params, RequestOptionsoptions?): InstanceUpdateResponse { id, created_at, modified_at, 36 more }
PUT/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}
Delete an AI Search instance.
client.aiSearch.namespaces.instances.delete(stringid, InstanceDeleteParams { account_id, name } params, RequestOptionsoptions?): InstanceDeleteResponse { id, created_at, modified_at, 36 more }
DELETE/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}
Get instance statistics.
client.aiSearch.namespaces.instances.stats(stringid, InstanceStatsParams { account_id, name } params, RequestOptionsoptions?): InstanceStatsResponse { completed, degraded, engine, 8 more }
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/stats
Search
client.aiSearch.namespaces.instances.search(stringid, InstanceSearchParams { account_id, name, ai_search_options, 2 more } params, RequestOptionsoptions?): InstanceSearchResponse { chunks, query_kind, search_query }
POST/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/search
Chat Completions
client.aiSearch.namespaces.instances.chatCompletions(stringid, InstanceChatCompletionsParams { account_id, name, messages, 3 more } params, RequestOptionsoptions?): InstanceChatCompletionsResponse { choices, chunks, id, 2 more }
POST/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/chat/completions
ModelsExpand 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"
InstanceCreateResponse { id, created_at, modified_at, 36 more }
id: string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
created_at: string
formatdate-time
modified_at: string
formatdate-time
ai_gateway_id?: string | null
ai_search_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
cache?: boolean
cache_threshold?: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes"
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl?: 600 | 1800 | 3600 | 7 more

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk_overlap?: number
maximum30
minimum0
chunk_size?: number
minimum64
created_by?: string | null
custom_metadata?: Array<CustomMetadata>
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
maxLength64
minLength1
embedding_model?: "@cf/qwen/qwen3-embedding-0.6b" | "@cf/qwen/qwen3-vl-embedding-2b" | "@cf/baai/bge-m3" | 8 more | null
One of the following:
"@cf/qwen/qwen3-embedding-0.6b"
"@cf/qwen/qwen3-vl-embedding-2b"
"@cf/baai/bge-m3"
"@cf/baai/bge-large-en-v1.5"
"@cf/google/embeddinggemma-300m"
"google-ai-studio/gemini-embedding-001"
"google-ai-studio/gemini-embedding-2-preview"
"google-ai-studio/gemini-embedding-2"
"openai/text-embedding-3-small"
"openai/text-embedding-3-large"
""
enable?: boolean
engine_version?: number
fusion_method?: "max" | "rrf"
One of the following:
"max"
"rrf"
Deprecatedhybrid_search_enabled?: boolean

Deprecated — use index_method instead.

index_method?: IndexMethod { keyword, vector }

Controls which storage backends are used during indexing. Defaults to vector-only.

keyword: boolean

Enable keyword (BM25) storage backend.

vector: boolean

Enable vector (embedding) storage backend.

indexing_options?: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
"porter"
"trigram"
last_activity?: string | null
formatdate-time
max_num_results?: number
maximum50
minimum1
metadata?: Metadata { created_from_aisearch_wizard, worker_domain }
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_by?: string | null
namespace?: string | null
paused?: boolean
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams { authorized_hosts, chat_completions_endpoint, custom_domains, 5 more }
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

reranking?: boolean
reranking_model?: "@cf/baai/bge-reranker-base" | "" | null
One of the following:
"@cf/baai/bge-reranker-base"
""
retrieval_options?: RetrievalOptions | null
boost_by?: Array<BoostBy>

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

field: string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
direction?: "asc" | "desc" | "exists" | "not_exists"

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
"and"
"or"
rewrite_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
rewrite_query?: boolean
score_threshold?: number
maximum1
minimum0
source?: string | null
source_params?: SourceParams | null
exclude_items?: Array<string>

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.

include_items?: Array<string>

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.

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 }

Options for parse_type ‘discover’, where Browser Run discovers URLs by link following and sitemaps. Ignored for ‘sitemap’.

depth?: number

Maximum link-follow depth from the seed URL.

maximum100000
minimum1
include_subdomains?: boolean

Follow links to subdomains of the source host.

limit?: number

Maximum number of pages to crawl (1-100000).

maximum100000
minimum1
max_age?: number

Maximum content age in seconds to accept (0–604800).

maximum604800
minimum0
source?: "all" | "sitemaps" | "links"

Where the crawler looks for URLs: ‘sitemaps’ reads sitemap XML only, ‘links’ follows page links only, ‘all’ does both.

One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

path: string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
selector: string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
include_headers?: Record<string, string>

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

include_images?: boolean
specific_sitemaps?: Array<string>

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"

How URLs are discovered. ‘sitemap’ reads XML sitemaps; ‘discover’ follows links recursively and requires the source to be a Verified zone on this account.

One of the following:
"sitemap"
"discover"
status?: string
sync_interval?: 900 | 1800 | 3600 | 5 more

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
900
1800
3600
7200
14400
21600
43200
86400
token_id?: string
formatuuid
type?: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"
InstanceReadResponse { id, created_at, modified_at, 36 more }
id: string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
created_at: string
formatdate-time
modified_at: string
formatdate-time
ai_gateway_id?: string | null
ai_search_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
cache?: boolean
cache_threshold?: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes"
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl?: 600 | 1800 | 3600 | 7 more

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk_overlap?: number
maximum30
minimum0
chunk_size?: number
minimum64
created_by?: string | null
custom_metadata?: Array<CustomMetadata>
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
maxLength64
minLength1
embedding_model?: "@cf/qwen/qwen3-embedding-0.6b" | "@cf/qwen/qwen3-vl-embedding-2b" | "@cf/baai/bge-m3" | 8 more | null
One of the following:
"@cf/qwen/qwen3-embedding-0.6b"
"@cf/qwen/qwen3-vl-embedding-2b"
"@cf/baai/bge-m3"
"@cf/baai/bge-large-en-v1.5"
"@cf/google/embeddinggemma-300m"
"google-ai-studio/gemini-embedding-001"
"google-ai-studio/gemini-embedding-2-preview"
"google-ai-studio/gemini-embedding-2"
"openai/text-embedding-3-small"
"openai/text-embedding-3-large"
""
enable?: boolean
engine_version?: number
fusion_method?: "max" | "rrf"
One of the following:
"max"
"rrf"
Deprecatedhybrid_search_enabled?: boolean

Deprecated — use index_method instead.

index_method?: IndexMethod { keyword, vector }

Controls which storage backends are used during indexing. Defaults to vector-only.

keyword: boolean

Enable keyword (BM25) storage backend.

vector: boolean

Enable vector (embedding) storage backend.

indexing_options?: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
"porter"
"trigram"
last_activity?: string | null
formatdate-time
max_num_results?: number
maximum50
minimum1
metadata?: Metadata { created_from_aisearch_wizard, worker_domain }
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_by?: string | null
namespace?: string | null
paused?: boolean
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams { authorized_hosts, chat_completions_endpoint, custom_domains, 5 more }
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

reranking?: boolean
reranking_model?: "@cf/baai/bge-reranker-base" | "" | null
One of the following:
"@cf/baai/bge-reranker-base"
""
retrieval_options?: RetrievalOptions | null
boost_by?: Array<BoostBy>

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

field: string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
direction?: "asc" | "desc" | "exists" | "not_exists"

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
"and"
"or"
rewrite_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
rewrite_query?: boolean
score_threshold?: number
maximum1
minimum0
source?: string | null
source_params?: SourceParams | null
exclude_items?: Array<string>

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.

include_items?: Array<string>

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.

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 }

Options for parse_type ‘discover’, where Browser Run discovers URLs by link following and sitemaps. Ignored for ‘sitemap’.

depth?: number

Maximum link-follow depth from the seed URL.

maximum100000
minimum1
include_subdomains?: boolean

Follow links to subdomains of the source host.

limit?: number

Maximum number of pages to crawl (1-100000).

maximum100000
minimum1
max_age?: number

Maximum content age in seconds to accept (0–604800).

maximum604800
minimum0
source?: "all" | "sitemaps" | "links"

Where the crawler looks for URLs: ‘sitemaps’ reads sitemap XML only, ‘links’ follows page links only, ‘all’ does both.

One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

path: string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
selector: string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
include_headers?: Record<string, string>

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

include_images?: boolean
specific_sitemaps?: Array<string>

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"

How URLs are discovered. ‘sitemap’ reads XML sitemaps; ‘discover’ follows links recursively and requires the source to be a Verified zone on this account.

One of the following:
"sitemap"
"discover"
status?: string
sync_interval?: 900 | 1800 | 3600 | 5 more

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
900
1800
3600
7200
14400
21600
43200
86400
token_id?: string
formatuuid
type?: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"
InstanceUpdateResponse { id, created_at, modified_at, 36 more }
id: string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
created_at: string
formatdate-time
modified_at: string
formatdate-time
ai_gateway_id?: string | null
ai_search_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
cache?: boolean
cache_threshold?: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes"
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl?: 600 | 1800 | 3600 | 7 more

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk_overlap?: number
maximum30
minimum0
chunk_size?: number
minimum64
created_by?: string | null
custom_metadata?: Array<CustomMetadata>
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
maxLength64
minLength1
embedding_model?: "@cf/qwen/qwen3-embedding-0.6b" | "@cf/qwen/qwen3-vl-embedding-2b" | "@cf/baai/bge-m3" | 8 more | null
One of the following:
"@cf/qwen/qwen3-embedding-0.6b"
"@cf/qwen/qwen3-vl-embedding-2b"
"@cf/baai/bge-m3"
"@cf/baai/bge-large-en-v1.5"
"@cf/google/embeddinggemma-300m"
"google-ai-studio/gemini-embedding-001"
"google-ai-studio/gemini-embedding-2-preview"
"google-ai-studio/gemini-embedding-2"
"openai/text-embedding-3-small"
"openai/text-embedding-3-large"
""
enable?: boolean
engine_version?: number
fusion_method?: "max" | "rrf"
One of the following:
"max"
"rrf"
Deprecatedhybrid_search_enabled?: boolean

Deprecated — use index_method instead.

index_method?: IndexMethod { keyword, vector }

Controls which storage backends are used during indexing. Defaults to vector-only.

keyword: boolean

Enable keyword (BM25) storage backend.

vector: boolean

Enable vector (embedding) storage backend.

indexing_options?: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
"porter"
"trigram"
last_activity?: string | null
formatdate-time
max_num_results?: number
maximum50
minimum1
metadata?: Metadata { created_from_aisearch_wizard, worker_domain }
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_by?: string | null
namespace?: string | null
paused?: boolean
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams { authorized_hosts, chat_completions_endpoint, custom_domains, 5 more }
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

reranking?: boolean
reranking_model?: "@cf/baai/bge-reranker-base" | "" | null
One of the following:
"@cf/baai/bge-reranker-base"
""
retrieval_options?: RetrievalOptions | null
boost_by?: Array<BoostBy>

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

field: string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
direction?: "asc" | "desc" | "exists" | "not_exists"

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
"and"
"or"
rewrite_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
rewrite_query?: boolean
score_threshold?: number
maximum1
minimum0
source?: string | null
source_params?: SourceParams | null
exclude_items?: Array<string>

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.

include_items?: Array<string>

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.

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 }

Options for parse_type ‘discover’, where Browser Run discovers URLs by link following and sitemaps. Ignored for ‘sitemap’.

depth?: number

Maximum link-follow depth from the seed URL.

maximum100000
minimum1
include_subdomains?: boolean

Follow links to subdomains of the source host.

limit?: number

Maximum number of pages to crawl (1-100000).

maximum100000
minimum1
max_age?: number

Maximum content age in seconds to accept (0–604800).

maximum604800
minimum0
source?: "all" | "sitemaps" | "links"

Where the crawler looks for URLs: ‘sitemaps’ reads sitemap XML only, ‘links’ follows page links only, ‘all’ does both.

One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

path: string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
selector: string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
include_headers?: Record<string, string>

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

include_images?: boolean
specific_sitemaps?: Array<string>

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"

How URLs are discovered. ‘sitemap’ reads XML sitemaps; ‘discover’ follows links recursively and requires the source to be a Verified zone on this account.

One of the following:
"sitemap"
"discover"
status?: string
sync_interval?: 900 | 1800 | 3600 | 5 more

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
900
1800
3600
7200
14400
21600
43200
86400
token_id?: string
formatuuid
type?: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"
InstanceDeleteResponse { id, created_at, modified_at, 36 more }
id: string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
created_at: string
formatdate-time
modified_at: string
formatdate-time
ai_gateway_id?: string | null
ai_search_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
cache?: boolean
cache_threshold?: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes"
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl?: 600 | 1800 | 3600 | 7 more

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk_overlap?: number
maximum30
minimum0
chunk_size?: number
minimum64
created_by?: string | null
custom_metadata?: Array<CustomMetadata>
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
maxLength64
minLength1
embedding_model?: "@cf/qwen/qwen3-embedding-0.6b" | "@cf/qwen/qwen3-vl-embedding-2b" | "@cf/baai/bge-m3" | 8 more | null
One of the following:
"@cf/qwen/qwen3-embedding-0.6b"
"@cf/qwen/qwen3-vl-embedding-2b"
"@cf/baai/bge-m3"
"@cf/baai/bge-large-en-v1.5"
"@cf/google/embeddinggemma-300m"
"google-ai-studio/gemini-embedding-001"
"google-ai-studio/gemini-embedding-2-preview"
"google-ai-studio/gemini-embedding-2"
"openai/text-embedding-3-small"
"openai/text-embedding-3-large"
""
enable?: boolean
engine_version?: number
fusion_method?: "max" | "rrf"
One of the following:
"max"
"rrf"
Deprecatedhybrid_search_enabled?: boolean

Deprecated — use index_method instead.

index_method?: IndexMethod { keyword, vector }

Controls which storage backends are used during indexing. Defaults to vector-only.

keyword: boolean

Enable keyword (BM25) storage backend.

vector: boolean

Enable vector (embedding) storage backend.

indexing_options?: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
"porter"
"trigram"
last_activity?: string | null
formatdate-time
max_num_results?: number
maximum50
minimum1
metadata?: Metadata { created_from_aisearch_wizard, worker_domain }
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_by?: string | null
namespace?: string | null
paused?: boolean
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams { authorized_hosts, chat_completions_endpoint, custom_domains, 5 more }
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

reranking?: boolean
reranking_model?: "@cf/baai/bge-reranker-base" | "" | null
One of the following:
"@cf/baai/bge-reranker-base"
""
retrieval_options?: RetrievalOptions | null
boost_by?: Array<BoostBy>

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

field: string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
direction?: "asc" | "desc" | "exists" | "not_exists"

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
"and"
"or"
rewrite_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
rewrite_query?: boolean
score_threshold?: number
maximum1
minimum0
source?: string | null
source_params?: SourceParams | null
exclude_items?: Array<string>

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.

include_items?: Array<string>

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.

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 }

Options for parse_type ‘discover’, where Browser Run discovers URLs by link following and sitemaps. Ignored for ‘sitemap’.

depth?: number

Maximum link-follow depth from the seed URL.

maximum100000
minimum1
include_subdomains?: boolean

Follow links to subdomains of the source host.

limit?: number

Maximum number of pages to crawl (1-100000).

maximum100000
minimum1
max_age?: number

Maximum content age in seconds to accept (0–604800).

maximum604800
minimum0
source?: "all" | "sitemaps" | "links"

Where the crawler looks for URLs: ‘sitemaps’ reads sitemap XML only, ‘links’ follows page links only, ‘all’ does both.

One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

path: string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
selector: string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
include_headers?: Record<string, string>

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

include_images?: boolean
specific_sitemaps?: Array<string>

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"

How URLs are discovered. ‘sitemap’ reads XML sitemaps; ‘discover’ follows links recursively and requires the source to be a Verified zone on this account.

One of the following:
"sitemap"
"discover"
status?: string
sync_interval?: 900 | 1800 | 3600 | 5 more

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
900
1800
3600
7200
14400
21600
43200
86400
token_id?: string
formatuuid
type?: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"
InstanceStatsResponse { completed, degraded, engine, 8 more }
completed?: number
degraded?: boolean

True when status counts are unavailable (e.g. legacy stats query exceeded D1 statement-size limit). Counts are omitted in this case.

engine?: Engine { r2, vectorize }

Engine-specific metadata. Present only for managed (v3) instances.

r2?: R2 { metadataSizeBytes, objectCount, payloadSizeBytes }

R2 bucket storage usage in bytes.

metadataSizeBytes: number
objectCount: number
payloadSizeBytes: number
vectorize?: Vectorize { dimensions, vectorsCount }

Vectorize index metadata (dimensions, vector count).

dimensions: number
vectorsCount: number
error?: number
file_embed_errors?: Record<string, unknown>
index_source_errors?: Record<string, unknown>
last_activity?: string
formatdate-time
outdated?: number
queued?: number
running?: number
skipped?: number
InstanceSearchResponse { chunks, query_kind, search_query }
chunks: Array<Chunk>
id: string
score: number
maximum1
minimum0
text: string
type: string
item?: Item { key, metadata, timestamp }
key: string
metadata?: Record<string, unknown>
timestamp?: number
scoring_details?: ScoringDetails { fusion_method, keyword_rank, keyword_score, 3 more }
fusion_method?: "rrf" | "max"
One of the following:
"rrf"
"max"
keyword_rank?: number
keyword_score?: number
minimum0
reranking_score?: number
maximum1
minimum0
vector_rank?: number
vector_score?: number
maximum1
minimum0
query_kind: "text" | "image" | "multimodal"
One of the following:
"text"
"image"
"multimodal"
search_query?: string
InstanceChatCompletionsResponse { choices, chunks, id, 2 more }
choices: Array<Choice>
message: Message { content, role }
content: string | Array<UnionMember0 { text, type } | UnionMember1 { image_url, type } | UnionMember2 { file, type } > | null
One of the following:
string
Array<UnionMember0 { text, type } | UnionMember1 { image_url, type } | UnionMember2 { file, type } >
UnionMember0 { text, type }
text: string
minLength1
type: "text"
UnionMember1 { image_url, type }
image_url: ImageURL { url }
url: string
maxLength20971520
minLength1
type: "image_url"
UnionMember2 { file, type }
file: File { filename, file_data, file_id }
filename: string
maxLength255
minLength1
file_data?: string
maxLength13981144
minLength1
file_id?: string
type: "file"
role: "system" | "developer" | "user" | 2 more
One of the following:
"system"
"developer"
"user"
"assistant"
"tool"
index?: number
chunks: Array<Chunk>
id: string
score: number
maximum1
minimum0
text: string
type: string
item?: Item { key, metadata, timestamp }
key: string
metadata?: Record<string, unknown>
timestamp?: number
scoring_details?: ScoringDetails { fusion_method, keyword_rank, keyword_score, 3 more }
fusion_method?: "rrf" | "max"
One of the following:
"rrf"
"max"
keyword_rank?: number
keyword_score?: number
minimum0
reranking_score?: number
maximum1
minimum0
vector_rank?: number
vector_score?: number
maximum1
minimum0
id?: string
model?: string
object?: string

AI SearchNamespacesInstancesJobs

List Jobs
client.aiSearch.namespaces.instances.jobs.list(stringid, JobListParams { account_id, name, page, per_page } params, RequestOptionsoptions?): V4PagePaginationArray<JobListResponse { id, source, description, 4 more } >
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs
Create new job
client.aiSearch.namespaces.instances.jobs.create(stringid, JobCreateParams { account_id, name, description } params, RequestOptionsoptions?): JobCreateResponse { id, source, description, 4 more }
POST/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs
Get a Job Details
client.aiSearch.namespaces.instances.jobs.get(stringjobID, JobGetParams { account_id, name, id } params, RequestOptionsoptions?): JobGetResponse { id, source, description, 4 more }
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}
Cancel an indexing job.
client.aiSearch.namespaces.instances.jobs.update(stringjobID, JobUpdateParams { account_id, name, id, action } params, RequestOptionsoptions?): JobUpdateResponse { id, source, description, 4 more }
PATCH/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}
List Job Logs
client.aiSearch.namespaces.instances.jobs.logs(stringjobID, JobLogsParams { account_id, name, id, 2 more } params, RequestOptionsoptions?): JobLogsResponse { id, created_at, message, message_type }
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}/logs
ModelsExpand Collapse
JobListResponse { id, source, description, 4 more }
id: string
source: "user" | "schedule"
One of the following:
"user"
"schedule"
description?: string
end_reason?: string
ended_at?: string
last_seen_at?: string
started_at?: string
JobCreateResponse { id, source, description, 4 more }
id: string
source: "user" | "schedule"
One of the following:
"user"
"schedule"
description?: string
end_reason?: string
ended_at?: string
last_seen_at?: string
started_at?: string
JobGetResponse { id, source, description, 4 more }
id: string
source: "user" | "schedule"
One of the following:
"user"
"schedule"
description?: string
end_reason?: string
ended_at?: string
last_seen_at?: string
started_at?: string
JobUpdateResponse { id, source, description, 4 more }
id: string
source: "user" | "schedule"
One of the following:
"user"
"schedule"
description?: string
end_reason?: string
ended_at?: string
last_seen_at?: string
started_at?: string
JobLogsResponse = Array<JobLogsResponseItem>
id: number
created_at: number
message: string
message_type: number

AI SearchNamespacesInstancesItems

Items List.
client.aiSearch.namespaces.instances.items.list(stringid, ItemListParams { account_id, name, item_id, 8 more } params, RequestOptionsoptions?): V4PagePaginationArray<ItemListResponse { id, checksum, chunks_count, 10 more } >
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items
Upload Item.
client.aiSearch.namespaces.instances.items.upload(stringid, ItemUploadParams { account_id, name, file } params, RequestOptionsoptions?): ItemUploadResponse { id, checksum, chunks_count, 10 more }
POST/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items
Create or Update Item.
client.aiSearch.namespaces.instances.items.createOrUpdate(stringid, ItemCreateOrUpdateParams { account_id, name, key, 2 more } params, RequestOptionsoptions?): ItemCreateOrUpdateResponse { id, checksum, chunks_count, 10 more }
PUT/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items
Get Item.
client.aiSearch.namespaces.instances.items.get(stringitemID, ItemGetParams { account_id, name, id } params, RequestOptionsoptions?): ItemGetResponse { id, checksum, chunks_count, 10 more }
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}
Sync Item.
client.aiSearch.namespaces.instances.items.sync(stringitemID, ItemSyncParams { account_id, name, id, 2 more } params, RequestOptionsoptions?): ItemSyncResponse { id, checksum, chunks_count, 10 more }
PATCH/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}
Delete Item.
client.aiSearch.namespaces.instances.items.delete(stringitemID, ItemDeleteParams { account_id, name, id } params, RequestOptionsoptions?): ItemDeleteResponse { key }
DELETE/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}
Download Item Content.
client.aiSearch.namespaces.instances.items.download(stringitemID, ItemDownloadParams { account_id, name, id } params, RequestOptionsoptions?): Response
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/download
Item Logs.
client.aiSearch.namespaces.instances.items.logs(stringitemID, ItemLogsParams { account_id, name, id, 2 more } params, RequestOptionsoptions?): ItemLogsResponse { action, chunkCount, errorType, 4 more }
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/logs
List Item Chunks.
client.aiSearch.namespaces.instances.items.chunks(stringitemID, ItemChunksParams { account_id, name, id, 2 more } params, RequestOptionsoptions?): ItemChunksResponse { id, item, text, 2 more }
GET/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/chunks
ModelsExpand Collapse
ItemListResponse { id, checksum, chunks_count, 10 more }
id: string
checksum: string
chunks_count: number | null
created_at: string
formatdate-time
file_size: number | null
key: string
last_seen_at: string
formatdate-time
metadata: Record<string, string | number | boolean> | null

Built-in, configured filterable, and retained source metadata for the item.

One of the following:
string
number
boolean
namespace: string
next_action: "INDEX" | "DELETE" | null
One of the following:
"INDEX"
"DELETE"
source_id: string | null

Identifies which data source this item belongs to. “builtin” for uploaded files, “{type}:{source}” for external sources, null for legacy items.

status: "queued" | "running" | "completed" | 3 more
One of the following:
"queued"
"running"
"completed"
"error"
"skipped"
"outdated"
error?: string
ItemUploadResponse { id, checksum, chunks_count, 10 more }
id: string
checksum: string
chunks_count: number | null
created_at: string
formatdate-time
file_size: number | null
key: string
last_seen_at: string
formatdate-time
metadata: Record<string, string | number | boolean> | null

Built-in, configured filterable, and retained source metadata for the item.

One of the following:
string
number
boolean
namespace: string
next_action: "INDEX" | "DELETE" | null
One of the following:
"INDEX"
"DELETE"
source_id: string | null

Identifies which data source this item belongs to. “builtin” for uploaded files, “{type}:{source}” for external sources, null for legacy items.

status: "queued" | "running" | "completed" | 3 more
One of the following:
"queued"
"running"
"completed"
"error"
"skipped"
"outdated"
error?: string
ItemCreateOrUpdateResponse { id, checksum, chunks_count, 10 more }
id: string
checksum: string
chunks_count: number | null
created_at: string
formatdate-time
file_size: number | null
key: string
last_seen_at: string
formatdate-time
metadata: Record<string, string | number | boolean> | null

Built-in, configured filterable, and retained source metadata for the item.

One of the following:
string
number
boolean
namespace: string
next_action: "INDEX" | "DELETE" | null
One of the following:
"INDEX"
"DELETE"
source_id: string | null

Identifies which data source this item belongs to. “builtin” for uploaded files, “{type}:{source}” for external sources, null for legacy items.

status: "queued" | "running" | "completed" | 3 more
One of the following:
"queued"
"running"
"completed"
"error"
"skipped"
"outdated"
error?: string
ItemGetResponse { id, checksum, chunks_count, 10 more }
id: string
checksum: string
chunks_count: number | null
created_at: string
formatdate-time
file_size: number | null
key: string
last_seen_at: string
formatdate-time
metadata: Record<string, string | number | boolean> | null

Built-in, configured filterable, and retained source metadata for the item.

One of the following:
string
number
boolean
namespace: string
next_action: "INDEX" | "DELETE" | null
One of the following:
"INDEX"
"DELETE"
source_id: string | null

Identifies which data source this item belongs to. “builtin” for uploaded files, “{type}:{source}” for external sources, null for legacy items.

status: "queued" | "running" | "completed" | 3 more
One of the following:
"queued"
"running"
"completed"
"error"
"skipped"
"outdated"
error?: string
ItemSyncResponse { id, checksum, chunks_count, 10 more }
id: string
checksum: string
chunks_count: number | null
created_at: string
formatdate-time
file_size: number | null
key: string
last_seen_at: string
formatdate-time
metadata: Record<string, string | number | boolean> | null

Built-in, configured filterable, and retained source metadata for the item.

One of the following:
string
number
boolean
namespace: string
next_action: "INDEX" | "DELETE" | null
One of the following:
"INDEX"
"DELETE"
source_id: string | null

Identifies which data source this item belongs to. “builtin” for uploaded files, “{type}:{source}” for external sources, null for legacy items.

status: "queued" | "running" | "completed" | 3 more
One of the following:
"queued"
"running"
"completed"
"error"
"skipped"
"outdated"
error?: string
ItemDeleteResponse { key }
key: string
ItemLogsResponse = Array<ItemLogsResponseItem>
action: string
chunkCount: number | null
errorType: string | null
fileKey: string
message: string | null
processingTimeMs: number | null
timestamp: string
formatdate-time
ItemChunksResponse = Array<ItemChunksResponseItem>
id: string
item: Item { key, metadata, timestamp }
key: string
metadata?: Record<string, unknown>
timestamp?: number
text: string
end_byte?: number
start_byte?: number

AI SearchInstances

List AI Search instances.
client.aiSearch.instances.list(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/instances
Create an AI Search instance.
client.aiSearch.instances.create(InstanceCreateParams { account_id, id, ai_gateway_id, 27 more } params, RequestOptionsoptions?): InstanceCreateResponse { id, created_at, modified_at, 36 more }
POST/accounts/{account_id}/ai-search/instances
Get an AI Search instance.
client.aiSearch.instances.read(stringid, InstanceReadParams { account_id } params, RequestOptionsoptions?): InstanceReadResponse { id, created_at, modified_at, 36 more }
GET/accounts/{account_id}/ai-search/instances/{id}
Update an AI Search instance.
client.aiSearch.instances.update(stringid, InstanceUpdateParams { account_id, ai_gateway_id, ai_search_model, 30 more } params, RequestOptionsoptions?): InstanceUpdateResponse { id, created_at, modified_at, 36 more }
PUT/accounts/{account_id}/ai-search/instances/{id}
Delete an AI Search instance.
client.aiSearch.instances.delete(stringid, InstanceDeleteParams { account_id } params, RequestOptionsoptions?): InstanceDeleteResponse { id, created_at, modified_at, 36 more }
DELETE/accounts/{account_id}/ai-search/instances/{id}
Get instance statistics.
client.aiSearch.instances.stats(stringid, InstanceStatsParams { account_id } params, RequestOptionsoptions?): InstanceStatsResponse { completed, degraded, engine, 8 more }
GET/accounts/{account_id}/ai-search/instances/{id}/stats
Search
client.aiSearch.instances.search(stringid, InstanceSearchParams { account_id, ai_search_options, messages, query } params, RequestOptionsoptions?): InstanceSearchResponse { chunks, query_kind, search_query }
POST/accounts/{account_id}/ai-search/instances/{id}/search
Chat Completions
client.aiSearch.instances.chatCompletions(stringid, InstanceChatCompletionsParams { account_id, messages, ai_search_options, 2 more } params, RequestOptionsoptions?): InstanceChatCompletionsResponse { choices, chunks, id, 2 more }
POST/accounts/{account_id}/ai-search/instances/{id}/chat/completions
ModelsExpand 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"
InstanceCreateResponse { id, created_at, modified_at, 36 more }
id: string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
created_at: string
formatdate-time
modified_at: string
formatdate-time
ai_gateway_id?: string | null
ai_search_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
cache?: boolean
cache_threshold?: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes"
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl?: 600 | 1800 | 3600 | 7 more

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk_overlap?: number
maximum30
minimum0
chunk_size?: number
minimum64
created_by?: string | null
custom_metadata?: Array<CustomMetadata>
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
maxLength64
minLength1
embedding_model?: "@cf/qwen/qwen3-embedding-0.6b" | "@cf/qwen/qwen3-vl-embedding-2b" | "@cf/baai/bge-m3" | 8 more | null
One of the following:
"@cf/qwen/qwen3-embedding-0.6b"
"@cf/qwen/qwen3-vl-embedding-2b"
"@cf/baai/bge-m3"
"@cf/baai/bge-large-en-v1.5"
"@cf/google/embeddinggemma-300m"
"google-ai-studio/gemini-embedding-001"
"google-ai-studio/gemini-embedding-2-preview"
"google-ai-studio/gemini-embedding-2"
"openai/text-embedding-3-small"
"openai/text-embedding-3-large"
""
enable?: boolean
engine_version?: number
fusion_method?: "max" | "rrf"
One of the following:
"max"
"rrf"
Deprecatedhybrid_search_enabled?: boolean

Deprecated — use index_method instead.

index_method?: IndexMethod { keyword, vector }

Controls which storage backends are used during indexing. Defaults to vector-only.

keyword: boolean

Enable keyword (BM25) storage backend.

vector: boolean

Enable vector (embedding) storage backend.

indexing_options?: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
"porter"
"trigram"
last_activity?: string | null
formatdate-time
max_num_results?: number
maximum50
minimum1
metadata?: Metadata { created_from_aisearch_wizard, worker_domain }
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_by?: string | null
namespace?: string | null
paused?: boolean
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams { authorized_hosts, chat_completions_endpoint, custom_domains, 5 more }
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

reranking?: boolean
reranking_model?: "@cf/baai/bge-reranker-base" | "" | null
One of the following:
"@cf/baai/bge-reranker-base"
""
retrieval_options?: RetrievalOptions | null
boost_by?: Array<BoostBy>

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

field: string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
direction?: "asc" | "desc" | "exists" | "not_exists"

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
"and"
"or"
rewrite_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
rewrite_query?: boolean
score_threshold?: number
maximum1
minimum0
source?: string | null
source_params?: SourceParams | null
exclude_items?: Array<string>

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.

include_items?: Array<string>

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.

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 }

Options for parse_type ‘discover’, where Browser Run discovers URLs by link following and sitemaps. Ignored for ‘sitemap’.

depth?: number

Maximum link-follow depth from the seed URL.

maximum100000
minimum1
include_subdomains?: boolean

Follow links to subdomains of the source host.

limit?: number

Maximum number of pages to crawl (1-100000).

maximum100000
minimum1
max_age?: number

Maximum content age in seconds to accept (0–604800).

maximum604800
minimum0
source?: "all" | "sitemaps" | "links"

Where the crawler looks for URLs: ‘sitemaps’ reads sitemap XML only, ‘links’ follows page links only, ‘all’ does both.

One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

path: string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
selector: string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
include_headers?: Record<string, string>

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

include_images?: boolean
specific_sitemaps?: Array<string>

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"

How URLs are discovered. ‘sitemap’ reads XML sitemaps; ‘discover’ follows links recursively and requires the source to be a Verified zone on this account.

One of the following:
"sitemap"
"discover"
status?: string
sync_interval?: 900 | 1800 | 3600 | 5 more

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
900
1800
3600
7200
14400
21600
43200
86400
token_id?: string
formatuuid
type?: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"
InstanceReadResponse { id, created_at, modified_at, 36 more }
id: string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
created_at: string
formatdate-time
modified_at: string
formatdate-time
ai_gateway_id?: string | null
ai_search_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
cache?: boolean
cache_threshold?: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes"
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl?: 600 | 1800 | 3600 | 7 more

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk_overlap?: number
maximum30
minimum0
chunk_size?: number
minimum64
created_by?: string | null
custom_metadata?: Array<CustomMetadata>
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
maxLength64
minLength1
embedding_model?: "@cf/qwen/qwen3-embedding-0.6b" | "@cf/qwen/qwen3-vl-embedding-2b" | "@cf/baai/bge-m3" | 8 more | null
One of the following:
"@cf/qwen/qwen3-embedding-0.6b"
"@cf/qwen/qwen3-vl-embedding-2b"
"@cf/baai/bge-m3"
"@cf/baai/bge-large-en-v1.5"
"@cf/google/embeddinggemma-300m"
"google-ai-studio/gemini-embedding-001"
"google-ai-studio/gemini-embedding-2-preview"
"google-ai-studio/gemini-embedding-2"
"openai/text-embedding-3-small"
"openai/text-embedding-3-large"
""
enable?: boolean
engine_version?: number
fusion_method?: "max" | "rrf"
One of the following:
"max"
"rrf"
Deprecatedhybrid_search_enabled?: boolean

Deprecated — use index_method instead.

index_method?: IndexMethod { keyword, vector }

Controls which storage backends are used during indexing. Defaults to vector-only.

keyword: boolean

Enable keyword (BM25) storage backend.

vector: boolean

Enable vector (embedding) storage backend.

indexing_options?: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
"porter"
"trigram"
last_activity?: string | null
formatdate-time
max_num_results?: number
maximum50
minimum1
metadata?: Metadata { created_from_aisearch_wizard, worker_domain }
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_by?: string | null
namespace?: string | null
paused?: boolean
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams { authorized_hosts, chat_completions_endpoint, custom_domains, 5 more }
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

reranking?: boolean
reranking_model?: "@cf/baai/bge-reranker-base" | "" | null
One of the following:
"@cf/baai/bge-reranker-base"
""
retrieval_options?: RetrievalOptions | null
boost_by?: Array<BoostBy>

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

field: string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
direction?: "asc" | "desc" | "exists" | "not_exists"

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
"and"
"or"
rewrite_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
rewrite_query?: boolean
score_threshold?: number
maximum1
minimum0
source?: string | null
source_params?: SourceParams | null
exclude_items?: Array<string>

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.

include_items?: Array<string>

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.

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 }

Options for parse_type ‘discover’, where Browser Run discovers URLs by link following and sitemaps. Ignored for ‘sitemap’.

depth?: number

Maximum link-follow depth from the seed URL.

maximum100000
minimum1
include_subdomains?: boolean

Follow links to subdomains of the source host.

limit?: number

Maximum number of pages to crawl (1-100000).

maximum100000
minimum1
max_age?: number

Maximum content age in seconds to accept (0–604800).

maximum604800
minimum0
source?: "all" | "sitemaps" | "links"

Where the crawler looks for URLs: ‘sitemaps’ reads sitemap XML only, ‘links’ follows page links only, ‘all’ does both.

One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

path: string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
selector: string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
include_headers?: Record<string, string>

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

include_images?: boolean
specific_sitemaps?: Array<string>

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"

How URLs are discovered. ‘sitemap’ reads XML sitemaps; ‘discover’ follows links recursively and requires the source to be a Verified zone on this account.

One of the following:
"sitemap"
"discover"
status?: string
sync_interval?: 900 | 1800 | 3600 | 5 more

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
900
1800
3600
7200
14400
21600
43200
86400
token_id?: string
formatuuid
type?: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"
InstanceUpdateResponse { id, created_at, modified_at, 36 more }
id: string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
created_at: string
formatdate-time
modified_at: string
formatdate-time
ai_gateway_id?: string | null
ai_search_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
cache?: boolean
cache_threshold?: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes"
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl?: 600 | 1800 | 3600 | 7 more

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk_overlap?: number
maximum30
minimum0
chunk_size?: number
minimum64
created_by?: string | null
custom_metadata?: Array<CustomMetadata>
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
maxLength64
minLength1
embedding_model?: "@cf/qwen/qwen3-embedding-0.6b" | "@cf/qwen/qwen3-vl-embedding-2b" | "@cf/baai/bge-m3" | 8 more | null
One of the following:
"@cf/qwen/qwen3-embedding-0.6b"
"@cf/qwen/qwen3-vl-embedding-2b"
"@cf/baai/bge-m3"
"@cf/baai/bge-large-en-v1.5"
"@cf/google/embeddinggemma-300m"
"google-ai-studio/gemini-embedding-001"
"google-ai-studio/gemini-embedding-2-preview"
"google-ai-studio/gemini-embedding-2"
"openai/text-embedding-3-small"
"openai/text-embedding-3-large"
""
enable?: boolean
engine_version?: number
fusion_method?: "max" | "rrf"
One of the following:
"max"
"rrf"
Deprecatedhybrid_search_enabled?: boolean

Deprecated — use index_method instead.

index_method?: IndexMethod { keyword, vector }

Controls which storage backends are used during indexing. Defaults to vector-only.

keyword: boolean

Enable keyword (BM25) storage backend.

vector: boolean

Enable vector (embedding) storage backend.

indexing_options?: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
"porter"
"trigram"
last_activity?: string | null
formatdate-time
max_num_results?: number
maximum50
minimum1
metadata?: Metadata { created_from_aisearch_wizard, worker_domain }
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_by?: string | null
namespace?: string | null
paused?: boolean
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams { authorized_hosts, chat_completions_endpoint, custom_domains, 5 more }
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

reranking?: boolean
reranking_model?: "@cf/baai/bge-reranker-base" | "" | null
One of the following:
"@cf/baai/bge-reranker-base"
""
retrieval_options?: RetrievalOptions | null
boost_by?: Array<BoostBy>

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

field: string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
direction?: "asc" | "desc" | "exists" | "not_exists"

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
"and"
"or"
rewrite_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
rewrite_query?: boolean
score_threshold?: number
maximum1
minimum0
source?: string | null
source_params?: SourceParams | null
exclude_items?: Array<string>

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.

include_items?: Array<string>

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.

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 }

Options for parse_type ‘discover’, where Browser Run discovers URLs by link following and sitemaps. Ignored for ‘sitemap’.

depth?: number

Maximum link-follow depth from the seed URL.

maximum100000
minimum1
include_subdomains?: boolean

Follow links to subdomains of the source host.

limit?: number

Maximum number of pages to crawl (1-100000).

maximum100000
minimum1
max_age?: number

Maximum content age in seconds to accept (0–604800).

maximum604800
minimum0
source?: "all" | "sitemaps" | "links"

Where the crawler looks for URLs: ‘sitemaps’ reads sitemap XML only, ‘links’ follows page links only, ‘all’ does both.

One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

path: string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
selector: string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
include_headers?: Record<string, string>

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

include_images?: boolean
specific_sitemaps?: Array<string>

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"

How URLs are discovered. ‘sitemap’ reads XML sitemaps; ‘discover’ follows links recursively and requires the source to be a Verified zone on this account.

One of the following:
"sitemap"
"discover"
status?: string
sync_interval?: 900 | 1800 | 3600 | 5 more

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
900
1800
3600
7200
14400
21600
43200
86400
token_id?: string
formatuuid
type?: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"
InstanceDeleteResponse { id, created_at, modified_at, 36 more }
id: string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
created_at: string
formatdate-time
modified_at: string
formatdate-time
ai_gateway_id?: string | null
ai_search_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
cache?: boolean
cache_threshold?: "super_strict_match" | "close_enough" | "flexible_friend" | "anything_goes"
One of the following:
"super_strict_match"
"close_enough"
"flexible_friend"
"anything_goes"
cache_ttl?: 600 | 1800 | 3600 | 7 more

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
600
1800
3600
7200
21600
43200
86400
172800
259200
518400
chunk_overlap?: number
maximum30
minimum0
chunk_size?: number
minimum64
created_by?: string | null
custom_metadata?: Array<CustomMetadata>
data_type: "text" | "number" | "boolean" | "datetime"
One of the following:
"text"
"number"
"boolean"
"datetime"
field_name: string
maxLength64
minLength1
embedding_model?: "@cf/qwen/qwen3-embedding-0.6b" | "@cf/qwen/qwen3-vl-embedding-2b" | "@cf/baai/bge-m3" | 8 more | null
One of the following:
"@cf/qwen/qwen3-embedding-0.6b"
"@cf/qwen/qwen3-vl-embedding-2b"
"@cf/baai/bge-m3"
"@cf/baai/bge-large-en-v1.5"
"@cf/google/embeddinggemma-300m"
"google-ai-studio/gemini-embedding-001"
"google-ai-studio/gemini-embedding-2-preview"
"google-ai-studio/gemini-embedding-2"
"openai/text-embedding-3-small"
"openai/text-embedding-3-large"
""
enable?: boolean
engine_version?: number
fusion_method?: "max" | "rrf"
One of the following:
"max"
"rrf"
Deprecatedhybrid_search_enabled?: boolean

Deprecated — use index_method instead.

index_method?: IndexMethod { keyword, vector }

Controls which storage backends are used during indexing. Defaults to vector-only.

keyword: boolean

Enable keyword (BM25) storage backend.

vector: boolean

Enable vector (embedding) storage backend.

indexing_options?: IndexingOptions | null
keyword_tokenizer?: "porter" | "trigram"

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
"porter"
"trigram"
last_activity?: string | null
formatdate-time
max_num_results?: number
maximum50
minimum1
metadata?: Metadata { created_from_aisearch_wizard, worker_domain }
created_from_aisearch_wizard?: boolean
worker_domain?: string
modified_by?: string | null
namespace?: string | null
paused?: boolean
public_endpoint_id?: string | null
public_endpoint_params?: PublicEndpointParams { authorized_hosts, chat_completions_endpoint, custom_domains, 5 more }
authorized_hosts?: Array<string>
chat_completions_endpoint?: ChatCompletionsEndpoint { disabled }
disabled?: boolean

Disable chat completions endpoint for this public endpoint

custom_domains?: Array<string> | null

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

default_domain_enabled?: boolean

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.

enabled?: boolean
mcp?: Mcp { description, disabled }
description?: string
disabled?: boolean

Disable MCP endpoint for this public endpoint

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

Disable search endpoint for this public endpoint

reranking?: boolean
reranking_model?: "@cf/baai/bge-reranker-base" | "" | null
One of the following:
"@cf/baai/bge-reranker-base"
""
retrieval_options?: RetrievalOptions | null
boost_by?: Array<BoostBy>

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

field: string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
direction?: "asc" | "desc" | "exists" | "not_exists"

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
"asc"
"desc"
"exists"
"not_exists"
keyword_match_mode?: "and" | "or"

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
"and"
"or"
rewrite_model?: "@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@cf/zai-org/glm-4.7-flash" | "@cf/meta/llama-3.1-8b-instruct-fast" | 27 more | null
One of the following:
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
"@cf/zai-org/glm-4.7-flash"
"@cf/meta/llama-3.1-8b-instruct-fast"
"@cf/meta/llama-3.1-8b-instruct-fp8"
"@cf/meta/llama-4-scout-17b-16e-instruct"
"@cf/qwen/qwen3-30b-a3b-fp8"
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
"@cf/moonshotai/kimi-k2-instruct"
"@cf/google/gemma-3-12b-it"
"@cf/google/gemma-4-26b-a4b-it"
"@cf/moonshotai/kimi-k2.5"
"anthropic/claude-3-7-sonnet"
"anthropic/claude-sonnet-4"
"anthropic/claude-opus-4"
"anthropic/claude-3-5-haiku"
"cerebras/qwen-3-235b-a22b-instruct"
"cerebras/qwen-3-235b-a22b-thinking"
"cerebras/llama-3.3-70b"
"cerebras/llama-4-maverick-17b-128e-instruct"
"cerebras/llama-4-scout-17b-16e-instruct"
"cerebras/gpt-oss-120b"
"google-ai-studio/gemini-2.5-flash"
"google-ai-studio/gemini-2.5-pro"
"grok/grok-4"
"groq/llama-3.3-70b-versatile"
"groq/llama-3.1-8b-instant"
"openai/gpt-5"
"openai/gpt-5-mini"
"openai/gpt-5-nano"
""
rewrite_query?: boolean
score_threshold?: number
maximum1
minimum0
source?: string | null
source_params?: SourceParams | null
exclude_items?: Array<string>

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.

include_items?: Array<string>

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.

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 }

Options for parse_type ‘discover’, where Browser Run discovers URLs by link following and sitemaps. Ignored for ‘sitemap’.

depth?: number

Maximum link-follow depth from the seed URL.

maximum100000
minimum1
include_subdomains?: boolean

Follow links to subdomains of the source host.

limit?: number

Maximum number of pages to crawl (1-100000).

maximum100000
minimum1
max_age?: number

Maximum content age in seconds to accept (0–604800).

maximum604800
minimum0
source?: "all" | "sitemaps" | "links"

Where the crawler looks for URLs: ‘sitemaps’ reads sitemap XML only, ‘links’ follows page links only, ‘all’ does both.

One of the following:
"all"
"sitemaps"
"links"
parse_options?: ParseOptions { content_selector, include_headers, include_images, 2 more }
content_selector?: Array<ContentSelector>

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

path: string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
selector: string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
include_headers?: Record<string, string>

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

include_images?: boolean
specific_sitemaps?: Array<string>

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

use_browser_rendering?: boolean
parse_type?: "sitemap" | "discover"

How URLs are discovered. ‘sitemap’ reads XML sitemaps; ‘discover’ follows links recursively and requires the source to be a Verified zone on this account.

One of the following:
"sitemap"
"discover"
status?: string
sync_interval?: 900 | 1800 | 3600 | 5 more

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
900
1800
3600
7200
14400
21600
43200
86400
token_id?: string
formatuuid
type?: "r2" | "web-crawler" | null
One of the following:
"r2"
"web-crawler"
InstanceStatsResponse { completed, degraded, engine, 8 more }
completed?: number
degraded?: boolean

True when status counts are unavailable (e.g. legacy stats query exceeded D1 statement-size limit). Counts are omitted in this case.

engine?: Engine { r2, vectorize }

Engine-specific metadata. Present only for managed (v3) instances.

r2?: R2 { metadataSizeBytes, objectCount, payloadSizeBytes }

R2 bucket storage usage in bytes.

metadataSizeBytes: number
objectCount: number
payloadSizeBytes: number
vectorize?: Vectorize { dimensions, vectorsCount }

Vectorize index metadata (dimensions, vector count).

dimensions: number
vectorsCount: number
error?: number
file_embed_errors?: Record<string, unknown>
index_source_errors?: Record<string, unknown>
last_activity?: string
formatdate-time
outdated?: number
queued?: number
running?: number
skipped?: number
InstanceSearchResponse { chunks, query_kind, search_query }
chunks: Array<Chunk>
id: string
score: number
maximum1
minimum0
text: string
type: string
item?: Item { key, metadata, timestamp }
key: string
metadata?: Record<string, unknown>
timestamp?: number
scoring_details?: ScoringDetails { fusion_method, keyword_rank, keyword_score, 3 more }
fusion_method?: "rrf" | "max"
One of the following:
"rrf"
"max"
keyword_rank?: number
keyword_score?: number
minimum0
reranking_score?: number
maximum1
minimum0
vector_rank?: number
vector_score?: number
maximum1
minimum0
query_kind: "text" | "image" | "multimodal"
One of the following:
"text"
"image"
"multimodal"
search_query?: string
InstanceChatCompletionsResponse { choices, chunks, id, 2 more }
choices: Array<Choice>
message: Message { content, role }
content: string | Array<UnionMember0 { text, type } | UnionMember1 { image_url, type } | UnionMember2 { file, type } > | null
One of the following:
string
Array<UnionMember0 { text, type } | UnionMember1 { image_url, type } | UnionMember2 { file, type } >
UnionMember0 { text, type }
text: string
minLength1
type: "text"
UnionMember1 { image_url, type }
image_url: ImageURL { url }
url: string
maxLength20971520
minLength1
type: "image_url"
UnionMember2 { file, type }
file: File { filename, file_data, file_id }
filename: string
maxLength255
minLength1
file_data?: string
maxLength13981144
minLength1
file_id?: string
type: "file"
role: "system" | "developer" | "user" | 2 more
One of the following:
"system"
"developer"
"user"
"assistant"
"tool"
index?: number
chunks: Array<Chunk>
id: string
score: number
maximum1
minimum0
text: string
type: string
item?: Item { key, metadata, timestamp }
key: string
metadata?: Record<string, unknown>
timestamp?: number
scoring_details?: ScoringDetails { fusion_method, keyword_rank, keyword_score, 3 more }
fusion_method?: "rrf" | "max"
One of the following:
"rrf"
"max"
keyword_rank?: number
keyword_score?: number
minimum0
reranking_score?: number
maximum1
minimum0
vector_rank?: number
vector_score?: number
maximum1
minimum0
id?: string
model?: string
object?: string

AI SearchInstancesJobs

List Jobs
client.aiSearch.instances.jobs.list(stringid, JobListParams { account_id, page, per_page } params, RequestOptionsoptions?): V4PagePaginationArray<JobListResponse { id, source, description, 4 more } >
GET/accounts/{account_id}/ai-search/instances/{id}/jobs
Create new job
client.aiSearch.instances.jobs.create(stringid, JobCreateParams { account_id, description } params, RequestOptionsoptions?): JobCreateResponse { id, source, description, 4 more }
POST/accounts/{account_id}/ai-search/instances/{id}/jobs
Get a Job Details
client.aiSearch.instances.jobs.get(stringjobID, JobGetParams { account_id, id } params, RequestOptionsoptions?): JobGetResponse { id, source, description, 4 more }
GET/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}
List Job Logs
client.aiSearch.instances.jobs.logs(stringjobID, JobLogsParams { account_id, id, page, per_page } params, RequestOptionsoptions?): JobLogsResponse { id, created_at, message, message_type }
GET/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}/logs
ModelsExpand Collapse
JobListResponse { id, source, description, 4 more }
id: string
source: "user" | "schedule"
One of the following:
"user"
"schedule"
description?: string
end_reason?: string
ended_at?: string
last_seen_at?: string
started_at?: string
JobCreateResponse { id, source, description, 4 more }
id: string
source: "user" | "schedule"
One of the following:
"user"
"schedule"
description?: string
end_reason?: string
ended_at?: string
last_seen_at?: string
started_at?: string
JobGetResponse { id, source, description, 4 more }
id: string
source: "user" | "schedule"
One of the following:
"user"
"schedule"
description?: string
end_reason?: string
ended_at?: string
last_seen_at?: string
started_at?: string
JobLogsResponse = Array<JobLogsResponseItem>
id: number
created_at: number
message: string
message_type: number

AI SearchTokens

List tokens
client.aiSearch.tokens.list(TokenListParams { account_id, page, per_page, search } params, RequestOptionsoptions?): V4PagePaginationArray<TokenListResponse { id, cf_api_id, created_at, 6 more } >
GET/accounts/{account_id}/ai-search/tokens
Create a token
client.aiSearch.tokens.create(TokenCreateParams { account_id, cf_api_id, cf_api_key, 2 more } params, RequestOptionsoptions?): TokenCreateResponse { id, cf_api_id, created_at, 6 more }
POST/accounts/{account_id}/ai-search/tokens
Get a token
client.aiSearch.tokens.read(stringid, TokenReadParams { account_id } params, RequestOptionsoptions?): TokenReadResponse { id, cf_api_id, created_at, 6 more }
GET/accounts/{account_id}/ai-search/tokens/{id}
Update a token
client.aiSearch.tokens.update(stringid, TokenUpdateParams { account_id, cf_api_id, cf_api_key, 2 more } params, RequestOptionsoptions?): TokenUpdateResponse { id, cf_api_id, created_at, 6 more }
PUT/accounts/{account_id}/ai-search/tokens/{id}
Delete a token
client.aiSearch.tokens.delete(stringid, TokenDeleteParams { account_id } params, RequestOptionsoptions?): TokenDeleteResponse
DELETE/accounts/{account_id}/ai-search/tokens/{id}
ModelsExpand Collapse
TokenListResponse { id, cf_api_id, created_at, 6 more }
id: string
formatuuid
cf_api_id: string
created_at: string
formatdate-time
modified_at: string
formatdate-time
name: string
created_by?: string | null
enabled?: boolean
legacy?: boolean
modified_by?: string | null
TokenCreateResponse { id, cf_api_id, created_at, 6 more }
id: string
formatuuid
cf_api_id: string
created_at: string
formatdate-time
modified_at: string
formatdate-time
name: string
created_by?: string | null
enabled?: boolean
legacy?: boolean
modified_by?: string | null
TokenReadResponse { id, cf_api_id, created_at, 6 more }
id: string
formatuuid
cf_api_id: string
created_at: string
formatdate-time
modified_at: string
formatdate-time
name: string
created_by?: string | null
enabled?: boolean
legacy?: boolean
modified_by?: string | null
TokenUpdateResponse { id, cf_api_id, created_at, 6 more }
id: string
formatuuid
cf_api_id: string
created_at: string
formatdate-time
modified_at: string
formatdate-time
name: string
created_by?: string | null
enabled?: boolean
legacy?: boolean
modified_by?: string | null
TokenDeleteResponse = unknown