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, 21 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
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
headers: map[string]
url: string
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, 21 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
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
headers: map[string]
url: string
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, 21 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
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
headers: map[string]
url: string
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, 21 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
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
headers: map[string]
url: string
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, 21 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
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
headers: map[string]
url: string
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