Skip to content
Start here

Create new instance.

client.AISearch.Instances.New(ctx, params) (*InstanceNewResponse, error)
POST/accounts/{account_id}/ai-search/instances

Create a new instance.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

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

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

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

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
params InstanceNewParams
AccountID param.Field[string]

Path param

ID param.Field[string]

Body param: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
AIGatewayID param.Field[string]Optional

Body param

AISearchModel param.Field[InstanceNewParamsAISearchModel]Optional

Body param

const InstanceNewParamsAISearchModelCfMetaLlama3_3_70bInstructFp8Fast InstanceNewParamsAISearchModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceNewParamsAISearchModelCfZaiOrgGlm4_7Flash InstanceNewParamsAISearchModel = "@cf/zai-org/glm-4.7-flash"
const InstanceNewParamsAISearchModelCfMetaLlama3_1_8bInstructFast InstanceNewParamsAISearchModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceNewParamsAISearchModelCfMetaLlama3_1_8bInstructFp8 InstanceNewParamsAISearchModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceNewParamsAISearchModelCfMetaLlama4Scout17b16eInstruct InstanceNewParamsAISearchModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceNewParamsAISearchModelCfQwenQwen3_30bA3bFp8 InstanceNewParamsAISearchModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceNewParamsAISearchModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceNewParamsAISearchModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceNewParamsAISearchModelCfMoonshotaiKimiK2Instruct InstanceNewParamsAISearchModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceNewParamsAISearchModelCfGoogleGemma3_12bIt InstanceNewParamsAISearchModel = "@cf/google/gemma-3-12b-it"
const InstanceNewParamsAISearchModelCfGoogleGemma4_26bA4bIt InstanceNewParamsAISearchModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceNewParamsAISearchModelCfMoonshotaiKimiK2_5 InstanceNewParamsAISearchModel = "@cf/moonshotai/kimi-k2.5"
const InstanceNewParamsAISearchModelAnthropicClaude3_7Sonnet InstanceNewParamsAISearchModel = "anthropic/claude-3-7-sonnet"
const InstanceNewParamsAISearchModelAnthropicClaudeSonnet4 InstanceNewParamsAISearchModel = "anthropic/claude-sonnet-4"
const InstanceNewParamsAISearchModelAnthropicClaudeOpus4 InstanceNewParamsAISearchModel = "anthropic/claude-opus-4"
const InstanceNewParamsAISearchModelAnthropicClaude3_5Haiku InstanceNewParamsAISearchModel = "anthropic/claude-3-5-haiku"
const InstanceNewParamsAISearchModelCerebrasQwen3_235bA22bInstruct InstanceNewParamsAISearchModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceNewParamsAISearchModelCerebrasQwen3_235bA22bThinking InstanceNewParamsAISearchModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceNewParamsAISearchModelCerebrasLlama3_3_70b InstanceNewParamsAISearchModel = "cerebras/llama-3.3-70b"
const InstanceNewParamsAISearchModelCerebrasLlama4Maverick17b128eInstruct InstanceNewParamsAISearchModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceNewParamsAISearchModelCerebrasLlama4Scout17b16eInstruct InstanceNewParamsAISearchModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceNewParamsAISearchModelCerebrasGptOSs120b InstanceNewParamsAISearchModel = "cerebras/gpt-oss-120b"
const InstanceNewParamsAISearchModelGoogleAIStudioGemini2_5Flash InstanceNewParamsAISearchModel = "google-ai-studio/gemini-2.5-flash"
const InstanceNewParamsAISearchModelGoogleAIStudioGemini2_5Pro InstanceNewParamsAISearchModel = "google-ai-studio/gemini-2.5-pro"
const InstanceNewParamsAISearchModelGrokGrok4 InstanceNewParamsAISearchModel = "grok/grok-4"
const InstanceNewParamsAISearchModelGroqLlama3_3_70bVersatile InstanceNewParamsAISearchModel = "groq/llama-3.3-70b-versatile"
const InstanceNewParamsAISearchModelGroqLlama3_1_8bInstant InstanceNewParamsAISearchModel = "groq/llama-3.1-8b-instant"
const InstanceNewParamsAISearchModelOpenAIGpt5 InstanceNewParamsAISearchModel = "openai/gpt-5"
const InstanceNewParamsAISearchModelOpenAIGpt5Mini InstanceNewParamsAISearchModel = "openai/gpt-5-mini"
const InstanceNewParamsAISearchModelOpenAIGpt5Nano InstanceNewParamsAISearchModel = "openai/gpt-5-nano"
const InstanceNewParamsAISearchModelEmpty InstanceNewParamsAISearchModel = ""
Cache param.Field[bool]Optional

Body param

CacheThreshold param.Field[InstanceNewParamsCacheThreshold]Optional

Body param

const InstanceNewParamsCacheThresholdSuperStrictMatch InstanceNewParamsCacheThreshold = "super_strict_match"
const InstanceNewParamsCacheThresholdCloseEnough InstanceNewParamsCacheThreshold = "close_enough"
const InstanceNewParamsCacheThresholdFlexibleFriend InstanceNewParamsCacheThreshold = "flexible_friend"
const InstanceNewParamsCacheThresholdAnythingGoes InstanceNewParamsCacheThreshold = "anything_goes"
CacheTTL param.Field[InstanceNewParamsCacheTTL]Optional

Body param: 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).

const InstanceNewParamsCacheTTL600 InstanceNewParamsCacheTTL = 600
const InstanceNewParamsCacheTTL1800 InstanceNewParamsCacheTTL = 1800
const InstanceNewParamsCacheTTL3600 InstanceNewParamsCacheTTL = 3600
const InstanceNewParamsCacheTTL7200 InstanceNewParamsCacheTTL = 7200
const InstanceNewParamsCacheTTL21600 InstanceNewParamsCacheTTL = 21600
const InstanceNewParamsCacheTTL43200 InstanceNewParamsCacheTTL = 43200
const InstanceNewParamsCacheTTL86400 InstanceNewParamsCacheTTL = 86400
const InstanceNewParamsCacheTTL172800 InstanceNewParamsCacheTTL = 172800
const InstanceNewParamsCacheTTL259200 InstanceNewParamsCacheTTL = 259200
const InstanceNewParamsCacheTTL518400 InstanceNewParamsCacheTTL = 518400
Chunk param.Field[bool]Optional

