namespace_instances
Creates, updates, deletes, gets or lists a namespace_instances resource.
Overview
| Name | namespace_instances |
| Type | Resource |
| Id | cloudflare.aisearch.namespace_instances |
Fields
The following fields are returned by SELECT queries:
- get_by_account
- list_by_account_by_account
Returns the instance.
| Name | Datatype | Description |
|---|---|---|
id | string | AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores. |
ai_gateway_id | string | |
public_endpoint_id | string | |
token_id | string (uuid) | |
ai_search_model | string | (@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 | string | (super_strict_match, close_enough, flexible_friend, anything_goes) (default: close_enough) |
chunk_overlap | integer | |
chunk_size | integer | |
created_at | string (date-time) | |
created_by | string | |
custom_metadata | array | |
embedding_model | string | (@cf/qwen/qwen3-embedding-0.6b, @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, openai/text-embedding-3-small, openai/text-embedding-3-large, , ) |
enable | boolean | |
engine_version | number | |
fusion_method | string | (max, rrf) (default: rrf) |
hybrid_search_enabled | boolean | Deprecated — use index_method instead. |
index_method | object | Controls which storage backends are used during indexing. Defaults to vector-only. |
indexing_options | object | |
last_activity | string (date-time) | |
max_num_results | integer | |
metadata | object | |
modified_at | string (date-time) | |
modified_by | string | |
namespace | string | |
paused | boolean | |
public_endpoint_params | object | |
reranking | boolean | |
reranking_model | string | (@cf/baai/bge-reranker-base, , ) |
retrieval_options | object | |
rewrite_model | string | (@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 | |
source | string | |
source_params | object | |
status | string | (default: waiting) |
sync_interval | number | Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). (900) |
type | string | (r2, web-crawler, ) |
List of instances.
| Name | Datatype | Description |
|---|---|---|
id | string | AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores. |
ai_gateway_id | string | |
public_endpoint_id | string | |
token_id | string (uuid) | |
ai_search_model | string | (@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 | string | (super_strict_match, close_enough, flexible_friend, anything_goes) (default: close_enough) |
chunk_overlap | integer | |
chunk_size | integer | |
created_at | string (date-time) | |
created_by | string | |
custom_metadata | array | |
embedding_model | string | (@cf/qwen/qwen3-embedding-0.6b, @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, openai/text-embedding-3-small, openai/text-embedding-3-large, , ) |
enable | boolean | |
engine_version | number | |
fusion_method | string | (max, rrf) (default: rrf) |
hybrid_search_enabled | boolean | Deprecated — use index_method instead. |
index_method | object | Controls which storage backends are used during indexing. Defaults to vector-only. |
indexing_options | object | |
last_activity | string (date-time) | |
max_num_results | integer | |
metadata | object | |
modified_at | string (date-time) | |
modified_by | string | |
namespace | string | |
paused | boolean | |
public_endpoint_params | object | |
reranking | boolean | |
reranking_model | string | (@cf/baai/bge-reranker-base, , ) |
retrieval_options | object | |
rewrite_model | string | (@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 | |
source | string | |
source_params | object | |
status | string | (default: waiting) |
sync_interval | number | Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). (900) |
type | string | (r2, web-crawler, ) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_by_account | select | account_id, id, name | Read instance. | |
list_by_account_by_account | select | account_id, name | page, per_page, search, namespace, order_by, order_by_direction | List instances. |
create_by_account | insert | account_id, name, id | Create a new instance. | |
update_by_account | replace | account_id, id, name | Update instance. | |
delete_by_account | delete | account_id, id, name | Delete instance. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
id | string | Resource ID. |
name | string | Resource name. |
namespace | string | Filter by namespace. |
order_by | string | Field to order results by. |
order_by_direction | string | Order direction. |
page | integer | Page number (1-indexed). |
per_page | integer | Number of results per page. |
search | string | Filter instances whose id contains this string (case-insensitive). |
SELECT examples
- get_by_account
- list_by_account_by_account
Read instance.
SELECT
id,
ai_gateway_id,
public_endpoint_id,
token_id,
ai_search_model,
cache,
cache_threshold,
chunk_overlap,
chunk_size,
created_at,
created_by,
custom_metadata,
embedding_model,
enable,
engine_version,
fusion_method,
hybrid_search_enabled,
index_method,
indexing_options,
last_activity,
max_num_results,
metadata,
modified_at,
modified_by,
namespace,
paused,
public_endpoint_params,
reranking,
reranking_model,
retrieval_options,
rewrite_model,
rewrite_query,
score_threshold,
source,
source_params,
status,
sync_interval,
type
FROM cloudflare.aisearch.namespace_instances
WHERE account_id = '{{ account_id }}' -- required
AND id = '{{ id }}' -- required
AND name = '{{ name }}' -- required
;
List instances.
SELECT
id,
ai_gateway_id,
public_endpoint_id,
token_id,
ai_search_model,
cache,
cache_threshold,
chunk_overlap,
chunk_size,
created_at,
created_by,
custom_metadata,
embedding_model,
enable,
engine_version,
fusion_method,
hybrid_search_enabled,
index_method,
indexing_options,
last_activity,
max_num_results,
metadata,
modified_at,
modified_by,
namespace,
paused,
public_endpoint_params,
reranking,
reranking_model,
retrieval_options,
rewrite_model,
rewrite_query,
score_threshold,
source,
source_params,
status,
sync_interval,
type
FROM cloudflare.aisearch.namespace_instances
WHERE account_id = '{{ account_id }}' -- required
AND name = '{{ name }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND search = '{{ search }}'
AND namespace = '{{ namespace }}'
AND order_by = '{{ order_by }}'
AND order_by_direction = '{{ order_by_direction }}'
;
INSERT examples
- create_by_account
- Manifest
Create a new instance.
INSERT INTO cloudflare.aisearch.namespace_instances (
ai_gateway_id,
ai_search_model,
cache,
cache_threshold,
chunk,
chunk_overlap,
chunk_size,
custom_metadata,
embedding_model,
fusion_method,
hybrid_search_enabled,
id,
index_method,
indexing_options,
max_num_results,
metadata,
public_endpoint_params,
reranking,
reranking_model,
retrieval_options,
rewrite_model,
rewrite_query,
score_threshold,
source,
source_params,
sync_interval,
token_id,
type,
account_id,
name
)
SELECT
'{{ ai_gateway_id }}',
'{{ ai_search_model }}',
{{ cache }},
'{{ cache_threshold }}',
{{ chunk }},
{{ chunk_overlap }},
{{ chunk_size }},
'{{ custom_metadata }}',
'{{ embedding_model }}',
'{{ fusion_method }}',
{{ hybrid_search_enabled }},
'{{ id }}' /* required */,
'{{ index_method }}',
'{{ indexing_options }}',
{{ max_num_results }},
'{{ metadata }}',
'{{ public_endpoint_params }}',
{{ reranking }},
'{{ reranking_model }}',
'{{ retrieval_options }}',
'{{ rewrite_model }}',
{{ rewrite_query }},
{{ score_threshold }},
'{{ source }}',
'{{ source_params }}',
{{ sync_interval }},
'{{ token_id }}',
'{{ type }}',
'{{ account_id }}',
'{{ name }}'
RETURNING
result,
success
;
# Description fields are for documentation purposes
- name: namespace_instances
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the namespace_instances resource.
- name: name
value: "{{ name }}"
description: Required parameter for the namespace_instances resource.
- name: ai_gateway_id
value: "{{ ai_gateway_id }}"
- name: ai_search_model
value: "{{ ai_search_model }}"
valid_values: ['@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', '', '']
- name: cache
value: {{ cache }}
default: true
- name: cache_threshold
value: "{{ cache_threshold }}"
valid_values: ['super_strict_match', 'close_enough', 'flexible_friend', 'anything_goes']
default: close_enough
- name: chunk
value: {{ chunk }}
default: true
- name: chunk_overlap
value: {{ chunk_overlap }}
default: 10
- name: chunk_size
value: {{ chunk_size }}
- name: custom_metadata
value:
- data_type: "{{ data_type }}"
field_name: "{{ field_name }}"
- name: embedding_model
value: "{{ embedding_model }}"
valid_values: ['@cf/qwen/qwen3-embedding-0.6b', '@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', 'openai/text-embedding-3-small', 'openai/text-embedding-3-large', '', '']
- name: fusion_method
value: "{{ fusion_method }}"
valid_values: ['max', 'rrf']
default: rrf
- name: hybrid_search_enabled
value: {{ hybrid_search_enabled }}
description: |
Deprecated — use index_method instead.
default: false
- name: id
value: "{{ id }}"
description: |
AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
- name: index_method
description: |
Controls which storage backends are used during indexing. Defaults to vector-only.
value:
keyword: {{ keyword }}
vector: {{ vector }}
default: [object Object]
- name: indexing_options
value:
keyword_tokenizer: "{{ keyword_tokenizer }}"
- name: max_num_results
value: {{ max_num_results }}
default: 10
- name: metadata
value:
created_from_aisearch_wizard: {{ created_from_aisearch_wizard }}
search_for_agents:
hostname: "{{ hostname }}"
zone_id: "{{ zone_id }}"
zone_name: "{{ zone_name }}"
worker_domain: "{{ worker_domain }}"
- name: public_endpoint_params
value:
authorized_hosts:
- "{{ authorized_hosts }}"
chat_completions_endpoint:
disabled: {{ disabled }}
enabled: {{ enabled }}
mcp:
description: "{{ description }}"
disabled: {{ disabled }}
rate_limit:
period_ms: {{ period_ms }}
requests: {{ requests }}
technique: "{{ technique }}"
search_endpoint:
disabled: {{ disabled }}
- name: reranking
value: {{ reranking }}
default: false
- name: reranking_model
value: "{{ reranking_model }}"
valid_values: ['@cf/baai/bge-reranker-base', '', '']
- name: retrieval_options
value:
boost_by:
- direction: "{{ direction }}"
field: "{{ field }}"
keyword_match_mode: "{{ keyword_match_mode }}"
- name: rewrite_model
value: "{{ rewrite_model }}"
valid_values: ['@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', '', '']
- name: rewrite_query
value: {{ rewrite_query }}
default: false
- name: score_threshold
value: {{ score_threshold }}
default: 0.4
- name: source
value: "{{ source }}"
- name: source_params
value:
exclude_items:
- "{{ exclude_items }}"
include_items:
- "{{ include_items }}"
prefix: "{{ prefix }}"
r2_jurisdiction: "{{ r2_jurisdiction }}"
web_crawler:
crawl_options:
depth: {{ depth }}
include_external_links: {{ include_external_links }}
include_subdomains: {{ include_subdomains }}
max_age: {{ max_age }}
source: "{{ source }}"
parse_options:
content_selector:
- path: "{{ path }}"
selector: "{{ selector }}"
include_headers: "{{ include_headers }}"
include_images: {{ include_images }}
specific_sitemaps:
- "{{ specific_sitemaps }}"
use_browser_rendering: {{ use_browser_rendering }}
parse_type: "{{ parse_type }}"
store_options:
r2_jurisdiction: "{{ r2_jurisdiction }}"
storage_id: "{{ storage_id }}"
storage_type: "{{ storage_type }}"
- name: sync_interval
value: {{ sync_interval }}
description: |
Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
valid_values: ['900']
default: 21600
- name: token_id
value: "{{ token_id }}"
- name: type
value: "{{ type }}"
valid_values: ['r2', 'web-crawler', '']
REPLACE examples
- update_by_account
Update instance.
REPLACE cloudflare.aisearch.namespace_instances
SET
ai_gateway_id = '{{ ai_gateway_id }}',
ai_search_model = '{{ ai_search_model }}',
cache = {{ cache }},
cache_threshold = '{{ cache_threshold }}',
chunk = {{ chunk }},
chunk_overlap = {{ chunk_overlap }},
chunk_size = {{ chunk_size }},
custom_metadata = '{{ custom_metadata }}',
embedding_model = '{{ embedding_model }}',
fusion_method = '{{ fusion_method }}',
index_method = '{{ index_method }}',
indexing_options = '{{ indexing_options }}',
max_num_results = {{ max_num_results }},
metadata = '{{ metadata }}',
paused = {{ paused }},
public_endpoint_params = '{{ public_endpoint_params }}',
reranking = {{ reranking }},
reranking_model = '{{ reranking_model }}',
retrieval_options = '{{ retrieval_options }}',
rewrite_model = '{{ rewrite_model }}',
rewrite_query = {{ rewrite_query }},
score_threshold = {{ score_threshold }},
source_params = '{{ source_params }}',
summarization = {{ summarization }},
summarization_model = '{{ summarization_model }}',
sync_interval = {{ sync_interval }},
system_prompt_ai_search = '{{ system_prompt_ai_search }}',
system_prompt_index_summarization = '{{ system_prompt_index_summarization }}',
system_prompt_rewrite_query = '{{ system_prompt_rewrite_query }}',
token_id = '{{ token_id }}'
WHERE
account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required
AND name = '{{ name }}' --required
RETURNING
result,
success;
DELETE examples
- delete_by_account
Delete instance.
DELETE FROM cloudflare.aisearch.namespace_instances
WHERE account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required
AND name = '{{ name }}' --required
;