Skip to content
Start here

AI Gateway

List Gateways
GET/accounts/{account_id}/ai-gateway/gateways
Fetch a Gateway
GET/accounts/{account_id}/ai-gateway/gateways/{id}
Create a new Gateway
POST/accounts/{account_id}/ai-gateway/gateways
Update a Gateway
PUT/accounts/{account_id}/ai-gateway/gateways/{id}
Delete a Gateway
DELETE/accounts/{account_id}/ai-gateway/gateways/{id}
ModelsExpand Collapse
AIGatewayListResponse object { id, cache_invalidate_on_update, cache_ttl, 22 more }
id: string

gateway id

maxLength64
minLength1
cache_invalidate_on_update: boolean
cache_ttl: number
minimum0
collect_logs: boolean
created_at: string
formatdate-time
modified_at: string
formatdate-time
rate_limiting_interval: number
minimum0
rate_limiting_limit: number
minimum0
authentication: optional boolean
dlp: optional object { action, enabled, profiles } or object { enabled, policies }
One of the following:
object { action, enabled, profiles }
action: "BLOCK" or "FLAG"
One of the following:
"BLOCK"
"FLAG"
enabled: boolean
profiles: array of string
object { enabled, policies }
enabled: boolean
policies: array of object { id, action, check, 2 more }
id: string
action: "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
check: array of "REQUEST" or "RESPONSE"
One of the following:
"REQUEST"
"RESPONSE"
enabled: boolean
profiles: array of string
guardrails: optional object { prompt, response }
prompt: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
response: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
is_default: optional boolean
log_management: optional number
maximum10000000
minimum10000
log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: optional boolean
logpush_public_key: optional string
maxLength1024
minLength16
otel: optional array of object { authorization, headers, url, content_type }
authorization: string
maxLength256
headers: map[string]
url: string
formaturi
maxLength2048
content_type: optional "json" or "protobuf"
One of the following:
"json"
"protobuf"
rate_limiting_technique: optional "fixed" or "sliding"
One of the following:
"fixed"
"sliding"
retry_backoff: optional "constant" or "linear" or "exponential"

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: optional number

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: optional number

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: optional string
stripe: optional object { authorization, usage_events }
authorization: string
usage_events: array of object { payload }
payload: string
workers_ai_billing_mode: optional "postpaid"

Controls how Workers AI inference calls routed through this gateway are billed. Only ‘postpaid’ is currently supported.

zdr: optional boolean
AIGatewayGetResponse object { id, cache_invalidate_on_update, cache_ttl, 22 more }
id: string

gateway id

maxLength64
minLength1
cache_invalidate_on_update: boolean
cache_ttl: number
minimum0
collect_logs: boolean
created_at: string
formatdate-time
modified_at: string
formatdate-time
rate_limiting_interval: number
minimum0
rate_limiting_limit: number
minimum0
authentication: optional boolean
dlp: optional object { action, enabled, profiles } or object { enabled, policies }
One of the following:
object { action, enabled, profiles }
action: "BLOCK" or "FLAG"
One of the following:
"BLOCK"
"FLAG"
enabled: boolean
profiles: array of string
object { enabled, policies }
enabled: boolean
policies: array of object { id, action, check, 2 more }
id: string
action: "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
check: array of "REQUEST" or "RESPONSE"
One of the following:
"REQUEST"
"RESPONSE"
enabled: boolean
profiles: array of string
guardrails: optional object { prompt, response }
prompt: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
response: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
is_default: optional boolean
log_management: optional number
maximum10000000
minimum10000
log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: optional boolean
logpush_public_key: optional string
maxLength1024
minLength16
otel: optional array of object { authorization, headers, url, content_type }
authorization: string
maxLength256
headers: map[string]
url: string
formaturi
maxLength2048
content_type: optional "json" or "protobuf"
One of the following:
"json"
"protobuf"
rate_limiting_technique: optional "fixed" or "sliding"
One of the following:
"fixed"
"sliding"
retry_backoff: optional "constant" or "linear" or "exponential"

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: optional number

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: optional number

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: optional string
stripe: optional object { authorization, usage_events }
authorization: string
usage_events: array of object { payload }
payload: string
workers_ai_billing_mode: optional "postpaid"