Body param

ChunkOverlap param.Field[int64]Optional

Body param

maximum30
minimum0
ChunkSize param.Field[int64]Optional

Body param

minimum64
CustomMetadata param.Field[[]InstanceNewParamsCustomMetadata]Optional

Body param

DataType InstanceNewParamsCustomMetadataDataType
One of the following:
const InstanceNewParamsCustomMetadataDataTypeText InstanceNewParamsCustomMetadataDataType = "text"
const InstanceNewParamsCustomMetadataDataTypeNumber InstanceNewParamsCustomMetadataDataType = "number"
const InstanceNewParamsCustomMetadataDataTypeBoolean InstanceNewParamsCustomMetadataDataType = "boolean"
const InstanceNewParamsCustomMetadataDataTypeDatetime InstanceNewParamsCustomMetadataDataType = "datetime"
FieldName string
maxLength64
minLength1
EmbeddingModel param.Field[InstanceNewParamsEmbeddingModel]Optional

Body param

const InstanceNewParamsEmbeddingModelCfQwenQwen3Embedding0_6b InstanceNewParamsEmbeddingModel = "@cf/qwen/qwen3-embedding-0.6b"
const InstanceNewParamsEmbeddingModelCfBaaiBgeM3 InstanceNewParamsEmbeddingModel = "@cf/baai/bge-m3"
const InstanceNewParamsEmbeddingModelCfBaaiBgeLargeEnV1_5 InstanceNewParamsEmbeddingModel = "@cf/baai/bge-large-en-v1.5"
const InstanceNewParamsEmbeddingModelCfGoogleEmbeddinggemma300m InstanceNewParamsEmbeddingModel = "@cf/google/embeddinggemma-300m"
const InstanceNewParamsEmbeddingModelGoogleAIStudioGeminiEmbedding001 InstanceNewParamsEmbeddingModel = "google-ai-studio/gemini-embedding-001"
const InstanceNewParamsEmbeddingModelGoogleAIStudioGeminiEmbedding2Preview InstanceNewParamsEmbeddingModel = "google-ai-studio/gemini-embedding-2-preview"
const InstanceNewParamsEmbeddingModelOpenAITextEmbedding3Small InstanceNewParamsEmbeddingModel = "openai/text-embedding-3-small"
const InstanceNewParamsEmbeddingModelOpenAITextEmbedding3Large InstanceNewParamsEmbeddingModel = "openai/text-embedding-3-large"
const InstanceNewParamsEmbeddingModelEmpty InstanceNewParamsEmbeddingModel = ""
FusionMethod param.Field[InstanceNewParamsFusionMethod]Optional

Body param

const InstanceNewParamsFusionMethodMax InstanceNewParamsFusionMethod = "max"
const InstanceNewParamsFusionMethodRrf InstanceNewParamsFusionMethod = "rrf"
DeprecatedHybridSearchEnabled param.Field[bool]Optional

Body param: Deprecated — use index_method instead.

IndexMethod param.Field[InstanceNewParamsIndexMethod]Optional

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

Keyword bool

Enable keyword (BM25) storage backend.

Vector bool

Enable vector (embedding) storage backend.

IndexingOptions param.Field[InstanceNewParamsIndexingOptions]Optional

Body param

KeywordTokenizer InstanceNewParamsIndexingOptionsKeywordTokenizerOptional

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:
const InstanceNewParamsIndexingOptionsKeywordTokenizerPorter InstanceNewParamsIndexingOptionsKeywordTokenizer = "porter"
const InstanceNewParamsIndexingOptionsKeywordTokenizerTrigram InstanceNewParamsIndexingOptionsKeywordTokenizer = "trigram"
MaxNumResults param.Field[int64]Optional

Body param

maximum50
minimum1
Metadata param.Field[InstanceNewParamsMetadata]Optional

Body param

CreatedFromAISearchWizard boolOptional
WorkerDomain stringOptional
PublicEndpointParams param.Field[InstanceNewParamsPublicEndpointParams]Optional

Body param

AuthorizedHosts []stringOptional
ChatCompletionsEndpoint InstanceNewParamsPublicEndpointParamsChatCompletionsEndpointOptional
Disabled boolOptional

Disable chat completions endpoint for this public endpoint

Enabled boolOptional
Mcp InstanceNewParamsPublicEndpointParamsMcpOptional
Description stringOptional
Disabled boolOptional

Disable MCP endpoint for this public endpoint

RateLimit InstanceNewParamsPublicEndpointParamsRateLimitOptional
PeriodMs int64Optional
maximum3600000
minimum60000
Requests int64Optional
minimum1
Technique InstanceNewParamsPublicEndpointParamsRateLimitTechniqueOptional
One of the following:
const InstanceNewParamsPublicEndpointParamsRateLimitTechniqueFixed InstanceNewParamsPublicEndpointParamsRateLimitTechnique = "fixed"
const InstanceNewParamsPublicEndpointParamsRateLimitTechniqueSliding InstanceNewParamsPublicEndpointParamsRateLimitTechnique = "sliding"
SearchEndpoint InstanceNewParamsPublicEndpointParamsSearchEndpointOptional
Disabled boolOptional

Disable search endpoint for this public endpoint

Reranking param.Field[bool]Optional

Body param

RerankingModel param.Field[InstanceNewParamsRerankingModel]Optional

Body param

const InstanceNewParamsRerankingModelCfBaaiBgeRerankerBase InstanceNewParamsRerankingModel = "@cf/baai/bge-reranker-base"
const InstanceNewParamsRerankingModelEmpty InstanceNewParamsRerankingModel = ""
RetrievalOptions param.Field[InstanceNewParamsRetrievalOptions]Optional

Body param

BoostBy []InstanceNewParamsRetrievalOptionsBoostByOptional

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric 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 asc/desc directions; text/boolean fields support exists/not_exists.

