Skip to main content

namespace_instances

Creates, updates, deletes, gets or lists a namespace_instances resource.

Overview

Namenamespace_instances
TypeResource
Idcloudflare.aisearch.namespace_instances

Fields

The following fields are returned by SELECT queries:

Returns the instance.

NameDatatypeDescription
idstringAI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
ai_gateway_idstring
public_endpoint_idstring
token_idstring (uuid)
ai_search_modelstring (@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, , )
cacheboolean
cache_thresholdstring (super_strict_match, close_enough, flexible_friend, anything_goes) (default: close_enough)
chunk_overlapinteger
chunk_sizeinteger
created_atstring (date-time)
created_bystring
custom_metadataarray
embedding_modelstring (@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, , )
enableboolean
engine_versionnumber
fusion_methodstring (max, rrf) (default: rrf)
hybrid_search_enabledbooleanDeprecated — use index_method instead.
index_methodobjectControls which storage backends are used during indexing. Defaults to vector-only.
indexing_optionsobject
last_activitystring (date-time)
max_num_resultsinteger
metadataobject
modified_atstring (date-time)
modified_bystring
namespacestring
pausedboolean
public_endpoint_paramsobject
rerankingboolean
reranking_modelstring (@cf/baai/bge-reranker-base, , )
retrieval_optionsobject
rewrite_modelstring (@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_queryboolean
score_thresholdnumber
sourcestring
source_paramsobject
statusstring (default: waiting)
sync_intervalnumberInterval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). (900)
typestring (r2, web-crawler, )

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_accountselectaccount_id, id, nameRead instance.
list_by_account_by_accountselectaccount_id, namepage, per_page, search, namespace, order_by, order_by_directionList instances.
create_by_accountinsertaccount_id, name, idCreate a new instance.
update_by_accountreplaceaccount_id, id, nameUpdate instance.
delete_by_accountdeleteaccount_id, id, nameDelete 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
idstringResource ID.
namestringResource name.
namespacestringFilter by namespace.
order_bystringField to order results by.
order_by_directionstringOrder direction.
pageintegerPage number (1-indexed).
per_pageintegerNumber of results per page.

SELECT examples

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
;

INSERT examples

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
;

REPLACE examples

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 instance.

DELETE FROM cloudflare.aisearch.namespace_instances
WHERE account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required
AND name = '{{ name }}' --required
;