Controls how Workers AI inference calls routed through this gateway are billed. Only ‘postpaid’ is currently supported.

zdr: optional boolean
AIGatewayCreateResponse object { id, cache_invalidate_on_update, cache_ttl, 22 more }
id: string

gateway id

maxLength64
minLength1
cache_invalidate_on_update: boolean
cache_ttl: number
minimum0
collect_logs: boolean
created_at: string
formatdate-time
modified_at: string
formatdate-time
rate_limiting_interval: number
minimum0
rate_limiting_limit: number
minimum0
authentication: optional boolean
dlp: optional object { action, enabled, profiles } or object { enabled, policies }
One of the following:
object { action, enabled, profiles }
action: "BLOCK" or "FLAG"
One of the following:
"BLOCK"
"FLAG"
enabled: boolean
profiles: array of string
object { enabled, policies }
enabled: boolean
policies: array of object { id, action, check, 2 more }
id: string
action: "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
check: array of "REQUEST" or "RESPONSE"
One of the following:
"REQUEST"
"RESPONSE"
enabled: boolean
profiles: array of string
guardrails: optional object { prompt, response }
prompt: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
response: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
is_default: optional boolean
log_management: optional number
maximum10000000
minimum10000
log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: optional boolean
logpush_public_key: optional string
maxLength1024
minLength16
otel: optional array of object { authorization, headers, url, content_type }
authorization: string
maxLength256
headers: map[string]
url: string
formaturi
maxLength2048
content_type: optional "json" or "protobuf"
One of the following:
"json"
"protobuf"
rate_limiting_technique: optional "fixed" or "sliding"
One of the following:
"fixed"
"sliding"
retry_backoff: optional "constant" or "linear" or "exponential"

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: optional number

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: optional number

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: optional string
stripe: optional object { authorization, usage_events }
authorization: string
usage_events: array of object { payload }
payload: string
workers_ai_billing_mode: optional "postpaid"

Controls how Workers AI inference calls routed through this gateway are billed. Only ‘postpaid’ is currently supported.

zdr: optional boolean
AIGatewayUpdateResponse object { id, cache_invalidate_on_update, cache_ttl, 22 more }
id: string

gateway id

maxLength64
minLength1
cache_invalidate_on_update: boolean
cache_ttl: number
minimum0
collect_logs: boolean
created_at: string
formatdate-time
modified_at: string
formatdate-time
rate_limiting_interval: number
minimum0
rate_limiting_limit: number
minimum0
authentication: optional boolean
dlp: optional object { action, enabled, profiles } or object { enabled, policies }
One of the following:
object { action, enabled, profiles }
action: "BLOCK" or "FLAG"
One of the following:
"BLOCK"
"FLAG"
enabled: boolean
profiles: array of string
object { enabled, policies }
enabled: boolean
policies: array of object { id, action, check, 2 more }
id: string
action: "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
check: array of "REQUEST" or "RESPONSE"
One of the following:
"REQUEST"
"RESPONSE"
enabled: boolean
profiles: array of string
guardrails: optional object { prompt, response }
prompt: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
response: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
is_default: optional boolean
log_management: optional number
maximum10000000
minimum10000
log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: optional boolean
logpush_public_key: optional string
maxLength1024
minLength16
otel: optional array of object { authorization, headers, url, content_type }
authorization: string
maxLength256
headers: map[string]
url: string
formaturi
maxLength2048
content_type: optional "json" or "protobuf"
One of the following:
"json"
"protobuf"
rate_limiting_technique: optional "fixed" or "sliding"
One of the following:
"fixed"
"sliding"
retry_backoff: optional "constant" or "linear" or "exponential"

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: optional number

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: optional number

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: optional string
stripe: optional object { authorization, usage_events }
authorization: string
usage_events: array of object { payload }
payload: string
workers_ai_billing_mode: optional "postpaid"