maxLength64
minLength1
Direction InstanceNewParamsRetrievalOptionsBoostByDirectionOptional

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:
const InstanceNewParamsRetrievalOptionsBoostByDirectionAsc InstanceNewParamsRetrievalOptionsBoostByDirection = "asc"
const InstanceNewParamsRetrievalOptionsBoostByDirectionDesc InstanceNewParamsRetrievalOptionsBoostByDirection = "desc"
const InstanceNewParamsRetrievalOptionsBoostByDirectionExists InstanceNewParamsRetrievalOptionsBoostByDirection = "exists"
const InstanceNewParamsRetrievalOptionsBoostByDirectionNotExists InstanceNewParamsRetrievalOptionsBoostByDirection = "not_exists"
KeywordMatchMode InstanceNewParamsRetrievalOptionsKeywordMatchModeOptional

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. Defaults to ‘and’.

One of the following:
const InstanceNewParamsRetrievalOptionsKeywordMatchModeAnd InstanceNewParamsRetrievalOptionsKeywordMatchMode = "and"
const InstanceNewParamsRetrievalOptionsKeywordMatchModeOr InstanceNewParamsRetrievalOptionsKeywordMatchMode = "or"
RewriteModel param.Field[InstanceNewParamsRewriteModel]Optional

Body param

const InstanceNewParamsRewriteModelCfMetaLlama3_3_70bInstructFp8Fast InstanceNewParamsRewriteModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceNewParamsRewriteModelCfZaiOrgGlm4_7Flash InstanceNewParamsRewriteModel = "@cf/zai-org/glm-4.7-flash"
const InstanceNewParamsRewriteModelCfMetaLlama3_1_8bInstructFast InstanceNewParamsRewriteModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceNewParamsRewriteModelCfMetaLlama3_1_8bInstructFp8 InstanceNewParamsRewriteModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceNewParamsRewriteModelCfMetaLlama4Scout17b16eInstruct InstanceNewParamsRewriteModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceNewParamsRewriteModelCfQwenQwen3_30bA3bFp8 InstanceNewParamsRewriteModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceNewParamsRewriteModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceNewParamsRewriteModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceNewParamsRewriteModelCfMoonshotaiKimiK2Instruct InstanceNewParamsRewriteModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceNewParamsRewriteModelCfGoogleGemma3_12bIt InstanceNewParamsRewriteModel = "@cf/google/gemma-3-12b-it"
const InstanceNewParamsRewriteModelCfGoogleGemma4_26bA4bIt InstanceNewParamsRewriteModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceNewParamsRewriteModelCfMoonshotaiKimiK2_5 InstanceNewParamsRewriteModel = "@cf/moonshotai/kimi-k2.5"
const InstanceNewParamsRewriteModelAnthropicClaude3_7Sonnet InstanceNewParamsRewriteModel = "anthropic/claude-3-7-sonnet"
const InstanceNewParamsRewriteModelAnthropicClaudeSonnet4 InstanceNewParamsRewriteModel = "anthropic/claude-sonnet-4"
const InstanceNewParamsRewriteModelAnthropicClaudeOpus4 InstanceNewParamsRewriteModel = "anthropic/claude-opus-4"
const InstanceNewParamsRewriteModelAnthropicClaude3_5Haiku InstanceNewParamsRewriteModel = "anthropic/claude-3-5-haiku"
const InstanceNewParamsRewriteModelCerebrasQwen3_235bA22bInstruct InstanceNewParamsRewriteModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceNewParamsRewriteModelCerebrasQwen3_235bA22bThinking InstanceNewParamsRewriteModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceNewParamsRewriteModelCerebrasLlama3_3_70b InstanceNewParamsRewriteModel = "cerebras/llama-3.3-70b"
const InstanceNewParamsRewriteModelCerebrasLlama4Maverick17b128eInstruct InstanceNewParamsRewriteModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceNewParamsRewriteModelCerebrasLlama4Scout17b16eInstruct InstanceNewParamsRewriteModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceNewParamsRewriteModelCerebrasGptOSs120b InstanceNewParamsRewriteModel = "cerebras/gpt-oss-120b"
const InstanceNewParamsRewriteModelGoogleAIStudioGemini2_5Flash InstanceNewParamsRewriteModel = "google-ai-studio/gemini-2.5-flash"
const InstanceNewParamsRewriteModelGoogleAIStudioGemini2_5Pro InstanceNewParamsRewriteModel = "google-ai-studio/gemini-2.5-pro"
const InstanceNewParamsRewriteModelGrokGrok4 InstanceNewParamsRewriteModel = "grok/grok-4"
const InstanceNewParamsRewriteModelGroqLlama3_3_70bVersatile InstanceNewParamsRewriteModel = "groq/llama-3.3-70b-versatile"
const InstanceNewParamsRewriteModelGroqLlama3_1_8bInstant InstanceNewParamsRewriteModel = "groq/llama-3.1-8b-instant"
const InstanceNewParamsRewriteModelOpenAIGpt5 InstanceNewParamsRewriteModel = "openai/gpt-5"
const InstanceNewParamsRewriteModelOpenAIGpt5Mini InstanceNewParamsRewriteModel = "openai/gpt-5-mini"
const InstanceNewParamsRewriteModelOpenAIGpt5Nano InstanceNewParamsRewriteModel = "openai/gpt-5-nano"
const InstanceNewParamsRewriteModelEmpty InstanceNewParamsRewriteModel = ""
RewriteQuery param.Field[bool]Optional

Body param

ScoreThreshold param.Field[float64]Optional

Body param

maximum1
minimum0
Source param.Field[string]Optional

Body param

SourceParams param.Field[InstanceNewParamsSourceParams]Optional

Body param

ExcludeItems []stringOptional

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)

IncludeItems []stringOptional

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)

