Skip to content
Start here

Dynamic Routing

List all AI Gateway Dynamic Routes.
ai_gateway.dynamic_routing.list(strgateway_id, DynamicRoutingListParams**kwargs) -> DynamicRoutingListResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes
Get an AI Gateway Dynamic Route.
ai_gateway.dynamic_routing.get(strid, DynamicRoutingGetParams**kwargs) -> DynamicRoutingGetResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
Create a new AI Gateway Dynamic Route.
ai_gateway.dynamic_routing.create(strgateway_id, DynamicRoutingCreateParams**kwargs) -> DynamicRoutingCreateResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes
Update an AI Gateway Dynamic Route.
ai_gateway.dynamic_routing.update(strid, DynamicRoutingUpdateParams**kwargs) -> DynamicRoutingUpdateResponse
PATCH/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
Delete an AI Gateway Dynamic Route.
ai_gateway.dynamic_routing.delete(strid, DynamicRoutingDeleteParams**kwargs) -> DynamicRoutingDeleteResponse
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
List all AI Gateway Dynamic Route Deployments.
ai_gateway.dynamic_routing.list_deployments(strid, DynamicRoutingListDeploymentsParams**kwargs) -> DynamicRoutingListDeploymentsResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments
Create a new AI Gateway Dynamic Route Deployment.
ai_gateway.dynamic_routing.create_deployment(strid, DynamicRoutingCreateDeploymentParams**kwargs) -> DynamicRoutingCreateDeploymentResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments
List all AI Gateway Dynamic Route Versions.
ai_gateway.dynamic_routing.list_versions(strid, DynamicRoutingListVersionsParams**kwargs) -> DynamicRoutingListVersionsResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions
Create a new AI Gateway Dynamic Route Version.
ai_gateway.dynamic_routing.create_version(strid, DynamicRoutingCreateVersionParams**kwargs) -> DynamicRoutingCreateVersionResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions
Get an AI Gateway Dynamic Route Version.
ai_gateway.dynamic_routing.get_version(strversion_id, DynamicRoutingGetVersionParams**kwargs) -> DynamicRoutingGetVersionResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}
ModelsExpand Collapse
class DynamicRoutingListResponse:
data: Data
order_by: str
order_by_direction: str
page: float
per_page: float
routes: List[DataRoute]
id: str
account_tag: str
created_at: datetime
formatdate-time
deployment: DataRouteDeployment
created_at: str
deployment_id: str
version_id: str
elements: List[DataRouteElement]
One of the following:
class DataRouteElementUnionMember0:
id: str
outputs: DataRouteElementUnionMember0Outputs
type: Literal["start"]
class DataRouteElementUnionMember1:
id: str
outputs: DataRouteElementUnionMember1Outputs
false: DataRouteElementUnionMember1OutputsFalse_
element_id: str
true: DataRouteElementUnionMember1OutputsTrue_
element_id: str
properties: DataRouteElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class DataRouteElementUnionMember2:
id: str
outputs: Dict[str, DataRouteElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class DataRouteElementUnionMember3:
id: str
outputs: DataRouteElementUnionMember3Outputs
fallback: DataRouteElementUnionMember3OutputsFallback
element_id: str
success: DataRouteElementUnionMember3OutputsSuccess
element_id: str
properties: DataRouteElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class DataRouteElementUnionMember4:
id: str
outputs: DataRouteElementUnionMember4Outputs
fallback: DataRouteElementUnionMember4OutputsFallback
element_id: str
success: DataRouteElementUnionMember4OutputsSuccess
element_id: str
properties: DataRouteElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class DataRouteElementUnionMember5:
id: str
outputs: Dict[str, DataRouteElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version: DataRouteVersion
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
success: bool
class DynamicRoutingGetResponse:
id: str
created_at: datetime
formatdate-time
deployment: Deployment
created_at: str
deployment_id: str
version_id: str
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version: Version
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
class DynamicRoutingCreateResponse:
id: str
created_at: datetime
formatdate-time
deployment: Deployment
created_at: str
deployment_id: str
version_id: str
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version: Version
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
class DynamicRoutingUpdateResponse:
route: Route
id: str
account_tag: str
created_at: datetime
formatdate-time
deployment: RouteDeployment
created_at: str
deployment_id: str
version_id: str
elements: List[RouteElement]
One of the following:
class RouteElementUnionMember0:
id: str
outputs: RouteElementUnionMember0Outputs
type: Literal["start"]
class RouteElementUnionMember1:
id: str
outputs: RouteElementUnionMember1Outputs
false: RouteElementUnionMember1OutputsFalse_
element_id: str
true: RouteElementUnionMember1OutputsTrue_
element_id: str
properties: RouteElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class RouteElementUnionMember2:
id: str
outputs: Dict[str, RouteElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class RouteElementUnionMember3:
id: str
outputs: RouteElementUnionMember3Outputs
fallback: RouteElementUnionMember3OutputsFallback
element_id: str
success: RouteElementUnionMember3OutputsSuccess
element_id: str
properties: RouteElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class RouteElementUnionMember4:
id: str
outputs: RouteElementUnionMember4Outputs
fallback: RouteElementUnionMember4OutputsFallback
element_id: str
success: RouteElementUnionMember4OutputsSuccess
element_id: str
properties: RouteElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class RouteElementUnionMember5:
id: str
outputs: Dict[str, RouteElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version: RouteVersion
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
success: bool
class DynamicRoutingDeleteResponse:
id: str
created_at: datetime
formatdate-time
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
class DynamicRoutingListDeploymentsResponse:
data: Data
deployments: List[DataDeployment]
created_at: str
deployment_id: str
version_id: str
order_by: str
order_by_direction: str
page: float
per_page: float
success: bool
class DynamicRoutingCreateDeploymentResponse:
id: str
created_at: datetime
formatdate-time
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
class DynamicRoutingListVersionsResponse:
data: Data
order_by: str
order_by_direction: str
page: float
per_page: float
versions: List[DataVersion]
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
success: bool
class DynamicRoutingCreateVersionResponse:
id: str
created_at: datetime
formatdate-time
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
class DynamicRoutingGetVersionResponse:
id: str
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version_id: str