Cloudflare/ai Gateway
@swamp/cloudflare/ai-gatewayv2026.11.19.1
01README
Cloudflare ai-gateway infrastructure models
02Release Notes
- Updated: gateways
03Behaviors
costs.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) |
| cost_in? | number | |
| cost_out? | number | |
| cost_type? | string | |
| enable? | boolean | |
| model? | string | |
| model_rule? | enum | |
| token_pricing? | object | |
| account_provider_id? | string | ID of the custom provider that the pricing rule applies to. |
| 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 Costs
fn get(id: string)
Get a Costs
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Costs |
fn lookup(allowMissing?: boolean)
Look up an existing Costs 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 Costs by ID into state for management
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Costs to import |
fn update(identifier?: string)
Update Costs attributes
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Costs by id (e.g. one discovered by list) |
fn delete(id: string)
Delete the Costs
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Costs |
fn sync(identifier?: string)
Sync Costs state from Cloudflare
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Costs by id (e.g. one discovered by list) |
Resources
state(infinite)— Costs resource state
lookupResult(infinite)— Outcome of the most recent lookup
custom-providers.tsv2026.11.16.1
Global Arguments
| Argument | Type | Description |
|---|---|---|
| account_id | string | Cloudflare account ID |
| base_url? | string | |
| beta? | boolean | |
| curl_example? | string | |
| description? | string | |
| enable? | boolean | |
| headers? | string | JSON object of extra HTTP headers that AI Gateway sends to the provider. Values can contain credentials. Sensitive: wire with a vault.get(...) expression to source it from a vault. |
| js_example? | string | |
| link? | string | |
| logo? | string | |
| name? | string | |
| position? | number | |
| slug? | 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 Custom-providers
fn get(id: string)
Get a Custom-providers
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Custom-providers |
fn lookup(allowMissing?: boolean)
Look up an existing Custom-providers 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 Custom-providers by ID into state for management
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Custom-providers to import |
fn update(identifier?: string)
Update Custom-providers attributes
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Custom-providers by id (e.g. one discovered by list) |
fn delete(id: string)
Delete the Custom-providers
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Custom-providers |
fn sync(identifier?: string)
Sync Custom-providers state from Cloudflare
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Custom-providers by id (e.g. one discovered by list) |
Resources
state(infinite)— Custom-providers resource state
lookupResult(infinite)— Outcome of the most recent lookup
gateways.tsv2026.11.19.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) |
| authentication? | boolean | Require authentication for gateway access. New gateways must have authentication enabled. Once enabled, authentication cannot be disabled. |
| byok_only? | boolean | Requires customer-provided provider credentials and prevents fallback to Unified Billing. |
| cache_invalidate_on_update? | boolean | |
| cache_ttl? | number | |
| collect_logs? | boolean | |
| dlp? | object | |
| guardrails? | object | |
| log_classification? | boolean | |
| log_management? | number | |
| log_management_strategy? | enum | |
| logpush? | boolean | |
| logpush_public_key? | string | |
| multiprovider_enabled? | boolean | Lets requests to a model use every provider that serves it. When off, a model uses only the providers it launched with, so a provider added later receives none of its traffic. A request that names providers (the cf-aig-allowed-providers header or routing.allowedProviders) can still use any of them. Model aliases (custom/) are not restricted. |
| otel? | array | |
| rate_limiting_interval? | number | |
| rate_limiting_limit? | number | |
| rate_limiting_technique? | enum | |
| retry_backoff? | enum | Backoff strategy for retry delays |
| retry_delay? | number | Delay between retry attempts in milliseconds (0-60000) |
| retry_max_attempts? | number | Maximum number of retry attempts for failed requests (1-5) |
| spend_limits? | object | |
| store_id? | string | Secrets Store used by this gateway. Omit on update to keep the current store. Cannot be cleared while stored keys or secret references depend on it. |
| stripe? | object | |
| workers_ai_billing_mode? | enum | Controls how Workers AI inference calls routed through this gateway are billed. 'postpaid' bills the account directly through Workers AI; 'unified' deducts credits via AI Gateway using neuron-based pricing and delegates billing to AI Gateway. |
| zdr? | boolean | |
| id? | string | Unique identifier of the AI Gateway within the account. |
| 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 Gateways
fn get(id: string)
Get a Gateways
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Gateways |
fn lookup(allowMissing?: boolean)
Look up an existing Gateways 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 Gateways by ID into state for management
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Gateways to import |
fn update(identifier?: string)
Update Gateways attributes
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Gateways by id (e.g. one discovered by list) |
fn delete(id: string)
Delete the Gateways
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Gateways |
fn sync(identifier?: string)
Sync Gateways state from Cloudflare
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Gateways by id (e.g. one discovered by list) |
Resources
state(infinite)— Gateways resource state
lookupResult(infinite)— Outcome of the most recent lookup
04Previous Versions
2026.11.17.1AGPL-3.0-or-later
- Updated: gateways
Added 1, removed 3 behaviors
2026.11.16.1AGPL-3.0-or-later
- Updated: custom-providers
2026.11.14.1AGPL-3.0-or-later
- Updated: gateways
2026.10.30.1AGPL-3.0-or-later
- Updated: gateways
2026.10.23.1AGPL-3.0-or-later
- Updated: custom-providers
- Updated: costs
- Updated: gateways
2026.10.22.1AGPL-3.0-or-later
- Updated: gateways
2026.10.21.1AGPL-3.0-or-later
- Updated: gateways
2026.10.20.1AGPL-3.0-or-later
- Updated: custom-providers
- Updated: costs
- Updated: gateways
Modified 3 behaviors
2026.10.16.1AGPL-3.0-or-later(was none)
2026.10.13.1
- Updated: custom-providers
- Updated: costs
- Updated: gateways
2026.10.01.1
- Updated: gateways
2026.09.29.2
- Updated: gateways
2026.09.29.1
- Updated: custom-providers
- Updated: costs
- Updated: gateways
2026.09.26.1
- Updated: custom-providers
- Updated: costs
- Updated: gateways
2026.09.11.1
- Updated: gateways
2026.08.25.2
- Updated: custom-providers
- Updated: gateways
2026.08.25.1
- Updated: custom-providers
- Updated: gateways
2026.08.15.1
- Updated: gateways
2026.08.11.1
- Updated: gateways
05Stats
A
100 / 100
Downloads
45
Archive size
24.4 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