Prefix stringOptional
R2Jurisdiction stringOptional
WebCrawler InstanceNewParamsSourceParamsWebCrawlerOptional
CrawlOptions InstanceNewParamsSourceParamsWebCrawlerCrawlOptionsOptional
Depth float64Optional
maximum100000
minimum1
IncludeSubdomains boolOptional
MaxAge float64Optional
maximum604800
minimum0
Source InstanceNewParamsSourceParamsWebCrawlerCrawlOptionsSourceOptional
One of the following:
const InstanceNewParamsSourceParamsWebCrawlerCrawlOptionsSourceAll InstanceNewParamsSourceParamsWebCrawlerCrawlOptionsSource = "all"
const InstanceNewParamsSourceParamsWebCrawlerCrawlOptionsSourceSitemaps InstanceNewParamsSourceParamsWebCrawlerCrawlOptionsSource = "sitemaps"
const InstanceNewParamsSourceParamsWebCrawlerCrawlOptionsSourceLinks InstanceNewParamsSourceParamsWebCrawlerCrawlOptionsSource = "links"
ParseOptions InstanceNewParamsSourceParamsWebCrawlerParseOptionsOptional
ContentSelector []InstanceNewParamsSourceParamsWebCrawlerParseOptionsContentSelectorOptional

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
IncludeHeaders map[string, string]Optional

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

IncludeImages boolOptional
SpecificSitemaps []stringOptional

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

UseBrowserRendering boolOptional
ParseType InstanceNewParamsSourceParamsWebCrawlerParseTypeOptional
One of the following:
const InstanceNewParamsSourceParamsWebCrawlerParseTypeSitemap InstanceNewParamsSourceParamsWebCrawlerParseType = "sitemap"
const InstanceNewParamsSourceParamsWebCrawlerParseTypeFeedRss InstanceNewParamsSourceParamsWebCrawlerParseType = "feed-rss"
const InstanceNewParamsSourceParamsWebCrawlerParseTypeCrawl InstanceNewParamsSourceParamsWebCrawlerParseType = "crawl"
StoreOptions InstanceNewParamsSourceParamsWebCrawlerStoreOptionsOptional
StorageID string
R2Jurisdiction stringOptional
StorageType ProviderOptional
SyncInterval param.Field[InstanceNewParamsSyncInterval]Optional

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

const InstanceNewParamsSyncInterval900 InstanceNewParamsSyncInterval = 900
const InstanceNewParamsSyncInterval1800 InstanceNewParamsSyncInterval = 1800
const InstanceNewParamsSyncInterval3600 InstanceNewParamsSyncInterval = 3600
const InstanceNewParamsSyncInterval7200 InstanceNewParamsSyncInterval = 7200
const InstanceNewParamsSyncInterval14400 InstanceNewParamsSyncInterval = 14400
const InstanceNewParamsSyncInterval21600 InstanceNewParamsSyncInterval = 21600
const InstanceNewParamsSyncInterval43200 InstanceNewParamsSyncInterval = 43200
const InstanceNewParamsSyncInterval86400 InstanceNewParamsSyncInterval = 86400
TokenID param.Field[string]Optional

Body param

formatuuid
Type param.Field[InstanceNewParamsType]Optional

Body param

const InstanceNewParamsTypeR2 InstanceNewParamsType = "r2"
const InstanceNewParamsTypeWebCrawler InstanceNewParamsType = "web-crawler"
ReturnsExpand Collapse
type InstanceNewResponse struct{…}
ID string

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