Controls how Workers AI inference calls routed through this gateway are billed. Only ‘postpaid’ is currently supported.

zdr: optional boolean
AIGatewayDeleteResponse object { id, cache_invalidate_on_update, cache_ttl, 22 more }
id: string

gateway id

maxLength64
minLength1
cache_invalidate_on_update: boolean
cache_ttl: number
minimum0
collect_logs: boolean
created_at: string
formatdate-time
modified_at: string
formatdate-time
rate_limiting_interval: number
minimum0
rate_limiting_limit: number
minimum0
authentication: optional boolean
dlp: optional object { action, enabled, profiles } or object { enabled, policies }
One of the following:
object { action, enabled, profiles }
action: "BLOCK" or "FLAG"
One of the following:
"BLOCK"
"FLAG"
enabled: boolean
profiles: array of string
object { enabled, policies }
enabled: boolean
policies: array of object { id, action, check, 2 more }
id: string
action: "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
check: array of "REQUEST" or "RESPONSE"
One of the following:
"REQUEST"
"RESPONSE"
enabled: boolean
profiles: array of string
guardrails: optional object { prompt, response }
prompt: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
response: object { P1, S1, S10, 11 more }
P1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S1: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S10: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S11: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S12: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S13: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S2: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S3: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S4: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S5: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S6: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S7: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S8: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
S9: optional "FLAG" or "BLOCK"
One of the following:
"FLAG"
"BLOCK"
is_default: optional boolean
log_management: optional number
maximum10000000
minimum10000
log_management_strategy: optional "STOP_INSERTING" or "DELETE_OLDEST"
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: optional boolean
logpush_public_key: optional string
maxLength1024
minLength16
otel: optional array of object { authorization, headers, url, content_type }
authorization: string
maxLength256
headers: map[string]
url: string
formaturi
maxLength2048
content_type: optional "json" or "protobuf"
One of the following:
"json"
"protobuf"
rate_limiting_technique: optional "fixed" or "sliding"
One of the following:
"fixed"
"sliding"
retry_backoff: optional "constant" or "linear" or "exponential"

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: optional number

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: optional number

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: optional string
stripe: optional object { authorization, usage_events }
authorization: string
usage_events: array of object { payload }
payload: string
workers_ai_billing_mode: optional "postpaid"

Controls how Workers AI inference calls routed through this gateway are billed. Only ‘postpaid’ is currently supported.

zdr: optional boolean

AI GatewayEvaluation Types

List Evaluators
GET/accounts/{account_id}/ai-gateway/evaluation-types
ModelsExpand Collapse
EvaluationTypeListResponse object { id, created_at, description, 5 more }
id: string
created_at: string
formatdate-time
description: string
enable: boolean
mandatory: boolean
modified_at: string
formatdate-time
name: string
type: string

AI GatewayLogs

List Gateway Logs
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs
Get Gateway Log Detail
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}
Patch Gateway Log
PATCH/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}
Delete Gateway Logs
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs
Get Gateway Log Request
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/request
Get Gateway Log Response
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/response
ModelsExpand Collapse
LogListResponse object { id, cached, created_at, 16 more }
id: string
cached: boolean
created_at: string
formatdate-time
duration: number
model: string
path: string
provider: string
success: boolean
tokens_in: number
tokens_out: number
cost: optional number
custom_cost: optional boolean
metadata: optional string
model_type: optional string
request_content_type: optional string
request_type: optional string
response_content_type: optional string
status_code: optional number
step: optional number
LogGetResponse object { id, cached, created_at, 22 more }
id: string
cached: boolean
created_at: string
formatdate-time
duration: number
model: string
path: string
provider: string
success: boolean
tokens_in: number
tokens_out: number
cost: optional number
custom_cost: optional boolean
metadata: optional string
model_type: optional string
request_content_type: optional string
request_head: optional string
request_head_complete: optional boolean
request_size: optional number
request_type: optional string
response_content_type: optional string
response_head: optional string
response_head_complete: optional boolean
response_size: optional number
status_code: optional number
step: optional number
LogEditResponse = unknown
LogDeleteResponse object { success }
success: boolean
LogRequestResponse = unknown
LogResponseResponse = unknown

