Cloudflare/ai Search
@swamp/cloudflare/ai-searchv2026.10.23.1
01README
Cloudflare ai-search infrastructure models
02Release Notes
- Updated: instances
- Updated: namespaces
- Updated: tokens
03Behaviors
instances.tsv2026.10.23.1
Global Arguments
| Argument | Type | Description |
|---|---|---|
| account_id | string | Cloudflare account ID |
| name | string | Instance name for this resource (used as the unique identifier in the factory pattern) |
| ai_gateway_id? | string | |
| ai_search_model? | string | A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model. |
| cache? | boolean | |
| cache_threshold? | enum | |
| cache_ttl? | union | |
| chunk? | boolean | |
| chunk_overlap? | number | |
| chunk_size? | number | |
| custom_metadata? | array | |
| embedding_model? | string | |
| fusion_method? | enum | |
| index_method? | object | Controls which storage backends indexing uses. Defaults to vector and keyword indexing for new instances. When set, both vector and keyword are required. |
| indexing_options? | object | |
| max_num_results? | number | |
| metadata? | object | |
| paused? | boolean | |
| public_endpoint_params? | object | |
| reranking? | boolean | |
| reranking_model? | string | |
| retrieval_options? | object | |
| rewrite_model? | string | A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model. |
| rewrite_query? | boolean | |
| score_threshold? | number | Minimum similarity score a chunk must reach to be returned. Defaults to 0.4. |
| source? | string | |
| source_params? | object | |
| summarization? | boolean | |
| summarization_model? | string | |
| sync_interval? | union | |
| system_prompt_ai_search? | string | |
| system_prompt_index_summarization? | string | |
| system_prompt_rewrite_query? | string | |
| token_id? | string | |
| hybrid_search_enabled? | boolean | Deprecated — use index_method instead. Defaults to true for new instances; set false to create a vector-only instance. |
| id? | string | AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores. |
| type? | enum | Source type. When omitted or null with a non-blank source, HTTP(S) URLs infer web-crawler and existing R2 bucket names infer r2. A missing or blank source without a type uses managed upload-only storage. |
| apiToken? | string | Cloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault. |
| apiKey? | string | Cloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email. |
| email? | string | Cloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey. |
fn create()
Create a Instances
fn get(id: string)
Get a Instances
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Instances |
fn lookup(allowMissing?: boolean)
Look up an existing Instances by matching global argument values and import it into state
| Argument | Type | Description |
|---|---|---|
| allowMissing? | boolean | Succeed and record found: false in lookupResult when nothing matches, instead of failing |
fn adopt(id: string)
Import an existing Instances by ID into state for management
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Instances to import |
fn update(identifier?: string)
Update Instances attributes
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Instances by id (e.g. one discovered by list) |
fn delete(id: string)
Delete the Instances
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Instances |
fn sync(identifier?: string)
Sync Instances state from Cloudflare
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Instances by id (e.g. one discovered by list) |
Resources
state(infinite)— Instances resource state
lookupResult(infinite)— Outcome of the most recent lookup
namespaces.tsv2026.10.23.1
Global Arguments
| Argument | Type | Description |
|---|---|---|
| account_id | string | Cloudflare account ID |
| description? | string | Optional description for the namespace. Max 256 characters. |
| public_endpoint_params? | object | |
| name? | string | |
| apiToken? | string | Cloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault. |
| apiKey? | string | Cloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email. |
| email? | string | Cloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey. |
fn create()
Create a Namespaces
fn get(id: string)
Get a Namespaces
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Namespaces |
fn lookup(allowMissing?: boolean)
Look up an existing Namespaces by matching global argument values and import it into state
| Argument | Type | Description |
|---|---|---|
| allowMissing? | boolean | Succeed and record found: false in lookupResult when nothing matches, instead of failing |
fn adopt(id: string)
Import an existing Namespaces by ID into state for management
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Namespaces to import |
fn update(identifier?: string)
Update Namespaces attributes
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Namespaces by id (e.g. one discovered by list) |
fn delete(id: string)
Delete the Namespaces
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Namespaces |
fn sync(identifier?: string)
Sync Namespaces state from Cloudflare
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Namespaces by id (e.g. one discovered by list) |
Resources
state(infinite)— Namespaces resource state
lookupResult(infinite)— Outcome of the most recent lookup
tokens.tsv2026.10.23.1
Global Arguments
| Argument | Type | Description |
|---|---|---|
| account_id | string | Cloudflare account ID |
| cf_api_id? | string | |
| cf_api_key? | string | |
| legacy? | boolean | |
| name? | string | |
| apiToken? | string | Cloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault. |
| apiKey? | string | Cloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email. |
| email? | string | Cloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey. |
fn create()
Create a Tokens
fn get(id: string)
Get a Tokens
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Tokens |
fn lookup(allowMissing?: boolean)
Look up an existing Tokens by matching global argument values and import it into state
| Argument | Type | Description |
|---|---|---|
| allowMissing? | boolean | Succeed and record found: false in lookupResult when nothing matches, instead of failing |
fn adopt(id: string)
Import an existing Tokens by ID into state for management
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Tokens to import |
fn update(identifier?: string)
Update Tokens attributes
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Tokens by id (e.g. one discovered by list) |
fn delete(id: string)
Delete the Tokens
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Tokens |
fn sync(identifier?: string)
Sync Tokens state from Cloudflare
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Tokens by id (e.g. one discovered by list) |
Resources
state(infinite)— Tokens resource state
lookupResult(infinite)— Outcome of the most recent lookup
04Previous Versions
2026.10.20.1AGPL-3.0-or-later
- Updated: instances
- Updated: namespaces
- Updated: tokens
Modified 1 behaviors
2026.10.16.2AGPL-3.0-or-later
2026.10.16.1AGPL-3.0-or-later(was none)
- Updated: instances
2026.10.13.1
- Updated: instances
- Updated: namespaces
- Updated: tokens
2026.09.29.2
- Updated: instances
- Updated: namespaces
- Updated: tokens
2026.09.29.1
- Updated: instances
- Updated: namespaces
- Updated: tokens
2026.09.25.1
- Updated: instances
Modified 1 behaviors
2026.09.11.1
- Updated: instances
2026.09.03.1
- Updated: instances
2026.08.26.1
- Updated: instances
2026.08.25.2
- Updated: instances
- Updated: namespaces
2026.08.25.1
- Updated: instances
- Updated: namespaces
2026.08.07.1
- Updated: instances
2026.08.02.1
- Updated: namespaces
2026.07.28.1
- Updated: instances
2026.07.21.1
- Updated: instances
- Updated: namespaces
- Updated: tokens
2026.07.18.2
Modified 1 behaviors
2026.07.14.1
- Updated: instances
2026.06.24.1
- Updated: instances
05Stats
A
100 / 100
Downloads
25
Archive size
24.3 KB
Verified by Swamp
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned
06Platforms
07Labels