Cloudflare/ai Gateway
@swamp/cloudflare/ai-gatewayv2026.10.01.1
01README
Cloudflare ai-gateway infrastructure models
02Release Notes
- Updated: gateways
03Models
@swamp/cloudflare/ai-gateway/costsv2026.09.29.1costs.ts
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()
Look up an existing Costs by matching global argument values and import it into state
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
@swamp/cloudflare/ai-gateway/custom-providersv2026.09.29.1custom-providers.ts
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. |
| 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()
Look up an existing Custom-providers by matching global argument values and import it into state
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
@swamp/cloudflare/ai-gateway/gatewaysv2026.10.01.1gateways.ts
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 | |
| 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 | |
| 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 | |
| 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()
Look up an existing Gateways by matching global argument values and import it into state
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
04Previous Versions
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
2026.08.02.1
- Updated: custom-providers
- Updated: gateways
2026.07.21.1
- Updated: custom-providers
- Updated: costs
- Updated: gateways
2026.07.18.2
Modified 3 models
2026.06.08.2
- Updated: custom-providers
- Updated: costs
- Updated: gateways
2026.05.29.1
- Updated: custom-providers
- Updated: costs
- Updated: gateways
2026.05.22.1
- Added: custom-providers
- Added: costs
- Added: gateways
05Stats
A
100 / 100
Downloads
14
Archive size
20.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
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
06Platforms
07Labels