maxLength64
minLength1
CreatedAt Time
formatdate-time
ModifiedAt Time
formatdate-time
AIGatewayID stringOptional
AISearchModel InstanceNewResponseAISearchModelOptional
One of the following:
const InstanceNewResponseAISearchModelCfMetaLlama3_3_70bInstructFp8Fast InstanceNewResponseAISearchModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceNewResponseAISearchModelCfZaiOrgGlm4_7Flash InstanceNewResponseAISearchModel = "@cf/zai-org/glm-4.7-flash"
const InstanceNewResponseAISearchModelCfMetaLlama3_1_8bInstructFast InstanceNewResponseAISearchModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceNewResponseAISearchModelCfMetaLlama3_1_8bInstructFp8 InstanceNewResponseAISearchModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceNewResponseAISearchModelCfMetaLlama4Scout17b16eInstruct InstanceNewResponseAISearchModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceNewResponseAISearchModelCfQwenQwen3_30bA3bFp8 InstanceNewResponseAISearchModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceNewResponseAISearchModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceNewResponseAISearchModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceNewResponseAISearchModelCfMoonshotaiKimiK2Instruct InstanceNewResponseAISearchModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceNewResponseAISearchModelCfGoogleGemma3_12bIt InstanceNewResponseAISearchModel = "@cf/google/gemma-3-12b-it"
const InstanceNewResponseAISearchModelCfGoogleGemma4_26bA4bIt InstanceNewResponseAISearchModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceNewResponseAISearchModelCfMoonshotaiKimiK2_5 InstanceNewResponseAISearchModel = "@cf/moonshotai/kimi-k2.5"
const InstanceNewResponseAISearchModelAnthropicClaude3_7Sonnet InstanceNewResponseAISearchModel = "anthropic/claude-3-7-sonnet"
const InstanceNewResponseAISearchModelAnthropicClaudeSonnet4 InstanceNewResponseAISearchModel = "anthropic/claude-sonnet-4"
const InstanceNewResponseAISearchModelAnthropicClaudeOpus4 InstanceNewResponseAISearchModel = "anthropic/claude-opus-4"
const InstanceNewResponseAISearchModelAnthropicClaude3_5Haiku InstanceNewResponseAISearchModel = "anthropic/claude-3-5-haiku"
const InstanceNewResponseAISearchModelCerebrasQwen3_235bA22bInstruct InstanceNewResponseAISearchModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceNewResponseAISearchModelCerebrasQwen3_235bA22bThinking InstanceNewResponseAISearchModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceNewResponseAISearchModelCerebrasLlama3_3_70b InstanceNewResponseAISearchModel = "cerebras/llama-3.3-70b"
const InstanceNewResponseAISearchModelCerebrasLlama4Maverick17b128eInstruct InstanceNewResponseAISearchModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceNewResponseAISearchModelCerebrasLlama4Scout17b16eInstruct InstanceNewResponseAISearchModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceNewResponseAISearchModelCerebrasGptOSs120b InstanceNewResponseAISearchModel = "cerebras/gpt-oss-120b"
const InstanceNewResponseAISearchModelGoogleAIStudioGemini2_5Flash InstanceNewResponseAISearchModel = "google-ai-studio/gemini-2.5-flash"
const InstanceNewResponseAISearchModelGoogleAIStudioGemini2_5Pro InstanceNewResponseAISearchModel = "google-ai-studio/gemini-2.5-pro"
const InstanceNewResponseAISearchModelGrokGrok4 InstanceNewResponseAISearchModel = "grok/grok-4"
const InstanceNewResponseAISearchModelGroqLlama3_3_70bVersatile InstanceNewResponseAISearchModel = "groq/llama-3.3-70b-versatile"
const InstanceNewResponseAISearchModelGroqLlama3_1_8bInstant InstanceNewResponseAISearchModel = "groq/llama-3.1-8b-instant"
const InstanceNewResponseAISearchModelOpenAIGpt5 InstanceNewResponseAISearchModel = "openai/gpt-5"
const InstanceNewResponseAISearchModelOpenAIGpt5Mini InstanceNewResponseAISearchModel = "openai/gpt-5-mini"
const InstanceNewResponseAISearchModelOpenAIGpt5Nano InstanceNewResponseAISearchModel = "openai/gpt-5-nano"
const InstanceNewResponseAISearchModelEmpty InstanceNewResponseAISearchModel = ""
Cache boolOptional
CacheThreshold InstanceNewResponseCacheThresholdOptional
One of the following:
const InstanceNewResponseCacheThresholdSuperStrictMatch InstanceNewResponseCacheThreshold = "super_strict_match"
const InstanceNewResponseCacheThresholdCloseEnough InstanceNewResponseCacheThreshold = "close_enough"
const InstanceNewResponseCacheThresholdFlexibleFriend InstanceNewResponseCacheThreshold = "flexible_friend"
const InstanceNewResponseCacheThresholdAnythingGoes InstanceNewResponseCacheThreshold = "anything_goes"
CacheTTL InstanceNewResponseCacheTTLOptional

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:
const InstanceNewResponseCacheTTL600 InstanceNewResponseCacheTTL = 600
const InstanceNewResponseCacheTTL1800 InstanceNewResponseCacheTTL = 1800
const InstanceNewResponseCacheTTL3600 InstanceNewResponseCacheTTL = 3600
const InstanceNewResponseCacheTTL7200 InstanceNewResponseCacheTTL = 7200
const InstanceNewResponseCacheTTL21600 InstanceNewResponseCacheTTL = 21600
const InstanceNewResponseCacheTTL43200 InstanceNewResponseCacheTTL = 43200
const InstanceNewResponseCacheTTL86400 InstanceNewResponseCacheTTL = 86400
const InstanceNewResponseCacheTTL172800 InstanceNewResponseCacheTTL = 172800
const InstanceNewResponseCacheTTL259200 InstanceNewResponseCacheTTL = 259200
const InstanceNewResponseCacheTTL518400 InstanceNewResponseCacheTTL = 518400
ChunkOverlap int64Optional
maximum30
minimum0
ChunkSize int64Optional
minimum64
CreatedBy stringOptional
CustomMetadata []InstanceNewResponseCustomMetadataOptional
DataType InstanceNewResponseCustomMetadataDataType
One of the following:
const InstanceNewResponseCustomMetadataDataTypeText InstanceNewResponseCustomMetadataDataType = "text"
const InstanceNewResponseCustomMetadataDataTypeNumber InstanceNewResponseCustomMetadataDataType = "number"
const InstanceNewResponseCustomMetadataDataTypeBoolean InstanceNewResponseCustomMetadataDataType = "boolean"
const InstanceNewResponseCustomMetadataDataTypeDatetime InstanceNewResponseCustomMetadataDataType = "datetime"
FieldName string
maxLength64
minLength1
EmbeddingModel InstanceNewResponseEmbeddingModelOptional
One of the following:
const InstanceNewResponseEmbeddingModelCfQwenQwen3Embedding0_6b InstanceNewResponseEmbeddingModel = "@cf/qwen/qwen3-embedding-0.6b"
const InstanceNewResponseEmbeddingModelCfBaaiBgeM3 InstanceNewResponseEmbeddingModel = "@cf/baai/bge-m3"
const InstanceNewResponseEmbeddingModelCfBaaiBgeLargeEnV1_5 InstanceNewResponseEmbeddingModel = "@cf/baai/bge-large-en-v1.5"
const InstanceNewResponseEmbeddingModelCfGoogleEmbeddinggemma300m InstanceNewResponseEmbeddingModel = "@cf/google/embeddinggemma-300m"
const InstanceNewResponseEmbeddingModelGoogleAIStudioGeminiEmbedding001 InstanceNewResponseEmbeddingModel = "google-ai-studio/gemini-embedding-001"
const InstanceNewResponseEmbeddingModelGoogleAIStudioGeminiEmbedding2Preview InstanceNewResponseEmbeddingModel = "google-ai-studio/gemini-embedding-2-preview"
const InstanceNewResponseEmbeddingModelOpenAITextEmbedding3Small InstanceNewResponseEmbeddingModel = "openai/text-embedding-3-small"
const InstanceNewResponseEmbeddingModelOpenAITextEmbedding3Large InstanceNewResponseEmbeddingModel = "openai/text-embedding-3-large"
const InstanceNewResponseEmbeddingModelEmpty InstanceNewResponseEmbeddingModel = ""
Enable boolOptional
EngineVersion float64Optional
FusionMethod InstanceNewResponseFusionMethodOptional
One of the following:
const InstanceNewResponseFusionMethodMax InstanceNewResponseFusionMethod = "max"
const InstanceNewResponseFusionMethodRrf InstanceNewResponseFusionMethod = "rrf"
DeprecatedHybridSearchEnabled boolOptional

Deprecated — use index_method instead.

IndexMethod InstanceNewResponseIndexMethodOptional

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

Keyword bool

Enable keyword (BM25) storage backend.

Vector bool

Enable vector (embedding) storage backend.

