gateways
Creates, updates, deletes, gets or lists a gateways resource.
Overview
| Name | gateways |
| Type | Resource |
| Id | cloudflare.ai_gateway.gateways |
Fields
The following fields are returned by SELECT queries:
- get
- list
Returns a single object if found
| Name | Datatype | Description |
|---|---|---|
id | string | gateway id |
store_id | string | |
authentication | boolean | |
cache_invalidate_on_update | boolean | |
cache_ttl | integer | |
collect_logs | boolean | |
created_at | string (date-time) | |
dlp | object | |
is_default | boolean | |
log_management | integer | |
log_management_strategy | string | (STOP_INSERTING, DELETE_OLDEST) |
logpush | boolean | |
logpush_public_key | string | |
modified_at | string (date-time) | |
otel | array | |
rate_limiting_interval | integer | |
rate_limiting_limit | integer | |
rate_limiting_technique | string | (fixed, sliding) |
retry_backoff | string | Backoff strategy for retry delays (constant, linear, exponential) |
retry_delay | integer | Delay between retry attempts in milliseconds (0-5000) |
retry_max_attempts | integer | Maximum number of retry attempts for failed requests (1-5) |
stripe | object | |
workers_ai_billing_mode | string | Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. (postpaid) (default: postpaid) |
zdr | boolean |
List objects
| Name | Datatype | Description |
|---|---|---|
id | string | gateway id |
store_id | string | |
authentication | boolean | |
cache_invalidate_on_update | boolean | |
cache_ttl | integer | |
collect_logs | boolean | |
created_at | string (date-time) | |
dlp | object | |
is_default | boolean | |
log_management | integer | |
log_management_strategy | string | (STOP_INSERTING, DELETE_OLDEST) |
logpush | boolean | |
logpush_public_key | string | |
modified_at | string (date-time) | |
otel | array | |
rate_limiting_interval | integer | |
rate_limiting_limit | integer | |
rate_limiting_technique | string | (fixed, sliding) |
retry_backoff | string | Backoff strategy for retry delays (constant, linear, exponential) |
retry_delay | integer | Delay between retry attempts in milliseconds (0-5000) |
retry_max_attempts | integer | Maximum number of retry attempts for failed requests (1-5) |
stripe | object | |
workers_ai_billing_mode | string | Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. (postpaid) (default: postpaid) |
zdr | boolean |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, id | Retrieves details for a specific AI Gateway dataset. | |
list | select | account_id | page, per_page, search | Lists all AI Gateway evaluator types configured for the account. |
create | insert | account_id, id, rate_limiting_interval, rate_limiting_limit, collect_logs, cache_ttl, cache_invalidate_on_update | Creates a new AI Gateway. | |
update | replace | account_id, id, rate_limiting_interval, rate_limiting_limit, collect_logs, cache_ttl, cache_invalidate_on_update | Updates an existing AI Gateway dataset. | |
delete | delete | account_id, id | Deletes an AI Gateway dataset. |
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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
id | string | Resource ID. |
page | integer | |
per_page | integer | |
search | string |
SELECT examples
- get
- list
Retrieves details for a specific AI Gateway dataset.
SELECT
id,
store_id,
authentication,
cache_invalidate_on_update,
cache_ttl,
collect_logs,
created_at,
dlp,
is_default,
log_management,
log_management_strategy,
logpush,
logpush_public_key,
modified_at,
otel,
rate_limiting_interval,
rate_limiting_limit,
rate_limiting_technique,
retry_backoff,
retry_delay,
retry_max_attempts,
stripe,
workers_ai_billing_mode,
zdr
FROM cloudflare.ai_gateway.gateways
WHERE account_id = '{{ account_id }}' -- required
AND id = '{{ id }}' -- required
;
Lists all AI Gateway evaluator types configured for the account.
SELECT
id,
store_id,
authentication,
cache_invalidate_on_update,
cache_ttl,
collect_logs,
created_at,
dlp,
is_default,
log_management,
log_management_strategy,
logpush,
logpush_public_key,
modified_at,
otel,
rate_limiting_interval,
rate_limiting_limit,
rate_limiting_technique,
retry_backoff,
retry_delay,
retry_max_attempts,
stripe,
workers_ai_billing_mode,
zdr
FROM cloudflare.ai_gateway.gateways
WHERE account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND search = '{{ search }}'
;
INSERT examples
- create
- Manifest
Creates a new AI Gateway.
INSERT INTO cloudflare.ai_gateway.gateways (
authentication,
cache_invalidate_on_update,
cache_ttl,
collect_logs,
id,
log_management,
log_management_strategy,
logpush,
logpush_public_key,
rate_limiting_interval,
rate_limiting_limit,
rate_limiting_technique,
retry_backoff,
retry_delay,
retry_max_attempts,
workers_ai_billing_mode,
zdr,
account_id
)
SELECT
{{ authentication }},
{{ cache_invalidate_on_update }} /* required */,
{{ cache_ttl }} /* required */,
{{ collect_logs }} /* required */,
'{{ id }}' /* required */,
{{ log_management }},
'{{ log_management_strategy }}',
{{ logpush }},
'{{ logpush_public_key }}',
{{ rate_limiting_interval }} /* required */,
{{ rate_limiting_limit }} /* required */,
'{{ rate_limiting_technique }}',
'{{ retry_backoff }}',
{{ retry_delay }},
{{ retry_max_attempts }},
'{{ workers_ai_billing_mode }}',
{{ zdr }},
'{{ account_id }}'
RETURNING
result,
success
;
# Description fields are for documentation purposes
- name: gateways
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the gateways resource.
- name: authentication
value: {{ authentication }}
- name: cache_invalidate_on_update
value: {{ cache_invalidate_on_update }}
- name: cache_ttl
value: {{ cache_ttl }}
- name: collect_logs
value: {{ collect_logs }}
- name: id
value: "{{ id }}"
description: |
gateway id
- name: log_management
value: {{ log_management }}
- name: log_management_strategy
value: "{{ log_management_strategy }}"
valid_values: ['STOP_INSERTING', 'DELETE_OLDEST']
- name: logpush
value: {{ logpush }}
- name: logpush_public_key
value: "{{ logpush_public_key }}"
- name: rate_limiting_interval
value: {{ rate_limiting_interval }}
- name: rate_limiting_limit
value: {{ rate_limiting_limit }}
- name: rate_limiting_technique
value: "{{ rate_limiting_technique }}"
valid_values: ['fixed', 'sliding']
- name: retry_backoff
value: "{{ retry_backoff }}"
description: |
Backoff strategy for retry delays
valid_values: ['constant', 'linear', 'exponential']
- name: retry_delay
value: {{ retry_delay }}
description: |
Delay between retry attempts in milliseconds (0-5000)
- name: retry_max_attempts
value: {{ retry_max_attempts }}
description: |
Maximum number of retry attempts for failed requests (1-5)
- name: workers_ai_billing_mode
value: "{{ workers_ai_billing_mode }}"
description: |
Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported.
valid_values: ['postpaid']
default: postpaid
- name: zdr
value: {{ zdr }}
REPLACE examples
- update
Updates an existing AI Gateway dataset.
REPLACE cloudflare.ai_gateway.gateways
SET
authentication = {{ authentication }},
cache_invalidate_on_update = {{ cache_invalidate_on_update }},
cache_ttl = {{ cache_ttl }},
collect_logs = {{ collect_logs }},
dlp = '{{ dlp }}',
log_management = {{ log_management }},
log_management_strategy = '{{ log_management_strategy }}',
logpush = {{ logpush }},
logpush_public_key = '{{ logpush_public_key }}',
otel = '{{ otel }}',
rate_limiting_interval = {{ rate_limiting_interval }},
rate_limiting_limit = {{ rate_limiting_limit }},
rate_limiting_technique = '{{ rate_limiting_technique }}',
retry_backoff = '{{ retry_backoff }}',
retry_delay = {{ retry_delay }},
retry_max_attempts = {{ retry_max_attempts }},
store_id = '{{ store_id }}',
stripe = '{{ stripe }}',
workers_ai_billing_mode = '{{ workers_ai_billing_mode }}',
zdr = {{ zdr }}
WHERE
account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required
AND rate_limiting_interval = '{{ rate_limiting_interval }}' --required
AND rate_limiting_limit = '{{ rate_limiting_limit }}' --required
AND collect_logs = {{ collect_logs }} --required
AND cache_ttl = '{{ cache_ttl }}' --required
AND cache_invalidate_on_update = {{ cache_invalidate_on_update }} --required
RETURNING
result,
success;
DELETE examples
- delete
Deletes an AI Gateway dataset.
DELETE FROM cloudflare.ai_gateway.gateways
WHERE account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required
;