AI GatewayDatasets

List Datasets
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets
Fetch a Dataset
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}
Create a new Dataset
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets
Update a Dataset
PUT/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}
Delete a Dataset
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}
ModelsExpand Collapse
DatasetListResponse object { id, created_at, enable, 4 more }
id: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
DatasetGetResponse object { id, created_at, enable, 4 more }
id: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
DatasetCreateResponse object { id, created_at, enable, 4 more }
id: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
DatasetUpdateResponse object { id, created_at, enable, 4 more }
id: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
DatasetDeleteResponse object { id, created_at, enable, 4 more }
id: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string

AI GatewayEvaluations

List Evaluations
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations
Fetch a Evaluation
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}
Create a new Evaluation
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations
Delete a Evaluation
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}
ModelsExpand Collapse
EvaluationListResponse object { id, created_at, datasets, 6 more }
id: string
created_at: string
formatdate-time
datasets: array of object { id, account_id, account_tag, 6 more }
id: string
account_id: string
account_tag: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
processed: boolean
results: array of object { id, created_at, evaluation_id, 6 more }
id: string
created_at: string
formatdate-time
evaluation_id: string
evaluation_type_id: string
modified_at: string
formatdate-time
result: string
status: number
status_description: string
total_logs: number
total_logs: number
EvaluationGetResponse object { id, created_at, datasets, 6 more }
id: string
created_at: string
formatdate-time
datasets: array of object { id, account_id, account_tag, 6 more }
id: string
account_id: string
account_tag: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
processed: boolean
results: array of object { id, created_at, evaluation_id, 6 more }
id: string
created_at: string
formatdate-time
evaluation_id: string
evaluation_type_id: string
modified_at: string
formatdate-time
result: string
status: number
status_description: string
total_logs: number
total_logs: number
EvaluationCreateResponse object { id, created_at, datasets, 6 more }
id: string
created_at: string
formatdate-time
datasets: array of object { id, account_id, account_tag, 6 more }
id: string
account_id: string
account_tag: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
processed: boolean
results: array of object { id, created_at, evaluation_id, 6 more }
id: string
created_at: string
formatdate-time
evaluation_id: string
evaluation_type_id: string
modified_at: string
formatdate-time
result: string
status: number
status_description: string
total_logs: number
total_logs: number
EvaluationDeleteResponse object { id, created_at, datasets, 6 more }
id: string
created_at: string
formatdate-time
datasets: array of object { id, account_id, account_tag, 6 more }
id: string
account_id: string
account_tag: string
created_at: string
formatdate-time
enable: boolean
filters: array of object { key, operator, value }
key: "created_at" or "request_content_type" or "response_content_type" or 10 more
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: "eq" or "contains" or "lt" or "gt"
One of the following:
"eq"
"contains"
"lt"
"gt"
value: array of string or number or boolean
One of the following:
string
number
boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
name: string
processed: boolean
results: array of object { id, created_at, evaluation_id, 6 more }
id: string
created_at: string
formatdate-time
evaluation_id: string
evaluation_type_id: string
modified_at: string
formatdate-time
result: string
status: number
status_description: string
total_logs: number
total_logs: number

AI GatewayDynamic Routing