IndexingOptions InstanceNewResponseIndexingOptionsOptional
KeywordTokenizer InstanceNewResponseIndexingOptionsKeywordTokenizerOptional

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:
const InstanceNewResponseIndexingOptionsKeywordTokenizerPorter InstanceNewResponseIndexingOptionsKeywordTokenizer = "porter"
const InstanceNewResponseIndexingOptionsKeywordTokenizerTrigram InstanceNewResponseIndexingOptionsKeywordTokenizer = "trigram"
LastActivity TimeOptional
formatdate-time
MaxNumResults int64Optional
maximum50
minimum1
Metadata InstanceNewResponseMetadataOptional
CreatedFromAISearchWizard boolOptional
WorkerDomain stringOptional
ModifiedBy stringOptional
Namespace stringOptional
Paused boolOptional
PublicEndpointID stringOptional
PublicEndpointParams InstanceNewResponsePublicEndpointParamsOptional
AuthorizedHosts []stringOptional
ChatCompletionsEndpoint InstanceNewResponsePublicEndpointParamsChatCompletionsEndpointOptional
Disabled boolOptional

Disable chat completions endpoint for this public endpoint

Enabled boolOptional
Mcp InstanceNewResponsePublicEndpointParamsMcpOptional
Description stringOptional
Disabled boolOptional

Disable MCP endpoint for this public endpoint

RateLimit InstanceNewResponsePublicEndpointParamsRateLimitOptional
PeriodMs int64Optional
maximum3600000
minimum60000
Requests int64Optional
minimum1
Technique InstanceNewResponsePublicEndpointParamsRateLimitTechniqueOptional
One of the following:
const InstanceNewResponsePublicEndpointParamsRateLimitTechniqueFixed InstanceNewResponsePublicEndpointParamsRateLimitTechnique = "fixed"
const InstanceNewResponsePublicEndpointParamsRateLimitTechniqueSliding InstanceNewResponsePublicEndpointParamsRateLimitTechnique = "sliding"
SearchEndpoint InstanceNewResponsePublicEndpointParamsSearchEndpointOptional
Disabled boolOptional

Disable search endpoint for this public endpoint

Reranking boolOptional
RerankingModel InstanceNewResponseRerankingModelOptional
One of the following:
const InstanceNewResponseRerankingModelCfBaaiBgeRerankerBase InstanceNewResponseRerankingModel = "@cf/baai/bge-reranker-base"
const InstanceNewResponseRerankingModelEmpty InstanceNewResponseRerankingModel = ""
RetrievalOptions InstanceNewResponseRetrievalOptionsOptional
BoostBy []InstanceNewResponseRetrievalOptionsBoostByOptional

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric 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 asc/desc directions; text/boolean fields support exists/not_exists.

maxLength64
minLength1
Direction InstanceNewResponseRetrievalOptionsBoostByDirectionOptional

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:
const InstanceNewResponseRetrievalOptionsBoostByDirectionAsc InstanceNewResponseRetrievalOptionsBoostByDirection = "asc"
const InstanceNewResponseRetrievalOptionsBoostByDirectionDesc InstanceNewResponseRetrievalOptionsBoostByDirection = "desc"
const InstanceNewResponseRetrievalOptionsBoostByDirectionExists InstanceNewResponseRetrievalOptionsBoostByDirection = "exists"
const InstanceNewResponseRetrievalOptionsBoostByDirectionNotExists InstanceNewResponseRetrievalOptionsBoostByDirection = "not_exists"
KeywordMatchMode InstanceNewResponseRetrievalOptionsKeywordMatchModeOptional

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. Defaults to ‘and’.

One of the following:
const InstanceNewResponseRetrievalOptionsKeywordMatchModeAnd InstanceNewResponseRetrievalOptionsKeywordMatchMode = "and"
const InstanceNewResponseRetrievalOptionsKeywordMatchModeOr InstanceNewResponseRetrievalOptionsKeywordMatchMode = "or"
RewriteModel InstanceNewResponseRewriteModelOptional
One of the following:
const InstanceNewResponseRewriteModelCfMetaLlama3_3_70bInstructFp8Fast InstanceNewResponseRewriteModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceNewResponseRewriteModelCfZaiOrgGlm4_7Flash InstanceNewResponseRewriteModel = "@cf/zai-org/glm-4.7-flash"
const InstanceNewResponseRewriteModelCfMetaLlama3_1_8bInstructFast InstanceNewResponseRewriteModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceNewResponseRewriteModelCfMetaLlama3_1_8bInstructFp8 InstanceNewResponseRewriteModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceNewResponseRewriteModelCfMetaLlama4Scout17b16eInstruct InstanceNewResponseRewriteModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceNewResponseRewriteModelCfQwenQwen3_30bA3bFp8 InstanceNewResponseRewriteModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceNewResponseRewriteModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceNewResponseRewriteModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceNewResponseRewriteModelCfMoonshotaiKimiK2Instruct InstanceNewResponseRewriteModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceNewResponseRewriteModelCfGoogleGemma3_12bIt InstanceNewResponseRewriteModel = "@cf/google/gemma-3-12b-it"
const InstanceNewResponseRewriteModelCfGoogleGemma4_26bA4bIt InstanceNewResponseRewriteModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceNewResponseRewriteModelCfMoonshotaiKimiK2_5 InstanceNewResponseRewriteModel = "@cf/moonshotai/kimi-k2.5"
const InstanceNewResponseRewriteModelAnthropicClaude3_7Sonnet InstanceNewResponseRewriteModel = "anthropic/claude-3-7-sonnet"
const InstanceNewResponseRewriteModelAnthropicClaudeSonnet4 InstanceNewResponseRewriteModel = "anthropic/claude-sonnet-4"
const InstanceNewResponseRewriteModelAnthropicClaudeOpus4 InstanceNewResponseRewriteModel = "anthropic/claude-opus-4"
const InstanceNewResponseRewriteModelAnthropicClaude3_5Haiku InstanceNewResponseRewriteModel = "anthropic/claude-3-5-haiku"
const InstanceNewResponseRewriteModelCerebrasQwen3_235bA22bInstruct InstanceNewResponseRewriteModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceNewResponseRewriteModelCerebrasQwen3_235bA22bThinking InstanceNewResponseRewriteModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceNewResponseRewriteModelCerebrasLlama3_3_70b InstanceNewResponseRewriteModel = "cerebras/llama-3.3-70b"
const InstanceNewResponseRewriteModelCerebrasLlama4Maverick17b128eInstruct InstanceNewResponseRewriteModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceNewResponseRewriteModelCerebrasLlama4Scout17b16eInstruct InstanceNewResponseRewriteModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceNewResponseRewriteModelCerebrasGptOSs120b InstanceNewResponseRewriteModel = "cerebras/gpt-oss-120b"
const InstanceNewResponseRewriteModelGoogleAIStudioGemini2_5Flash InstanceNewResponseRewriteModel = "google-ai-studio/gemini-2.5-flash"
const InstanceNewResponseRewriteModelGoogleAIStudioGemini2_5Pro InstanceNewResponseRewriteModel = "google-ai-studio/gemini-2.5-pro"
const InstanceNewResponseRewriteModelGrokGrok4 InstanceNewResponseRewriteModel = "grok/grok-4"
const InstanceNewResponseRewriteModelGroqLlama3_3_70bVersatile InstanceNewResponseRewriteModel = "groq/llama-3.3-70b-versatile"
const InstanceNewResponseRewriteModelGroqLlama3_1_8bInstant InstanceNewResponseRewriteModel = "groq/llama-3.1-8b-instant"
const InstanceNewResponseRewriteModelOpenAIGpt5 InstanceNewResponseRewriteModel = "openai/gpt-5"
const InstanceNewResponseRewriteModelOpenAIGpt5Mini InstanceNewResponseRewriteModel = "openai/gpt-5-mini"
const InstanceNewResponseRewriteModelOpenAIGpt5Nano InstanceNewResponseRewriteModel = "openai/gpt-5-nano"
const InstanceNewResponseRewriteModelEmpty InstanceNewResponseRewriteModel = ""
RewriteQuery boolOptional
ScoreThreshold float64Optional
maximum1
minimum0
Source stringOptional
SourceParams InstanceNewResponseSourceParamsOptional
ExcludeItems []stringOptional

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)

