Skip to content
Start here

Dynamic Routing

List all AI Gateway Dynamic Routes.
client.aiGateway.dynamicRouting.list(stringgatewayId, DynamicRoutingListParams { account_id } params, RequestOptionsoptions?): DynamicRoutingListResponse { data, success }
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes
Get an AI Gateway Dynamic Route.
client.aiGateway.dynamicRouting.get(stringgatewayId, stringid, DynamicRoutingGetParams { account_id } params, RequestOptionsoptions?): DynamicRoutingGetResponse { id, created_at, deployment, 5 more }
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
Create a new AI Gateway Dynamic Route.
client.aiGateway.dynamicRouting.create(stringgatewayId, DynamicRoutingCreateParams { account_id, elements, name } params, RequestOptionsoptions?): DynamicRoutingCreateResponse { id, created_at, deployment, 5 more }
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes
Update an AI Gateway Dynamic Route.
client.aiGateway.dynamicRouting.update(stringgatewayId, stringid, DynamicRoutingUpdateParams { account_id, name } params, RequestOptionsoptions?): DynamicRoutingUpdateResponse { route, success }
PATCH/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
Delete an AI Gateway Dynamic Route.
client.aiGateway.dynamicRouting.delete(stringgatewayId, stringid, DynamicRoutingDeleteParams { account_id } params, RequestOptionsoptions?): DynamicRoutingDeleteResponse { id, created_at, elements, 3 more }
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
List all AI Gateway Dynamic Route Deployments.
client.aiGateway.dynamicRouting.listDeployments(stringgatewayId, stringid, DynamicRoutingListDeploymentsParams { account_id } params, RequestOptionsoptions?): DynamicRoutingListDeploymentsResponse { data, success }
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments
Create a new AI Gateway Dynamic Route Deployment.
client.aiGateway.dynamicRouting.createDeployment(stringgatewayId, stringid, DynamicRoutingCreateDeploymentParams { account_id, version_id } params, RequestOptionsoptions?): DynamicRoutingCreateDeploymentResponse { id, created_at, elements, 3 more }
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments
List all AI Gateway Dynamic Route Versions.
client.aiGateway.dynamicRouting.listVersions(stringgatewayId, stringid, DynamicRoutingListVersionsParams { account_id } params, RequestOptionsoptions?): DynamicRoutingListVersionsResponse { data, success }
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions
Create a new AI Gateway Dynamic Route Version.
client.aiGateway.dynamicRouting.createVersion(stringgatewayId, stringid, DynamicRoutingCreateVersionParams { account_id, elements } params, RequestOptionsoptions?): DynamicRoutingCreateVersionResponse { id, created_at, elements, 3 more }
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions
Get an AI Gateway Dynamic Route Version.
client.aiGateway.dynamicRouting.getVersion(stringgatewayId, stringid, stringversionId, DynamicRoutingGetVersionParams { account_id } params, RequestOptionsoptions?): DynamicRoutingGetVersionResponse { id, active, created_at, 6 more }
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}
ModelsExpand Collapse
DynamicRoutingListResponse { data, success }
data: Data { order_by, order_by_direction, page, 2 more }
order_by: string
order_by_direction: string
page: number
per_page: number
routes: Array<Route>
id: string
account_tag: string
created_at: string
formatdate-time
deployment: Deployment { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
elements: Array<UnionMember0 { id, outputs, type } | UnionMember1 { id, outputs, properties, type } | UnionMember2 { id, outputs, type } | 3 more>
One of the following:
UnionMember0 { id, outputs, type }
id: string
outputs: Outputs { next }
type: "start"
UnionMember1 { id, outputs, properties, type }
id: string
outputs: Outputs { false, true }
false: False { elementId }
elementId: string
true: True { elementId }
elementId: string
properties: Properties { conditions }
conditions?: unknown
type: "conditional"
UnionMember2 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "percentage"
UnionMember3 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { key, limit, limitType, window }
key: string
limit: number
limitType: "count" | "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
UnionMember4 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
UnionMember5 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version: Version { active, created_at, data, version_id }
active: "true" | "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
success: boolean
DynamicRoutingGetResponse { id, created_at, deployment, 5 more }
id: string
created_at: string
formatdate-time
deployment: Deployment { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
elements: Array<UnionMember0 { id, outputs, type } | UnionMember1 { id, outputs, properties, type } | UnionMember2 { id, outputs, type } | 3 more>
One of the following:
UnionMember0 { id, outputs, type }
id: string
outputs: Outputs { next }
type: "start"
UnionMember1 { id, outputs, properties, type }
id: string
outputs: Outputs { false, true }
false: False { elementId }
elementId: string
true: True { elementId }
elementId: string
properties: Properties { conditions }
conditions?: unknown
type: "conditional"
UnionMember2 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "percentage"
UnionMember3 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { key, limit, limitType, window }
key: string
limit: number
limitType: "count" | "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
UnionMember4 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
UnionMember5 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version: Version { active, created_at, data, version_id }
active: "true" | "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
DynamicRoutingCreateResponse { id, created_at, deployment, 5 more }
id: string
created_at: string
formatdate-time
deployment: Deployment { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
elements: Array<UnionMember0 { id, outputs, type } | UnionMember1 { id, outputs, properties, type } | UnionMember2 { id, outputs, type } | 3 more>
One of the following:
UnionMember0 { id, outputs, type }
id: string
outputs: Outputs { next }
type: "start"
UnionMember1 { id, outputs, properties, type }
id: string
outputs: Outputs { false, true }
false: False { elementId }
elementId: string
true: True { elementId }
elementId: string
properties: Properties { conditions }
conditions?: unknown
type: "conditional"
UnionMember2 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "percentage"
UnionMember3 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { key, limit, limitType, window }
key: string
limit: number
limitType: "count" | "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
UnionMember4 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
UnionMember5 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version: Version { active, created_at, data, version_id }
active: "true" | "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
DynamicRoutingUpdateResponse { route, success }
route: Route { id, account_tag, created_at, 6 more }
id: string
account_tag: string
created_at: string
formatdate-time
deployment: Deployment { created_at, deployment_id, version_id }
created_at: string
deployment_id: string
version_id: string
elements: Array<UnionMember0 { id, outputs, type } | UnionMember1 { id, outputs, properties, type } | UnionMember2 { id, outputs, type } | 3 more>
One of the following:
UnionMember0 { id, outputs, type }
id: string
outputs: Outputs { next }
type: "start"
UnionMember1 { id, outputs, properties, type }
id: string
outputs: Outputs { false, true }
false: False { elementId }
elementId: string
true: True { elementId }
elementId: string
properties: Properties { conditions }
conditions?: unknown
type: "conditional"
UnionMember2 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "percentage"
UnionMember3 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { key, limit, limitType, window }
key: string
limit: number
limitType: "count" | "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
UnionMember4 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
UnionMember5 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version: Version { active, created_at, data, version_id }
active: "true" | "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
success: boolean
DynamicRoutingDeleteResponse { id, created_at, elements, 3 more }
id: string
created_at: string
formatdate-time
elements: Array<UnionMember0 { id, outputs, type } | UnionMember1 { id, outputs, properties, type } | UnionMember2 { id, outputs, type } | 3 more>
One of the following:
UnionMember0 { id, outputs, type }
id: string
outputs: Outputs { next }
type: "start"
UnionMember1 { id, outputs, properties, type }
id: string
outputs: Outputs { false, true }
false: False { elementId }
elementId: string
true: True { elementId }
elementId: string
properties: Properties { conditions }
conditions?: unknown
type: "conditional"
UnionMember2 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "percentage"
UnionMember3 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { key, limit, limitType, window }
key: string
limit: number
limitType: "count" | "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
UnionMember4 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
UnionMember5 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
DynamicRoutingListDeploymentsResponse { data, success }
data: Data { deployments, order_by, order_by_direction, 2 more }
deployments: Array<Deployment>
created_at: string
deployment_id: string
version_id: string
order_by: string
order_by_direction: string
page: number
per_page: number
success: boolean
DynamicRoutingCreateDeploymentResponse { id, created_at, elements, 3 more }
id: string
created_at: string
formatdate-time
elements: Array<UnionMember0 { id, outputs, type } | UnionMember1 { id, outputs, properties, type } | UnionMember2 { id, outputs, type } | 3 more>
One of the following:
UnionMember0 { id, outputs, type }
id: string
outputs: Outputs { next }
type: "start"
UnionMember1 { id, outputs, properties, type }
id: string
outputs: Outputs { false, true }
false: False { elementId }
elementId: string
true: True { elementId }
elementId: string
properties: Properties { conditions }
conditions?: unknown
type: "conditional"
UnionMember2 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "percentage"
UnionMember3 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { key, limit, limitType, window }
key: string
limit: number
limitType: "count" | "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
UnionMember4 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
UnionMember5 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
DynamicRoutingListVersionsResponse { data, success }
data: Data { order_by, order_by_direction, page, 2 more }
order_by: string
order_by_direction: string
page: number
per_page: number
versions: Array<Version>
active: "true" | "false"
One of the following:
"true"
"false"
created_at: string
data: string
version_id: string
success: boolean
DynamicRoutingCreateVersionResponse { id, created_at, elements, 3 more }
id: string
created_at: string
formatdate-time
elements: Array<UnionMember0 { id, outputs, type } | UnionMember1 { id, outputs, properties, type } | UnionMember2 { id, outputs, type } | 3 more>
One of the following:
UnionMember0 { id, outputs, type }
id: string
outputs: Outputs { next }
type: "start"
UnionMember1 { id, outputs, properties, type }
id: string
outputs: Outputs { false, true }
false: False { elementId }
elementId: string
true: True { elementId }
elementId: string
properties: Properties { conditions }
conditions?: unknown
type: "conditional"
UnionMember2 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "percentage"
UnionMember3 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { key, limit, limitType, window }
key: string
limit: number
limitType: "count" | "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
UnionMember4 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
UnionMember5 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
DynamicRoutingGetVersionResponse { id, active, created_at, 6 more }
id: string
active: "true" | "false"
One of the following:
"true"
"false"
created_at: string
data: string
elements: Array<UnionMember0 { id, outputs, type } | UnionMember1 { id, outputs, properties, type } | UnionMember2 { id, outputs, type } | 3 more>
One of the following:
UnionMember0 { id, outputs, type }
id: string
outputs: Outputs { next }
type: "start"
UnionMember1 { id, outputs, properties, type }
id: string
outputs: Outputs { false, true }
false: False { elementId }
elementId: string
true: True { elementId }
elementId: string
properties: Properties { conditions }
conditions?: unknown
type: "conditional"
UnionMember2 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "percentage"
UnionMember3 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { key, limit, limitType, window }
key: string
limit: number
limitType: "count" | "cost"
One of the following:
"count"
"cost"
window: number
type: "rate"
UnionMember4 { id, outputs, properties, type }
id: string
outputs: Outputs { fallback, success }
fallback: Fallback { elementId }
elementId: string
success: Success { elementId }
elementId: string
properties: Properties { model, provider, retries, timeout }
model: string
provider: string
retries: number
timeout: number
type: "model"
UnionMember5 { id, outputs, type }
id: string
outputs: Record<string, Outputs>
elementId: string
type: "end"
gateway_id: string
modified_at: string
formatdate-time
name: string
version_id: string