List all AI Gateway Dynamic Routes.
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes
Get an AI Gateway Dynamic Route.
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
Create a new AI Gateway Dynamic Route.
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes
Update an AI Gateway Dynamic Route.
PATCH/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
Delete an AI Gateway Dynamic Route.
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
List all AI Gateway Dynamic Route Deployments.
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments
Create a new AI Gateway Dynamic Route Deployment.
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments
List all AI Gateway Dynamic Route Versions.
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions
Create a new AI Gateway Dynamic Route Version.
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions
Get an AI Gateway Dynamic Route Version.
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}
ModelsExpand Collapse
DynamicRoutingListResponse object { data, success }
data: object { order_by, order_by_direction, page, 2 more }
order_by: string
order_by_direction: string
page: number
per_page: number
routes: array of object { id, account_tag, created_at, 6 more }
id: string
account_tag: string
created_at: string
formatdate-time
deployment: object { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version: object { active, created_at, data, version_id }
active: "true" or "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
success: boolean
DynamicRoutingGetResponse object { id, created_at, deployment, 5 more }
id: string
created_at: string
formatdate-time
deployment: object { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version: object { active, created_at, data, version_id }
active: "true" or "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
DynamicRoutingCreateResponse object { id, created_at, deployment, 5 more }
id: string
created_at: string
formatdate-time
deployment: object { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version: object { active, created_at, data, version_id }
active: "true" or "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
DynamicRoutingUpdateResponse object { route, success }
route: object { id, account_tag, created_at, 6 more }
id: string
account_tag: string
created_at: string
formatdate-time
deployment: object { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version: object { active, created_at, data, version_id }
active: "true" or "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
success: boolean
DynamicRoutingDeleteResponse object { id, created_at, elements, 3 more }
id: string
created_at: string
formatdate-time
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
DynamicRoutingListDeploymentsResponse object { data, success }
data: object { deployments, order_by, order_by_direction, 2 more }
deployments: array of object { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
order_by: string
order_by_direction: string
page: number
per_page: number
success: boolean
DynamicRoutingCreateDeploymentResponse object { id, created_at, elements, 3 more }
id: string
created_at: string
formatdate-time
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
DynamicRoutingListVersionsResponse object { data, success }
data: object { order_by, order_by_direction, page, 2 more }
order_by: string
order_by_direction: string
page: number
per_page: number
versions: array of object { active, created_at, data, version_id }
active: "true" or "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
success: boolean
DynamicRoutingCreateVersionResponse object { id, created_at, elements, 3 more }
id: string
created_at: string
formatdate-time
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
DynamicRoutingGetVersionResponse object { id, active, created_at, 6 more }
id: string
active: "true" or "false"
One of the following:
"true"
"false"
created_at: string
data: string
elements: array of object { id, outputs, type } or object { id, outputs, properties, type } or object { id, outputs, type } or 3 more
One of the following:
object { id, outputs, type }
id: string
outputs: object { next }
type: "start"
object { id, outputs, properties, type }
id: string
outputs: object { false, true }
false: object { elementId }
elementId: string
true: object { elementId }
elementId: string
properties: object { conditions }
conditions: optional unknown
type: "conditional"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "percentage"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { key, limit, limitType, window }
key: string
limit: number
limitType: "count" or "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
object { id, outputs, properties, type }
id: string
outputs: object { fallback, success }
fallback: object { elementId }
elementId: string
success: object { elementId }
elementId: string
properties: object { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
object { id, outputs, type }
id: string
outputs: map[object { elementId } ]
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version_id: string

AI GatewayProvider Configs

List Provider Configs
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs
Create a new Provider Configs
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs
ModelsExpand Collapse
ProviderConfigListResponse object { id, alias, default_config, 7 more }
id: string
alias: string
default_config: boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
provider_slug: string
secret_id: string
secret_preview: string
rate_limit: optional number
rate_limit_period: optional number
ProviderConfigCreateResponse object { id, alias, default_config, 7 more }
id: string
alias: string
default_config: boolean
gateway_id: string

gateway id

maxLength64
minLength1
modified_at: string
formatdate-time
provider_slug: string
secret_id: string
secret_preview: string
rate_limit: optional number
rate_limit_period: optional number

AI GatewayURLs

Get Gateway URL
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/url/{provider}
ModelsExpand Collapse
URLGetResponse = string

AI GatewayBilling

Get credit balance
GET/accounts/{account_id}/ai-gateway/billing/credit-balance
Get usage history
GET/accounts/{account_id}/ai-gateway/billing/usage-history
Get invoice history
GET/accounts/{account_id}/ai-gateway/billing/invoice-history
Get invoice preview
GET/accounts/{account_id}/ai-gateway/billing/invoice-preview
ModelsExpand Collapse
BillingCreditBalanceResponse object { balance, has_default_payment_method, payment_method, 2 more }
balance: number
has_default_payment_method: boolean
payment_method: object { brand, last4 }
brand: optional string
last4: optional string
topup_config: object { amount, disabledReason, error, 2 more }
amount: number
disabledReason: string
error: string
lastFailedAt: number
threshold: number
first_topup_success: optional boolean
BillingUsageHistoryResponse object { history }
history: array of object { id, aggregated_value, end_time, start_time }
id: string
aggregated_value: number
end_time: number
start_time: number
BillingInvoiceHistoryResponse object { invoices, pagination }
invoices: array of object { amount_due, amount_paid, amount_remaining, 11 more }
amount_due: number
amount_paid: number
amount_remaining: number
currency: string
id: optional string
attempt_count: optional number
attempted: optional boolean
auto_advance: optional boolean
created: optional number
created_by: optional string
description: optional string
invoice_origin: optional string
invoice_pdf: optional string
status: optional string
BillingInvoicePreviewResponse object { id, amount_due, amount_paid, 6 more }
id: string
amount_due: number
amount_paid: number
amount_remaining: number
currency: string
invoice_lines: array of object { amount, currency, description, 4 more }
amount: number
currency: string
description: string
period: object { end, start }
end: number
start: number
pricing: object { unit_amount_decimal }
unit_amount_decimal: string
quantity: number
pretax_credit_amounts: optional array of object { amount, type, credit_balance_transaction, discount }
amount: number
type: string
credit_balance_transaction: optional string
discount: optional string
period_end: number
period_start: number
status: "draft" or "open" or "paid" or 2 more
One of the following:
"draft"
"open"
"paid"
"uncollectible"
"void"

AI GatewayBillingTopup

Create a top-up
POST/accounts/{account_id}/ai-gateway/billing/topup
Check top-up status
POST/accounts/{account_id}/ai-gateway/billing/topup/status
ModelsExpand Collapse
TopupCreateResponse object { client_secret, onboarding, payment_intent_id, 2 more }
client_secret: string

Stripe PaymentIntent client secret.

onboarding: boolean

Whether the user was already onboarded.

payment_intent_id: string

Stripe invoice ID.

brand: optional string

Card brand (visa, mastercard, etc.).

last4: optional string

Last 4 digits of card.

TopupStatusResponse object { payment_intent_id, status }
payment_intent_id: string
status: "completed" or "pending"
One of the following:
"completed"
"pending"

AI GatewayBillingTopupConfig

Get auto top-up configuration
GET/accounts/{account_id}/ai-gateway/billing/topup/config
Set auto top-up configuration
POST/accounts/{account_id}/ai-gateway/billing/topup/config
Delete auto top-up configuration
DELETE/accounts/{account_id}/ai-gateway/billing/topup/config
ModelsExpand Collapse
ConfigGetResponse object { amount, disabledReason, error, 2 more }
amount: number
disabledReason: string
error: string
lastFailedAt: number
threshold: number
ConfigCreateResponse object { amount, threshold }
amount: number
threshold: number
ConfigDeleteResponse = unknown

AI GatewayBillingSpending Limit

Get spending limit
GET/accounts/{account_id}/ai-gateway/billing/spending-limit
Set spending limit
POST/accounts/{account_id}/ai-gateway/billing/spending-limit
Delete spending limit
DELETE/accounts/{account_id}/ai-gateway/billing/spending-limit
ModelsExpand Collapse
SpendingLimitGetResponse object { config, enabled }
config: object { amount, duration, strategy }
amount: number
duration: string
strategy: string
enabled: boolean
SpendingLimitCreateResponse = unknown
SpendingLimitDeleteResponse = unknown