IncludeItems []stringOptional

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)

Prefix stringOptional
R2Jurisdiction stringOptional
WebCrawler InstanceNewResponseSourceParamsWebCrawlerOptional
CrawlOptions InstanceNewResponseSourceParamsWebCrawlerCrawlOptionsOptional
Depth float64Optional
maximum100000
minimum1
IncludeSubdomains boolOptional
MaxAge float64Optional
maximum604800
minimum0
Source InstanceNewResponseSourceParamsWebCrawlerCrawlOptionsSourceOptional
One of the following:
const InstanceNewResponseSourceParamsWebCrawlerCrawlOptionsSourceAll InstanceNewResponseSourceParamsWebCrawlerCrawlOptionsSource = "all"
const InstanceNewResponseSourceParamsWebCrawlerCrawlOptionsSourceSitemaps InstanceNewResponseSourceParamsWebCrawlerCrawlOptionsSource = "sitemaps"
const InstanceNewResponseSourceParamsWebCrawlerCrawlOptionsSourceLinks InstanceNewResponseSourceParamsWebCrawlerCrawlOptionsSource = "links"
ParseOptions InstanceNewResponseSourceParamsWebCrawlerParseOptionsOptional
ContentSelector []InstanceNewResponseSourceParamsWebCrawlerParseOptionsContentSelectorOptional

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
IncludeHeaders map[string, string]Optional

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

IncludeImages boolOptional
SpecificSitemaps []stringOptional

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

UseBrowserRendering boolOptional
ParseType InstanceNewResponseSourceParamsWebCrawlerParseTypeOptional
One of the following:
const InstanceNewResponseSourceParamsWebCrawlerParseTypeSitemap InstanceNewResponseSourceParamsWebCrawlerParseType = "sitemap"
const InstanceNewResponseSourceParamsWebCrawlerParseTypeFeedRss InstanceNewResponseSourceParamsWebCrawlerParseType = "feed-rss"
const InstanceNewResponseSourceParamsWebCrawlerParseTypeCrawl InstanceNewResponseSourceParamsWebCrawlerParseType = "crawl"
StoreOptions InstanceNewResponseSourceParamsWebCrawlerStoreOptionsOptional
StorageID string
R2Jurisdiction stringOptional
StorageType ProviderOptional
Status stringOptional
SyncInterval InstanceNewResponseSyncIntervalOptional

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:
const InstanceNewResponseSyncInterval900 InstanceNewResponseSyncInterval = 900
const InstanceNewResponseSyncInterval1800 InstanceNewResponseSyncInterval = 1800
const InstanceNewResponseSyncInterval3600 InstanceNewResponseSyncInterval = 3600
const InstanceNewResponseSyncInterval7200 InstanceNewResponseSyncInterval = 7200
const InstanceNewResponseSyncInterval14400 InstanceNewResponseSyncInterval = 14400
const InstanceNewResponseSyncInterval21600 InstanceNewResponseSyncInterval = 21600
const InstanceNewResponseSyncInterval43200 InstanceNewResponseSyncInterval = 43200
const InstanceNewResponseSyncInterval86400 InstanceNewResponseSyncInterval = 86400
TokenID stringOptional
formatuuid
Type InstanceNewResponseTypeOptional
One of the following:
const InstanceNewResponseTypeR2 InstanceNewResponseType = "r2"
const InstanceNewResponseTypeWebCrawler InstanceNewResponseType = "web-crawler"

Create new instance.

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/ai_search"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  instance, err := client.AISearch.Instances.New(context.TODO(), ai_search.InstanceNewParams{
    AccountID: cloudflare.F("c3dc5f0b34a14ff8e1b3ec04895e1b22"),
    ID: cloudflare.F("my-ai-search"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", instance.ID)
}
{
  "result": {
    "id": "my-ai-search",
    "created_at": "2019-12-27T18:11:19.117Z",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "ai_gateway_id": "ai_gateway_id",
    "ai_search_model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "cache": true,
    "cache_threshold": "super_strict_match",
    "cache_ttl": 600,
    "chunk_overlap": 0,
    "chunk_size": 64,
    "created_by": "created_by",
    "custom_metadata": [
      {
        "data_type": "text",
        "field_name": "x"
      }
    ],
    "embedding_model": "@cf/qwen/qwen3-embedding-0.6b",
    "enable": true,
    "engine_version": 0,
    "fusion_method": "max",
    "hybrid_search_enabled": true,
    "index_method": {
      "keyword": true,
      "vector": true
    },
    "indexing_options": {
      "keyword_tokenizer": "porter"
    },
    "last_activity": "2019-12-27T18:11:19.117Z",
    "max_num_results": 1,
    "metadata": {
      "created_from_aisearch_wizard": true,
      "worker_domain": "worker_domain"
    },
    "modified_by": "modified_by",
    "namespace": "namespace",
    "paused": true,
    "public_endpoint_id": "public_endpoint_id",
    "public_endpoint_params": {
      "authorized_hosts": [
        "string"
      ],
      "chat_completions_endpoint": {
        "disabled": true
      },
      "enabled": true,
      "mcp": {
        "description": "description",
        "disabled": true
      },
      "rate_limit": {
        "period_ms": 60000,
        "requests": 1,
        "technique": "fixed"
      },
      "search_endpoint": {
        "disabled": true
      }
    },
    "reranking": true,
    "reranking_model": "@cf/baai/bge-reranker-base",
    "retrieval_options": {
      "boost_by": [
        {
          "field": "timestamp",
          "direction": "desc"
        }
      ],
      "keyword_match_mode": "and"
    },
    "rewrite_model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "rewrite_query": true,
    "score_threshold": 0,
    "source": "source",
    "source_params": {
      "exclude_items": [
        "/admin/**",
        "/private/**",
        "**\\temp\\**"
      ],
      "include_items": [
        "/blog/**",
        "/docs/**/*.html",
        "**\\blog\\**.html"
      ],
      "prefix": "prefix",
      "r2_jurisdiction": "r2_jurisdiction",
      "web_crawler": {
        "crawl_options": {
          "depth": 1,
          "include_external_links": true,
          "include_subdomains": true,
          "max_age": 0,
          "source": "all"
        },
        "parse_options": {
          "content_selector": [
            {
              "path": "**/blog/**",
              "selector": "article div.post-body"
            },
            {
              "path": "**/docs/**",
              "selector": "main"
            }
          ],
          "include_headers": {
            "cache-control": "no-cache, no-store"
          },
          "include_images": true,
          "specific_sitemaps": [
            "https://example.com/sitemap.xml",
            "https://example.com/blog-sitemap.xml"
          ],
          "use_browser_rendering": true
        },
        "parse_type": "sitemap",
        "store_options": {
          "storage_id": "storage_id",
          "r2_jurisdiction": "r2_jurisdiction",
          "storage_type": "r2"
        }
      }
    },
    "status": "status",
    "sync_interval": 900,
    "token_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "type": "r2"
  },
  "success": true
}
Returns Examples
{
  "result": {
    "id": "my-ai-search",
    "created_at": "2019-12-27T18:11:19.117Z",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "ai_gateway_id": "ai_gateway_id",
    "ai_search_model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "cache": true,
    "cache_threshold": "super_strict_match",
    "cache_ttl": 600,
    "chunk_overlap": 0,
    "chunk_size": 64,
    "created_by": "created_by",
    "custom_metadata": [
      {
        "data_type": "text",
        "field_name": "x"
      }
    ],
    "embedding_model": "@cf/qwen/qwen3-embedding-0.6b",
    "enable": true,
    "engine_version": 0,
    "fusion_method": "max",
    "hybrid_search_enabled": true,
    "index_method": {
      "keyword": true,
      "vector": true
    },
    "indexing_options": {
      "keyword_tokenizer": "porter"
    },
    "last_activity": "2019-12-27T18:11:19.117Z",
    "max_num_results": 1,
    "metadata": {
      "created_from_aisearch_wizard": true,
      "worker_domain": "worker_domain"
    },
    "modified_by": "modified_by",
    "namespace": "namespace",
    "paused": true,
    "public_endpoint_id": "public_endpoint_id",
    "public_endpoint_params": {
      "authorized_hosts": [
        "string"
      ],
      "chat_completions_endpoint": {
        "disabled": true
      },
      "enabled": true,
      "mcp": {
        "description": "description",
        "disabled": true
      },
      "rate_limit": {
        "period_ms": 60000,
        "requests": 1,
        "technique": "fixed"
      },
      "search_endpoint": {
        "disabled": true
      }
    },
    "reranking": true,
    "reranking_model": "@cf/baai/bge-reranker-base",
    "retrieval_options": {
      "boost_by": [
        {
          "field": "timestamp",
          "direction": "desc"
        }
      ],
      "keyword_match_mode": "and"
    },
    "rewrite_model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "rewrite_query": true,
    "score_threshold": 0,
    "source": "source",
    "source_params": {
      "exclude_items": [
        "/admin/**",
        "/private/**",
        "**\\temp\\**"
      ],
      "include_items": [
        "/blog/**",
        "/docs/**/*.html",
        "**\\blog\\**.html"
      ],
      "prefix": "prefix",
      "r2_jurisdiction": "r2_jurisdiction",
      "web_crawler": {
        "crawl_options": {
          "depth": 1,
          "include_external_links": true,
          "include_subdomains": true,
          "max_age": 0,
          "source": "all"
        },
        "parse_options": {
          "content_selector": [
            {
              "path": "**/blog/**",
              "selector": "article div.post-body"
            },
            {
              "path": "**/docs/**",
              "selector": "main"
            }
          ],
          "include_headers": {
            "cache-control": "no-cache, no-store"
          },
          "include_images": true,
          "specific_sitemaps": [
            "https://example.com/sitemap.xml",
            "https://example.com/blog-sitemap.xml"
          ],
          "use_browser_rendering": true
        },
        "parse_type": "sitemap",
        "store_options": {
          "storage_id": "storage_id",
          "r2_jurisdiction": "r2_jurisdiction",
          "storage_type": "r2"
        }
      }
    },
    "status": "status",
    "sync_interval": 900,
    "token_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "type": "r2"
  },
  "success": true
}